1/* A Bison parser, made by GNU Bison 3.2.4.  */
2
3/* Bison implementation for Yacc-like parsers in C
4
5   Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
6
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.
11
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.
16
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/>.  */
19
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.
29
30   This special exception was added by the Free Software Foundation in
31   version 2.2 of Bison.  */
32
33/* C LALR(1) parser skeleton written by Richard Stallman, by
34   simplifying the original so-called "semantic" parser.  */
35
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.  */
42
43/* Undocumented macros, especially those whose name start with YY_,
44   are private implementation details.  Do not rely on them.  */
45
46/* Identify Bison output.  */
47#define YYBISON 1
48
49/* Bison version.  */
50#define YYBISON_VERSION "3.2.4"
51
52/* Skeleton name.  */
53#define YYSKELETON_NAME "yacc.c"
54
55/* Pure parsers.  */
56#define YYPURE 1
57
58/* Push parsers.  */
59#define YYPUSH 0
60
61/* Pull parsers.  */
62#define YYPULL 1
63
64
65/* Substitute the variable and function names.  */
66#define yyparse         _mesa_glsl_parse
67#define yylex           _mesa_glsl_lex
68#define yyerror         _mesa_glsl_error
69#define yydebug         _mesa_glsl_debug
70#define yynerrs         _mesa_glsl_nerrs
71
72
73/* First part of user prologue.  */
74#line 1 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:338  */
75
76/*
77 * Copyright © 2008, 2009 Intel Corporation
78 *
79 * Permission is hereby granted, free of charge, to any person obtaining a
80 * copy of this software and associated documentation files (the "Software"),
81 * to deal in the Software without restriction, including without limitation
82 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
83 * and/or sell copies of the Software, and to permit persons to whom the
84 * Software is furnished to do so, subject to the following conditions:
85 *
86 * The above copyright notice and this permission notice (including the next
87 * paragraph) shall be included in all copies or substantial portions of the
88 * Software.
89 *
90 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
91 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
92 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
94 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
95 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
96 * DEALINGS IN THE SOFTWARE.
97 */
98#include <stdio.h>
99#include <stdlib.h>
100#include <string.h>
101#ifndef _MSC_VER
102#include <strings.h>
103#endif
104#include <assert.h>
105
106#include "ast.h"
107#include "glsl_parser_extras.h"
108#include "compiler/glsl_types.h"
109#include "main/context.h"
110
111#ifdef _MSC_VER
112#pragma warning( disable : 4065 ) // switch statement contains 'default' but no 'case' labels
113#endif
114
115#undef yyerror
116
117static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
118{
119   _mesa_glsl_error(loc, st, "%s", msg);
120}
121
122static int
123_mesa_glsl_lex(YYSTYPE *val, YYLTYPE *loc, _mesa_glsl_parse_state *state)
124{
125   return _mesa_glsl_lexer_lex(val, loc, state->scanner);
126}
127
128static bool match_layout_qualifier(const char *s1, const char *s2,
129                                   _mesa_glsl_parse_state *state)
130{
131   /* From the GLSL 1.50 spec, section 4.3.8 (Layout Qualifiers):
132    *
133    *     "The tokens in any layout-qualifier-id-list ... are not case
134    *     sensitive, unless explicitly noted otherwise."
135    *
136    * The text "unless explicitly noted otherwise" appears to be
137    * vacuous--no desktop GLSL spec (up through GLSL 4.40) notes
138    * otherwise.
139    *
140    * However, the GLSL ES 3.00 spec says, in section 4.3.8 (Layout
141    * Qualifiers):
142    *
143    *     "As for other identifiers, they are case sensitive."
144    *
145    * So we need to do a case-sensitive or a case-insensitive match,
146    * depending on whether we are compiling for GLSL ES.
147    */
148   if (state->es_shader)
149      return strcmp(s1, s2);
150   else
151      return strcasecmp(s1, s2);
152}
153
154#line 155 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:338  */
155# ifndef YY_NULLPTR
156#  if defined __cplusplus
157#   if 201103L <= __cplusplus
158#    define YY_NULLPTR nullptr
159#   else
160#    define YY_NULLPTR 0
161#   endif
162#  else
163#   define YY_NULLPTR ((void*)0)
164#  endif
165# endif
166
167/* Enabling verbose error messages.  */
168#ifdef YYERROR_VERBOSE
169# undef YYERROR_VERBOSE
170# define YYERROR_VERBOSE 1
171#else
172# define YYERROR_VERBOSE 1
173#endif
174
175/* In a future release of Bison, this section will be replaced
176   by #include "glsl_parser.h".  */
177#ifndef YY__MESA_GLSL_SRC_COMPILER_GLSL_GLSL_PARSER_H_INCLUDED
178# define YY__MESA_GLSL_SRC_COMPILER_GLSL_GLSL_PARSER_H_INCLUDED
179/* Debug traces.  */
180#ifndef YYDEBUG
181# define YYDEBUG 0
182#endif
183#if YYDEBUG
184extern int _mesa_glsl_debug;
185#endif
186
187/* Token type.  */
188#ifndef YYTOKENTYPE
189# define YYTOKENTYPE
190  enum yytokentype
191  {
192    ATTRIBUTE = 258,
193    CONST_TOK = 259,
194    BASIC_TYPE_TOK = 260,
195    BREAK = 261,
196    BUFFER = 262,
197    CONTINUE = 263,
198    DO = 264,
199    ELSE = 265,
200    FOR = 266,
201    IF = 267,
202    DISCARD = 268,
203    RETURN = 269,
204    SWITCH = 270,
205    CASE = 271,
206    DEFAULT = 272,
207    CENTROID = 273,
208    IN_TOK = 274,
209    OUT_TOK = 275,
210    INOUT_TOK = 276,
211    UNIFORM = 277,
212    VARYING = 278,
213    SAMPLE = 279,
214    NOPERSPECTIVE = 280,
215    FLAT = 281,
216    SMOOTH = 282,
217    IMAGE1DSHADOW = 283,
218    IMAGE2DSHADOW = 284,
219    IMAGE1DARRAYSHADOW = 285,
220    IMAGE2DARRAYSHADOW = 286,
221    COHERENT = 287,
222    VOLATILE = 288,
223    RESTRICT = 289,
224    READONLY = 290,
225    WRITEONLY = 291,
226    SHARED = 292,
227    STRUCT = 293,
228    VOID_TOK = 294,
229    WHILE = 295,
230    IDENTIFIER = 296,
231    TYPE_IDENTIFIER = 297,
232    NEW_IDENTIFIER = 298,
233    FLOATCONSTANT = 299,
234    DOUBLECONSTANT = 300,
235    INTCONSTANT = 301,
236    UINTCONSTANT = 302,
237    BOOLCONSTANT = 303,
238    INT64CONSTANT = 304,
239    UINT64CONSTANT = 305,
240    FIELD_SELECTION = 306,
241    LEFT_OP = 307,
242    RIGHT_OP = 308,
243    INC_OP = 309,
244    DEC_OP = 310,
245    LE_OP = 311,
246    GE_OP = 312,
247    EQ_OP = 313,
248    NE_OP = 314,
249    AND_OP = 315,
250    OR_OP = 316,
251    XOR_OP = 317,
252    MUL_ASSIGN = 318,
253    DIV_ASSIGN = 319,
254    ADD_ASSIGN = 320,
255    MOD_ASSIGN = 321,
256    LEFT_ASSIGN = 322,
257    RIGHT_ASSIGN = 323,
258    AND_ASSIGN = 324,
259    XOR_ASSIGN = 325,
260    OR_ASSIGN = 326,
261    SUB_ASSIGN = 327,
262    INVARIANT = 328,
263    PRECISE = 329,
264    LOWP = 330,
265    MEDIUMP = 331,
266    HIGHP = 332,
267    SUPERP = 333,
268    PRECISION = 334,
269    VERSION_TOK = 335,
270    EXTENSION = 336,
271    LINE = 337,
272    COLON = 338,
273    EOL = 339,
274    INTERFACE = 340,
275    OUTPUT = 341,
276    PRAGMA_DEBUG_ON = 342,
277    PRAGMA_DEBUG_OFF = 343,
278    PRAGMA_OPTIMIZE_ON = 344,
279    PRAGMA_OPTIMIZE_OFF = 345,
280    PRAGMA_WARNING_ON = 346,
281    PRAGMA_WARNING_OFF = 347,
282    PRAGMA_INVARIANT_ALL = 348,
283    LAYOUT_TOK = 349,
284    DOT_TOK = 350,
285    ASM = 351,
286    CLASS = 352,
287    UNION = 353,
288    ENUM = 354,
289    TYPEDEF = 355,
290    TEMPLATE = 356,
291    THIS = 357,
292    PACKED_TOK = 358,
293    GOTO = 359,
294    INLINE_TOK = 360,
295    NOINLINE = 361,
296    PUBLIC_TOK = 362,
297    STATIC = 363,
298    EXTERN = 364,
299    EXTERNAL = 365,
300    LONG_TOK = 366,
301    SHORT_TOK = 367,
302    HALF = 368,
303    FIXED_TOK = 369,
304    UNSIGNED = 370,
305    INPUT_TOK = 371,
306    HVEC2 = 372,
307    HVEC3 = 373,
308    HVEC4 = 374,
309    FVEC2 = 375,
310    FVEC3 = 376,
311    FVEC4 = 377,
312    SAMPLER3DRECT = 378,
313    SIZEOF = 379,
314    CAST = 380,
315    NAMESPACE = 381,
316    USING = 382,
317    RESOURCE = 383,
318    PATCH = 384,
319    SUBROUTINE = 385,
320    ERROR_TOK = 386,
321    COMMON = 387,
322    PARTITION = 388,
323    ACTIVE = 389,
324    FILTER = 390,
325    ROW_MAJOR = 391,
326    THEN = 392
327  };
328#endif
329
330/* Value type.  */
331#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
332
333union YYSTYPE
334{
335#line 98 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:353  */
336
337   int n;
338   int64_t n64;
339   float real;
340   double dreal;
341   const char *identifier;
342
343   struct ast_type_qualifier type_qualifier;
344
345   ast_node *node;
346   ast_type_specifier *type_specifier;
347   ast_array_specifier *array_specifier;
348   ast_fully_specified_type *fully_specified_type;
349   ast_function *function;
350   ast_parameter_declarator *parameter_declarator;
351   ast_function_definition *function_definition;
352   ast_compound_statement *compound_statement;
353   ast_expression *expression;
354   ast_declarator_list *declarator_list;
355   ast_struct_specifier *struct_specifier;
356   ast_declaration *declaration;
357   ast_switch_body *switch_body;
358   ast_case_label *case_label;
359   ast_case_label_list *case_label_list;
360   ast_case_statement *case_statement;
361   ast_case_statement_list *case_statement_list;
362   ast_interface_block *interface_block;
363   ast_subroutine_list *subroutine_list;
364   struct {
365      ast_node *cond;
366      ast_expression *rest;
367   } for_rest_statement;
368
369   struct {
370      ast_node *then_statement;
371      ast_node *else_statement;
372   } selection_rest_statement;
373
374   const glsl_type *type;
375
376#line 377 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:353  */
377};
378
379typedef union YYSTYPE YYSTYPE;
380# define YYSTYPE_IS_TRIVIAL 1
381# define YYSTYPE_IS_DECLARED 1
382#endif
383
384/* Location type.  */
385#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
386typedef struct YYLTYPE YYLTYPE;
387struct YYLTYPE
388{
389  int first_line;
390  int first_column;
391  int last_line;
392  int last_column;
393};
394# define YYLTYPE_IS_DECLARED 1
395# define YYLTYPE_IS_TRIVIAL 1
396#endif
397
398
399
400int _mesa_glsl_parse (struct _mesa_glsl_parse_state *state);
401
402#endif /* !YY__MESA_GLSL_SRC_COMPILER_GLSL_GLSL_PARSER_H_INCLUDED  */
403
404
405
406#ifdef short
407# undef short
408#endif
409
410#ifdef YYTYPE_UINT8
411typedef YYTYPE_UINT8 yytype_uint8;
412#else
413typedef unsigned char yytype_uint8;
414#endif
415
416#ifdef YYTYPE_INT8
417typedef YYTYPE_INT8 yytype_int8;
418#else
419typedef signed char yytype_int8;
420#endif
421
422#ifdef YYTYPE_UINT16
423typedef YYTYPE_UINT16 yytype_uint16;
424#else
425typedef unsigned short yytype_uint16;
426#endif
427
428#ifdef YYTYPE_INT16
429typedef YYTYPE_INT16 yytype_int16;
430#else
431typedef short yytype_int16;
432#endif
433
434#ifndef YYSIZE_T
435# ifdef __SIZE_TYPE__
436#  define YYSIZE_T __SIZE_TYPE__
437# elif defined size_t
438#  define YYSIZE_T size_t
439# elif ! defined YYSIZE_T
440#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
441#  define YYSIZE_T size_t
442# else
443#  define YYSIZE_T unsigned
444# endif
445#endif
446
447#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
448
449#ifndef YY_
450# if defined YYENABLE_NLS && YYENABLE_NLS
451#  if ENABLE_NLS
452#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
453#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
454#  endif
455# endif
456# ifndef YY_
457#  define YY_(Msgid) Msgid
458# endif
459#endif
460
461#ifndef YY_ATTRIBUTE
462# if (defined __GNUC__                                               \
463      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
464     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
465#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
466# else
467#  define YY_ATTRIBUTE(Spec) /* empty */
468# endif
469#endif
470
471#ifndef YY_ATTRIBUTE_PURE
472# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
473#endif
474
475#ifndef YY_ATTRIBUTE_UNUSED
476# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
477#endif
478
479/* Suppress unused-variable warnings by "using" E.  */
480#if ! defined lint || defined __GNUC__
481# define YYUSE(E) ((void) (E))
482#else
483# define YYUSE(E) /* empty */
484#endif
485
486#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
487/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
488# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
489    _Pragma ("GCC diagnostic push") \
490    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
491    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
492# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
493    _Pragma ("GCC diagnostic pop")
494#else
495# define YY_INITIAL_VALUE(Value) Value
496#endif
497#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
498# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
499# define YY_IGNORE_MAYBE_UNINITIALIZED_END
500#endif
501#ifndef YY_INITIAL_VALUE
502# define YY_INITIAL_VALUE(Value) /* Nothing. */
503#endif
504
505
506#if ! defined yyoverflow || YYERROR_VERBOSE
507
508/* The parser invokes alloca or malloc; define the necessary symbols.  */
509
510# ifdef YYSTACK_USE_ALLOCA
511#  if YYSTACK_USE_ALLOCA
512#   ifdef __GNUC__
513#    define YYSTACK_ALLOC __builtin_alloca
514#   elif defined __BUILTIN_VA_ARG_INCR
515#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
516#   elif defined _AIX
517#    define YYSTACK_ALLOC __alloca
518#   elif defined _MSC_VER
519#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
520#    define alloca _alloca
521#   else
522#    define YYSTACK_ALLOC alloca
523#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
524#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
525      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
526#     ifndef EXIT_SUCCESS
527#      define EXIT_SUCCESS 0
528#     endif
529#    endif
530#   endif
531#  endif
532# endif
533
534# ifdef YYSTACK_ALLOC
535   /* Pacify GCC's 'empty if-body' warning.  */
536#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
537#  ifndef YYSTACK_ALLOC_MAXIMUM
538    /* The OS might guarantee only one guard page at the bottom of the stack,
539       and a page size can be as small as 4096 bytes.  So we cannot safely
540       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
541       to allow for a few compiler-allocated temporary stack slots.  */
542#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
543#  endif
544# else
545#  define YYSTACK_ALLOC YYMALLOC
546#  define YYSTACK_FREE YYFREE
547#  ifndef YYSTACK_ALLOC_MAXIMUM
548#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
549#  endif
550#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
551       && ! ((defined YYMALLOC || defined malloc) \
552             && (defined YYFREE || defined free)))
553#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
554#   ifndef EXIT_SUCCESS
555#    define EXIT_SUCCESS 0
556#   endif
557#  endif
558#  ifndef YYMALLOC
559#   define YYMALLOC malloc
560#   if ! defined malloc && ! defined EXIT_SUCCESS
561void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
562#   endif
563#  endif
564#  ifndef YYFREE
565#   define YYFREE free
566#   if ! defined free && ! defined EXIT_SUCCESS
567void free (void *); /* INFRINGES ON USER NAME SPACE */
568#   endif
569#  endif
570# endif
571#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
572
573
574#if (! defined yyoverflow \
575     && (! defined __cplusplus \
576         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
577             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
578
579/* A type that is properly aligned for any stack member.  */
580union yyalloc
581{
582  yytype_int16 yyss_alloc;
583  YYSTYPE yyvs_alloc;
584  YYLTYPE yyls_alloc;
585};
586
587/* The size of the maximum gap between one aligned stack and the next.  */
588# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
589
590/* The size of an array large to enough to hold all stacks, each with
591   N elements.  */
592# define YYSTACK_BYTES(N) \
593     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
594      + 2 * YYSTACK_GAP_MAXIMUM)
595
596# define YYCOPY_NEEDED 1
597
598/* Relocate STACK from its old location to the new one.  The
599   local variables YYSIZE and YYSTACKSIZE give the old and new number of
600   elements in the stack, and YYPTR gives the new location of the
601   stack.  Advance YYPTR to a properly aligned location for the next
602   stack.  */
603# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
604    do                                                                  \
605      {                                                                 \
606        YYSIZE_T yynewbytes;                                            \
607        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
608        Stack = &yyptr->Stack_alloc;                                    \
609        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
610        yyptr += yynewbytes / sizeof (*yyptr);                          \
611      }                                                                 \
612    while (0)
613
614#endif
615
616#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
617/* Copy COUNT objects from SRC to DST.  The source and destination do
618   not overlap.  */
619# ifndef YYCOPY
620#  if defined __GNUC__ && 1 < __GNUC__
621#   define YYCOPY(Dst, Src, Count) \
622      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
623#  else
624#   define YYCOPY(Dst, Src, Count)              \
625      do                                        \
626        {                                       \
627          YYSIZE_T yyi;                         \
628          for (yyi = 0; yyi < (Count); yyi++)   \
629            (Dst)[yyi] = (Src)[yyi];            \
630        }                                       \
631      while (0)
632#  endif
633# endif
634#endif /* !YYCOPY_NEEDED */
635
636/* YYFINAL -- State number of the termination state.  */
637#define YYFINAL  5
638/* YYLAST -- Last index in YYTABLE.  */
639#define YYLAST   2531
640
641/* YYNTOKENS -- Number of terminals.  */
642#define YYNTOKENS  161
643/* YYNNTS -- Number of nonterminals.  */
644#define YYNNTS  110
645/* YYNRULES -- Number of rules.  */
646#define YYNRULES  310
647/* YYNSTATES -- Number of states.  */
648#define YYNSTATES  472
649
650/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
651   by yylex, with out-of-bounds checking.  */
652#define YYUNDEFTOK  2
653#define YYMAXUTOK   392
654
655#define YYTRANSLATE(YYX)                                                \
656  ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
657
658/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
659   as returned by yylex, without out-of-bounds checking.  */
660static const yytype_uint8 yytranslate[] =
661{
662       0,     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,   145,     2,     2,     2,   149,   152,     2,
666     138,   139,   147,   143,   142,   144,     2,   148,     2,     2,
667       2,     2,     2,     2,     2,     2,     2,     2,   156,   158,
668     150,   157,   151,   155,     2,     2,     2,     2,     2,     2,
669       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
670       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
671       2,   140,     2,   141,   153,     2,     2,     2,     2,     2,
672       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
673       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
674       2,     2,     2,   159,   154,   160,   146,     2,     2,     2,
675       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
676       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
677       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
678       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
679       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
680       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
681       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
682       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
683       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
684       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
685       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
686       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
687       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
688       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
689      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
690      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
691      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
692      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
693      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
694      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
695      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
696      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
697      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
698     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
699     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
700     125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
701     135,   136,   137
702};
703
704#if YYDEBUG
705  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
706static const yytype_uint16 yyrline[] =
707{
708       0,   291,   291,   290,   314,   316,   323,   333,   334,   335,
709     336,   337,   361,   366,   373,   375,   379,   380,   381,   385,
710     394,   402,   410,   421,   422,   426,   433,   440,   447,   454,
711     461,   468,   475,   482,   489,   490,   496,   500,   507,   513,
712     522,   526,   530,   534,   535,   539,   540,   544,   550,   562,
713     566,   572,   586,   587,   593,   599,   609,   610,   611,   612,
714     616,   617,   623,   629,   638,   639,   645,   654,   655,   661,
715     670,   671,   677,   683,   689,   698,   699,   705,   714,   715,
716     724,   725,   734,   735,   744,   745,   754,   755,   764,   765,
717     774,   775,   784,   785,   794,   795,   796,   797,   798,   799,
718     800,   801,   802,   803,   804,   808,   812,   828,   832,   837,
719     841,   846,   863,   867,   868,   872,   877,   885,   903,   914,
720     931,   946,   954,   971,   974,   982,   990,  1002,  1014,  1021,
721    1026,  1031,  1040,  1044,  1045,  1055,  1065,  1075,  1089,  1096,
722    1107,  1118,  1129,  1140,  1152,  1167,  1174,  1192,  1199,  1200,
723    1210,  1695,  1860,  1886,  1891,  1896,  1904,  1909,  1918,  1927,
724    1939,  1944,  1949,  1958,  1963,  1968,  1969,  1970,  1971,  1972,
725    1973,  1974,  1992,  2000,  2025,  2049,  2063,  2068,  2084,  2109,
726    2121,  2129,  2134,  2139,  2146,  2151,  2156,  2161,  2166,  2191,
727    2203,  2208,  2213,  2221,  2226,  2231,  2237,  2242,  2250,  2258,
728    2264,  2274,  2285,  2286,  2294,  2300,  2306,  2315,  2316,  2317,
729    2329,  2334,  2339,  2347,  2354,  2371,  2376,  2384,  2422,  2427,
730    2435,  2441,  2450,  2451,  2455,  2462,  2469,  2476,  2482,  2483,
731    2487,  2488,  2489,  2490,  2491,  2492,  2496,  2503,  2502,  2516,
732    2517,  2521,  2527,  2536,  2546,  2555,  2567,  2573,  2582,  2591,
733    2596,  2604,  2608,  2626,  2634,  2639,  2647,  2652,  2660,  2668,
734    2676,  2684,  2692,  2700,  2708,  2715,  2722,  2732,  2733,  2737,
735    2739,  2745,  2750,  2759,  2765,  2771,  2777,  2783,  2792,  2793,
736    2794,  2795,  2796,  2800,  2814,  2818,  2831,  2849,  2868,  2873,
737    2878,  2883,  2888,  2903,  2906,  2911,  2919,  2924,  2932,  2956,
738    2963,  2967,  2974,  2978,  2988,  2997,  3007,  3016,  3028,  3050,
739    3060
740};
741#endif
742
743#if YYDEBUG || YYERROR_VERBOSE || 1
744/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
745   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
746static const char *const yytname[] =
747{
748  "$end", "error", "$undefined", "ATTRIBUTE", "CONST_TOK",
749  "BASIC_TYPE_TOK", "BREAK", "BUFFER", "CONTINUE", "DO", "ELSE", "FOR",
750  "IF", "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "CENTROID",
751  "IN_TOK", "OUT_TOK", "INOUT_TOK", "UNIFORM", "VARYING", "SAMPLE",
752  "NOPERSPECTIVE", "FLAT", "SMOOTH", "IMAGE1DSHADOW", "IMAGE2DSHADOW",
753  "IMAGE1DARRAYSHADOW", "IMAGE2DARRAYSHADOW", "COHERENT", "VOLATILE",
754  "RESTRICT", "READONLY", "WRITEONLY", "SHARED", "STRUCT", "VOID_TOK",
755  "WHILE", "IDENTIFIER", "TYPE_IDENTIFIER", "NEW_IDENTIFIER",
756  "FLOATCONSTANT", "DOUBLECONSTANT", "INTCONSTANT", "UINTCONSTANT",
757  "BOOLCONSTANT", "INT64CONSTANT", "UINT64CONSTANT", "FIELD_SELECTION",
758  "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP",
759  "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN",
760  "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN",
761  "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "INVARIANT", "PRECISE", "LOWP",
762  "MEDIUMP", "HIGHP", "SUPERP", "PRECISION", "VERSION_TOK", "EXTENSION",
763  "LINE", "COLON", "EOL", "INTERFACE", "OUTPUT", "PRAGMA_DEBUG_ON",
764  "PRAGMA_DEBUG_OFF", "PRAGMA_OPTIMIZE_ON", "PRAGMA_OPTIMIZE_OFF",
765  "PRAGMA_WARNING_ON", "PRAGMA_WARNING_OFF", "PRAGMA_INVARIANT_ALL",
766  "LAYOUT_TOK", "DOT_TOK", "ASM", "CLASS", "UNION", "ENUM", "TYPEDEF",
767  "TEMPLATE", "THIS", "PACKED_TOK", "GOTO", "INLINE_TOK", "NOINLINE",
768  "PUBLIC_TOK", "STATIC", "EXTERN", "EXTERNAL", "LONG_TOK", "SHORT_TOK",
769  "HALF", "FIXED_TOK", "UNSIGNED", "INPUT_TOK", "HVEC2", "HVEC3", "HVEC4",
770  "FVEC2", "FVEC3", "FVEC4", "SAMPLER3DRECT", "SIZEOF", "CAST",
771  "NAMESPACE", "USING", "RESOURCE", "PATCH", "SUBROUTINE", "ERROR_TOK",
772  "COMMON", "PARTITION", "ACTIVE", "FILTER", "ROW_MAJOR", "THEN", "'('",
773  "')'", "'['", "']'", "','", "'+'", "'-'", "'!'", "'~'", "'*'", "'/'",
774  "'%'", "'<'", "'>'", "'&'", "'^'", "'|'", "'?'", "':'", "'='", "';'",
775  "'{'", "'}'", "$accept", "translation_unit", "$@1", "version_statement",
776  "pragma_statement", "extension_statement_list", "any_identifier",
777  "extension_statement", "external_declaration_list",
778  "variable_identifier", "primary_expression", "postfix_expression",
779  "integer_expression", "function_call", "function_call_or_method",
780  "function_call_generic", "function_call_header_no_parameters",
781  "function_call_header_with_parameters", "function_call_header",
782  "function_identifier", "unary_expression", "unary_operator",
783  "multiplicative_expression", "additive_expression", "shift_expression",
784  "relational_expression", "equality_expression", "and_expression",
785  "exclusive_or_expression", "inclusive_or_expression",
786  "logical_and_expression", "logical_xor_expression",
787  "logical_or_expression", "conditional_expression",
788  "assignment_expression", "assignment_operator", "expression",
789  "constant_expression", "declaration", "function_prototype",
790  "function_declarator", "function_header_with_parameters",
791  "function_header", "parameter_declarator", "parameter_declaration",
792  "parameter_qualifier", "parameter_direction_qualifier",
793  "parameter_type_specifier", "init_declarator_list", "single_declaration",
794  "fully_specified_type", "layout_qualifier", "layout_qualifier_id_list",
795  "layout_qualifier_id", "interface_block_layout_qualifier",
796  "subroutine_qualifier", "subroutine_type_list",
797  "interpolation_qualifier", "type_qualifier",
798  "auxiliary_storage_qualifier", "storage_qualifier", "memory_qualifier",
799  "array_specifier", "type_specifier", "type_specifier_nonarray",
800  "basic_type_specifier_nonarray", "precision_qualifier",
801  "struct_specifier", "struct_declaration_list", "struct_declaration",
802  "struct_declarator_list", "struct_declarator", "initializer",
803  "initializer_list", "declaration_statement", "statement",
804  "simple_statement", "compound_statement", "$@2",
805  "statement_no_new_scope", "compound_statement_no_new_scope",
806  "statement_list", "expression_statement", "selection_statement",
807  "selection_rest_statement", "condition", "switch_statement",
808  "switch_body", "case_label", "case_label_list", "case_statement",
809  "case_statement_list", "iteration_statement", "for_init_statement",
810  "conditionopt", "for_rest_statement", "jump_statement",
811  "external_declaration", "function_definition", "interface_block",
812  "basic_interface_block", "interface_qualifier", "instance_name_opt",
813  "member_list", "member_declaration", "layout_uniform_defaults",
814  "layout_buffer_defaults", "layout_in_defaults", "layout_out_defaults",
815  "layout_defaults", YY_NULLPTR
816};
817#endif
818
819# ifdef YYPRINT
820/* YYTOKNUM[NUM] -- (External) token number corresponding to the
821   (internal) symbol number NUM (which must be that of a token).  */
822static const yytype_uint16 yytoknum[] =
823{
824       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
825     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
826     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
827     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
828     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
829     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
830     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
831     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
832     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
833     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
834     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
835     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
836     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
837     385,   386,   387,   388,   389,   390,   391,   392,    40,    41,
838      91,    93,    44,    43,    45,    33,   126,    42,    47,    37,
839      60,    62,    38,    94,   124,    63,    58,    61,    59,   123,
840     125
841};
842# endif
843
844#define YYPACT_NINF -398
845
846#define yypact_value_is_default(Yystate) \
847  (!!((Yystate) == (-398)))
848
849#define YYTABLE_NINF -292
850
851#define yytable_value_is_error(Yytable_value) \
852  0
853
854  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
855     STATE-NUM.  */
856static const yytype_int16 yypact[] =
857{
858     -73,    24,    72,  -398,   192,  -398,    37,  -398,  -398,  -398,
859    -398,    43,     6,  1753,  -398,  -398,    52,  -398,  -398,  -398,
860     110,  -398,   155,   170,  -398,   193,  -398,  -398,  -398,  -398,
861    -398,  -398,  -398,  -398,  -398,  -398,  -398,   -22,  -398,  -398,
862    2208,  2208,  -398,  -398,  -398,   258,   134,   171,   173,   182,
863     186,   188,   201,   140,   298,  -398,   177,  -398,  -398,  1654,
864    -398,   -61,   169,   184,    67,   -85,  -398,   320,  2273,  2336,
865    2336,    69,  2401,  2336,  2401,  -398,   178,  -398,  2336,  -398,
866    -398,  -398,  -398,  -398,   270,  -398,  -398,  -398,  -398,  -398,
867       6,  2145,   172,  -398,  -398,  -398,  -398,  -398,  -398,  2336,
868    2336,  -398,  2336,  -398,  2336,  2336,  -398,  -398,    69,  -398,
869    -398,  -398,  -398,  -398,  -398,  -398,   139,  -398,     6,  -398,
870    -398,  -398,   804,  -398,  -398,   319,   319,  -398,  -398,  -398,
871     319,  -398,    51,   319,   319,   319,     6,  -398,   198,   203,
872    -123,   204,   -30,   -18,    -1,     0,  -398,  -398,  -398,  -398,
873    -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,  2401,  -398,
874    -398,  1846,   190,  -398,   185,   265,     6,   933,  -398,  2145,
875     200,  -398,  -398,  -398,   199,   -48,  -398,  -398,  -398,    90,
876     206,   208,  1282,   212,   221,   209,  1759,   235,   236,  -398,
877    -398,  -398,  -398,  -398,  -398,  -398,  1981,  1981,  1981,  -398,
878    -398,  -398,  -398,  -398,   215,  -398,  -398,  -398,   205,  -398,
879    -398,  -398,   237,   129,  2016,   239,   180,  1981,   223,     3,
880      53,    27,   116,   226,   227,   228,   321,   322,   -45,  -398,
881    -398,   -66,  -398,   225,   247,  -398,  -398,  -398,  -398,   488,
882    -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,
883      69,     6,  -398,  -398,  -398,  -103,  1493,    31,  -398,  -398,
884    -398,  -398,  -398,  -398,  -398,  -398,   245,  -398,  1957,  2145,
885    -398,   178,   -46,  -398,  -398,  -398,   996,  -398,  1981,  -398,
886     139,  -398,     6,  -398,  -398,   347,  1568,  1981,  -398,  -398,
887      57,  1981,  1903,  -398,  -398,   144,  -398,  1282,  -398,  -398,
888     337,  1981,  -398,  -398,  1981,   251,  -398,  -398,  -398,  -398,
889    -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,  1981,
890    -398,  1981,  1981,  1981,  1981,  1981,  1981,  1981,  1981,  1981,
891    1981,  1981,  1981,  1981,  1981,  1981,  1981,  1981,  1981,  1981,
892    1981,  1981,  -398,  -398,  -398,  -398,     6,   178,  1493,    32,
893    1493,  -398,  -398,  1493,  -398,  -398,   250,     6,   232,  2145,
894     190,     6,  -398,  -398,  -398,  -398,  -398,   259,  -398,  -398,
895    1903,   150,  -398,   175,   256,     6,   260,  -398,   646,  -398,
896     261,   256,  -398,  -398,  -398,  -398,  -398,   223,   223,     3,
897       3,    53,    53,    53,    53,    27,    27,   116,   226,   227,
898     228,   321,   322,  -127,  -398,  -398,   190,  -398,  1493,  -398,
899    -119,  -398,  -398,    63,   357,  -398,  -398,  1981,  -398,   243,
900     264,  1282,   246,   249,  1439,  -398,  -398,  1981,  -398,   938,
901    -398,  -398,   178,   252,   183,  1981,  1439,   394,  -398,    -8,
902    -398,  1493,  -398,  -398,  -398,  -398,  -398,  -398,   190,  -398,
903     255,   256,  -398,  1282,  1981,   253,  -398,  -398,  1125,  1282,
904      -5,  -398,  -398,  -398,  -104,  -398,  -398,  -398,  -398,  -398,
905    1282,  -398
906};
907
908  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
909     Performed when YYTABLE does not specify something else to do.  Zero
910     means the default is an error.  */
911static const yytype_uint16 yydefact[] =
912{
913       4,     0,     0,    14,     0,     1,     2,    16,    17,    18,
914       5,     0,     0,     0,    15,     6,     0,   185,   184,   208,
915     191,   181,   187,   188,   189,   190,   186,   182,   162,   161,
916     160,   193,   194,   195,   196,   197,   192,     0,   207,   206,
917     163,   164,   212,   211,   210,     0,     0,     0,     0,     0,
918       0,     0,     0,     0,     0,   183,   156,   282,   280,     3,
919     279,     0,     0,   114,   123,     0,   133,   138,   168,   170,
920     167,     0,   165,   166,   169,   145,   202,   204,   171,   205,
921      20,   278,   111,   284,     0,   307,   308,   309,   310,   281,
922       0,     0,     0,   191,   187,   188,   190,    23,    24,   163,
923     164,   143,   168,   173,   165,   169,   144,   172,     0,     7,
924       8,     9,    10,    12,    13,    11,     0,   209,     0,    22,
925      21,   108,     0,   283,   112,   123,   123,   129,   130,   131,
926     123,   115,     0,   123,   123,   123,     0,   109,    16,    18,
927     139,     0,   191,   187,   188,   190,   175,   285,   299,   301,
928     303,   305,   176,   174,   146,   177,   292,   178,   168,   180,
929     286,     0,   203,   179,     0,     0,     0,     0,   215,     0,
930       0,   155,   154,   153,   150,     0,   148,   152,   158,     0,
931       0,     0,     0,     0,     0,     0,     0,     0,     0,    30,
932      31,    26,    27,    32,    28,    29,     0,     0,     0,    56,
933      57,    58,    59,   246,   237,   241,    25,    34,    52,    36,
934      41,    42,     0,     0,    46,     0,    60,     0,    64,    67,
935      70,    75,    78,    80,    82,    84,    86,    88,    90,    92,
936     105,     0,   227,     0,   145,   230,   243,   229,   228,     0,
937     231,   232,   233,   234,   235,   116,   124,   125,   121,   122,
938       0,   132,   126,   128,   127,   134,     0,   140,   117,   302,
939     304,   306,   300,   198,    60,   107,     0,    50,     0,     0,
940      19,   220,     0,   218,   214,   216,     0,   110,     0,   147,
941       0,   157,     0,   274,   273,     0,     0,     0,   277,   275,
942       0,     0,     0,    53,    54,     0,   236,     0,    38,    39,
943       0,     0,    44,    43,     0,   207,    47,    49,    95,    96,
944      98,    97,   100,   101,   102,   103,   104,    99,    94,     0,
945      55,     0,     0,     0,     0,     0,     0,     0,     0,     0,
946       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
947       0,     0,   247,   242,   245,   244,     0,   118,     0,   135,
948       0,   222,   142,     0,   199,   200,     0,     0,     0,   296,
949     221,     0,   217,   213,   151,   149,   159,     0,   268,   267,
950     270,     0,   276,     0,   251,     0,     0,    33,     0,    37,
951       0,    40,    48,    93,    61,    62,    63,    65,    66,    68,
952      69,    73,    74,    71,    72,    76,    77,    79,    81,    83,
953      85,    87,    89,     0,   106,   119,   120,   137,     0,   225,
954       0,   141,   201,     0,   293,   297,   219,     0,   269,     0,
955       0,     0,     0,     0,     0,   238,    35,     0,   136,     0,
956     223,   298,   294,     0,     0,   271,     0,   250,   248,     0,
957     253,     0,   240,   264,   239,    91,   224,   226,   295,   287,
958       0,   272,   266,     0,     0,     0,   254,   258,     0,   262,
959       0,   252,   265,   249,     0,   257,   260,   259,   261,   255,
960     263,   256
961};
962
963  /* YYPGOTO[NTERM-NUM].  */
964static const yytype_int16 yypgoto[] =
965{
966    -398,  -398,  -398,  -398,  -398,  -398,    14,     4,  -398,   127,
967    -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,  -398,
968     151,  -398,  -121,   -65,  -120,   -42,    73,    79,    80,    81,
969      82,    78,  -398,  -117,  -134,  -398,  -153,   -78,     9,    23,
970    -398,  -398,  -398,  -398,   296,   176,  -398,  -398,  -398,  -398,
971     -90,     1,  -398,   146,  -398,  -398,  -398,  -398,   123,   -38,
972    -398,    -9,  -135,   -13,  -398,  -398,   194,  -398,   262,  -161,
973      71,    74,  -188,  -398,   138,  -154,  -397,  -398,  -398,    -6,
974     371,   136,   148,  -398,  -398,    66,  -398,  -398,   -20,  -398,
975     -21,  -398,  -398,  -398,  -398,  -398,  -398,   382,  -398,   -44,
976    -398,   370,  -398,    84,  -398,   379,   380,   383,   384,  -398
977};
978
979  /* YYDEFGOTO[NTERM-NUM].  */
980static const yytype_int16 yydefgoto[] =
981{
982      -1,     2,    13,     3,    58,     6,   271,   344,    59,   206,
983     207,   208,   380,   209,   210,   211,   212,   213,   214,   215,
984     216,   217,   218,   219,   220,   221,   222,   223,   224,   225,
985     226,   227,   228,   229,   230,   319,   231,   266,   232,   233,
986      62,    63,    64,   248,   131,   132,   133,   249,    65,    66,
987      67,   102,   175,   176,   177,    69,   179,    70,    71,    72,
988      73,   105,   162,   267,    76,    77,    78,    79,   167,   168,
989     272,   273,   352,   410,   235,   236,   237,   238,   297,   443,
990     444,   239,   240,   241,   438,   376,   242,   440,   457,   458,
991     459,   460,   243,   370,   419,   420,   244,    80,    81,    82,
992      83,    84,   433,   358,   359,    85,    86,    87,    88,    89
993};
994
995  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
996     positive, shift that token.  If negative, reduce the rule whose
997     number is the opposite.  If YYTABLE_NINF, syntax error.  */
998static const yytype_int16 yytable[] =
999{
1000      75,   166,   104,   104,    74,   257,   275,     1,   454,   455,
1001      14,   454,   455,  -291,    68,   341,   339,   161,    11,     7,
1002       8,     9,    60,   429,   147,  -288,    16,   442,   285,   427,
1003     160,   104,   104,   290,   256,   104,    61,   161,   341,   442,
1004     104,   430,  -289,  -290,   265,   295,    75,     7,     8,     9,
1005      74,    92,   471,   104,   348,   134,    19,   136,   154,    74,
1006      68,   104,   104,   119,   104,    74,   104,   104,    60,    68,
1007       4,   126,     5,   137,    19,   158,   341,   166,    75,   166,
1008     306,   140,    61,   328,   329,   345,   127,   128,   129,    37,
1009      38,   279,   342,    39,   280,   170,   361,   121,   122,    31,
1010      32,    33,    34,    35,   165,   326,   327,    37,    38,   234,
1011     340,    39,   362,    74,   147,   275,   134,   134,    12,   251,
1012     349,   134,   351,   158,   134,   134,   134,    15,   259,   104,
1013     174,   104,   178,   250,   371,    90,   360,    91,   373,   374,
1014     260,   130,    42,    43,    44,    53,   324,   325,   381,    74,
1015     255,   265,   456,  -291,    75,   469,    75,   261,   262,   158,
1016     407,   265,   409,   103,   107,   411,    54,   101,   106,   234,
1017     382,   268,   268,    74,   332,   333,   171,   330,   331,   357,
1018       7,     8,     9,   158,    54,   383,   166,   403,   353,   408,
1019     356,   146,   152,   153,   141,   155,   157,   159,  -288,   341,
1020     364,   163,   375,   387,   388,   361,  -113,   404,   391,   392,
1021     393,   394,   406,  -289,   351,   372,   351,   374,   109,   351,
1022     428,   431,   103,   107,   345,   146,   234,   155,   159,   281,
1023      74,   104,   282,     7,     8,     9,  -290,   346,   104,   108,
1024     158,   447,   172,   308,   309,   310,   311,   312,   313,   314,
1025     315,   316,   317,   461,   104,   110,    75,   111,   135,   298,
1026     299,   389,   390,    75,   434,   347,   112,   437,   303,   357,
1027     113,   304,   114,   234,   351,   173,    10,    74,   116,   234,
1028     375,   146,   451,   377,   234,   115,   341,   158,    74,   421,
1029     395,   396,   341,   445,   174,   351,   366,   448,   158,   463,
1030     300,   464,   246,   117,   466,   468,   247,   351,   124,   252,
1031     253,   254,   264,   164,   422,   118,   468,   341,   161,   135,
1032     135,   104,   450,   126,   135,   341,   125,   135,   135,   135,
1033     268,   169,   104,    42,    43,    44,   -23,   318,   127,   128,
1034     129,   -24,   258,   -51,   269,   301,    75,   293,   294,   270,
1035     286,    31,    32,    33,    34,    35,   278,   234,   277,   287,
1036     405,   138,     8,   139,   283,   234,   284,   288,   320,    74,
1037     321,   322,   323,   291,   292,   296,   302,   307,   334,   158,
1038     335,   337,   336,   121,   338,   -50,   354,   367,   379,   423,
1039     -45,   412,   414,   130,    42,    43,    44,   417,   341,   424,
1040     432,   435,   426,   436,   453,   439,   441,   397,   234,   465,
1041     449,   234,    74,   462,   398,    74,   399,   402,   400,   264,
1042     401,   245,   158,   234,   368,   158,   365,    74,   413,   264,
1043     452,   276,   123,   378,   369,   416,   418,   158,   467,   470,
1044     234,   120,   156,   415,    74,   234,   234,   148,   149,    74,
1045      74,   150,   151,     0,   158,     0,     0,   234,     0,   158,
1046     158,    74,     0,     0,     0,     0,     0,     0,     0,     0,
1047       0,   158,   384,   385,   386,   264,   264,   264,   264,   264,
1048     264,   264,   264,   264,   264,   264,   264,   264,   264,   264,
1049     264,    17,    18,    19,   180,    20,   181,   182,     0,   183,
1050     184,   185,   186,   187,     0,     0,    21,    22,    23,    24,
1051      25,    26,    27,    28,    29,    30,     0,     0,     0,     0,
1052      31,    32,    33,    34,    35,    36,    37,    38,   188,    97,
1053      39,    98,   189,   190,   191,   192,   193,   194,   195,     0,
1054       0,     0,   196,   197,     0,     0,     0,     0,     0,     0,
1055       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1056       0,    40,    41,    42,    43,    44,     0,    45,     0,    12,
1057       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1058       0,     0,    53,     0,     0,     0,     0,     0,     0,     0,
1059       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1060       0,     0,     0,    54,     0,     0,     0,     0,     0,     0,
1061       0,     0,     0,     0,     0,     0,     0,    55,    56,     0,
1062       0,     0,     0,     0,     0,     0,   198,     0,     0,     0,
1063       0,   199,   200,   201,   202,     0,     0,     0,     0,     0,
1064       0,     0,     0,     0,     0,     0,   203,   204,   343,    17,
1065      18,    19,   180,    20,   181,   182,     0,   183,   184,   185,
1066     186,   187,     0,     0,    21,    22,    23,    24,    25,    26,
1067      27,    28,    29,    30,     0,     0,     0,     0,    31,    32,
1068      33,    34,    35,    36,    37,    38,   188,    97,    39,    98,
1069     189,   190,   191,   192,   193,   194,   195,     0,     0,     0,
1070     196,   197,     0,     0,     0,     0,     0,     0,     0,     0,
1071       0,     0,     0,     0,     0,     0,     0,     0,     0,    40,
1072      41,    42,    43,    44,     0,    45,     0,    12,     0,     0,
1073       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1074      53,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1075       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1076       0,    54,     0,     0,     0,     0,     0,     0,     0,     0,
1077       0,     0,     0,     0,     0,    55,    56,     0,     0,     0,
1078       0,     0,     0,     0,   198,     0,     0,     0,     0,   199,
1079     200,   201,   202,     0,     0,     0,     0,     0,     0,     0,
1080       0,     0,     0,     0,   203,   204,   425,    17,    18,    19,
1081     180,    20,   181,   182,     0,   183,   184,   185,   186,   187,
1082       0,     0,    21,    22,    23,    24,    25,    26,    27,    28,
1083      29,    30,     0,     0,     0,     0,    31,    32,    33,    34,
1084      35,    36,    37,    38,   188,    97,    39,    98,   189,   190,
1085     191,   192,   193,   194,   195,     0,     0,     0,   196,   197,
1086       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1087       0,     0,     0,     0,     0,     0,     0,    40,    41,    42,
1088      43,    44,     0,    45,     0,     0,     0,     0,     0,     0,
1089       0,     0,     0,     0,     0,     0,     0,     0,    53,     0,
1090       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1091       0,     0,     0,     0,     0,     0,     0,     0,     0,    54,
1092       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1093       0,     0,     0,    55,    56,     0,    17,    18,    19,     0,
1094      93,     0,   198,    19,     0,     0,     0,   199,   200,   201,
1095     202,    21,    94,    95,    24,    96,    26,    27,    28,    29,
1096      30,     0,   203,   204,   205,    31,    32,    33,    34,    35,
1097      36,    37,    38,     0,     0,    39,    37,    38,     0,    97,
1098      39,    98,   189,   190,   191,   192,   193,   194,   195,     0,
1099       0,     0,   196,   197,     0,     0,     0,     0,     0,    17,
1100      18,    19,     0,    93,     0,     0,    99,   100,    42,    43,
1101      44,     0,     0,     0,    21,    94,    95,    24,    96,    26,
1102      27,    28,    29,    30,     0,     0,     0,    53,    31,    32,
1103      33,    34,    35,    36,    37,    38,     0,     0,    39,     0,
1104       0,     0,     0,     0,     0,     0,     0,     0,    54,     0,
1105       0,     0,     0,    54,     0,     0,     0,     0,     0,     0,
1106       0,     0,    55,    56,     0,     0,     0,     0,     0,    99,
1107     100,    42,    43,    44,     0,     0,   198,     0,     0,     0,
1108       0,   199,   200,   201,   202,     0,     0,     0,     0,     0,
1109      53,     0,     0,   274,     0,     0,     0,   350,   446,     0,
1110       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1111       0,    54,     0,     0,     0,     0,     0,     0,     0,     0,
1112       0,     0,     0,     0,     0,    55,    56,     0,    17,    18,
1113      19,   180,    20,   181,   182,     0,   183,   184,   185,   186,
1114     187,   454,   455,    21,    22,    23,    24,    25,    26,    27,
1115      28,    29,    30,     0,     0,     0,   363,    31,    32,    33,
1116      34,    35,    36,    37,    38,   188,    97,    39,    98,   189,
1117     190,   191,   192,   193,   194,   195,     0,     0,     0,   196,
1118     197,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1119       0,     0,     0,     0,     0,     0,     0,     0,    40,    41,
1120      42,    43,    44,     0,    45,     0,     0,     0,     0,     0,
1121       0,     0,     0,     0,     0,     0,     0,     0,     0,    53,
1122       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1123       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1124      54,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1125       0,     0,     0,     0,    55,    56,     0,     0,     0,     0,
1126       0,     0,     0,   198,     0,     0,     0,     0,   199,   200,
1127     201,   202,     0,     0,     0,     0,     0,     0,     0,     0,
1128       0,     0,     0,   203,   204,    17,    18,    19,   180,    20,
1129     181,   182,     0,   183,   184,   185,   186,   187,     0,     0,
1130      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
1131       0,     0,     0,     0,    31,    32,    33,    34,    35,    36,
1132      37,    38,   188,    97,    39,    98,   189,   190,   191,   192,
1133     193,   194,   195,     0,     0,     0,   196,   197,     0,     0,
1134       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1135       0,     0,     0,     0,     0,    40,    41,    42,    43,    44,
1136       0,    45,     0,     0,     0,     0,     0,     0,     0,     0,
1137       0,     0,     0,     0,     0,     0,    53,     0,     0,     0,
1138       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1139       0,     0,     0,     0,     0,     0,     0,    54,     0,     0,
1140       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1141       0,    55,    56,     0,     0,     0,     0,     0,     0,     0,
1142     198,     0,     0,     0,     0,   199,   200,   201,   202,     0,
1143       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1144     203,   204,    17,    18,    19,   180,    20,   181,   182,     0,
1145     183,   184,   185,   186,   187,     0,     0,    21,    22,    23,
1146      24,    25,    26,    27,    28,    29,    30,     0,     0,     0,
1147       0,    31,    32,    33,    34,    35,    36,    37,    38,   188,
1148      97,    39,    98,   189,   190,   191,   192,   193,   194,   195,
1149       0,     0,     0,   196,   197,     0,     0,     0,    19,     0,
1150       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1151       0,     0,    40,    41,    42,    43,    44,     0,    45,     0,
1152       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1153       0,    37,    38,    53,    97,    39,    98,   189,   190,   191,
1154     192,   193,   194,   195,     0,     0,     0,   196,   197,     0,
1155       0,     0,     0,     0,    54,     0,     0,     0,     0,     0,
1156       0,     0,     0,     0,     0,     0,     0,     0,    55,    56,
1157       0,    17,    18,    19,     0,    20,     0,   198,     0,     0,
1158       0,     0,   199,   200,   201,   202,    21,    22,    23,    24,
1159      25,    26,    27,    28,    29,    30,     0,   203,   122,     0,
1160      31,    32,    33,    34,    35,    36,    37,    38,    54,    97,
1161      39,    98,   189,   190,   191,   192,   193,   194,   195,     0,
1162       0,     0,   196,   197,     0,     0,     0,     0,     0,     0,
1163       0,   198,     0,     0,     0,     0,   199,   200,   201,   202,
1164       0,    40,    41,    42,    43,    44,     0,    45,     0,     0,
1165       0,     0,   350,     0,     0,     0,     0,    17,    18,    19,
1166       0,    20,    53,     0,     0,     0,     0,     0,     0,     0,
1167       0,     0,    21,    22,    23,    24,    25,    26,    27,    28,
1168      29,    30,     0,    54,     0,     0,    31,    32,    33,    34,
1169      35,    36,    37,    38,     0,     0,    39,    55,    56,     0,
1170       0,     0,     0,     0,     0,     0,   198,     0,     0,     0,
1171       0,   199,   200,   201,   202,     0,     0,     0,     0,     0,
1172       0,     0,     0,     0,     0,     0,   203,    40,    41,    42,
1173      43,    44,     0,    45,     0,    12,     0,     0,     0,     0,
1174       0,    46,    47,    48,    49,    50,    51,    52,    53,     0,
1175       0,     0,     0,     0,     0,     0,    17,    18,    19,     0,
1176      20,     0,     0,     0,    19,     0,     0,     0,     0,    54,
1177       0,    21,    22,    23,    24,    25,    26,    27,    28,    29,
1178      30,     0,     0,    55,    56,    31,    32,    33,    34,    35,
1179      36,    37,    38,     0,     0,    39,     0,    37,    38,     0,
1180      97,    39,    98,   189,   190,   191,   192,   193,   194,   195,
1181       0,     0,    57,   196,   197,     0,     0,     0,     0,     0,
1182       0,     0,     0,     0,     0,     0,    40,    41,    42,    43,
1183      44,     0,    45,     0,     0,     0,     0,     0,     0,     0,
1184      46,    47,    48,    49,    50,    51,    52,    53,     0,     0,
1185       0,    19,     0,     0,     0,     0,     0,     0,     0,     0,
1186       0,     0,     0,     0,     0,     0,     0,     0,    54,     0,
1187       0,     0,     0,     0,    54,     0,     0,     0,     0,     0,
1188       0,     0,    55,    56,    37,    38,     0,    97,    39,    98,
1189     189,   190,   191,   192,   193,   194,   195,   198,     0,     0,
1190     196,   197,   199,   200,   201,   202,    17,    18,    19,     0,
1191      93,    57,     0,     0,     0,     0,     0,   289,     0,     0,
1192       0,    21,    94,    95,    24,    96,    26,    27,    28,    29,
1193      30,     0,     0,     0,     0,    31,    32,    33,    34,    35,
1194      36,    37,    38,     0,    97,    39,    98,   189,   190,   191,
1195     192,   193,   194,   195,     0,     0,     0,   196,   197,     0,
1196       0,    54,    19,     0,     0,     0,     0,     0,     0,     0,
1197       0,     0,     0,     0,     0,     0,    99,   100,    42,    43,
1198      44,     0,     0,     0,   198,     0,    19,   263,     0,   199,
1199     200,   201,   202,     0,     0,    37,    38,    53,    97,    39,
1200      98,   189,   190,   191,   192,   193,   194,   195,     0,     0,
1201       0,   196,   197,     0,     0,     0,     0,     0,    54,    37,
1202      38,    19,    97,    39,    98,   189,   190,   191,   192,   193,
1203     194,   195,    55,    56,     0,   196,   197,     0,     0,     0,
1204       0,   198,     0,     0,     0,     0,   199,   200,   201,   202,
1205       0,     0,     0,     0,    37,   305,     0,    97,    39,    98,
1206     189,   190,   191,   192,   193,   194,   195,     0,     0,     0,
1207     196,   197,    54,     0,     0,     0,     0,     0,     0,     0,
1208       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1209       0,     0,     0,     0,     0,   198,    54,     0,   355,     0,
1210     199,   200,   201,   202,     0,     0,     0,     0,     0,     0,
1211       0,     0,     0,     0,     0,     0,     0,     0,     0,   198,
1212       0,     0,     0,     0,   199,   200,   201,   202,     0,     0,
1213       0,    54,     0,     0,     0,     0,     0,     0,     0,     0,
1214       0,     0,     0,     0,     0,     0,     0,     0,    17,    18,
1215      19,     0,    93,     0,   198,     0,     0,     0,     0,   199,
1216     200,   201,   202,    21,    94,    95,    24,    96,    26,    27,
1217      28,    29,    30,     0,     0,     0,     0,    31,    32,    33,
1218      34,    35,    36,    37,    38,     0,     0,    39,     0,     0,
1219       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1220       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1221       0,    17,    18,     0,     0,    93,     0,     0,    99,   100,
1222      42,    43,    44,     0,     0,     0,    21,    94,    95,    24,
1223      96,    26,    27,    28,    29,    30,     0,     0,     0,    53,
1224      31,    32,    33,    34,    35,    36,     0,     0,     0,    97,
1225       0,    98,     0,     0,     0,     0,     0,     0,     0,     0,
1226      54,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1227       0,     0,     0,     0,    55,    56,    17,    18,     0,     0,
1228     142,    99,   100,    42,    43,    44,     0,     0,     0,     0,
1229       0,    21,   143,   144,    24,   145,    26,    27,    28,    29,
1230      30,     0,    53,     0,     0,    31,    32,    33,    34,    35,
1231      36,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1232       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1233       0,     0,     0,     0,     0,     0,     0,    55,    56,    17,
1234      18,     0,     0,    93,     0,     0,    99,   100,    42,    43,
1235      44,     0,     0,     0,    21,    94,    95,    24,    96,    26,
1236      27,    28,    29,    30,     0,     0,     0,    53,    31,    32,
1237      33,    34,    35,    36,     0,     0,     0,     0,     0,     0,
1238       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1239       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1240       0,     0,    55,    56,    17,    18,     0,     0,    20,    99,
1241     100,    42,    43,    44,     0,     0,     0,     0,     0,    21,
1242      22,    23,    24,    25,    26,    27,    28,    29,    30,     0,
1243      53,     0,     0,    31,    32,    33,    34,    35,    36,     0,
1244       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1245       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1246       0,     0,     0,     0,     0,    55,    56,     0,     0,     0,
1247       0,     0,     0,     0,    99,   100,    42,    43,    44,     0,
1248       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1249       0,     0,     0,     0,     0,    53,     0,     0,     0,     0,
1250       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1251       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1252       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1253      55,    56
1254};
1255
1256static const yytype_int16 yycheck[] =
1257{
1258      13,    91,    40,    41,    13,   140,   167,    80,    16,    17,
1259       6,    16,    17,    43,    13,   142,    61,   140,     4,    41,
1260      42,    43,    13,   142,    68,    43,    12,   424,   182,   156,
1261      74,    69,    70,   186,   157,    73,    13,   140,   142,   436,
1262      78,   160,    43,    43,   161,   198,    59,    41,    42,    43,
1263      59,    37,   156,    91,   157,    64,     5,   142,    71,    68,
1264      59,    99,   100,    59,   102,    74,   104,   105,    59,    68,
1265      46,     4,     0,   158,     5,    74,   142,   167,    91,   169,
1266     214,    67,    59,    56,    57,   239,    19,    20,    21,    38,
1267      39,   139,   158,    42,   142,   108,   142,   158,   159,    32,
1268      33,    34,    35,    36,    90,    52,    53,    38,    39,   122,
1269     155,    42,   158,   122,   158,   276,   125,   126,    81,   132,
1270     255,   130,   256,   122,   133,   134,   135,    84,   158,   167,
1271     116,   169,   118,   132,   287,    83,   271,   159,   291,   292,
1272     158,    74,    75,    76,    77,    94,   143,   144,   301,   158,
1273     136,   268,   160,    43,   167,   160,   169,   158,   158,   158,
1274     348,   278,   350,    40,    41,   353,   115,    40,    41,   182,
1275     304,   140,   140,   182,    58,    59,    37,   150,   151,   269,
1276      41,    42,    43,   182,   115,   319,   276,   340,   157,   157,
1277     268,    68,    69,    70,    67,    72,    73,    74,    43,   142,
1278     278,    78,   292,   324,   325,   142,   139,   341,   328,   329,
1279     330,   331,   347,    43,   348,   158,   350,   370,    84,   353,
1280     408,   158,    99,   100,   378,   102,   239,   104,   105,   139,
1281     239,   269,   142,    41,    42,    43,    43,   250,   276,    45,
1282     239,   429,   103,    63,    64,    65,    66,    67,    68,    69,
1283      70,    71,    72,   441,   292,    84,   269,    84,    64,    54,
1284      55,   326,   327,   276,   417,   251,    84,   421,   139,   359,
1285      84,   142,    84,   286,   408,   136,    84,   286,   138,   292,
1286     370,   158,   435,   139,   297,    84,   142,   286,   297,   139,
1287     332,   333,   142,   427,   280,   429,   282,   432,   297,   453,
1288      95,   454,   126,     5,   458,   459,   130,   441,   139,   133,
1289     134,   135,   161,    43,   139,   138,   470,   142,   140,   125,
1290     126,   359,   139,     4,   130,   142,   142,   133,   134,   135,
1291     140,   159,   370,    75,    76,    77,   138,   157,    19,    20,
1292      21,   138,   138,   138,   159,   140,   359,   196,   197,    84,
1293     138,    32,    33,    34,    35,    36,   157,   370,   158,   138,
1294     346,    41,    42,    43,   158,   378,   158,   158,   217,   378,
1295     147,   148,   149,   138,   138,   160,   139,   138,   152,   378,
1296     153,    60,   154,   158,    62,   138,   141,    40,    51,   375,
1297     139,   141,   160,    74,    75,    76,    77,   138,   142,   139,
1298      43,   158,   141,   139,    10,   159,   157,   334,   421,   156,
1299     158,   424,   421,   158,   335,   424,   336,   339,   337,   268,
1300     338,   125,   421,   436,   286,   424,   280,   436,   357,   278,
1301     436,   169,    61,   297,   286,   361,   370,   436,   458,   460,
1302     453,    59,    72,   359,   453,   458,   459,    68,    68,   458,
1303     459,    68,    68,    -1,   453,    -1,    -1,   470,    -1,   458,
1304     459,   470,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1305      -1,   470,   321,   322,   323,   324,   325,   326,   327,   328,
1306     329,   330,   331,   332,   333,   334,   335,   336,   337,   338,
1307     339,     3,     4,     5,     6,     7,     8,     9,    -1,    11,
1308      12,    13,    14,    15,    -1,    -1,    18,    19,    20,    21,
1309      22,    23,    24,    25,    26,    27,    -1,    -1,    -1,    -1,
1310      32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
1311      42,    43,    44,    45,    46,    47,    48,    49,    50,    -1,
1312      -1,    -1,    54,    55,    -1,    -1,    -1,    -1,    -1,    -1,
1313      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1314      -1,    73,    74,    75,    76,    77,    -1,    79,    -1,    81,
1315      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1316      -1,    -1,    94,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1317      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1318      -1,    -1,    -1,   115,    -1,    -1,    -1,    -1,    -1,    -1,
1319      -1,    -1,    -1,    -1,    -1,    -1,    -1,   129,   130,    -1,
1320      -1,    -1,    -1,    -1,    -1,    -1,   138,    -1,    -1,    -1,
1321      -1,   143,   144,   145,   146,    -1,    -1,    -1,    -1,    -1,
1322      -1,    -1,    -1,    -1,    -1,    -1,   158,   159,   160,     3,
1323       4,     5,     6,     7,     8,     9,    -1,    11,    12,    13,
1324      14,    15,    -1,    -1,    18,    19,    20,    21,    22,    23,
1325      24,    25,    26,    27,    -1,    -1,    -1,    -1,    32,    33,
1326      34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
1327      44,    45,    46,    47,    48,    49,    50,    -1,    -1,    -1,
1328      54,    55,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1329      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    73,
1330      74,    75,    76,    77,    -1,    79,    -1,    81,    -1,    -1,
1331      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1332      94,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1333      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1334      -1,   115,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1335      -1,    -1,    -1,    -1,    -1,   129,   130,    -1,    -1,    -1,
1336      -1,    -1,    -1,    -1,   138,    -1,    -1,    -1,    -1,   143,
1337     144,   145,   146,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1338      -1,    -1,    -1,    -1,   158,   159,   160,     3,     4,     5,
1339       6,     7,     8,     9,    -1,    11,    12,    13,    14,    15,
1340      -1,    -1,    18,    19,    20,    21,    22,    23,    24,    25,
1341      26,    27,    -1,    -1,    -1,    -1,    32,    33,    34,    35,
1342      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
1343      46,    47,    48,    49,    50,    -1,    -1,    -1,    54,    55,
1344      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1345      -1,    -1,    -1,    -1,    -1,    -1,    -1,    73,    74,    75,
1346      76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,
1347      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    94,    -1,
1348      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1349      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   115,
1350      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1351      -1,    -1,    -1,   129,   130,    -1,     3,     4,     5,    -1,
1352       7,    -1,   138,     5,    -1,    -1,    -1,   143,   144,   145,
1353     146,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1354      27,    -1,   158,   159,   160,    32,    33,    34,    35,    36,
1355      37,    38,    39,    -1,    -1,    42,    38,    39,    -1,    41,
1356      42,    43,    44,    45,    46,    47,    48,    49,    50,    -1,
1357      -1,    -1,    54,    55,    -1,    -1,    -1,    -1,    -1,     3,
1358       4,     5,    -1,     7,    -1,    -1,    73,    74,    75,    76,
1359      77,    -1,    -1,    -1,    18,    19,    20,    21,    22,    23,
1360      24,    25,    26,    27,    -1,    -1,    -1,    94,    32,    33,
1361      34,    35,    36,    37,    38,    39,    -1,    -1,    42,    -1,
1362      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   115,    -1,
1363      -1,    -1,    -1,   115,    -1,    -1,    -1,    -1,    -1,    -1,
1364      -1,    -1,   129,   130,    -1,    -1,    -1,    -1,    -1,    73,
1365      74,    75,    76,    77,    -1,    -1,   138,    -1,    -1,    -1,
1366      -1,   143,   144,   145,   146,    -1,    -1,    -1,    -1,    -1,
1367      94,    -1,    -1,   160,    -1,    -1,    -1,   159,   160,    -1,
1368      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1369      -1,   115,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1370      -1,    -1,    -1,    -1,    -1,   129,   130,    -1,     3,     4,
1371       5,     6,     7,     8,     9,    -1,    11,    12,    13,    14,
1372      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
1373      25,    26,    27,    -1,    -1,    -1,   160,    32,    33,    34,
1374      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
1375      45,    46,    47,    48,    49,    50,    -1,    -1,    -1,    54,
1376      55,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1377      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    73,    74,
1378      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
1379      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    94,
1380      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1381      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1382     115,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1383      -1,    -1,    -1,    -1,   129,   130,    -1,    -1,    -1,    -1,
1384      -1,    -1,    -1,   138,    -1,    -1,    -1,    -1,   143,   144,
1385     145,   146,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1386      -1,    -1,    -1,   158,   159,     3,     4,     5,     6,     7,
1387       8,     9,    -1,    11,    12,    13,    14,    15,    -1,    -1,
1388      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
1389      -1,    -1,    -1,    -1,    32,    33,    34,    35,    36,    37,
1390      38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
1391      48,    49,    50,    -1,    -1,    -1,    54,    55,    -1,    -1,
1392      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1393      -1,    -1,    -1,    -1,    -1,    73,    74,    75,    76,    77,
1394      -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1395      -1,    -1,    -1,    -1,    -1,    -1,    94,    -1,    -1,    -1,
1396      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1397      -1,    -1,    -1,    -1,    -1,    -1,    -1,   115,    -1,    -1,
1398      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1399      -1,   129,   130,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1400     138,    -1,    -1,    -1,    -1,   143,   144,   145,   146,    -1,
1401      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1402     158,   159,     3,     4,     5,     6,     7,     8,     9,    -1,
1403      11,    12,    13,    14,    15,    -1,    -1,    18,    19,    20,
1404      21,    22,    23,    24,    25,    26,    27,    -1,    -1,    -1,
1405      -1,    32,    33,    34,    35,    36,    37,    38,    39,    40,
1406      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
1407      -1,    -1,    -1,    54,    55,    -1,    -1,    -1,     5,    -1,
1408      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1409      -1,    -1,    73,    74,    75,    76,    77,    -1,    79,    -1,
1410      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1411      -1,    38,    39,    94,    41,    42,    43,    44,    45,    46,
1412      47,    48,    49,    50,    -1,    -1,    -1,    54,    55,    -1,
1413      -1,    -1,    -1,    -1,   115,    -1,    -1,    -1,    -1,    -1,
1414      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   129,   130,
1415      -1,     3,     4,     5,    -1,     7,    -1,   138,    -1,    -1,
1416      -1,    -1,   143,   144,   145,   146,    18,    19,    20,    21,
1417      22,    23,    24,    25,    26,    27,    -1,   158,   159,    -1,
1418      32,    33,    34,    35,    36,    37,    38,    39,   115,    41,
1419      42,    43,    44,    45,    46,    47,    48,    49,    50,    -1,
1420      -1,    -1,    54,    55,    -1,    -1,    -1,    -1,    -1,    -1,
1421      -1,   138,    -1,    -1,    -1,    -1,   143,   144,   145,   146,
1422      -1,    73,    74,    75,    76,    77,    -1,    79,    -1,    -1,
1423      -1,    -1,   159,    -1,    -1,    -1,    -1,     3,     4,     5,
1424      -1,     7,    94,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1425      -1,    -1,    18,    19,    20,    21,    22,    23,    24,    25,
1426      26,    27,    -1,   115,    -1,    -1,    32,    33,    34,    35,
1427      36,    37,    38,    39,    -1,    -1,    42,   129,   130,    -1,
1428      -1,    -1,    -1,    -1,    -1,    -1,   138,    -1,    -1,    -1,
1429      -1,   143,   144,   145,   146,    -1,    -1,    -1,    -1,    -1,
1430      -1,    -1,    -1,    -1,    -1,    -1,   158,    73,    74,    75,
1431      76,    77,    -1,    79,    -1,    81,    -1,    -1,    -1,    -1,
1432      -1,    87,    88,    89,    90,    91,    92,    93,    94,    -1,
1433      -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,    -1,
1434       7,    -1,    -1,    -1,     5,    -1,    -1,    -1,    -1,   115,
1435      -1,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1436      27,    -1,    -1,   129,   130,    32,    33,    34,    35,    36,
1437      37,    38,    39,    -1,    -1,    42,    -1,    38,    39,    -1,
1438      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
1439      -1,    -1,   158,    54,    55,    -1,    -1,    -1,    -1,    -1,
1440      -1,    -1,    -1,    -1,    -1,    -1,    73,    74,    75,    76,
1441      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1442      87,    88,    89,    90,    91,    92,    93,    94,    -1,    -1,
1443      -1,     5,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1444      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   115,    -1,
1445      -1,    -1,    -1,    -1,   115,    -1,    -1,    -1,    -1,    -1,
1446      -1,    -1,   129,   130,    38,    39,    -1,    41,    42,    43,
1447      44,    45,    46,    47,    48,    49,    50,   138,    -1,    -1,
1448      54,    55,   143,   144,   145,   146,     3,     4,     5,    -1,
1449       7,   158,    -1,    -1,    -1,    -1,    -1,   158,    -1,    -1,
1450      -1,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1451      27,    -1,    -1,    -1,    -1,    32,    33,    34,    35,    36,
1452      37,    38,    39,    -1,    41,    42,    43,    44,    45,    46,
1453      47,    48,    49,    50,    -1,    -1,    -1,    54,    55,    -1,
1454      -1,   115,     5,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1455      -1,    -1,    -1,    -1,    -1,    -1,    73,    74,    75,    76,
1456      77,    -1,    -1,    -1,   138,    -1,     5,   141,    -1,   143,
1457     144,   145,   146,    -1,    -1,    38,    39,    94,    41,    42,
1458      43,    44,    45,    46,    47,    48,    49,    50,    -1,    -1,
1459      -1,    54,    55,    -1,    -1,    -1,    -1,    -1,   115,    38,
1460      39,     5,    41,    42,    43,    44,    45,    46,    47,    48,
1461      49,    50,   129,   130,    -1,    54,    55,    -1,    -1,    -1,
1462      -1,   138,    -1,    -1,    -1,    -1,   143,   144,   145,   146,
1463      -1,    -1,    -1,    -1,    38,    39,    -1,    41,    42,    43,
1464      44,    45,    46,    47,    48,    49,    50,    -1,    -1,    -1,
1465      54,    55,   115,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1466      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1467      -1,    -1,    -1,    -1,    -1,   138,   115,    -1,   141,    -1,
1468     143,   144,   145,   146,    -1,    -1,    -1,    -1,    -1,    -1,
1469      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   138,
1470      -1,    -1,    -1,    -1,   143,   144,   145,   146,    -1,    -1,
1471      -1,   115,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1472      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,
1473       5,    -1,     7,    -1,   138,    -1,    -1,    -1,    -1,   143,
1474     144,   145,   146,    18,    19,    20,    21,    22,    23,    24,
1475      25,    26,    27,    -1,    -1,    -1,    -1,    32,    33,    34,
1476      35,    36,    37,    38,    39,    -1,    -1,    42,    -1,    -1,
1477      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1478      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1479      -1,     3,     4,    -1,    -1,     7,    -1,    -1,    73,    74,
1480      75,    76,    77,    -1,    -1,    -1,    18,    19,    20,    21,
1481      22,    23,    24,    25,    26,    27,    -1,    -1,    -1,    94,
1482      32,    33,    34,    35,    36,    37,    -1,    -1,    -1,    41,
1483      -1,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1484     115,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1485      -1,    -1,    -1,    -1,   129,   130,     3,     4,    -1,    -1,
1486       7,    73,    74,    75,    76,    77,    -1,    -1,    -1,    -1,
1487      -1,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1488      27,    -1,    94,    -1,    -1,    32,    33,    34,    35,    36,
1489      37,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1490      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1491      -1,    -1,    -1,    -1,    -1,    -1,    -1,   129,   130,     3,
1492       4,    -1,    -1,     7,    -1,    -1,    73,    74,    75,    76,
1493      77,    -1,    -1,    -1,    18,    19,    20,    21,    22,    23,
1494      24,    25,    26,    27,    -1,    -1,    -1,    94,    32,    33,
1495      34,    35,    36,    37,    -1,    -1,    -1,    -1,    -1,    -1,
1496      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1497      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1498      -1,    -1,   129,   130,     3,     4,    -1,    -1,     7,    73,
1499      74,    75,    76,    77,    -1,    -1,    -1,    -1,    -1,    18,
1500      19,    20,    21,    22,    23,    24,    25,    26,    27,    -1,
1501      94,    -1,    -1,    32,    33,    34,    35,    36,    37,    -1,
1502      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1503      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1504      -1,    -1,    -1,    -1,    -1,   129,   130,    -1,    -1,    -1,
1505      -1,    -1,    -1,    -1,    73,    74,    75,    76,    77,    -1,
1506      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1507      -1,    -1,    -1,    -1,    -1,    94,    -1,    -1,    -1,    -1,
1508      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1509      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1510      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1511     129,   130
1512};
1513
1514  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1515     symbol of state STATE-NUM.  */
1516static const yytype_uint16 yystos[] =
1517{
1518       0,    80,   162,   164,    46,     0,   166,    41,    42,    43,
1519      84,   167,    81,   163,   168,    84,   167,     3,     4,     5,
1520       7,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1521      27,    32,    33,    34,    35,    36,    37,    38,    39,    42,
1522      73,    74,    75,    76,    77,    79,    87,    88,    89,    90,
1523      91,    92,    93,    94,   115,   129,   130,   158,   165,   169,
1524     199,   200,   201,   202,   203,   209,   210,   211,   212,   216,
1525     218,   219,   220,   221,   222,   224,   225,   226,   227,   228,
1526     258,   259,   260,   261,   262,   266,   267,   268,   269,   270,
1527      83,   159,   167,     7,    19,    20,    22,    41,    43,    73,
1528      74,   170,   212,   219,   220,   222,   170,   219,   227,    84,
1529      84,    84,    84,    84,    84,    84,   138,     5,   138,   168,
1530     258,   158,   159,   241,   139,   142,     4,    19,    20,    21,
1531      74,   205,   206,   207,   222,   227,   142,   158,    41,    43,
1532     167,   170,     7,    19,    20,    22,   219,   260,   266,   267,
1533     268,   269,   219,   219,   224,   219,   262,   219,   212,   219,
1534     260,   140,   223,   219,    43,   167,   211,   229,   230,   159,
1535     224,    37,   103,   136,   167,   213,   214,   215,   167,   217,
1536       6,     8,     9,    11,    12,    13,    14,    15,    40,    44,
1537      45,    46,    47,    48,    49,    50,    54,    55,   138,   143,
1538     144,   145,   146,   158,   159,   160,   170,   171,   172,   174,
1539     175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
1540     185,   186,   187,   188,   189,   190,   191,   192,   193,   194,
1541     195,   197,   199,   200,   224,   235,   236,   237,   238,   242,
1542     243,   244,   247,   253,   257,   205,   206,   206,   204,   208,
1543     212,   224,   206,   206,   206,   167,   157,   223,   138,   158,
1544     158,   158,   158,   141,   181,   194,   198,   224,   140,   159,
1545      84,   167,   231,   232,   160,   230,   229,   158,   157,   139,
1546     142,   139,   142,   158,   158,   236,   138,   138,   158,   158,
1547     197,   138,   138,   181,   181,   197,   160,   239,    54,    55,
1548      95,   140,   139,   139,   142,    39,   195,   138,    63,    64,
1549      65,    66,    67,    68,    69,    70,    71,    72,   157,   196,
1550     181,   147,   148,   149,   143,   144,    52,    53,    56,    57,
1551     150,   151,    58,    59,   152,   153,   154,    60,    62,    61,
1552     155,   142,   158,   160,   168,   236,   224,   167,   157,   223,
1553     159,   195,   233,   157,   141,   141,   198,   211,   264,   265,
1554     223,   142,   158,   160,   198,   214,   167,    40,   235,   243,
1555     254,   197,   158,   197,   197,   211,   246,   139,   242,    51,
1556     173,   197,   195,   195,   181,   181,   181,   183,   183,   184,
1557     184,   185,   185,   185,   185,   186,   186,   187,   188,   189,
1558     190,   191,   192,   197,   195,   167,   223,   233,   157,   233,
1559     234,   233,   141,   231,   160,   264,   232,   138,   246,   255,
1560     256,   139,   139,   167,   139,   160,   141,   156,   233,   142,
1561     160,   158,    43,   263,   197,   158,   139,   236,   245,   159,
1562     248,   157,   237,   240,   241,   195,   160,   233,   223,   158,
1563     139,   197,   240,    10,    16,    17,   160,   249,   250,   251,
1564     252,   233,   158,   236,   197,   156,   236,   249,   236,   160,
1565     251,   156
1566};
1567
1568  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1569static const yytype_uint16 yyr1[] =
1570{
1571       0,   161,   163,   162,   164,   164,   164,   165,   165,   165,
1572     165,   165,   165,   165,   166,   166,   167,   167,   167,   168,
1573     169,   169,   169,   170,   170,   171,   171,   171,   171,   171,
1574     171,   171,   171,   171,   172,   172,   172,   172,   172,   172,
1575     173,   174,   175,   176,   176,   177,   177,   178,   178,   179,
1576     180,   180,   181,   181,   181,   181,   182,   182,   182,   182,
1577     183,   183,   183,   183,   184,   184,   184,   185,   185,   185,
1578     186,   186,   186,   186,   186,   187,   187,   187,   188,   188,
1579     189,   189,   190,   190,   191,   191,   192,   192,   193,   193,
1580     194,   194,   195,   195,   196,   196,   196,   196,   196,   196,
1581     196,   196,   196,   196,   196,   197,   197,   198,   199,   199,
1582     199,   199,   200,   201,   201,   202,   202,   203,   204,   204,
1583     204,   205,   205,   206,   206,   206,   206,   206,   206,   207,
1584     207,   207,   208,   209,   209,   209,   209,   209,   210,   210,
1585     210,   210,   210,   210,   210,   211,   211,   212,   213,   213,
1586     214,   214,   214,   215,   215,   215,   216,   216,   217,   217,
1587     218,   218,   218,   219,   219,   219,   219,   219,   219,   219,
1588     219,   219,   219,   219,   219,   219,   219,   219,   219,   219,
1589     219,   220,   220,   220,   221,   221,   221,   221,   221,   221,
1590     221,   221,   221,   222,   222,   222,   222,   222,   223,   223,
1591     223,   223,   224,   224,   225,   225,   225,   226,   226,   226,
1592     227,   227,   227,   228,   228,   229,   229,   230,   231,   231,
1593     232,   232,   233,   233,   233,   234,   234,   235,   236,   236,
1594     237,   237,   237,   237,   237,   237,   238,   239,   238,   240,
1595     240,   241,   241,   242,   242,   242,   243,   243,   244,   245,
1596     245,   246,   246,   247,   248,   248,   249,   249,   250,   250,
1597     251,   251,   252,   252,   253,   253,   253,   254,   254,   255,
1598     255,   256,   256,   257,   257,   257,   257,   257,   258,   258,
1599     258,   258,   258,   259,   260,   260,   260,   261,   262,   262,
1600     262,   262,   262,   263,   263,   263,   264,   264,   265,   266,
1601     266,   267,   267,   268,   268,   269,   269,   270,   270,   270,
1602     270
1603};
1604
1605  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
1606static const yytype_uint8 yyr2[] =
1607{
1608       0,     2,     0,     4,     0,     3,     4,     2,     2,     2,
1609       2,     2,     2,     2,     0,     2,     1,     1,     1,     5,
1610       1,     2,     2,     1,     1,     1,     1,     1,     1,     1,
1611       1,     1,     1,     3,     1,     4,     1,     3,     2,     2,
1612       1,     1,     1,     2,     2,     2,     1,     2,     3,     2,
1613       1,     1,     1,     2,     2,     2,     1,     1,     1,     1,
1614       1,     3,     3,     3,     1,     3,     3,     1,     3,     3,
1615       1,     3,     3,     3,     3,     1,     3,     3,     1,     3,
1616       1,     3,     1,     3,     1,     3,     1,     3,     1,     3,
1617       1,     5,     1,     3,     1,     1,     1,     1,     1,     1,
1618       1,     1,     1,     1,     1,     1,     3,     1,     2,     2,
1619       4,     1,     2,     1,     1,     2,     3,     3,     2,     3,
1620       3,     2,     2,     0,     2,     2,     2,     2,     2,     1,
1621       1,     1,     1,     1,     3,     4,     6,     5,     1,     2,
1622       3,     5,     4,     2,     2,     1,     2,     4,     1,     3,
1623       1,     3,     1,     1,     1,     1,     1,     4,     1,     3,
1624       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1625       1,     1,     2,     2,     2,     2,     2,     2,     2,     2,
1626       2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1627       1,     1,     1,     1,     1,     1,     1,     1,     2,     3,
1628       3,     4,     1,     2,     1,     1,     1,     1,     1,     2,
1629       1,     1,     1,     5,     4,     1,     2,     3,     1,     3,
1630       1,     2,     1,     3,     4,     1,     3,     1,     1,     1,
1631       1,     1,     1,     1,     1,     1,     2,     0,     4,     1,
1632       1,     2,     3,     1,     2,     2,     1,     2,     5,     3,
1633       1,     1,     4,     5,     2,     3,     3,     2,     1,     2,
1634       2,     2,     1,     2,     5,     7,     6,     1,     1,     1,
1635       0,     2,     3,     2,     2,     2,     3,     2,     1,     1,
1636       1,     1,     1,     2,     1,     2,     2,     7,     1,     1,
1637       1,     1,     2,     0,     1,     2,     1,     2,     3,     2,
1638       3,     2,     3,     2,     3,     2,     3,     1,     1,     1,
1639       1
1640};
1641
1642
1643#define yyerrok         (yyerrstatus = 0)
1644#define yyclearin       (yychar = YYEMPTY)
1645#define YYEMPTY         (-2)
1646#define YYEOF           0
1647
1648#define YYACCEPT        goto yyacceptlab
1649#define YYABORT         goto yyabortlab
1650#define YYERROR         goto yyerrorlab
1651
1652
1653#define YYRECOVERING()  (!!yyerrstatus)
1654
1655#define YYBACKUP(Token, Value)                                  \
1656do                                                              \
1657  if (yychar == YYEMPTY)                                        \
1658    {                                                           \
1659      yychar = (Token);                                         \
1660      yylval = (Value);                                         \
1661      YYPOPSTACK (yylen);                                       \
1662      yystate = *yyssp;                                         \
1663      goto yybackup;                                            \
1664    }                                                           \
1665  else                                                          \
1666    {                                                           \
1667      yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
1668      YYERROR;                                                  \
1669    }                                                           \
1670while (0)
1671
1672/* Error token number */
1673#define YYTERROR        1
1674#define YYERRCODE       256
1675
1676
1677/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1678   If N is 0, then set CURRENT to the empty location which ends
1679   the previous symbol: RHS[0] (always defined).  */
1680
1681#ifndef YYLLOC_DEFAULT
1682# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
1683    do                                                                  \
1684      if (N)                                                            \
1685        {                                                               \
1686          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
1687          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
1688          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
1689          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
1690        }                                                               \
1691      else                                                              \
1692        {                                                               \
1693          (Current).first_line   = (Current).last_line   =              \
1694            YYRHSLOC (Rhs, 0).last_line;                                \
1695          (Current).first_column = (Current).last_column =              \
1696            YYRHSLOC (Rhs, 0).last_column;                              \
1697        }                                                               \
1698    while (0)
1699#endif
1700
1701#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1702
1703
1704/* Enable debugging if requested.  */
1705#if YYDEBUG
1706
1707# ifndef YYFPRINTF
1708#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1709#  define YYFPRINTF fprintf
1710# endif
1711
1712# define YYDPRINTF(Args)                        \
1713do {                                            \
1714  if (yydebug)                                  \
1715    YYFPRINTF Args;                             \
1716} while (0)
1717
1718
1719/* YY_LOCATION_PRINT -- Print the location on the stream.
1720   This macro was not mandated originally: define only if we know
1721   we won't break user code: when these are the locations we know.  */
1722
1723#ifndef YY_LOCATION_PRINT
1724# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1725
1726/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
1727
1728YY_ATTRIBUTE_UNUSED
1729static int
1730yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
1731{
1732  int res = 0;
1733  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
1734  if (0 <= yylocp->first_line)
1735    {
1736      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
1737      if (0 <= yylocp->first_column)
1738        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
1739    }
1740  if (0 <= yylocp->last_line)
1741    {
1742      if (yylocp->first_line < yylocp->last_line)
1743        {
1744          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
1745          if (0 <= end_col)
1746            res += YYFPRINTF (yyo, ".%d", end_col);
1747        }
1748      else if (0 <= end_col && yylocp->first_column < end_col)
1749        res += YYFPRINTF (yyo, "-%d", end_col);
1750    }
1751  return res;
1752 }
1753
1754#  define YY_LOCATION_PRINT(File, Loc)          \
1755  yy_location_print_ (File, &(Loc))
1756
1757# else
1758#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1759# endif
1760#endif
1761
1762
1763# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
1764do {                                                                      \
1765  if (yydebug)                                                            \
1766    {                                                                     \
1767      YYFPRINTF (stderr, "%s ", Title);                                   \
1768      yy_symbol_print (stderr,                                            \
1769                  Type, Value, Location, state); \
1770      YYFPRINTF (stderr, "\n");                                           \
1771    }                                                                     \
1772} while (0)
1773
1774
1775/*-----------------------------------.
1776| Print this symbol's value on YYO.  |
1777`-----------------------------------*/
1778
1779static void
1780yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct _mesa_glsl_parse_state *state)
1781{
1782  FILE *yyoutput = yyo;
1783  YYUSE (yyoutput);
1784  YYUSE (yylocationp);
1785  YYUSE (state);
1786  if (!yyvaluep)
1787    return;
1788# ifdef YYPRINT
1789  if (yytype < YYNTOKENS)
1790    YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
1791# endif
1792  YYUSE (yytype);
1793}
1794
1795
1796/*---------------------------.
1797| Print this symbol on YYO.  |
1798`---------------------------*/
1799
1800static void
1801yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct _mesa_glsl_parse_state *state)
1802{
1803  YYFPRINTF (yyo, "%s %s (",
1804             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1805
1806  YY_LOCATION_PRINT (yyo, *yylocationp);
1807  YYFPRINTF (yyo, ": ");
1808  yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, state);
1809  YYFPRINTF (yyo, ")");
1810}
1811
1812/*------------------------------------------------------------------.
1813| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1814| TOP (included).                                                   |
1815`------------------------------------------------------------------*/
1816
1817static void
1818yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1819{
1820  YYFPRINTF (stderr, "Stack now");
1821  for (; yybottom <= yytop; yybottom++)
1822    {
1823      int yybot = *yybottom;
1824      YYFPRINTF (stderr, " %d", yybot);
1825    }
1826  YYFPRINTF (stderr, "\n");
1827}
1828
1829# define YY_STACK_PRINT(Bottom, Top)                            \
1830do {                                                            \
1831  if (yydebug)                                                  \
1832    yy_stack_print ((Bottom), (Top));                           \
1833} while (0)
1834
1835
1836/*------------------------------------------------.
1837| Report that the YYRULE is going to be reduced.  |
1838`------------------------------------------------*/
1839
1840static void
1841yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, struct _mesa_glsl_parse_state *state)
1842{
1843  unsigned long yylno = yyrline[yyrule];
1844  int yynrhs = yyr2[yyrule];
1845  int yyi;
1846  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1847             yyrule - 1, yylno);
1848  /* The symbols being reduced.  */
1849  for (yyi = 0; yyi < yynrhs; yyi++)
1850    {
1851      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1852      yy_symbol_print (stderr,
1853                       yystos[yyssp[yyi + 1 - yynrhs]],
1854                       &(yyvsp[(yyi + 1) - (yynrhs)])
1855                       , &(yylsp[(yyi + 1) - (yynrhs)])                       , state);
1856      YYFPRINTF (stderr, "\n");
1857    }
1858}
1859
1860# define YY_REDUCE_PRINT(Rule)          \
1861do {                                    \
1862  if (yydebug)                          \
1863    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, state); \
1864} while (0)
1865
1866/* Nonzero means print parse trace.  It is left uninitialized so that
1867   multiple parsers can coexist.  */
1868int yydebug;
1869#else /* !YYDEBUG */
1870# define YYDPRINTF(Args)
1871# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1872# define YY_STACK_PRINT(Bottom, Top)
1873# define YY_REDUCE_PRINT(Rule)
1874#endif /* !YYDEBUG */
1875
1876
1877/* YYINITDEPTH -- initial size of the parser's stacks.  */
1878#ifndef YYINITDEPTH
1879# define YYINITDEPTH 200
1880#endif
1881
1882/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1883   if the built-in stack extension method is used).
1884
1885   Do not make this value too large; the results are undefined if
1886   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1887   evaluated with infinite-precision integer arithmetic.  */
1888
1889#ifndef YYMAXDEPTH
1890# define YYMAXDEPTH 10000
1891#endif
1892
1893
1894#if YYERROR_VERBOSE
1895
1896# ifndef yystrlen
1897#  if defined __GLIBC__ && defined _STRING_H
1898#   define yystrlen strlen
1899#  else
1900/* Return the length of YYSTR.  */
1901static YYSIZE_T
1902yystrlen (const char *yystr)
1903{
1904  YYSIZE_T yylen;
1905  for (yylen = 0; yystr[yylen]; yylen++)
1906    continue;
1907  return yylen;
1908}
1909#  endif
1910# endif
1911
1912# ifndef yystpcpy
1913#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1914#   define yystpcpy stpcpy
1915#  else
1916/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1917   YYDEST.  */
1918static char *
1919yystpcpy (char *yydest, const char *yysrc)
1920{
1921  char *yyd = yydest;
1922  const char *yys = yysrc;
1923
1924  while ((*yyd++ = *yys++) != '\0')
1925    continue;
1926
1927  return yyd - 1;
1928}
1929#  endif
1930# endif
1931
1932# ifndef yytnamerr
1933/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1934   quotes and backslashes, so that it's suitable for yyerror.  The
1935   heuristic is that double-quoting is unnecessary unless the string
1936   contains an apostrophe, a comma, or backslash (other than
1937   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1938   null, do not copy; instead, return the length of what the result
1939   would have been.  */
1940static YYSIZE_T
1941yytnamerr (char *yyres, const char *yystr)
1942{
1943  if (*yystr == '"')
1944    {
1945      YYSIZE_T yyn = 0;
1946      char const *yyp = yystr;
1947
1948      for (;;)
1949        switch (*++yyp)
1950          {
1951          case '\'':
1952          case ',':
1953            goto do_not_strip_quotes;
1954
1955          case '\\':
1956            if (*++yyp != '\\')
1957              goto do_not_strip_quotes;
1958            /* Fall through.  */
1959          default:
1960            if (yyres)
1961              yyres[yyn] = *yyp;
1962            yyn++;
1963            break;
1964
1965          case '"':
1966            if (yyres)
1967              yyres[yyn] = '\0';
1968            return yyn;
1969          }
1970    do_not_strip_quotes: ;
1971    }
1972
1973  if (! yyres)
1974    return yystrlen (yystr);
1975
1976  return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
1977}
1978# endif
1979
1980/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1981   about the unexpected token YYTOKEN for the state stack whose top is
1982   YYSSP.
1983
1984   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1985   not large enough to hold the message.  In that case, also set
1986   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1987   required number of bytes is too large to store.  */
1988static int
1989yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1990                yytype_int16 *yyssp, int yytoken)
1991{
1992  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1993  YYSIZE_T yysize = yysize0;
1994  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1995  /* Internationalized format string. */
1996  const char *yyformat = YY_NULLPTR;
1997  /* Arguments of yyformat. */
1998  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1999  /* Number of reported tokens (one for the "unexpected", one per
2000     "expected"). */
2001  int yycount = 0;
2002
2003  /* There are many possibilities here to consider:
2004     - If this state is a consistent state with a default action, then
2005       the only way this function was invoked is if the default action
2006       is an error action.  In that case, don't check for expected
2007       tokens because there are none.
2008     - The only way there can be no lookahead present (in yychar) is if
2009       this state is a consistent state with a default action.  Thus,
2010       detecting the absence of a lookahead is sufficient to determine
2011       that there is no unexpected or expected token to report.  In that
2012       case, just report a simple "syntax error".
2013     - Don't assume there isn't a lookahead just because this state is a
2014       consistent state with a default action.  There might have been a
2015       previous inconsistent state, consistent state with a non-default
2016       action, or user semantic action that manipulated yychar.
2017     - Of course, the expected token list depends on states to have
2018       correct lookahead information, and it depends on the parser not
2019       to perform extra reductions after fetching a lookahead from the
2020       scanner and before detecting a syntax error.  Thus, state merging
2021       (from LALR or IELR) and default reductions corrupt the expected
2022       token list.  However, the list is correct for canonical LR with
2023       one exception: it will still contain any token that will not be
2024       accepted due to an error action in a later state.
2025  */
2026  if (yytoken != YYEMPTY)
2027    {
2028      int yyn = yypact[*yyssp];
2029      yyarg[yycount++] = yytname[yytoken];
2030      if (!yypact_value_is_default (yyn))
2031        {
2032          /* Start YYX at -YYN if negative to avoid negative indexes in
2033             YYCHECK.  In other words, skip the first -YYN actions for
2034             this state because they are default actions.  */
2035          int yyxbegin = yyn < 0 ? -yyn : 0;
2036          /* Stay within bounds of both yycheck and yytname.  */
2037          int yychecklim = YYLAST - yyn + 1;
2038          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2039          int yyx;
2040
2041          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2042            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
2043                && !yytable_value_is_error (yytable[yyx + yyn]))
2044              {
2045                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2046                  {
2047                    yycount = 1;
2048                    yysize = yysize0;
2049                    break;
2050                  }
2051                yyarg[yycount++] = yytname[yyx];
2052                {
2053                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
2054                  if (! (yysize <= yysize1
2055                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2056                    return 2;
2057                  yysize = yysize1;
2058                }
2059              }
2060        }
2061    }
2062
2063  switch (yycount)
2064    {
2065# define YYCASE_(N, S)                      \
2066      case N:                               \
2067        yyformat = S;                       \
2068      break
2069    default: /* Avoid compiler warnings. */
2070      YYCASE_(0, YY_("syntax error"));
2071      YYCASE_(1, YY_("syntax error, unexpected %s"));
2072      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
2073      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2074      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2075      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2076# undef YYCASE_
2077    }
2078
2079  {
2080    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
2081    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2082      return 2;
2083    yysize = yysize1;
2084  }
2085
2086  if (*yymsg_alloc < yysize)
2087    {
2088      *yymsg_alloc = 2 * yysize;
2089      if (! (yysize <= *yymsg_alloc
2090             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
2091        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
2092      return 1;
2093    }
2094
2095  /* Avoid sprintf, as that infringes on the user's name space.
2096     Don't have undefined behavior even if the translation
2097     produced a string with the wrong number of "%s"s.  */
2098  {
2099    char *yyp = *yymsg;
2100    int yyi = 0;
2101    while ((*yyp = *yyformat) != '\0')
2102      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
2103        {
2104          yyp += yytnamerr (yyp, yyarg[yyi++]);
2105          yyformat += 2;
2106        }
2107      else
2108        {
2109          yyp++;
2110          yyformat++;
2111        }
2112  }
2113  return 0;
2114}
2115#endif /* YYERROR_VERBOSE */
2116
2117/*-----------------------------------------------.
2118| Release the memory associated to this symbol.  |
2119`-----------------------------------------------*/
2120
2121static void
2122yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct _mesa_glsl_parse_state *state)
2123{
2124  YYUSE (yyvaluep);
2125  YYUSE (yylocationp);
2126  YYUSE (state);
2127  if (!yymsg)
2128    yymsg = "Deleting";
2129  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2130
2131  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2132  YYUSE (yytype);
2133  YY_IGNORE_MAYBE_UNINITIALIZED_END
2134}
2135
2136
2137
2138
2139/*----------.
2140| yyparse.  |
2141`----------*/
2142
2143int
2144yyparse (struct _mesa_glsl_parse_state *state)
2145{
2146/* The lookahead symbol.  */
2147int yychar;
2148
2149
2150/* The semantic value of the lookahead symbol.  */
2151/* Default value used for initialization, for pacifying older GCCs
2152   or non-GCC compilers.  */
2153YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
2154YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
2155
2156/* Location data for the lookahead symbol.  */
2157static YYLTYPE yyloc_default
2158# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2159  = { 1, 1, 1, 1 }
2160# endif
2161;
2162YYLTYPE yylloc = yyloc_default;
2163
2164    /* Number of syntax errors so far.  */
2165    int yynerrs;
2166
2167    int yystate;
2168    /* Number of tokens to shift before error messages enabled.  */
2169    int yyerrstatus;
2170
2171    /* The stacks and their tools:
2172       'yyss': related to states.
2173       'yyvs': related to semantic values.
2174       'yyls': related to locations.
2175
2176       Refer to the stacks through separate pointers, to allow yyoverflow
2177       to reallocate them elsewhere.  */
2178
2179    /* The state stack.  */
2180    yytype_int16 yyssa[YYINITDEPTH];
2181    yytype_int16 *yyss;
2182    yytype_int16 *yyssp;
2183
2184    /* The semantic value stack.  */
2185    YYSTYPE yyvsa[YYINITDEPTH];
2186    YYSTYPE *yyvs;
2187    YYSTYPE *yyvsp;
2188
2189    /* The location stack.  */
2190    YYLTYPE yylsa[YYINITDEPTH];
2191    YYLTYPE *yyls;
2192    YYLTYPE *yylsp;
2193
2194    /* The locations where the error started and ended.  */
2195    YYLTYPE yyerror_range[3];
2196
2197    YYSIZE_T yystacksize;
2198
2199  int yyn;
2200  int yyresult;
2201  /* Lookahead token as an internal (translated) token number.  */
2202  int yytoken = 0;
2203  /* The variables used to return semantic value and location from the
2204     action routines.  */
2205  YYSTYPE yyval;
2206  YYLTYPE yyloc;
2207
2208#if YYERROR_VERBOSE
2209  /* Buffer for error messages, and its allocated size.  */
2210  char yymsgbuf[128];
2211  char *yymsg = yymsgbuf;
2212  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2213#endif
2214
2215#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
2216
2217  /* The number of symbols on the RHS of the reduced rule.
2218     Keep to zero when no symbol should be popped.  */
2219  int yylen = 0;
2220
2221  yyssp = yyss = yyssa;
2222  yyvsp = yyvs = yyvsa;
2223  yylsp = yyls = yylsa;
2224  yystacksize = YYINITDEPTH;
2225
2226  YYDPRINTF ((stderr, "Starting parse\n"));
2227
2228  yystate = 0;
2229  yyerrstatus = 0;
2230  yynerrs = 0;
2231  yychar = YYEMPTY; /* Cause a token to be read.  */
2232
2233/* User initialization code.  */
2234#line 87 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1429  */
2235{
2236   yylloc.first_line = 1;
2237   yylloc.first_column = 1;
2238   yylloc.last_line = 1;
2239   yylloc.last_column = 1;
2240   yylloc.source = 0;
2241}
2242
2243#line 2244 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1429  */
2244  yylsp[0] = yylloc;
2245  goto yysetstate;
2246
2247/*------------------------------------------------------------.
2248| yynewstate -- Push a new state, which is found in yystate.  |
2249`------------------------------------------------------------*/
2250 yynewstate:
2251  /* In all cases, when you get here, the value and location stacks
2252     have just been pushed.  So pushing a state here evens the stacks.  */
2253  yyssp++;
2254
2255 yysetstate:
2256  *yyssp = (yytype_int16) yystate;
2257
2258  if (yyss + yystacksize - 1 <= yyssp)
2259    {
2260      /* Get the current used size of the three stacks, in elements.  */
2261      YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
2262
2263#ifdef yyoverflow
2264      {
2265        /* Give user a chance to reallocate the stack.  Use copies of
2266           these so that the &'s don't force the real ones into
2267           memory.  */
2268        YYSTYPE *yyvs1 = yyvs;
2269        yytype_int16 *yyss1 = yyss;
2270        YYLTYPE *yyls1 = yyls;
2271
2272        /* Each stack pointer address is followed by the size of the
2273           data in use in that stack, in bytes.  This used to be a
2274           conditional around just the two extra args, but that might
2275           be undefined if yyoverflow is a macro.  */
2276        yyoverflow (YY_("memory exhausted"),
2277                    &yyss1, yysize * sizeof (*yyssp),
2278                    &yyvs1, yysize * sizeof (*yyvsp),
2279                    &yyls1, yysize * sizeof (*yylsp),
2280                    &yystacksize);
2281        yyss = yyss1;
2282        yyvs = yyvs1;
2283        yyls = yyls1;
2284      }
2285#else /* no yyoverflow */
2286# ifndef YYSTACK_RELOCATE
2287      goto yyexhaustedlab;
2288# else
2289      /* Extend the stack our own way.  */
2290      if (YYMAXDEPTH <= yystacksize)
2291        goto yyexhaustedlab;
2292      yystacksize *= 2;
2293      if (YYMAXDEPTH < yystacksize)
2294        yystacksize = YYMAXDEPTH;
2295
2296      {
2297        yytype_int16 *yyss1 = yyss;
2298        union yyalloc *yyptr =
2299          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2300        if (! yyptr)
2301          goto yyexhaustedlab;
2302        YYSTACK_RELOCATE (yyss_alloc, yyss);
2303        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2304        YYSTACK_RELOCATE (yyls_alloc, yyls);
2305#  undef YYSTACK_RELOCATE
2306        if (yyss1 != yyssa)
2307          YYSTACK_FREE (yyss1);
2308      }
2309# endif
2310#endif /* no yyoverflow */
2311
2312      yyssp = yyss + yysize - 1;
2313      yyvsp = yyvs + yysize - 1;
2314      yylsp = yyls + yysize - 1;
2315
2316      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2317                  (unsigned long) yystacksize));
2318
2319      if (yyss + yystacksize - 1 <= yyssp)
2320        YYABORT;
2321    }
2322
2323  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2324
2325  if (yystate == YYFINAL)
2326    YYACCEPT;
2327
2328  goto yybackup;
2329
2330/*-----------.
2331| yybackup.  |
2332`-----------*/
2333yybackup:
2334
2335  /* Do appropriate processing given the current state.  Read a
2336     lookahead token if we need one and don't already have one.  */
2337
2338  /* First try to decide what to do without reference to lookahead token.  */
2339  yyn = yypact[yystate];
2340  if (yypact_value_is_default (yyn))
2341    goto yydefault;
2342
2343  /* Not known => get a lookahead token if don't already have one.  */
2344
2345  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
2346  if (yychar == YYEMPTY)
2347    {
2348      YYDPRINTF ((stderr, "Reading a token: "));
2349      yychar = yylex (&yylval, &yylloc, state);
2350    }
2351
2352  if (yychar <= YYEOF)
2353    {
2354      yychar = yytoken = YYEOF;
2355      YYDPRINTF ((stderr, "Now at end of input.\n"));
2356    }
2357  else
2358    {
2359      yytoken = YYTRANSLATE (yychar);
2360      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2361    }
2362
2363  /* If the proper action on seeing token YYTOKEN is to reduce or to
2364     detect an error, take that action.  */
2365  yyn += yytoken;
2366  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2367    goto yydefault;
2368  yyn = yytable[yyn];
2369  if (yyn <= 0)
2370    {
2371      if (yytable_value_is_error (yyn))
2372        goto yyerrlab;
2373      yyn = -yyn;
2374      goto yyreduce;
2375    }
2376
2377  /* Count tokens shifted since error; after three, turn off error
2378     status.  */
2379  if (yyerrstatus)
2380    yyerrstatus--;
2381
2382  /* Shift the lookahead token.  */
2383  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2384
2385  /* Discard the shifted token.  */
2386  yychar = YYEMPTY;
2387
2388  yystate = yyn;
2389  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2390  *++yyvsp = yylval;
2391  YY_IGNORE_MAYBE_UNINITIALIZED_END
2392  *++yylsp = yylloc;
2393  goto yynewstate;
2394
2395
2396/*-----------------------------------------------------------.
2397| yydefault -- do the default action for the current state.  |
2398`-----------------------------------------------------------*/
2399yydefault:
2400  yyn = yydefact[yystate];
2401  if (yyn == 0)
2402    goto yyerrlab;
2403  goto yyreduce;
2404
2405
2406/*-----------------------------.
2407| yyreduce -- Do a reduction.  |
2408`-----------------------------*/
2409yyreduce:
2410  /* yyn is the number of a rule to reduce with.  */
2411  yylen = yyr2[yyn];
2412
2413  /* If YYLEN is nonzero, implement the default value of the action:
2414     '$$ = $1'.
2415
2416     Otherwise, the following line sets YYVAL to garbage.
2417     This behavior is undocumented and Bison
2418     users should not rely upon it.  Assigning to YYVAL
2419     unconditionally makes the parser a bit smaller, and it avoids a
2420     GCC warning that YYVAL may be used uninitialized.  */
2421  yyval = yyvsp[1-yylen];
2422
2423  /* Default location. */
2424  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
2425  yyerror_range[1] = yyloc;
2426  YY_REDUCE_PRINT (yyn);
2427  switch (yyn)
2428    {
2429        case 2:
2430#line 291 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2431    {
2432      _mesa_glsl_initialize_types(state);
2433   }
2434#line 2435 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2435    break;
2436
2437  case 3:
2438#line 295 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2439    {
2440      delete state->symbols;
2441      state->symbols = new(ralloc_parent(state)) glsl_symbol_table;
2442      if (state->es_shader) {
2443         if (state->stage == MESA_SHADER_FRAGMENT) {
2444            state->symbols->add_default_precision_qualifier("int", ast_precision_medium);
2445         } else {
2446            state->symbols->add_default_precision_qualifier("float", ast_precision_high);
2447            state->symbols->add_default_precision_qualifier("int", ast_precision_high);
2448         }
2449         state->symbols->add_default_precision_qualifier("sampler2D", ast_precision_low);
2450         state->symbols->add_default_precision_qualifier("samplerExternalOES", ast_precision_low);
2451         state->symbols->add_default_precision_qualifier("samplerCube", ast_precision_low);
2452         state->symbols->add_default_precision_qualifier("atomic_uint", ast_precision_high);
2453      }
2454      _mesa_glsl_initialize_types(state);
2455   }
2456#line 2457 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2457    break;
2458
2459  case 5:
2460#line 317 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2461    {
2462      state->process_version_directive(&(yylsp[-1]), (yyvsp[-1].n), NULL);
2463      if (state->error) {
2464         YYERROR;
2465      }
2466   }
2467#line 2468 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2468    break;
2469
2470  case 6:
2471#line 324 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2472    {
2473      state->process_version_directive(&(yylsp[-2]), (yyvsp[-2].n), (yyvsp[-1].identifier));
2474      if (state->error) {
2475         YYERROR;
2476      }
2477   }
2478#line 2479 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2479    break;
2480
2481  case 7:
2482#line 333 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2483    { (yyval.node) = NULL; }
2484#line 2485 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2485    break;
2486
2487  case 8:
2488#line 334 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2489    { (yyval.node) = NULL; }
2490#line 2491 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2491    break;
2492
2493  case 9:
2494#line 335 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2495    { (yyval.node) = NULL; }
2496#line 2497 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2497    break;
2498
2499  case 10:
2500#line 336 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2501    { (yyval.node) = NULL; }
2502#line 2503 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2503    break;
2504
2505  case 11:
2506#line 338 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2507    {
2508      /* Pragma invariant(all) cannot be used in a fragment shader.
2509       *
2510       * Page 27 of the GLSL 1.20 spec, Page 53 of the GLSL ES 3.00 spec:
2511       *
2512       *     "It is an error to use this pragma in a fragment shader."
2513       */
2514      if (state->is_version(120, 300) &&
2515          state->stage == MESA_SHADER_FRAGMENT) {
2516         _mesa_glsl_error(& (yylsp[-1]), state,
2517                          "pragma `invariant(all)' cannot be used "
2518                          "in a fragment shader.");
2519      } else if (!state->is_version(120, 100)) {
2520         _mesa_glsl_warning(& (yylsp[-1]), state,
2521                            "pragma `invariant(all)' not supported in %s "
2522                            "(GLSL ES 1.00 or GLSL 1.20 required)",
2523                            state->get_version_string());
2524      } else {
2525         state->all_invariant = true;
2526      }
2527
2528      (yyval.node) = NULL;
2529   }
2530#line 2531 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2531    break;
2532
2533  case 12:
2534#line 362 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2535    {
2536      void *mem_ctx = state->linalloc;
2537      (yyval.node) = new(mem_ctx) ast_warnings_toggle(true);
2538   }
2539#line 2540 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2540    break;
2541
2542  case 13:
2543#line 367 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2544    {
2545      void *mem_ctx = state->linalloc;
2546      (yyval.node) = new(mem_ctx) ast_warnings_toggle(false);
2547   }
2548#line 2549 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2549    break;
2550
2551  case 19:
2552#line 386 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2553    {
2554      if (!_mesa_glsl_process_extension((yyvsp[-3].identifier), & (yylsp[-3]), (yyvsp[-1].identifier), & (yylsp[-1]), state)) {
2555         YYERROR;
2556      }
2557   }
2558#line 2559 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2559    break;
2560
2561  case 20:
2562#line 395 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2563    {
2564      /* FINISHME: The NULL test is required because pragmas are set to
2565       * FINISHME: NULL. (See production rule for external_declaration.)
2566       */
2567      if ((yyvsp[0].node) != NULL)
2568         state->translation_unit.push_tail(& (yyvsp[0].node)->link);
2569   }
2570#line 2571 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2571    break;
2572
2573  case 21:
2574#line 403 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2575    {
2576      /* FINISHME: The NULL test is required because pragmas are set to
2577       * FINISHME: NULL. (See production rule for external_declaration.)
2578       */
2579      if ((yyvsp[0].node) != NULL)
2580         state->translation_unit.push_tail(& (yyvsp[0].node)->link);
2581   }
2582#line 2583 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2583    break;
2584
2585  case 22:
2586#line 410 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2587    {
2588      if (!state->allow_extension_directive_midshader) {
2589         _mesa_glsl_error(& (yylsp[0]), state,
2590                          "#extension directive is not allowed "
2591                          "in the middle of a shader");
2592         YYERROR;
2593      }
2594   }
2595#line 2596 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2596    break;
2597
2598  case 25:
2599#line 427 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2600    {
2601      void *ctx = state->linalloc;
2602      (yyval.expression) = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL);
2603      (yyval.expression)->set_location((yylsp[0]));
2604      (yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier);
2605   }
2606#line 2607 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2607    break;
2608
2609  case 26:
2610#line 434 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2611    {
2612      void *ctx = state->linalloc;
2613      (yyval.expression) = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL);
2614      (yyval.expression)->set_location((yylsp[0]));
2615      (yyval.expression)->primary_expression.int_constant = (yyvsp[0].n);
2616   }
2617#line 2618 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2618    break;
2619
2620  case 27:
2621#line 441 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2622    {
2623      void *ctx = state->linalloc;
2624      (yyval.expression) = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL);
2625      (yyval.expression)->set_location((yylsp[0]));
2626      (yyval.expression)->primary_expression.uint_constant = (yyvsp[0].n);
2627   }
2628#line 2629 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2629    break;
2630
2631  case 28:
2632#line 448 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2633    {
2634      void *ctx = state->linalloc;
2635      (yyval.expression) = new(ctx) ast_expression(ast_int64_constant, NULL, NULL, NULL);
2636      (yyval.expression)->set_location((yylsp[0]));
2637      (yyval.expression)->primary_expression.int64_constant = (yyvsp[0].n64);
2638   }
2639#line 2640 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2640    break;
2641
2642  case 29:
2643#line 455 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2644    {
2645      void *ctx = state->linalloc;
2646      (yyval.expression) = new(ctx) ast_expression(ast_uint64_constant, NULL, NULL, NULL);
2647      (yyval.expression)->set_location((yylsp[0]));
2648      (yyval.expression)->primary_expression.uint64_constant = (yyvsp[0].n64);
2649   }
2650#line 2651 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2651    break;
2652
2653  case 30:
2654#line 462 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2655    {
2656      void *ctx = state->linalloc;
2657      (yyval.expression) = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL);
2658      (yyval.expression)->set_location((yylsp[0]));
2659      (yyval.expression)->primary_expression.float_constant = (yyvsp[0].real);
2660   }
2661#line 2662 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2662    break;
2663
2664  case 31:
2665#line 469 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2666    {
2667      void *ctx = state->linalloc;
2668      (yyval.expression) = new(ctx) ast_expression(ast_double_constant, NULL, NULL, NULL);
2669      (yyval.expression)->set_location((yylsp[0]));
2670      (yyval.expression)->primary_expression.double_constant = (yyvsp[0].dreal);
2671   }
2672#line 2673 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2673    break;
2674
2675  case 32:
2676#line 476 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2677    {
2678      void *ctx = state->linalloc;
2679      (yyval.expression) = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL);
2680      (yyval.expression)->set_location((yylsp[0]));
2681      (yyval.expression)->primary_expression.bool_constant = (yyvsp[0].n);
2682   }
2683#line 2684 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2684    break;
2685
2686  case 33:
2687#line 483 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2688    {
2689      (yyval.expression) = (yyvsp[-1].expression);
2690   }
2691#line 2692 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2692    break;
2693
2694  case 35:
2695#line 491 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2696    {
2697      void *ctx = state->linalloc;
2698      (yyval.expression) = new(ctx) ast_expression(ast_array_index, (yyvsp[-3].expression), (yyvsp[-1].expression), NULL);
2699      (yyval.expression)->set_location_range((yylsp[-3]), (yylsp[0]));
2700   }
2701#line 2702 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2702    break;
2703
2704  case 36:
2705#line 497 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2706    {
2707      (yyval.expression) = (yyvsp[0].expression);
2708   }
2709#line 2710 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2710    break;
2711
2712  case 37:
2713#line 501 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2714    {
2715      void *ctx = state->linalloc;
2716      (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), NULL, NULL);
2717      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2718      (yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier);
2719   }
2720#line 2721 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2721    break;
2722
2723  case 38:
2724#line 508 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2725    {
2726      void *ctx = state->linalloc;
2727      (yyval.expression) = new(ctx) ast_expression(ast_post_inc, (yyvsp[-1].expression), NULL, NULL);
2728      (yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
2729   }
2730#line 2731 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2731    break;
2732
2733  case 39:
2734#line 514 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2735    {
2736      void *ctx = state->linalloc;
2737      (yyval.expression) = new(ctx) ast_expression(ast_post_dec, (yyvsp[-1].expression), NULL, NULL);
2738      (yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
2739   }
2740#line 2741 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2741    break;
2742
2743  case 47:
2744#line 545 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2745    {
2746      (yyval.expression) = (yyvsp[-1].expression);
2747      (yyval.expression)->set_location((yylsp[-1]));
2748      (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
2749   }
2750#line 2751 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2751    break;
2752
2753  case 48:
2754#line 551 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2755    {
2756      (yyval.expression) = (yyvsp[-2].expression);
2757      (yyval.expression)->set_location((yylsp[-2]));
2758      (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
2759   }
2760#line 2761 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2761    break;
2762
2763  case 50:
2764#line 567 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2765    {
2766      void *ctx = state->linalloc;
2767      (yyval.expression) = new(ctx) ast_function_expression((yyvsp[0].type_specifier));
2768      (yyval.expression)->set_location((yylsp[0]));
2769      }
2770#line 2771 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2771    break;
2772
2773  case 51:
2774#line 573 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2775    {
2776      void *ctx = state->linalloc;
2777      (yyval.expression) = new(ctx) ast_function_expression((yyvsp[0].expression));
2778      (yyval.expression)->set_location((yylsp[0]));
2779      }
2780#line 2781 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2781    break;
2782
2783  case 53:
2784#line 588 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2785    {
2786      void *ctx = state->linalloc;
2787      (yyval.expression) = new(ctx) ast_expression(ast_pre_inc, (yyvsp[0].expression), NULL, NULL);
2788      (yyval.expression)->set_location((yylsp[-1]));
2789   }
2790#line 2791 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2791    break;
2792
2793  case 54:
2794#line 594 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2795    {
2796      void *ctx = state->linalloc;
2797      (yyval.expression) = new(ctx) ast_expression(ast_pre_dec, (yyvsp[0].expression), NULL, NULL);
2798      (yyval.expression)->set_location((yylsp[-1]));
2799   }
2800#line 2801 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2801    break;
2802
2803  case 55:
2804#line 600 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2805    {
2806      void *ctx = state->linalloc;
2807      (yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[0].expression), NULL, NULL);
2808      (yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
2809   }
2810#line 2811 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2811    break;
2812
2813  case 56:
2814#line 609 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2815    { (yyval.n) = ast_plus; }
2816#line 2817 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2817    break;
2818
2819  case 57:
2820#line 610 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2821    { (yyval.n) = ast_neg; }
2822#line 2823 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2823    break;
2824
2825  case 58:
2826#line 611 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2827    { (yyval.n) = ast_logic_not; }
2828#line 2829 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2829    break;
2830
2831  case 59:
2832#line 612 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2833    { (yyval.n) = ast_bit_not; }
2834#line 2835 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2835    break;
2836
2837  case 61:
2838#line 618 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2839    {
2840      void *ctx = state->linalloc;
2841      (yyval.expression) = new(ctx) ast_expression_bin(ast_mul, (yyvsp[-2].expression), (yyvsp[0].expression));
2842      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2843   }
2844#line 2845 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2845    break;
2846
2847  case 62:
2848#line 624 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2849    {
2850      void *ctx = state->linalloc;
2851      (yyval.expression) = new(ctx) ast_expression_bin(ast_div, (yyvsp[-2].expression), (yyvsp[0].expression));
2852      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2853   }
2854#line 2855 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2855    break;
2856
2857  case 63:
2858#line 630 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2859    {
2860      void *ctx = state->linalloc;
2861      (yyval.expression) = new(ctx) ast_expression_bin(ast_mod, (yyvsp[-2].expression), (yyvsp[0].expression));
2862      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2863   }
2864#line 2865 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2865    break;
2866
2867  case 65:
2868#line 640 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2869    {
2870      void *ctx = state->linalloc;
2871      (yyval.expression) = new(ctx) ast_expression_bin(ast_add, (yyvsp[-2].expression), (yyvsp[0].expression));
2872      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2873   }
2874#line 2875 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2875    break;
2876
2877  case 66:
2878#line 646 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2879    {
2880      void *ctx = state->linalloc;
2881      (yyval.expression) = new(ctx) ast_expression_bin(ast_sub, (yyvsp[-2].expression), (yyvsp[0].expression));
2882      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2883   }
2884#line 2885 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2885    break;
2886
2887  case 68:
2888#line 656 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2889    {
2890      void *ctx = state->linalloc;
2891      (yyval.expression) = new(ctx) ast_expression_bin(ast_lshift, (yyvsp[-2].expression), (yyvsp[0].expression));
2892      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2893   }
2894#line 2895 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2895    break;
2896
2897  case 69:
2898#line 662 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2899    {
2900      void *ctx = state->linalloc;
2901      (yyval.expression) = new(ctx) ast_expression_bin(ast_rshift, (yyvsp[-2].expression), (yyvsp[0].expression));
2902      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2903   }
2904#line 2905 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2905    break;
2906
2907  case 71:
2908#line 672 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2909    {
2910      void *ctx = state->linalloc;
2911      (yyval.expression) = new(ctx) ast_expression_bin(ast_less, (yyvsp[-2].expression), (yyvsp[0].expression));
2912      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2913   }
2914#line 2915 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2915    break;
2916
2917  case 72:
2918#line 678 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2919    {
2920      void *ctx = state->linalloc;
2921      (yyval.expression) = new(ctx) ast_expression_bin(ast_greater, (yyvsp[-2].expression), (yyvsp[0].expression));
2922      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2923   }
2924#line 2925 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2925    break;
2926
2927  case 73:
2928#line 684 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2929    {
2930      void *ctx = state->linalloc;
2931      (yyval.expression) = new(ctx) ast_expression_bin(ast_lequal, (yyvsp[-2].expression), (yyvsp[0].expression));
2932      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2933   }
2934#line 2935 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2935    break;
2936
2937  case 74:
2938#line 690 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2939    {
2940      void *ctx = state->linalloc;
2941      (yyval.expression) = new(ctx) ast_expression_bin(ast_gequal, (yyvsp[-2].expression), (yyvsp[0].expression));
2942      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2943   }
2944#line 2945 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2945    break;
2946
2947  case 76:
2948#line 700 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2949    {
2950      void *ctx = state->linalloc;
2951      (yyval.expression) = new(ctx) ast_expression_bin(ast_equal, (yyvsp[-2].expression), (yyvsp[0].expression));
2952      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2953   }
2954#line 2955 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2955    break;
2956
2957  case 77:
2958#line 706 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2959    {
2960      void *ctx = state->linalloc;
2961      (yyval.expression) = new(ctx) ast_expression_bin(ast_nequal, (yyvsp[-2].expression), (yyvsp[0].expression));
2962      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2963   }
2964#line 2965 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2965    break;
2966
2967  case 79:
2968#line 716 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2969    {
2970      void *ctx = state->linalloc;
2971      (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_and, (yyvsp[-2].expression), (yyvsp[0].expression));
2972      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2973   }
2974#line 2975 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2975    break;
2976
2977  case 81:
2978#line 726 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2979    {
2980      void *ctx = state->linalloc;
2981      (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_xor, (yyvsp[-2].expression), (yyvsp[0].expression));
2982      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2983   }
2984#line 2985 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2985    break;
2986
2987  case 83:
2988#line 736 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2989    {
2990      void *ctx = state->linalloc;
2991      (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_or, (yyvsp[-2].expression), (yyvsp[0].expression));
2992      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
2993   }
2994#line 2995 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
2995    break;
2996
2997  case 85:
2998#line 746 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
2999    {
3000      void *ctx = state->linalloc;
3001      (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_and, (yyvsp[-2].expression), (yyvsp[0].expression));
3002      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
3003   }
3004#line 3005 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3005    break;
3006
3007  case 87:
3008#line 756 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3009    {
3010      void *ctx = state->linalloc;
3011      (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_xor, (yyvsp[-2].expression), (yyvsp[0].expression));
3012      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
3013   }
3014#line 3015 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3015    break;
3016
3017  case 89:
3018#line 766 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3019    {
3020      void *ctx = state->linalloc;
3021      (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_or, (yyvsp[-2].expression), (yyvsp[0].expression));
3022      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
3023   }
3024#line 3025 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3025    break;
3026
3027  case 91:
3028#line 776 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3029    {
3030      void *ctx = state->linalloc;
3031      (yyval.expression) = new(ctx) ast_expression(ast_conditional, (yyvsp[-4].expression), (yyvsp[-2].expression), (yyvsp[0].expression));
3032      (yyval.expression)->set_location_range((yylsp[-4]), (yylsp[0]));
3033   }
3034#line 3035 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3035    break;
3036
3037  case 93:
3038#line 786 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3039    {
3040      void *ctx = state->linalloc;
3041      (yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[-2].expression), (yyvsp[0].expression), NULL);
3042      (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
3043   }
3044#line 3045 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3045    break;
3046
3047  case 94:
3048#line 794 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3049    { (yyval.n) = ast_assign; }
3050#line 3051 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3051    break;
3052
3053  case 95:
3054#line 795 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3055    { (yyval.n) = ast_mul_assign; }
3056#line 3057 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3057    break;
3058
3059  case 96:
3060#line 796 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3061    { (yyval.n) = ast_div_assign; }
3062#line 3063 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3063    break;
3064
3065  case 97:
3066#line 797 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3067    { (yyval.n) = ast_mod_assign; }
3068#line 3069 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3069    break;
3070
3071  case 98:
3072#line 798 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3073    { (yyval.n) = ast_add_assign; }
3074#line 3075 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3075    break;
3076
3077  case 99:
3078#line 799 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3079    { (yyval.n) = ast_sub_assign; }
3080#line 3081 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3081    break;
3082
3083  case 100:
3084#line 800 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3085    { (yyval.n) = ast_ls_assign; }
3086#line 3087 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3087    break;
3088
3089  case 101:
3090#line 801 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3091    { (yyval.n) = ast_rs_assign; }
3092#line 3093 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3093    break;
3094
3095  case 102:
3096#line 802 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3097    { (yyval.n) = ast_and_assign; }
3098#line 3099 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3099    break;
3100
3101  case 103:
3102#line 803 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3103    { (yyval.n) = ast_xor_assign; }
3104#line 3105 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3105    break;
3106
3107  case 104:
3108#line 804 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3109    { (yyval.n) = ast_or_assign; }
3110#line 3111 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3111    break;
3112
3113  case 105:
3114#line 809 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3115    {
3116      (yyval.expression) = (yyvsp[0].expression);
3117   }
3118#line 3119 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3119    break;
3120
3121  case 106:
3122#line 813 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3123    {
3124      void *ctx = state->linalloc;
3125      if ((yyvsp[-2].expression)->oper != ast_sequence) {
3126         (yyval.expression) = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL);
3127         (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
3128         (yyval.expression)->expressions.push_tail(& (yyvsp[-2].expression)->link);
3129      } else {
3130         (yyval.expression) = (yyvsp[-2].expression);
3131      }
3132
3133      (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
3134   }
3135#line 3136 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3136    break;
3137
3138  case 108:
3139#line 833 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3140    {
3141      state->symbols->pop_scope();
3142      (yyval.node) = (yyvsp[-1].function);
3143   }
3144#line 3145 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3145    break;
3146
3147  case 109:
3148#line 838 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3149    {
3150      (yyval.node) = (yyvsp[-1].declarator_list);
3151   }
3152#line 3153 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3153    break;
3154
3155  case 110:
3156#line 842 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3157    {
3158      (yyvsp[-1].type_specifier)->default_precision = (yyvsp[-2].n);
3159      (yyval.node) = (yyvsp[-1].type_specifier);
3160   }
3161#line 3162 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3162    break;
3163
3164  case 111:
3165#line 847 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3166    {
3167      ast_interface_block *block = (ast_interface_block *) (yyvsp[0].node);
3168      if (block->layout.has_layout() || block->layout.has_memory()) {
3169         if (!block->default_layout.merge_qualifier(& (yylsp[0]), state, block->layout, false)) {
3170            YYERROR;
3171         }
3172      }
3173      block->layout = block->default_layout;
3174      if (!block->layout.push_to_global(& (yylsp[0]), state)) {
3175         YYERROR;
3176      }
3177      (yyval.node) = (yyvsp[0].node);
3178   }
3179#line 3180 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3180    break;
3181
3182  case 115:
3183#line 873 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3184    {
3185      (yyval.function) = (yyvsp[-1].function);
3186      (yyval.function)->parameters.push_tail(& (yyvsp[0].parameter_declarator)->link);
3187   }
3188#line 3189 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3189    break;
3190
3191  case 116:
3192#line 878 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3193    {
3194      (yyval.function) = (yyvsp[-2].function);
3195      (yyval.function)->parameters.push_tail(& (yyvsp[0].parameter_declarator)->link);
3196   }
3197#line 3198 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3198    break;
3199
3200  case 117:
3201#line 886 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3202    {
3203      void *ctx = state->linalloc;
3204      (yyval.function) = new(ctx) ast_function();
3205      (yyval.function)->set_location((yylsp[-1]));
3206      (yyval.function)->return_type = (yyvsp[-2].fully_specified_type);
3207      (yyval.function)->identifier = (yyvsp[-1].identifier);
3208
3209      if ((yyvsp[-2].fully_specified_type)->qualifier.is_subroutine_decl()) {
3210         /* add type for IDENTIFIER search */
3211         state->symbols->add_type((yyvsp[-1].identifier), glsl_type::get_subroutine_instance((yyvsp[-1].identifier)));
3212      } else
3213         state->symbols->add_function(new(state) ir_function((yyvsp[-1].identifier)));
3214      state->symbols->push_scope();
3215   }
3216#line 3217 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3217    break;
3218
3219  case 118:
3220#line 904 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3221    {
3222      void *ctx = state->linalloc;
3223      (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
3224      (yyval.parameter_declarator)->set_location_range((yylsp[-1]), (yylsp[0]));
3225      (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type();
3226      (yyval.parameter_declarator)->type->set_location((yylsp[-1]));
3227      (yyval.parameter_declarator)->type->specifier = (yyvsp[-1].type_specifier);
3228      (yyval.parameter_declarator)->identifier = (yyvsp[0].identifier);
3229      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[0].identifier), ir_var_auto));
3230   }
3231#line 3232 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3232    break;
3233
3234  case 119:
3235#line 915 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3236    {
3237      if (state->allow_layout_qualifier_on_function_parameter) {
3238         void *ctx = state->linalloc;
3239         (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
3240         (yyval.parameter_declarator)->set_location_range((yylsp[-1]), (yylsp[0]));
3241         (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type();
3242         (yyval.parameter_declarator)->type->set_location((yylsp[-1]));
3243         (yyval.parameter_declarator)->type->specifier = (yyvsp[-1].type_specifier);
3244         (yyval.parameter_declarator)->identifier = (yyvsp[0].identifier);
3245         state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[0].identifier), ir_var_auto));
3246      } else {
3247         _mesa_glsl_error(&(yylsp[-2]), state,
3248                          "is is not allowed on function parameter");
3249         YYERROR;
3250      }
3251   }
3252#line 3253 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3253    break;
3254
3255  case 120:
3256#line 932 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3257    {
3258      void *ctx = state->linalloc;
3259      (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
3260      (yyval.parameter_declarator)->set_location_range((yylsp[-2]), (yylsp[0]));
3261      (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type();
3262      (yyval.parameter_declarator)->type->set_location((yylsp[-2]));
3263      (yyval.parameter_declarator)->type->specifier = (yyvsp[-2].type_specifier);
3264      (yyval.parameter_declarator)->identifier = (yyvsp[-1].identifier);
3265      (yyval.parameter_declarator)->array_specifier = (yyvsp[0].array_specifier);
3266      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-1].identifier), ir_var_auto));
3267   }
3268#line 3269 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3269    break;
3270
3271  case 121:
3272#line 947 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3273    {
3274      (yyval.parameter_declarator) = (yyvsp[0].parameter_declarator);
3275      (yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier);
3276      if (!(yyval.parameter_declarator)->type->qualifier.push_to_global(& (yylsp[-1]), state)) {
3277         YYERROR;
3278      }
3279   }
3280#line 3281 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3281    break;
3282
3283  case 122:
3284#line 955 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3285    {
3286      void *ctx = state->linalloc;
3287      (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
3288      (yyval.parameter_declarator)->set_location((yylsp[0]));
3289      (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type();
3290      (yyval.parameter_declarator)->type->set_location_range((yylsp[-1]), (yylsp[0]));
3291      (yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier);
3292      if (!(yyval.parameter_declarator)->type->qualifier.push_to_global(& (yylsp[-1]), state)) {
3293         YYERROR;
3294      }
3295      (yyval.parameter_declarator)->type->specifier = (yyvsp[0].type_specifier);
3296   }
3297#line 3298 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3298    break;
3299
3300  case 123:
3301#line 971 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3302    {
3303      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
3304   }
3305#line 3306 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3306    break;
3307
3308  case 124:
3309#line 975 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3310    {
3311      if ((yyvsp[0].type_qualifier).flags.q.constant)
3312         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate const qualifier");
3313
3314      (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
3315      (yyval.type_qualifier).flags.q.constant = 1;
3316   }
3317#line 3318 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3318    break;
3319
3320  case 125:
3321#line 983 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3322    {
3323      if ((yyvsp[0].type_qualifier).flags.q.precise)
3324         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate precise qualifier");
3325
3326      (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
3327      (yyval.type_qualifier).flags.q.precise = 1;
3328   }
3329#line 3330 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3330    break;
3331
3332  case 126:
3333#line 991 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3334    {
3335      if (((yyvsp[-1].type_qualifier).flags.q.in || (yyvsp[-1].type_qualifier).flags.q.out) && ((yyvsp[0].type_qualifier).flags.q.in || (yyvsp[0].type_qualifier).flags.q.out))
3336         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate in/out/inout qualifier");
3337
3338      if (!state->has_420pack_or_es31() && (yyvsp[0].type_qualifier).flags.q.constant)
3339         _mesa_glsl_error(&(yylsp[-1]), state, "in/out/inout must come after const "
3340                                      "or precise");
3341
3342      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
3343      (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier), false);
3344   }
3345#line 3346 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3346    break;
3347
3348  case 127:
3349#line 1003 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3350    {
3351      if ((yyvsp[0].type_qualifier).precision != ast_precision_none)
3352         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate precision qualifier");
3353
3354      if (!state->has_420pack_or_es31() &&
3355          (yyvsp[0].type_qualifier).flags.i != 0)
3356         _mesa_glsl_error(&(yylsp[-1]), state, "precision qualifiers must come last");
3357
3358      (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
3359      (yyval.type_qualifier).precision = (yyvsp[-1].n);
3360   }
3361#line 3362 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3362    break;
3363
3364  case 128:
3365#line 1015 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3366    {
3367      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
3368      (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier), false);
3369   }
3370#line 3371 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3371    break;
3372
3373  case 129:
3374#line 1022 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3375    {
3376      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
3377      (yyval.type_qualifier).flags.q.in = 1;
3378   }
3379#line 3380 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3380    break;
3381
3382  case 130:
3383#line 1027 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3384    {
3385      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
3386      (yyval.type_qualifier).flags.q.out = 1;
3387   }
3388#line 3389 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3389    break;
3390
3391  case 131:
3392#line 1032 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3393    {
3394      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
3395      (yyval.type_qualifier).flags.q.in = 1;
3396      (yyval.type_qualifier).flags.q.out = 1;
3397   }
3398#line 3399 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3399    break;
3400
3401  case 134:
3402#line 1046 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3403    {
3404      void *ctx = state->linalloc;
3405      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
3406      decl->set_location((yylsp[0]));
3407
3408      (yyval.declarator_list) = (yyvsp[-2].declarator_list);
3409      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3410      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[0].identifier), ir_var_auto));
3411   }
3412#line 3413 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3413    break;
3414
3415  case 135:
3416#line 1056 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3417    {
3418      void *ctx = state->linalloc;
3419      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
3420      decl->set_location_range((yylsp[-1]), (yylsp[0]));
3421
3422      (yyval.declarator_list) = (yyvsp[-3].declarator_list);
3423      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3424      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-1].identifier), ir_var_auto));
3425   }
3426#line 3427 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3427    break;
3428
3429  case 136:
3430#line 1066 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3431    {
3432      void *ctx = state->linalloc;
3433      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression));
3434      decl->set_location_range((yylsp[-3]), (yylsp[-2]));
3435
3436      (yyval.declarator_list) = (yyvsp[-5].declarator_list);
3437      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3438      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-3].identifier), ir_var_auto));
3439   }
3440#line 3441 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3441    break;
3442
3443  case 137:
3444#line 1076 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3445    {
3446      void *ctx = state->linalloc;
3447      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
3448      decl->set_location((yylsp[-2]));
3449
3450      (yyval.declarator_list) = (yyvsp[-4].declarator_list);
3451      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3452      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-2].identifier), ir_var_auto));
3453   }
3454#line 3455 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3455    break;
3456
3457  case 138:
3458#line 1090 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3459    {
3460      void *ctx = state->linalloc;
3461      /* Empty declaration list is valid. */
3462      (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[0].fully_specified_type));
3463      (yyval.declarator_list)->set_location((yylsp[0]));
3464   }
3465#line 3466 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3466    break;
3467
3468  case 139:
3469#line 1097 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3470    {
3471      void *ctx = state->linalloc;
3472      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
3473      decl->set_location((yylsp[0]));
3474
3475      (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-1].fully_specified_type));
3476      (yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0]));
3477      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3478      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[0].identifier), ir_var_auto));
3479   }
3480#line 3481 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3481    break;
3482
3483  case 140:
3484#line 1108 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3485    {
3486      void *ctx = state->linalloc;
3487      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
3488      decl->set_location_range((yylsp[-1]), (yylsp[0]));
3489
3490      (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-2].fully_specified_type));
3491      (yyval.declarator_list)->set_location_range((yylsp[-2]), (yylsp[0]));
3492      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3493      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-1].identifier), ir_var_auto));
3494   }
3495#line 3496 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3496    break;
3497
3498  case 141:
3499#line 1119 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3500    {
3501      void *ctx = state->linalloc;
3502      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression));
3503      decl->set_location_range((yylsp[-3]), (yylsp[-2]));
3504
3505      (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-4].fully_specified_type));
3506      (yyval.declarator_list)->set_location_range((yylsp[-4]), (yylsp[-2]));
3507      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3508      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-3].identifier), ir_var_auto));
3509   }
3510#line 3511 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3511    break;
3512
3513  case 142:
3514#line 1130 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3515    {
3516      void *ctx = state->linalloc;
3517      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
3518      decl->set_location((yylsp[-2]));
3519
3520      (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-3].fully_specified_type));
3521      (yyval.declarator_list)->set_location_range((yylsp[-3]), (yylsp[-2]));
3522      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3523      state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-2].identifier), ir_var_auto));
3524   }
3525#line 3526 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3526    break;
3527
3528  case 143:
3529#line 1141 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3530    {
3531      void *ctx = state->linalloc;
3532      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
3533      decl->set_location((yylsp[0]));
3534
3535      (yyval.declarator_list) = new(ctx) ast_declarator_list(NULL);
3536      (yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0]));
3537      (yyval.declarator_list)->invariant = true;
3538
3539      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3540   }
3541#line 3542 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3542    break;
3543
3544  case 144:
3545#line 1153 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3546    {
3547      void *ctx = state->linalloc;
3548      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
3549      decl->set_location((yylsp[0]));
3550
3551      (yyval.declarator_list) = new(ctx) ast_declarator_list(NULL);
3552      (yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0]));
3553      (yyval.declarator_list)->precise = true;
3554
3555      (yyval.declarator_list)->declarations.push_tail(&decl->link);
3556   }
3557#line 3558 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3558    break;
3559
3560  case 145:
3561#line 1168 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3562    {
3563      void *ctx = state->linalloc;
3564      (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type();
3565      (yyval.fully_specified_type)->set_location((yylsp[0]));
3566      (yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier);
3567   }
3568#line 3569 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3569    break;
3570
3571  case 146:
3572#line 1175 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3573    {
3574      void *ctx = state->linalloc;
3575      (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type();
3576      (yyval.fully_specified_type)->set_location_range((yylsp[-1]), (yylsp[0]));
3577      (yyval.fully_specified_type)->qualifier = (yyvsp[-1].type_qualifier);
3578      if (!(yyval.fully_specified_type)->qualifier.push_to_global(& (yylsp[-1]), state)) {
3579         YYERROR;
3580      }
3581      (yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier);
3582      if ((yyval.fully_specified_type)->specifier->structure != NULL &&
3583          (yyval.fully_specified_type)->specifier->structure->is_declaration) {
3584            (yyval.fully_specified_type)->specifier->structure->layout = &(yyval.fully_specified_type)->qualifier;
3585      }
3586   }
3587#line 3588 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3588    break;
3589
3590  case 147:
3591#line 1193 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3592    {
3593      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
3594   }
3595#line 3596 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3596    break;
3597
3598  case 149:
3599#line 1201 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3600    {
3601      (yyval.type_qualifier) = (yyvsp[-2].type_qualifier);
3602      if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[0]), state, (yyvsp[0].type_qualifier), true)) {
3603         YYERROR;
3604      }
3605   }
3606#line 3607 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
3607    break;
3608
3609  case 150:
3610#line 1211 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
3611    {
3612      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
3613
3614      /* Layout qualifiers for ARB_fragment_coord_conventions. */
3615      if (!(yyval.type_qualifier).flags.i && (state->ARB_fragment_coord_conventions_enable ||
3616                          state->is_version(150, 0))) {
3617         if (match_layout_qualifier((yyvsp[0].identifier), "origin_upper_left", state) == 0) {
3618            (yyval.type_qualifier).flags.q.origin_upper_left = 1;
3619         } else if (match_layout_qualifier((yyvsp[0].identifier), "pixel_center_integer",
3620                                           state) == 0) {
3621            (yyval.type_qualifier).flags.q.pixel_center_integer = 1;
3622         }
3623
3624         if ((yyval.type_qualifier).flags.i && state->ARB_fragment_coord_conventions_warn) {
3625            _mesa_glsl_warning(& (yylsp[0]), state,
3626                               "GL_ARB_fragment_coord_conventions layout "
3627                               "identifier `%s' used", (yyvsp[0].identifier));
3628         }
3629      }
3630
3631      /* Layout qualifiers for AMD/ARB_conservative_depth. */
3632      if (!(yyval.type_qualifier).flags.i &&
3633          (state->AMD_conservative_depth_enable ||
3634           state->ARB_conservative_depth_enable ||
3635           state->is_version(420, 0))) {
3636         if (match_layout_qualifier((yyvsp[0].identifier), "depth_any", state) == 0) {
3637            (yyval.type_qualifier).flags.q.depth_type = 1;
3638            (yyval.type_qualifier).depth_type = ast_depth_any;
3639         } else if (match_layout_qualifier((yyvsp[0].identifier), "depth_greater", state) == 0) {
3640            (yyval.type_qualifier).flags.q.depth_type = 1;
3641            (yyval.type_qualifier).depth_type = ast_depth_greater;
3642         } else if (match_layout_qualifier((yyvsp[0].identifier), "depth_less", state) == 0) {
3643            (yyval.type_qualifier).flags.q.depth_type = 1;
3644            (yyval.type_qualifier).depth_type = ast_depth_less;
3645         } else if (match_layout_qualifier((yyvsp[0].identifier), "depth_unchanged",
3646                                           state) == 0) {
3647            (yyval.type_qualifier).flags.q.depth_type = 1;
3648            (yyval.type_qualifier).depth_type = ast_depth_unchanged;
3649         }
3650
3651         if ((yyval.type_qualifier).flags.i && state->AMD_conservative_depth_warn) {
3652            _mesa_glsl_warning(& (yylsp[0]), state,
3653                               "GL_AMD_conservative_depth "
3654                               "layout qualifier `%s' is used", (yyvsp[0].identifier));
3655         }
3656         if ((yyval.type_qualifier).flags.i && state->ARB_conservative_depth_warn) {
3657            _mesa_glsl_warning(& (yylsp[0]), state,
3658                               "GL_ARB_conservative_depth "
3659                               "layout qualifier `%s' is used", (yyvsp[0].identifier));
3660         }
3661      }
3662
3663      /* See also interface_block_layout_qualifier. */
3664      if (!(yyval.type_qualifier).flags.i && state->has_uniform_buffer_objects()) {
3665         if (match_layout_qualifier((yyvsp[0].identifier), "std140", state) == 0) {
3666            (yyval.type_qualifier).flags.q.std140 = 1;
3667         } else if (match_layout_qualifier((yyvsp[0].identifier), "shared", state) == 0) {
3668            (yyval.type_qualifier).flags.q.shared = 1;
3669         } else if (match_layout_qualifier((yyvsp[0].identifier), "std430", state) == 0) {
3670            (yyval.type_qualifier).flags.q.std430 = 1;
3671         } else if (match_layout_qualifier((yyvsp[0].identifier), "column_major", state) == 0) {
3672            (yyval.type_qualifier).flags.q.column_major = 1;
3673         /* "row_major" is a reserved word in GLSL 1.30+. Its token is parsed
3674          * below in the interface_block_layout_qualifier rule.
3675          *
3676          * It is not a reserved word in GLSL ES 3.00, so it's handled here as
3677          * an identifier.
3678          *
3679          * Also, this takes care of alternate capitalizations of
3680          * "row_major" (which is necessary because layout qualifiers
3681          * are case-insensitive in desktop GLSL).
3682          */
3683         } else if (match_layout_qualifier((yyvsp[0].identifier), "row_major", state) == 0) {
3684            (yyval.type_qualifier).flags.q.row_major = 1;
3685         /* "packed" is a reserved word in GLSL, and its token is
3686          * parsed below in the interface_block_layout_qualifier rule.
3687          * However, we must take care of alternate capitalizations of
3688          * "packed", because layout qualifiers are case-insensitive
3689          * in desktop GLSL.
3690          */
3691         } else if (match_layout_qualifier((yyvsp[0].identifier), "packed", state) == 0) {
3692           (yyval.type_qualifier).flags.q.packed = 1;
3693         }
3694
3695         if ((yyval.type_qualifier).flags.i && state->ARB_uniform_buffer_object_warn) {
3696            _mesa_glsl_warning(& (yylsp[0]), state,
3697                               "#version 140 / GL_ARB_uniform_buffer_object "
3698                               "layout qualifier `%s' is used", (yyvsp[0].identifier));
3699         }
3700      }
3701
3702      /* Layout qualifiers for GLSL 1.50 geometry shaders. */
3703      if (!(yyval.type_qualifier).flags.i) {
3704         static const struct {
3705            const char *s;
3706            GLenum e;
3707         } map[] = {
3708                 { "points", GL_POINTS },
3709                 { "lines", GL_LINES },
3710                 { "lines_adjacency", GL_LINES_ADJACENCY },
3711                 { "line_strip", GL_LINE_STRIP },
3712                 { "triangles", GL_TRIANGLES },
3713                 { "triangles_adjacency", GL_TRIANGLES_ADJACENCY },
3714                 { "triangle_strip", GL_TRIANGLE_STRIP },
3715         };
3716         for (unsigned i = 0; i < ARRAY_SIZE(map); i++) {
3717            if (match_layout_qualifier((yyvsp[0].identifier), map[i].s, state) == 0) {
3718               (yyval.type_qualifier).flags.q.prim_type = 1;
3719               (yyval.type_qualifier).prim_type = map[i].e;
3720               break;
3721            }
3722         }
3723
3724         if ((yyval.type_qualifier).flags.i && !state->has_geometry_shader() &&
3725             !state->has_tessellation_shader()) {
3726            _mesa_glsl_error(& (yylsp[0]), state, "#version 150 layout "
3727                             "qualifier `%s' used", (yyvsp[0].identifier));
3728         }
3729      }
3730
3731      /* Layout qualifiers for ARB_shader_image_load_store. */
3732      if (state->has_shader_image_load_store()) {
3733         if (!(yyval.type_qualifier).flags.i) {
3734            static const struct {
3735               const char *name;
3736               GLenum format;
3737               glsl_base_type base_type;
3738               /** Minimum desktop GLSL version required for the image
3739                * format.  Use 130 if already present in the original
3740                * ARB extension.
3741                */
3742               unsigned required_glsl;
3743               /** Minimum GLSL ES version required for the image format. */
3744               unsigned required_essl;
3745               /* NV_image_formats */
3746               bool nv_image_formats;
3747            } map[] = {
3748               { "rgba32f", GL_RGBA32F, GLSL_TYPE_FLOAT, 130, 310, false },
3749               { "rgba16f", GL_RGBA16F, GLSL_TYPE_FLOAT, 130, 310, false },
3750               { "rg32f", GL_RG32F, GLSL_TYPE_FLOAT, 130, 0, true },
3751               { "rg16f", GL_RG16F, GLSL_TYPE_FLOAT, 130, 0, true },
3752               { "r11f_g11f_b10f", GL_R11F_G11F_B10F, GLSL_TYPE_FLOAT, 130, 0, true },
3753               { "r32f", GL_R32F, GLSL_TYPE_FLOAT, 130, 310, false },
3754               { "r16f", GL_R16F, GLSL_TYPE_FLOAT, 130, 0, true },
3755               { "rgba32ui", GL_RGBA32UI, GLSL_TYPE_UINT, 130, 310, false },
3756               { "rgba16ui", GL_RGBA16UI, GLSL_TYPE_UINT, 130, 310, false },
3757               { "rgb10_a2ui", GL_RGB10_A2UI, GLSL_TYPE_UINT, 130, 0, true },
3758               { "rgba8ui", GL_RGBA8UI, GLSL_TYPE_UINT, 130, 310, false },
3759               { "rg32ui", GL_RG32UI, GLSL_TYPE_UINT, 130, 0, true },
3760               { "rg16ui", GL_RG16UI, GLSL_TYPE_UINT, 130, 0, true },
3761               { "rg8ui", GL_RG8UI, GLSL_TYPE_UINT, 130, 0, true },
3762               { "r32ui", GL_R32UI, GLSL_TYPE_UINT, 130, 310, false },
3763               { "r16ui", GL_R16UI, GLSL_TYPE_UINT, 130, 0, true },
3764               { "r8ui", GL_R8UI, GLSL_TYPE_UINT, 130, 0, true },
3765               { "rgba32i", GL_RGBA32I, GLSL_TYPE_INT, 130, 310, false },
3766               { "rgba16i", GL_RGBA16I, GLSL_TYPE_INT, 130, 310, false },
3767               { "rgba8i", GL_RGBA8I, GLSL_TYPE_INT, 130, 310, false },
3768               { "rg32i", GL_RG32I, GLSL_TYPE_INT, 130, 0, true },
3769               { "rg16i", GL_RG16I, GLSL_TYPE_INT, 130, 0, true },
3770               { "rg8i", GL_RG8I, GLSL_TYPE_INT, 130, 0, true },
3771               { "r32i", GL_R32I, GLSL_TYPE_INT, 130, 310, false },
3772               { "r16i", GL_R16I, GLSL_TYPE_INT, 130, 0, true },
3773               { "r8i", GL_R8I, GLSL_TYPE_INT, 130, 0, true },
3774               { "rgba16", GL_RGBA16, GLSL_TYPE_FLOAT, 130, 0, true },
3775               { "rgb10_a2", GL_RGB10_A2, GLSL_TYPE_FLOAT, 130, 0, true },
3776               { "rgba8", GL_RGBA8, GLSL_TYPE_FLOAT, 130, 310, false },
3777               { "rg16", GL_RG16, GLSL_TYPE_FLOAT, 130, 0, true },
3778               { "rg8", GL_RG8, GLSL_TYPE_FLOAT, 130, 0, true },
3779               { "r16", GL_R16, GLSL_TYPE_FLOAT, 130, 0, true },
3780               { "r8", GL_R8, GLSL_TYPE_FLOAT, 130, 0, true },
3781               { "rgba16_snorm", GL_RGBA16_SNORM, GLSL_TYPE_FLOAT, 130, 0, true },
3782               { "rgba8_snorm", GL_RGBA8_SNORM, GLSL_TYPE_FLOAT, 130, 310, false },
3783               { "rg16_snorm", GL_RG16_SNORM, GLSL_TYPE_FLOAT, 130, 0, true },
3784               { "rg8_snorm", GL_RG8_SNORM, GLSL_TYPE_FLOAT, 130, 0, true },
3785               { "r16_snorm", GL_R16_SNORM, GLSL_TYPE_FLOAT, 130, 0, true },
3786               { "r8_snorm", GL_R8_SNORM, GLSL_TYPE_FLOAT, 130, 0, true }
3787            };
3788
3789            for (unsigned i = 0; i < ARRAY_SIZE(map); i++) {
3790               if ((state->is_version(map[i].required_glsl,
3791                                      map[i].required_essl) ||
3792                    (state->NV_image_formats_enable &&
3793                     map[i].nv_image_formats)) &&
3794                   match_layout_qualifier((yyvsp[0].identifier), map[i].name, state) == 0) {
3795                  (yyval.type_qualifier).flags.q.explicit_image_format = 1;
3796                  (yyval.type_qualifier).image_format = map[i].format;
3797                  (yyval.type_qualifier).image_base_type = map[i].base_type;
3798                  break;
3799               }
3800            }
3801         }
3802      }
3803
3804      if (!(yyval.type_qualifier).flags.i) {
3805         if (match_layout_qualifier((yyvsp[0].identifier), "early_fragment_tests", state) == 0) {
3806            /* From section 4.4.1.3 of the GLSL 4.50 specification
3807             * (Fragment Shader Inputs):
3808             *
3809             *  "Fragment shaders also allow the following layout
3810             *   qualifier on in only (not with variable declarations)
3811             *     layout-qualifier-id
3812             *        early_fragment_tests
3813             *   [...]"
3814             */
3815            if (state->stage != MESA_SHADER_FRAGMENT) {
3816               _mesa_glsl_error(& (yylsp[0]), state,
3817                                "early_fragment_tests layout qualifier only "
3818                                "valid in fragment shaders");
3819            }
3820
3821            (yyval.type_qualifier).flags.q.early_fragment_tests = 1;
3822         }
3823
3824         if (match_layout_qualifier((yyvsp[0].identifier), "inner_coverage", state) == 0) {
3825            if (state->stage != MESA_SHADER_FRAGMENT) {
3826               _mesa_glsl_error(& (yylsp[0]), state,
3827                                "inner_coverage layout qualifier only "
3828                                "valid in fragment shaders");
3829            }
3830
3831	    if (state->INTEL_conservative_rasterization_enable) {
3832	       (yyval.type_qualifier).flags.q.inner_coverage = 1;
3833	    } else {
3834	       _mesa_glsl_error(& (yylsp[0]), state,
3835                                "inner_coverage layout qualifier present, "
3836                                "but the INTEL_conservative_rasterization extension "
3837                                "is not enabled.");
3838            }
3839         }
3840
3841         if (match_layout_qualifier((yyvsp[0].identifier), "post_depth_coverage", state) == 0) {
3842            if (state->stage != MESA_SHADER_FRAGMENT) {
3843               _mesa_glsl_error(& (yylsp[0]), state,
3844                                "post_depth_coverage layout qualifier only "
3845                                "valid in fragment shaders");
3846            }
3847
3848            if (state->ARB_post_depth_coverage_enable ||
3849		state->INTEL_conservative_rasterization_enable) {
3850               (yyval.type_qualifier).flags.q.post_depth_coverage = 1;
3851            } else {
3852               _mesa_glsl_error(& (yylsp[0]), state,
3853                                "post_depth_coverage layout qualifier present, "
3854                                "but the GL_ARB_post_depth_coverage extension "
3855                                "is not enabled.");
3856            }
3857         }
3858
3859         if ((yyval.type_qualifier).flags.q.post_depth_coverage && (yyval.type_qualifier).flags.q.inner_coverage) {
3860            _mesa_glsl_error(& (yylsp[0]), state,
3861                             "post_depth_coverage & inner_coverage layout qualifiers "
3862                             "are mutually exclusive");
3863         }
3864      }
3865
3866      const bool pixel_interlock_ordered = match_layout_qualifier((yyvsp[0].identifier),
3867         "pixel_interlock_ordered", state) == 0;
3868      const bool pixel_interlock_unordered = match_layout_qualifier((yyvsp[0].identifier),
3869         "pixel_interlock_unordered", state) == 0;
3870      const bool sample_interlock_ordered = match_layout_qualifier((yyvsp[0].identifier),
3871         "sample_interlock_ordered", state) == 0;
3872      const bool sample_interlock_unordered = match_layout_qualifier((yyvsp[0].identifier),
3873         "sample_interlock_unordered", state) == 0;
3874
3875      if (pixel_interlock_ordered + pixel_interlock_unordered +
3876          sample_interlock_ordered + sample_interlock_unordered > 0 &&
3877          state->stage != MESA_SHADER_FRAGMENT) {
3878         _mesa_glsl_error(& (yylsp[0]), state, "interlock layout qualifiers: "
3879                          "pixel_interlock_ordered, pixel_interlock_unordered, "
3880                          "sample_interlock_ordered and sample_interlock_unordered, "
3881                          "only valid in fragment shader input layout declaration.");
3882      } else if (pixel_interlock_ordered + pixel_interlock_unordered +
3883                 sample_interlock_ordered + sample_interlock_unordered > 0 &&
3884                 !state->ARB_fragment_shader_interlock_enable &&
3885                 !state->NV_fragment_shader_interlock_enable) {
3886         _mesa_glsl_error(& (yylsp[0]), state,
3887                          "interlock layout qualifier present, but the "
3888                          "GL_ARB_fragment_shader_interlock or "
3889                          "GL_NV_fragment_shader_interlock extension is not "
3890                          "enabled.");
3891      } else {
3892         (yyval.type_qualifier).flags.q.pixel_interlock_ordered = pixel_interlock_ordered;
3893         (yyval.type_qualifier).flags.q.pixel_interlock_unordered = pixel_interlock_unordered;
3894         (yyval.type_qualifier).flags.q.sample_interlock_ordered = sample_interlock_ordered;
3895         (yyval.type_qualifier).flags.q.sample_interlock_unordered = sample_interlock_unordered;
3896      }
3897
3898      /* Layout qualifiers for tessellation evaluation shaders. */
3899      if (!(yyval.type_qualifier).flags.i) {
3900         static const struct {
3901            const char *s;
3902            GLenum e;
3903         } map[] = {
3904                 /* triangles already parsed by gs-specific code */
3905                 { "quads", GL_QUADS },
3906                 { "isolines", GL_ISOLINES },
3907         };
3908         for (unsigned i = 0; i < ARRAY_SIZE(map); i++) {
3909            if (match_layout_qualifier((yyvsp[0].identifier), map[i].s, state) == 0) {
3910               (yyval.type_qualifier).flags.q.prim_type = 1;
3911               (yyval.type_qualifier).prim_type = map[i].e;
3912               break;
3913            }
3914         }
3915
3916         if ((yyval.type_qualifier).flags.i && !state->has_tessellation_shader()) {
3917            _mesa_glsl_error(& (yylsp[0]), state,
3918                             "primitive mode qualifier `%s' requires "
3919                             "GLSL 4.00 or ARB_tessellation_shader", (yyvsp[0].identifier));
3920         }
3921      }
3922      if (!(yyval.type_qualifier).flags.i) {
3923         static const struct {
3924            const char *s;
3925            enum gl_tess_spacing e;
3926         } map[] = {
3927                 { "equal_spacing", TESS_SPACING_EQUAL },
3928                 { "fractional_odd_spacing", TESS_SPACING_FRACTIONAL_ODD },
3929                 { "fractional_even_spacing", TESS_SPACING_FRACTIONAL_EVEN },
3930         };
3931         for (unsigned i = 0; i < ARRAY_SIZE(map); i++) {
3932            if (match_layout_qualifier((yyvsp[0].identifier), map[i].s, state) == 0) {
3933               (yyval.type_qualifier).flags.q.vertex_spacing = 1;
3934               (yyval.type_qualifier).vertex_spacing = map[i].e;
3935               break;
3936            }
3937         }
3938
3939         if ((yyval.type_qualifier).flags.i && !state->has_tessellation_shader()) {
3940            _mesa_glsl_error(& (yylsp[0]), state,
3941                             "vertex spacing qualifier `%s' requires "
3942                             "GLSL 4.00 or ARB_tessellation_shader", (yyvsp[0].identifier));
3943         }
3944      }
3945      if (!(yyval.type_qualifier).flags.i) {
3946         if (match_layout_qualifier((yyvsp[0].identifier), "cw", state) == 0) {
3947            (yyval.type_qualifier).flags.q.ordering = 1;
3948            (yyval.type_qualifier).ordering = GL_CW;
3949         } else if (match_layout_qualifier((yyvsp[0].identifier), "ccw", state) == 0) {
3950            (yyval.type_qualifier).flags.q.ordering = 1;
3951            (yyval.type_qualifier).ordering = GL_CCW;
3952         }
3953
3954         if ((yyval.type_qualifier).flags.i && !state->has_tessellation_shader()) {
3955            _mesa_glsl_error(& (yylsp[0]), state,
3956                             "ordering qualifier `%s' requires "
3957                             "GLSL 4.00 or ARB_tessellation_shader", (yyvsp[0].identifier));
3958         }
3959      }
3960      if (!(yyval.type_qualifier).flags.i) {
3961         if (match_layout_qualifier((yyvsp[0].identifier), "point_mode", state) == 0) {
3962            (yyval.type_qualifier).flags.q.point_mode = 1;
3963            (yyval.type_qualifier).point_mode = true;
3964         }
3965
3966         if ((yyval.type_qualifier).flags.i && !state->has_tessellation_shader()) {
3967            _mesa_glsl_error(& (yylsp[0]), state,
3968                             "qualifier `point_mode' requires "
3969                             "GLSL 4.00 or ARB_tessellation_shader");
3970         }
3971      }
3972
3973      if (!(yyval.type_qualifier).flags.i) {
3974         static const struct {
3975            const char *s;
3976            uint32_t mask;
3977         } map[] = {
3978                 { "blend_support_multiply",       BLEND_MULTIPLY },
3979                 { "blend_support_screen",         BLEND_SCREEN },
3980                 { "blend_support_overlay",        BLEND_OVERLAY },
3981                 { "blend_support_darken",         BLEND_DARKEN },
3982                 { "blend_support_lighten",        BLEND_LIGHTEN },
3983                 { "blend_support_colordodge",     BLEND_COLORDODGE },
3984                 { "blend_support_colorburn",      BLEND_COLORBURN },
3985                 { "blend_support_hardlight",      BLEND_HARDLIGHT },
3986                 { "blend_support_softlight",      BLEND_SOFTLIGHT },
3987                 { "blend_support_difference",     BLEND_DIFFERENCE },
3988                 { "blend_support_exclusion",      BLEND_EXCLUSION },
3989                 { "blend_support_hsl_hue",        BLEND_HSL_HUE },
3990                 { "blend_support_hsl_saturation", BLEND_HSL_SATURATION },
3991                 { "blend_support_hsl_color",      BLEND_HSL_COLOR },
3992                 { "blend_support_hsl_luminosity", BLEND_HSL_LUMINOSITY },
3993                 { "blend_support_all_equations",  BLEND_ALL },
3994         };
3995         for (unsigned i = 0; i < ARRAY_SIZE(map); i++) {
3996            if (match_layout_qualifier((yyvsp[0].identifier), map[i].s, state) == 0) {
3997               (yyval.type_qualifier).flags.q.blend_support = 1;
3998               state->fs_blend_support |= map[i].mask;
3999               break;
4000            }
4001         }
4002
4003         if ((yyval.type_qualifier).flags.i &&
4004             !state->KHR_blend_equation_advanced_enable &&
4005             !state->is_version(0, 320)) {
4006            _mesa_glsl_error(& (yylsp[0]), state,
4007                             "advanced blending layout qualifiers require "
4008                             "ESSL 3.20 or KHR_blend_equation_advanced");
4009         }
4010
4011         if ((yyval.type_qualifier).flags.i && state->stage != MESA_SHADER_FRAGMENT) {
4012            _mesa_glsl_error(& (yylsp[0]), state,
4013                             "advanced blending layout qualifiers only "
4014                             "valid in fragment shaders");
4015         }
4016      }
4017
4018      /* Layout qualifiers for ARB_compute_variable_group_size. */
4019      if (!(yyval.type_qualifier).flags.i) {
4020         if (match_layout_qualifier((yyvsp[0].identifier), "local_size_variable", state) == 0) {
4021            (yyval.type_qualifier).flags.q.local_size_variable = 1;
4022         }
4023
4024         if ((yyval.type_qualifier).flags.i && !state->ARB_compute_variable_group_size_enable) {
4025            _mesa_glsl_error(& (yylsp[0]), state,
4026                             "qualifier `local_size_variable` requires "
4027                             "ARB_compute_variable_group_size");
4028         }
4029      }
4030
4031      /* Layout qualifiers for ARB_bindless_texture. */
4032      if (!(yyval.type_qualifier).flags.i) {
4033         if (match_layout_qualifier((yyvsp[0].identifier), "bindless_sampler", state) == 0)
4034            (yyval.type_qualifier).flags.q.bindless_sampler = 1;
4035         if (match_layout_qualifier((yyvsp[0].identifier), "bound_sampler", state) == 0)
4036            (yyval.type_qualifier).flags.q.bound_sampler = 1;
4037
4038         if (state->has_shader_image_load_store()) {
4039            if (match_layout_qualifier((yyvsp[0].identifier), "bindless_image", state) == 0)
4040               (yyval.type_qualifier).flags.q.bindless_image = 1;
4041            if (match_layout_qualifier((yyvsp[0].identifier), "bound_image", state) == 0)
4042               (yyval.type_qualifier).flags.q.bound_image = 1;
4043         }
4044
4045         if ((yyval.type_qualifier).flags.i && !state->has_bindless()) {
4046            _mesa_glsl_error(& (yylsp[0]), state,
4047                             "qualifier `%s` requires "
4048                             "ARB_bindless_texture", (yyvsp[0].identifier));
4049         }
4050      }
4051
4052      if (!(yyval.type_qualifier).flags.i &&
4053          state->EXT_shader_framebuffer_fetch_non_coherent_enable) {
4054         if (match_layout_qualifier((yyvsp[0].identifier), "noncoherent", state) == 0)
4055            (yyval.type_qualifier).flags.q.non_coherent = 1;
4056      }
4057
4058      // Layout qualifiers for NV_compute_shader_derivatives.
4059      if (!(yyval.type_qualifier).flags.i) {
4060         if (match_layout_qualifier((yyvsp[0].identifier), "derivative_group_quadsNV", state) == 0) {
4061            (yyval.type_qualifier).flags.q.derivative_group = 1;
4062            (yyval.type_qualifier).derivative_group = DERIVATIVE_GROUP_QUADS;
4063         } else if (match_layout_qualifier((yyvsp[0].identifier), "derivative_group_linearNV", state) == 0) {
4064            (yyval.type_qualifier).flags.q.derivative_group = 1;
4065            (yyval.type_qualifier).derivative_group = DERIVATIVE_GROUP_LINEAR;
4066         }
4067
4068         if ((yyval.type_qualifier).flags.i) {
4069            if (!state->has_compute_shader()) {
4070               _mesa_glsl_error(& (yylsp[0]), state,
4071                                "qualifier `%s' requires "
4072                                "a compute shader", (yyvsp[0].identifier));
4073            }
4074
4075            if (!state->NV_compute_shader_derivatives_enable) {
4076               _mesa_glsl_error(& (yylsp[0]), state,
4077                                "qualifier `%s' requires "
4078                                "NV_compute_shader_derivatives", (yyvsp[0].identifier));
4079            }
4080
4081            if (state->NV_compute_shader_derivatives_warn) {
4082               _mesa_glsl_warning(& (yylsp[0]), state,
4083                                  "NV_compute_shader_derivatives layout "
4084                                  "qualifier `%s' used", (yyvsp[0].identifier));
4085            }
4086         }
4087      }
4088
4089      if (!(yyval.type_qualifier).flags.i) {
4090         _mesa_glsl_error(& (yylsp[0]), state, "unrecognized layout identifier "
4091                          "`%s'", (yyvsp[0].identifier));
4092         YYERROR;
4093      }
4094   }
4095#line 4096 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4096    break;
4097
4098  case 151:
4099#line 1696 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4100    {
4101      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4102      void *ctx = state->linalloc;
4103
4104      if ((yyvsp[0].expression)->oper != ast_int_constant &&
4105          (yyvsp[0].expression)->oper != ast_uint_constant &&
4106          !state->has_enhanced_layouts()) {
4107         _mesa_glsl_error(& (yylsp[-2]), state,
4108                          "compile-time constant expressions require "
4109                          "GLSL 4.40 or ARB_enhanced_layouts");
4110      }
4111
4112      if (match_layout_qualifier("align", (yyvsp[-2].identifier), state) == 0) {
4113         if (!state->has_enhanced_layouts()) {
4114            _mesa_glsl_error(& (yylsp[-2]), state,
4115                             "align qualifier requires "
4116                             "GLSL 4.40 or ARB_enhanced_layouts");
4117         } else {
4118            (yyval.type_qualifier).flags.q.explicit_align = 1;
4119            (yyval.type_qualifier).align = (yyvsp[0].expression);
4120         }
4121      }
4122
4123      if (match_layout_qualifier("location", (yyvsp[-2].identifier), state) == 0) {
4124         (yyval.type_qualifier).flags.q.explicit_location = 1;
4125
4126         if ((yyval.type_qualifier).flags.q.attribute == 1 &&
4127             state->ARB_explicit_attrib_location_warn) {
4128            _mesa_glsl_warning(& (yylsp[-2]), state,
4129                               "GL_ARB_explicit_attrib_location layout "
4130                               "identifier `%s' used", (yyvsp[-2].identifier));
4131         }
4132         (yyval.type_qualifier).location = (yyvsp[0].expression);
4133      }
4134
4135      if (match_layout_qualifier("component", (yyvsp[-2].identifier), state) == 0) {
4136         if (!state->has_enhanced_layouts()) {
4137            _mesa_glsl_error(& (yylsp[-2]), state,
4138                             "component qualifier requires "
4139                             "GLSL 4.40 or ARB_enhanced_layouts");
4140         } else {
4141            (yyval.type_qualifier).flags.q.explicit_component = 1;
4142            (yyval.type_qualifier).component = (yyvsp[0].expression);
4143         }
4144      }
4145
4146      if (match_layout_qualifier("index", (yyvsp[-2].identifier), state) == 0) {
4147         if (state->es_shader && !state->EXT_blend_func_extended_enable) {
4148            _mesa_glsl_error(& (yylsp[0]), state, "index layout qualifier requires EXT_blend_func_extended");
4149            YYERROR;
4150         }
4151
4152         (yyval.type_qualifier).flags.q.explicit_index = 1;
4153         (yyval.type_qualifier).index = (yyvsp[0].expression);
4154      }
4155
4156      if ((state->has_420pack_or_es31() ||
4157           state->has_atomic_counters() ||
4158           state->has_shader_storage_buffer_objects()) &&
4159          match_layout_qualifier("binding", (yyvsp[-2].identifier), state) == 0) {
4160         (yyval.type_qualifier).flags.q.explicit_binding = 1;
4161         (yyval.type_qualifier).binding = (yyvsp[0].expression);
4162      }
4163
4164      if ((state->has_atomic_counters() ||
4165           state->has_enhanced_layouts()) &&
4166          match_layout_qualifier("offset", (yyvsp[-2].identifier), state) == 0) {
4167         (yyval.type_qualifier).flags.q.explicit_offset = 1;
4168         (yyval.type_qualifier).offset = (yyvsp[0].expression);
4169      }
4170
4171      if (match_layout_qualifier("max_vertices", (yyvsp[-2].identifier), state) == 0) {
4172         (yyval.type_qualifier).flags.q.max_vertices = 1;
4173         (yyval.type_qualifier).max_vertices = new(ctx) ast_layout_expression((yylsp[-2]), (yyvsp[0].expression));
4174         if (!state->has_geometry_shader()) {
4175            _mesa_glsl_error(& (yylsp[0]), state,
4176                             "#version 150 max_vertices qualifier "
4177                             "specified", (yyvsp[0].expression));
4178         }
4179      }
4180
4181      if (state->stage == MESA_SHADER_GEOMETRY) {
4182         if (match_layout_qualifier("stream", (yyvsp[-2].identifier), state) == 0 &&
4183             state->check_explicit_attrib_stream_allowed(& (yylsp[0]))) {
4184            (yyval.type_qualifier).flags.q.stream = 1;
4185            (yyval.type_qualifier).flags.q.explicit_stream = 1;
4186            (yyval.type_qualifier).stream = (yyvsp[0].expression);
4187         }
4188      }
4189
4190      if (state->has_enhanced_layouts()) {
4191         if (match_layout_qualifier("xfb_buffer", (yyvsp[-2].identifier), state) == 0) {
4192            (yyval.type_qualifier).flags.q.xfb_buffer = 1;
4193            (yyval.type_qualifier).flags.q.explicit_xfb_buffer = 1;
4194            (yyval.type_qualifier).xfb_buffer = (yyvsp[0].expression);
4195         }
4196
4197         if (match_layout_qualifier("xfb_offset", (yyvsp[-2].identifier), state) == 0) {
4198            (yyval.type_qualifier).flags.q.explicit_xfb_offset = 1;
4199            (yyval.type_qualifier).offset = (yyvsp[0].expression);
4200         }
4201
4202         if (match_layout_qualifier("xfb_stride", (yyvsp[-2].identifier), state) == 0) {
4203            (yyval.type_qualifier).flags.q.xfb_stride = 1;
4204            (yyval.type_qualifier).flags.q.explicit_xfb_stride = 1;
4205            (yyval.type_qualifier).xfb_stride = (yyvsp[0].expression);
4206         }
4207      }
4208
4209      static const char * const local_size_qualifiers[3] = {
4210         "local_size_x",
4211         "local_size_y",
4212         "local_size_z",
4213      };
4214      for (int i = 0; i < 3; i++) {
4215         if (match_layout_qualifier(local_size_qualifiers[i], (yyvsp[-2].identifier),
4216                                    state) == 0) {
4217            if (!state->has_compute_shader()) {
4218               _mesa_glsl_error(& (yylsp[0]), state,
4219                                "%s qualifier requires GLSL 4.30 or "
4220                                "GLSL ES 3.10 or ARB_compute_shader",
4221                                local_size_qualifiers[i]);
4222               YYERROR;
4223            } else {
4224               (yyval.type_qualifier).flags.q.local_size |= (1 << i);
4225               (yyval.type_qualifier).local_size[i] = new(ctx) ast_layout_expression((yylsp[-2]), (yyvsp[0].expression));
4226            }
4227            break;
4228         }
4229      }
4230
4231      if (match_layout_qualifier("invocations", (yyvsp[-2].identifier), state) == 0) {
4232         (yyval.type_qualifier).flags.q.invocations = 1;
4233         (yyval.type_qualifier).invocations = new(ctx) ast_layout_expression((yylsp[-2]), (yyvsp[0].expression));
4234         if (!state->is_version(400, 320) &&
4235             !state->ARB_gpu_shader5_enable &&
4236             !state->OES_geometry_shader_enable &&
4237             !state->EXT_geometry_shader_enable) {
4238            _mesa_glsl_error(& (yylsp[0]), state,
4239                             "GL_ARB_gpu_shader5 invocations "
4240                             "qualifier specified", (yyvsp[0].expression));
4241         }
4242      }
4243
4244      /* Layout qualifiers for tessellation control shaders. */
4245      if (match_layout_qualifier("vertices", (yyvsp[-2].identifier), state) == 0) {
4246         (yyval.type_qualifier).flags.q.vertices = 1;
4247         (yyval.type_qualifier).vertices = new(ctx) ast_layout_expression((yylsp[-2]), (yyvsp[0].expression));
4248         if (!state->has_tessellation_shader()) {
4249            _mesa_glsl_error(& (yylsp[-2]), state,
4250                             "vertices qualifier requires GLSL 4.00 or "
4251                             "ARB_tessellation_shader");
4252         }
4253      }
4254
4255      /* If the identifier didn't match any known layout identifiers,
4256       * emit an error.
4257       */
4258      if (!(yyval.type_qualifier).flags.i) {
4259         _mesa_glsl_error(& (yylsp[-2]), state, "unrecognized layout identifier "
4260                          "`%s'", (yyvsp[-2].identifier));
4261         YYERROR;
4262      }
4263   }
4264#line 4265 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4265    break;
4266
4267  case 152:
4268#line 1861 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4269    {
4270      (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
4271      /* Layout qualifiers for ARB_uniform_buffer_object. */
4272      if ((yyval.type_qualifier).flags.q.uniform && !state->has_uniform_buffer_objects()) {
4273         _mesa_glsl_error(& (yylsp[0]), state,
4274                          "#version 140 / GL_ARB_uniform_buffer_object "
4275                          "layout qualifier `%s' is used", (yyvsp[0].type_qualifier));
4276      } else if ((yyval.type_qualifier).flags.q.uniform && state->ARB_uniform_buffer_object_warn) {
4277         _mesa_glsl_warning(& (yylsp[0]), state,
4278                            "#version 140 / GL_ARB_uniform_buffer_object "
4279                            "layout qualifier `%s' is used", (yyvsp[0].type_qualifier));
4280      }
4281   }
4282#line 4283 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4283    break;
4284
4285  case 153:
4286#line 1887 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4287    {
4288      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4289      (yyval.type_qualifier).flags.q.row_major = 1;
4290   }
4291#line 4292 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4292    break;
4293
4294  case 154:
4295#line 1892 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4296    {
4297      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4298      (yyval.type_qualifier).flags.q.packed = 1;
4299   }
4300#line 4301 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4301    break;
4302
4303  case 155:
4304#line 1897 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4305    {
4306      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4307      (yyval.type_qualifier).flags.q.shared = 1;
4308   }
4309#line 4310 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4310    break;
4311
4312  case 156:
4313#line 1905 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4314    {
4315      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4316      (yyval.type_qualifier).flags.q.subroutine = 1;
4317   }
4318#line 4319 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4319    break;
4320
4321  case 157:
4322#line 1910 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4323    {
4324      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4325      (yyval.type_qualifier).flags.q.subroutine = 1;
4326      (yyval.type_qualifier).subroutine_list = (yyvsp[-1].subroutine_list);
4327   }
4328#line 4329 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4329    break;
4330
4331  case 158:
4332#line 1919 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4333    {
4334        void *ctx = state->linalloc;
4335        ast_declaration *decl = new(ctx)  ast_declaration((yyvsp[0].identifier), NULL, NULL);
4336        decl->set_location((yylsp[0]));
4337
4338        (yyval.subroutine_list) = new(ctx) ast_subroutine_list();
4339        (yyval.subroutine_list)->declarations.push_tail(&decl->link);
4340   }
4341#line 4342 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4342    break;
4343
4344  case 159:
4345#line 1928 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4346    {
4347        void *ctx = state->linalloc;
4348        ast_declaration *decl = new(ctx)  ast_declaration((yyvsp[0].identifier), NULL, NULL);
4349        decl->set_location((yylsp[0]));
4350
4351        (yyval.subroutine_list) = (yyvsp[-2].subroutine_list);
4352        (yyval.subroutine_list)->declarations.push_tail(&decl->link);
4353   }
4354#line 4355 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4355    break;
4356
4357  case 160:
4358#line 1940 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4359    {
4360      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4361      (yyval.type_qualifier).flags.q.smooth = 1;
4362   }
4363#line 4364 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4364    break;
4365
4366  case 161:
4367#line 1945 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4368    {
4369      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4370      (yyval.type_qualifier).flags.q.flat = 1;
4371   }
4372#line 4373 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4373    break;
4374
4375  case 162:
4376#line 1950 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4377    {
4378      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4379      (yyval.type_qualifier).flags.q.noperspective = 1;
4380   }
4381#line 4382 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4382    break;
4383
4384  case 163:
4385#line 1959 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4386    {
4387      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4388      (yyval.type_qualifier).flags.q.invariant = 1;
4389   }
4390#line 4391 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4391    break;
4392
4393  case 164:
4394#line 1964 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4395    {
4396      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4397      (yyval.type_qualifier).flags.q.precise = 1;
4398   }
4399#line 4400 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4400    break;
4401
4402  case 171:
4403#line 1975 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4404    {
4405      memset(&(yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4406      (yyval.type_qualifier).precision = (yyvsp[0].n);
4407   }
4408#line 4409 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4409    break;
4410
4411  case 172:
4412#line 1993 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4413    {
4414      if ((yyvsp[0].type_qualifier).flags.q.precise)
4415         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate \"precise\" qualifier");
4416
4417      (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
4418      (yyval.type_qualifier).flags.q.precise = 1;
4419   }
4420#line 4421 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4421    break;
4422
4423  case 173:
4424#line 2001 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4425    {
4426      if ((yyvsp[0].type_qualifier).flags.q.invariant)
4427         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate \"invariant\" qualifier");
4428
4429      if (!state->has_420pack_or_es31() && (yyvsp[0].type_qualifier).flags.q.precise)
4430         _mesa_glsl_error(&(yylsp[-1]), state,
4431                          "\"invariant\" must come after \"precise\"");
4432
4433      (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
4434      (yyval.type_qualifier).flags.q.invariant = 1;
4435
4436      /* GLSL ES 3.00 spec, section 4.6.1 "The Invariant Qualifier":
4437       *
4438       * "Only variables output from a shader can be candidates for invariance.
4439       * This includes user-defined output variables and the built-in output
4440       * variables. As only outputs can be declared as invariant, an invariant
4441       * output from one shader stage will still match an input of a subsequent
4442       * stage without the input being declared as invariant."
4443       *
4444       * On the desktop side, this text first appears in GLSL 4.30.
4445       */
4446      if (state->is_version(430, 300) && (yyval.type_qualifier).flags.q.in)
4447         _mesa_glsl_error(&(yylsp[-1]), state, "invariant qualifiers cannot be used with shader inputs");
4448   }
4449#line 4450 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4450    break;
4451
4452  case 174:
4453#line 2026 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4454    {
4455      /* Section 4.3 of the GLSL 1.40 specification states:
4456       * "...qualified with one of these interpolation qualifiers"
4457       *
4458       * GLSL 1.30 claims to allow "one or more", but insists that:
4459       * "These interpolation qualifiers may only precede the qualifiers in,
4460       *  centroid in, out, or centroid out in a declaration."
4461       *
4462       * ...which means that e.g. smooth can't precede smooth, so there can be
4463       * only one after all, and the 1.40 text is a clarification, not a change.
4464       */
4465      if ((yyvsp[0].type_qualifier).has_interpolation())
4466         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate interpolation qualifier");
4467
4468      if (!state->has_420pack_or_es31() &&
4469          ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant)) {
4470         _mesa_glsl_error(&(yylsp[-1]), state, "interpolation qualifiers must come "
4471                          "after \"precise\" or \"invariant\"");
4472      }
4473
4474      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
4475      (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier), false);
4476   }
4477#line 4478 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4478    break;
4479
4480  case 175:
4481#line 2050 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4482    {
4483      /* In the absence of ARB_shading_language_420pack, layout qualifiers may
4484       * appear no later than auxiliary storage qualifiers. There is no
4485       * particularly clear spec language mandating this, but in all examples
4486       * the layout qualifier precedes the storage qualifier.
4487       *
4488       * We allow combinations of layout with interpolation, invariant or
4489       * precise qualifiers since these are useful in ARB_separate_shader_objects.
4490       * There is no clear spec guidance on this either.
4491       */
4492      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
4493      (yyval.type_qualifier).merge_qualifier(& (yylsp[-1]), state, (yyvsp[0].type_qualifier), false, (yyvsp[0].type_qualifier).has_layout());
4494   }
4495#line 4496 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4496    break;
4497
4498  case 176:
4499#line 2064 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4500    {
4501      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
4502      (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier), false);
4503   }
4504#line 4505 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4505    break;
4506
4507  case 177:
4508#line 2069 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4509    {
4510      if ((yyvsp[0].type_qualifier).has_auxiliary_storage()) {
4511         _mesa_glsl_error(&(yylsp[-1]), state,
4512                          "duplicate auxiliary storage qualifier (centroid or sample)");
4513      }
4514
4515      if ((!state->has_420pack_or_es31() && !state->EXT_gpu_shader4_enable) &&
4516          ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant ||
4517           (yyvsp[0].type_qualifier).has_interpolation() || (yyvsp[0].type_qualifier).has_layout())) {
4518         _mesa_glsl_error(&(yylsp[-1]), state, "auxiliary storage qualifiers must come "
4519                          "just before storage qualifiers");
4520      }
4521      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
4522      (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier), false);
4523   }
4524#line 4525 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4525    break;
4526
4527  case 178:
4528#line 2085 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4529    {
4530      /* Section 4.3 of the GLSL 1.20 specification states:
4531       * "Variable declarations may have a storage qualifier specified..."
4532       *  1.30 clarifies this to "may have one storage qualifier".
4533       *
4534       * GL_EXT_gpu_shader4 allows "varying out" in fragment shaders.
4535       */
4536      if ((yyvsp[0].type_qualifier).has_storage() &&
4537          (!state->EXT_gpu_shader4_enable ||
4538           state->stage != MESA_SHADER_FRAGMENT ||
4539           !(yyvsp[-1].type_qualifier).flags.q.varying || !(yyvsp[0].type_qualifier).flags.q.out))
4540         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate storage qualifier");
4541
4542      if (!state->has_420pack_or_es31() &&
4543          ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant || (yyvsp[0].type_qualifier).has_interpolation() ||
4544           (yyvsp[0].type_qualifier).has_layout() || (yyvsp[0].type_qualifier).has_auxiliary_storage())) {
4545         _mesa_glsl_error(&(yylsp[-1]), state, "storage qualifiers must come after "
4546                          "precise, invariant, interpolation, layout and auxiliary "
4547                          "storage qualifiers");
4548      }
4549
4550      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
4551      (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier), false);
4552   }
4553#line 4554 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4554    break;
4555
4556  case 179:
4557#line 2110 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4558    {
4559      if ((yyvsp[0].type_qualifier).precision != ast_precision_none)
4560         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate precision qualifier");
4561
4562      if (!(state->has_420pack_or_es31()) &&
4563          (yyvsp[0].type_qualifier).flags.i != 0)
4564         _mesa_glsl_error(&(yylsp[-1]), state, "precision qualifiers must come last");
4565
4566      (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
4567      (yyval.type_qualifier).precision = (yyvsp[-1].n);
4568   }
4569#line 4570 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4570    break;
4571
4572  case 180:
4573#line 2122 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4574    {
4575      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
4576      (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier), false);
4577   }
4578#line 4579 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4579    break;
4580
4581  case 181:
4582#line 2130 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4583    {
4584      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4585      (yyval.type_qualifier).flags.q.centroid = 1;
4586   }
4587#line 4588 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4588    break;
4589
4590  case 182:
4591#line 2135 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4592    {
4593      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4594      (yyval.type_qualifier).flags.q.sample = 1;
4595   }
4596#line 4597 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4597    break;
4598
4599  case 183:
4600#line 2140 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4601    {
4602      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4603      (yyval.type_qualifier).flags.q.patch = 1;
4604   }
4605#line 4606 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4606    break;
4607
4608  case 184:
4609#line 2147 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4610    {
4611      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4612      (yyval.type_qualifier).flags.q.constant = 1;
4613   }
4614#line 4615 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4615    break;
4616
4617  case 185:
4618#line 2152 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4619    {
4620      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4621      (yyval.type_qualifier).flags.q.attribute = 1;
4622   }
4623#line 4624 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4624    break;
4625
4626  case 186:
4627#line 2157 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4628    {
4629      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4630      (yyval.type_qualifier).flags.q.varying = 1;
4631   }
4632#line 4633 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4633    break;
4634
4635  case 187:
4636#line 2162 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4637    {
4638      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4639      (yyval.type_qualifier).flags.q.in = 1;
4640   }
4641#line 4642 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4642    break;
4643
4644  case 188:
4645#line 2167 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4646    {
4647      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4648      (yyval.type_qualifier).flags.q.out = 1;
4649
4650      if (state->stage == MESA_SHADER_GEOMETRY &&
4651          state->has_explicit_attrib_stream()) {
4652         /* Section 4.3.8.2 (Output Layout Qualifiers) of the GLSL 4.00
4653          * spec says:
4654          *
4655          *     "If the block or variable is declared with the stream
4656          *     identifier, it is associated with the specified stream;
4657          *     otherwise, it is associated with the current default stream."
4658          */
4659          (yyval.type_qualifier).flags.q.stream = 1;
4660          (yyval.type_qualifier).flags.q.explicit_stream = 0;
4661          (yyval.type_qualifier).stream = state->out_qualifier->stream;
4662      }
4663
4664      if (state->has_enhanced_layouts()) {
4665          (yyval.type_qualifier).flags.q.xfb_buffer = 1;
4666          (yyval.type_qualifier).flags.q.explicit_xfb_buffer = 0;
4667          (yyval.type_qualifier).xfb_buffer = state->out_qualifier->xfb_buffer;
4668      }
4669   }
4670#line 4671 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4671    break;
4672
4673  case 189:
4674#line 2192 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4675    {
4676      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4677      (yyval.type_qualifier).flags.q.in = 1;
4678      (yyval.type_qualifier).flags.q.out = 1;
4679
4680      if (!state->has_framebuffer_fetch() ||
4681          !state->is_version(130, 300) ||
4682          state->stage != MESA_SHADER_FRAGMENT)
4683         _mesa_glsl_error(&(yylsp[0]), state, "A single interface variable cannot be "
4684                          "declared as both input and output");
4685   }
4686#line 4687 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4687    break;
4688
4689  case 190:
4690#line 2204 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4691    {
4692      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4693      (yyval.type_qualifier).flags.q.uniform = 1;
4694   }
4695#line 4696 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4696    break;
4697
4698  case 191:
4699#line 2209 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4700    {
4701      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4702      (yyval.type_qualifier).flags.q.buffer = 1;
4703   }
4704#line 4705 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4705    break;
4706
4707  case 192:
4708#line 2214 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4709    {
4710      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4711      (yyval.type_qualifier).flags.q.shared_storage = 1;
4712   }
4713#line 4714 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4714    break;
4715
4716  case 193:
4717#line 2222 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4718    {
4719      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4720      (yyval.type_qualifier).flags.q.coherent = 1;
4721   }
4722#line 4723 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4723    break;
4724
4725  case 194:
4726#line 2227 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4727    {
4728      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4729      (yyval.type_qualifier).flags.q._volatile = 1;
4730   }
4731#line 4732 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4732    break;
4733
4734  case 195:
4735#line 2232 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4736    {
4737      STATIC_ASSERT(sizeof((yyval.type_qualifier).flags.q) <= sizeof((yyval.type_qualifier).flags.i));
4738      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4739      (yyval.type_qualifier).flags.q.restrict_flag = 1;
4740   }
4741#line 4742 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4742    break;
4743
4744  case 196:
4745#line 2238 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4746    {
4747      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4748      (yyval.type_qualifier).flags.q.read_only = 1;
4749   }
4750#line 4751 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4751    break;
4752
4753  case 197:
4754#line 2243 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4755    {
4756      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
4757      (yyval.type_qualifier).flags.q.write_only = 1;
4758   }
4759#line 4760 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4760    break;
4761
4762  case 198:
4763#line 2251 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4764    {
4765      void *ctx = state->linalloc;
4766      (yyval.array_specifier) = new(ctx) ast_array_specifier((yylsp[-1]), new(ctx) ast_expression(
4767                                                  ast_unsized_array_dim, NULL,
4768                                                  NULL, NULL));
4769      (yyval.array_specifier)->set_location_range((yylsp[-1]), (yylsp[0]));
4770   }
4771#line 4772 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4772    break;
4773
4774  case 199:
4775#line 2259 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4776    {
4777      void *ctx = state->linalloc;
4778      (yyval.array_specifier) = new(ctx) ast_array_specifier((yylsp[-2]), (yyvsp[-1].expression));
4779      (yyval.array_specifier)->set_location_range((yylsp[-2]), (yylsp[0]));
4780   }
4781#line 4782 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4782    break;
4783
4784  case 200:
4785#line 2265 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4786    {
4787      void *ctx = state->linalloc;
4788      (yyval.array_specifier) = (yyvsp[-2].array_specifier);
4789
4790      if (state->check_arrays_of_arrays_allowed(& (yylsp[-2]))) {
4791         (yyval.array_specifier)->add_dimension(new(ctx) ast_expression(ast_unsized_array_dim, NULL,
4792                                                   NULL, NULL));
4793      }
4794   }
4795#line 4796 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4796    break;
4797
4798  case 201:
4799#line 2275 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4800    {
4801      (yyval.array_specifier) = (yyvsp[-3].array_specifier);
4802
4803      if (state->check_arrays_of_arrays_allowed(& (yylsp[-3]))) {
4804         (yyval.array_specifier)->add_dimension((yyvsp[-1].expression));
4805      }
4806   }
4807#line 4808 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4808    break;
4809
4810  case 203:
4811#line 2287 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4812    {
4813      (yyval.type_specifier) = (yyvsp[-1].type_specifier);
4814      (yyval.type_specifier)->array_specifier = (yyvsp[0].array_specifier);
4815   }
4816#line 4817 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4817    break;
4818
4819  case 204:
4820#line 2295 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4821    {
4822      void *ctx = state->linalloc;
4823      (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].type));
4824      (yyval.type_specifier)->set_location((yylsp[0]));
4825   }
4826#line 4827 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4827    break;
4828
4829  case 205:
4830#line 2301 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4831    {
4832      void *ctx = state->linalloc;
4833      (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].struct_specifier));
4834      (yyval.type_specifier)->set_location((yylsp[0]));
4835   }
4836#line 4837 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4837    break;
4838
4839  case 206:
4840#line 2307 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4841    {
4842      void *ctx = state->linalloc;
4843      (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier));
4844      (yyval.type_specifier)->set_location((yylsp[0]));
4845   }
4846#line 4847 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4847    break;
4848
4849  case 207:
4850#line 2315 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4851    { (yyval.type) = glsl_type::void_type; }
4852#line 4853 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4853    break;
4854
4855  case 208:
4856#line 2316 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4857    { (yyval.type) = (yyvsp[0].type); }
4858#line 4859 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4859    break;
4860
4861  case 209:
4862#line 2318 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4863    {
4864      if ((yyvsp[0].type) == glsl_type::int_type) {
4865         (yyval.type) = glsl_type::uint_type;
4866      } else {
4867         _mesa_glsl_error(&(yylsp[-1]), state,
4868                          "\"unsigned\" is only allowed before \"int\"");
4869      }
4870   }
4871#line 4872 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4872    break;
4873
4874  case 210:
4875#line 2330 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4876    {
4877      state->check_precision_qualifiers_allowed(&(yylsp[0]));
4878      (yyval.n) = ast_precision_high;
4879   }
4880#line 4881 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4881    break;
4882
4883  case 211:
4884#line 2335 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4885    {
4886      state->check_precision_qualifiers_allowed(&(yylsp[0]));
4887      (yyval.n) = ast_precision_medium;
4888   }
4889#line 4890 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4890    break;
4891
4892  case 212:
4893#line 2340 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4894    {
4895      state->check_precision_qualifiers_allowed(&(yylsp[0]));
4896      (yyval.n) = ast_precision_low;
4897   }
4898#line 4899 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4899    break;
4900
4901  case 213:
4902#line 2348 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4903    {
4904      void *ctx = state->linalloc;
4905      (yyval.struct_specifier) = new(ctx) ast_struct_specifier((yyvsp[-3].identifier), (yyvsp[-1].declarator_list));
4906      (yyval.struct_specifier)->set_location_range((yylsp[-3]), (yylsp[0]));
4907      state->symbols->add_type((yyvsp[-3].identifier), glsl_type::void_type);
4908   }
4909#line 4910 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4910    break;
4911
4912  case 214:
4913#line 2355 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4914    {
4915      void *ctx = state->linalloc;
4916
4917      /* All anonymous structs have the same name. This simplifies matching of
4918       * globals whose type is an unnamed struct.
4919       *
4920       * It also avoids a memory leak when the same shader is compiled over and
4921       * over again.
4922       */
4923      (yyval.struct_specifier) = new(ctx) ast_struct_specifier("#anon_struct", (yyvsp[-1].declarator_list));
4924
4925      (yyval.struct_specifier)->set_location_range((yylsp[-2]), (yylsp[0]));
4926   }
4927#line 4928 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4928    break;
4929
4930  case 215:
4931#line 2372 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4932    {
4933      (yyval.declarator_list) = (yyvsp[0].declarator_list);
4934      (yyvsp[0].declarator_list)->link.self_link();
4935   }
4936#line 4937 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4937    break;
4938
4939  case 216:
4940#line 2377 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4941    {
4942      (yyval.declarator_list) = (yyvsp[-1].declarator_list);
4943      (yyval.declarator_list)->link.insert_before(& (yyvsp[0].declarator_list)->link);
4944   }
4945#line 4946 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4946    break;
4947
4948  case 217:
4949#line 2385 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4950    {
4951      void *ctx = state->linalloc;
4952      ast_fully_specified_type *const type = (yyvsp[-2].fully_specified_type);
4953      type->set_location((yylsp[-2]));
4954
4955      if (state->has_bindless()) {
4956         ast_type_qualifier input_layout_mask;
4957
4958         /* Allow to declare qualifiers for images. */
4959         input_layout_mask.flags.i = 0;
4960         input_layout_mask.flags.q.coherent = 1;
4961         input_layout_mask.flags.q._volatile = 1;
4962         input_layout_mask.flags.q.restrict_flag = 1;
4963         input_layout_mask.flags.q.read_only = 1;
4964         input_layout_mask.flags.q.write_only = 1;
4965         input_layout_mask.flags.q.explicit_image_format = 1;
4966
4967         if ((type->qualifier.flags.i & ~input_layout_mask.flags.i) != 0) {
4968            _mesa_glsl_error(&(yylsp[-2]), state,
4969                             "only precision and image qualifiers may be "
4970                             "applied to structure members");
4971         }
4972      } else {
4973         if (type->qualifier.flags.i != 0)
4974            _mesa_glsl_error(&(yylsp[-2]), state,
4975                             "only precision qualifiers may be applied to "
4976                             "structure members");
4977      }
4978
4979      (yyval.declarator_list) = new(ctx) ast_declarator_list(type);
4980      (yyval.declarator_list)->set_location((yylsp[-1]));
4981
4982      (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[-1].declaration)->link);
4983   }
4984#line 4985 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4985    break;
4986
4987  case 218:
4988#line 2423 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4989    {
4990      (yyval.declaration) = (yyvsp[0].declaration);
4991      (yyvsp[0].declaration)->link.self_link();
4992   }
4993#line 4994 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
4994    break;
4995
4996  case 219:
4997#line 2428 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
4998    {
4999      (yyval.declaration) = (yyvsp[-2].declaration);
5000      (yyval.declaration)->link.insert_before(& (yyvsp[0].declaration)->link);
5001   }
5002#line 5003 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5003    break;
5004
5005  case 220:
5006#line 2436 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5007    {
5008      void *ctx = state->linalloc;
5009      (yyval.declaration) = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
5010      (yyval.declaration)->set_location((yylsp[0]));
5011   }
5012#line 5013 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5013    break;
5014
5015  case 221:
5016#line 2442 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5017    {
5018      void *ctx = state->linalloc;
5019      (yyval.declaration) = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
5020      (yyval.declaration)->set_location_range((yylsp[-1]), (yylsp[0]));
5021   }
5022#line 5023 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5023    break;
5024
5025  case 223:
5026#line 2452 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5027    {
5028      (yyval.expression) = (yyvsp[-1].expression);
5029   }
5030#line 5031 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5031    break;
5032
5033  case 224:
5034#line 2456 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5035    {
5036      (yyval.expression) = (yyvsp[-2].expression);
5037   }
5038#line 5039 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5039    break;
5040
5041  case 225:
5042#line 2463 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5043    {
5044      void *ctx = state->linalloc;
5045      (yyval.expression) = new(ctx) ast_aggregate_initializer();
5046      (yyval.expression)->set_location((yylsp[0]));
5047      (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
5048   }
5049#line 5050 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5050    break;
5051
5052  case 226:
5053#line 2470 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5054    {
5055      (yyvsp[-2].expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
5056   }
5057#line 5058 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5058    break;
5059
5060  case 228:
5061#line 2482 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5062    { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); }
5063#line 5064 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5064    break;
5065
5066  case 236:
5067#line 2497 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5068    {
5069      void *ctx = state->linalloc;
5070      (yyval.compound_statement) = new(ctx) ast_compound_statement(true, NULL);
5071      (yyval.compound_statement)->set_location_range((yylsp[-1]), (yylsp[0]));
5072   }
5073#line 5074 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5074    break;
5075
5076  case 237:
5077#line 2503 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5078    {
5079      state->symbols->push_scope();
5080   }
5081#line 5082 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5082    break;
5083
5084  case 238:
5085#line 2507 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5086    {
5087      void *ctx = state->linalloc;
5088      (yyval.compound_statement) = new(ctx) ast_compound_statement(true, (yyvsp[-1].node));
5089      (yyval.compound_statement)->set_location_range((yylsp[-3]), (yylsp[0]));
5090      state->symbols->pop_scope();
5091   }
5092#line 5093 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5093    break;
5094
5095  case 239:
5096#line 2516 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5097    { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); }
5098#line 5099 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5099    break;
5100
5101  case 241:
5102#line 2522 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5103    {
5104      void *ctx = state->linalloc;
5105      (yyval.compound_statement) = new(ctx) ast_compound_statement(false, NULL);
5106      (yyval.compound_statement)->set_location_range((yylsp[-1]), (yylsp[0]));
5107   }
5108#line 5109 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5109    break;
5110
5111  case 242:
5112#line 2528 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5113    {
5114      void *ctx = state->linalloc;
5115      (yyval.compound_statement) = new(ctx) ast_compound_statement(false, (yyvsp[-1].node));
5116      (yyval.compound_statement)->set_location_range((yylsp[-2]), (yylsp[0]));
5117   }
5118#line 5119 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5119    break;
5120
5121  case 243:
5122#line 2537 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5123    {
5124      if ((yyvsp[0].node) == NULL) {
5125         _mesa_glsl_error(& (yylsp[0]), state, "<nil> statement");
5126         assert((yyvsp[0].node) != NULL);
5127      }
5128
5129      (yyval.node) = (yyvsp[0].node);
5130      (yyval.node)->link.self_link();
5131   }
5132#line 5133 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5133    break;
5134
5135  case 244:
5136#line 2547 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5137    {
5138      if ((yyvsp[0].node) == NULL) {
5139         _mesa_glsl_error(& (yylsp[0]), state, "<nil> statement");
5140         assert((yyvsp[0].node) != NULL);
5141      }
5142      (yyval.node) = (yyvsp[-1].node);
5143      (yyval.node)->link.insert_before(& (yyvsp[0].node)->link);
5144   }
5145#line 5146 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5146    break;
5147
5148  case 245:
5149#line 2556 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5150    {
5151      if (!state->allow_extension_directive_midshader) {
5152         _mesa_glsl_error(& (yylsp[-1]), state,
5153                          "#extension directive is not allowed "
5154                          "in the middle of a shader");
5155         YYERROR;
5156      }
5157   }
5158#line 5159 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5159    break;
5160
5161  case 246:
5162#line 2568 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5163    {
5164      void *ctx = state->linalloc;
5165      (yyval.node) = new(ctx) ast_expression_statement(NULL);
5166      (yyval.node)->set_location((yylsp[0]));
5167   }
5168#line 5169 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5169    break;
5170
5171  case 247:
5172#line 2574 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5173    {
5174      void *ctx = state->linalloc;
5175      (yyval.node) = new(ctx) ast_expression_statement((yyvsp[-1].expression));
5176      (yyval.node)->set_location((yylsp[-1]));
5177   }
5178#line 5179 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5179    break;
5180
5181  case 248:
5182#line 2583 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5183    {
5184      (yyval.node) = new(state->linalloc) ast_selection_statement((yyvsp[-2].expression), (yyvsp[0].selection_rest_statement).then_statement,
5185                                                        (yyvsp[0].selection_rest_statement).else_statement);
5186      (yyval.node)->set_location_range((yylsp[-4]), (yylsp[0]));
5187   }
5188#line 5189 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5189    break;
5190
5191  case 249:
5192#line 2592 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5193    {
5194      (yyval.selection_rest_statement).then_statement = (yyvsp[-2].node);
5195      (yyval.selection_rest_statement).else_statement = (yyvsp[0].node);
5196   }
5197#line 5198 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5198    break;
5199
5200  case 250:
5201#line 2597 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5202    {
5203      (yyval.selection_rest_statement).then_statement = (yyvsp[0].node);
5204      (yyval.selection_rest_statement).else_statement = NULL;
5205   }
5206#line 5207 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5207    break;
5208
5209  case 251:
5210#line 2605 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5211    {
5212      (yyval.node) = (ast_node *) (yyvsp[0].expression);
5213   }
5214#line 5215 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5215    break;
5216
5217  case 252:
5218#line 2609 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5219    {
5220      void *ctx = state->linalloc;
5221      ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
5222      ast_declarator_list *declarator = new(ctx) ast_declarator_list((yyvsp[-3].fully_specified_type));
5223      decl->set_location_range((yylsp[-2]), (yylsp[0]));
5224      declarator->set_location((yylsp[-3]));
5225
5226      declarator->declarations.push_tail(&decl->link);
5227      (yyval.node) = declarator;
5228   }
5229#line 5230 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5230    break;
5231
5232  case 253:
5233#line 2627 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5234    {
5235      (yyval.node) = new(state->linalloc) ast_switch_statement((yyvsp[-2].expression), (yyvsp[0].switch_body));
5236      (yyval.node)->set_location_range((yylsp[-4]), (yylsp[0]));
5237   }
5238#line 5239 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5239    break;
5240
5241  case 254:
5242#line 2635 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5243    {
5244      (yyval.switch_body) = new(state->linalloc) ast_switch_body(NULL);
5245      (yyval.switch_body)->set_location_range((yylsp[-1]), (yylsp[0]));
5246   }
5247#line 5248 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5248    break;
5249
5250  case 255:
5251#line 2640 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5252    {
5253      (yyval.switch_body) = new(state->linalloc) ast_switch_body((yyvsp[-1].case_statement_list));
5254      (yyval.switch_body)->set_location_range((yylsp[-2]), (yylsp[0]));
5255   }
5256#line 5257 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5257    break;
5258
5259  case 256:
5260#line 2648 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5261    {
5262      (yyval.case_label) = new(state->linalloc) ast_case_label((yyvsp[-1].expression));
5263      (yyval.case_label)->set_location((yylsp[-1]));
5264   }
5265#line 5266 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5266    break;
5267
5268  case 257:
5269#line 2653 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5270    {
5271      (yyval.case_label) = new(state->linalloc) ast_case_label(NULL);
5272      (yyval.case_label)->set_location((yylsp[0]));
5273   }
5274#line 5275 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5275    break;
5276
5277  case 258:
5278#line 2661 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5279    {
5280      ast_case_label_list *labels = new(state->linalloc) ast_case_label_list();
5281
5282      labels->labels.push_tail(& (yyvsp[0].case_label)->link);
5283      (yyval.case_label_list) = labels;
5284      (yyval.case_label_list)->set_location((yylsp[0]));
5285   }
5286#line 5287 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5287    break;
5288
5289  case 259:
5290#line 2669 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5291    {
5292      (yyval.case_label_list) = (yyvsp[-1].case_label_list);
5293      (yyval.case_label_list)->labels.push_tail(& (yyvsp[0].case_label)->link);
5294   }
5295#line 5296 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5296    break;
5297
5298  case 260:
5299#line 2677 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5300    {
5301      ast_case_statement *stmts = new(state->linalloc) ast_case_statement((yyvsp[-1].case_label_list));
5302      stmts->set_location((yylsp[0]));
5303
5304      stmts->stmts.push_tail(& (yyvsp[0].node)->link);
5305      (yyval.case_statement) = stmts;
5306   }
5307#line 5308 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5308    break;
5309
5310  case 261:
5311#line 2685 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5312    {
5313      (yyval.case_statement) = (yyvsp[-1].case_statement);
5314      (yyval.case_statement)->stmts.push_tail(& (yyvsp[0].node)->link);
5315   }
5316#line 5317 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5317    break;
5318
5319  case 262:
5320#line 2693 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5321    {
5322      ast_case_statement_list *cases= new(state->linalloc) ast_case_statement_list();
5323      cases->set_location((yylsp[0]));
5324
5325      cases->cases.push_tail(& (yyvsp[0].case_statement)->link);
5326      (yyval.case_statement_list) = cases;
5327   }
5328#line 5329 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5329    break;
5330
5331  case 263:
5332#line 2701 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5333    {
5334      (yyval.case_statement_list) = (yyvsp[-1].case_statement_list);
5335      (yyval.case_statement_list)->cases.push_tail(& (yyvsp[0].case_statement)->link);
5336   }
5337#line 5338 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5338    break;
5339
5340  case 264:
5341#line 2709 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5342    {
5343      void *ctx = state->linalloc;
5344      (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while,
5345                                            NULL, (yyvsp[-2].node), NULL, (yyvsp[0].node));
5346      (yyval.node)->set_location_range((yylsp[-4]), (yylsp[-1]));
5347   }
5348#line 5349 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5349    break;
5350
5351  case 265:
5352#line 2716 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5353    {
5354      void *ctx = state->linalloc;
5355      (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while,
5356                                            NULL, (yyvsp[-2].expression), NULL, (yyvsp[-5].node));
5357      (yyval.node)->set_location_range((yylsp[-6]), (yylsp[-1]));
5358   }
5359#line 5360 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5360    break;
5361
5362  case 266:
5363#line 2723 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5364    {
5365      void *ctx = state->linalloc;
5366      (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for,
5367                                            (yyvsp[-3].node), (yyvsp[-2].for_rest_statement).cond, (yyvsp[-2].for_rest_statement).rest, (yyvsp[0].node));
5368      (yyval.node)->set_location_range((yylsp[-5]), (yylsp[0]));
5369   }
5370#line 5371 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5371    break;
5372
5373  case 270:
5374#line 2739 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5375    {
5376      (yyval.node) = NULL;
5377   }
5378#line 5379 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5379    break;
5380
5381  case 271:
5382#line 2746 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5383    {
5384      (yyval.for_rest_statement).cond = (yyvsp[-1].node);
5385      (yyval.for_rest_statement).rest = NULL;
5386   }
5387#line 5388 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5388    break;
5389
5390  case 272:
5391#line 2751 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5392    {
5393      (yyval.for_rest_statement).cond = (yyvsp[-2].node);
5394      (yyval.for_rest_statement).rest = (yyvsp[0].expression);
5395   }
5396#line 5397 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5397    break;
5398
5399  case 273:
5400#line 2760 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5401    {
5402      void *ctx = state->linalloc;
5403      (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL);
5404      (yyval.node)->set_location((yylsp[-1]));
5405   }
5406#line 5407 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5407    break;
5408
5409  case 274:
5410#line 2766 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5411    {
5412      void *ctx = state->linalloc;
5413      (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL);
5414      (yyval.node)->set_location((yylsp[-1]));
5415   }
5416#line 5417 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5417    break;
5418
5419  case 275:
5420#line 2772 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5421    {
5422      void *ctx = state->linalloc;
5423      (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL);
5424      (yyval.node)->set_location((yylsp[-1]));
5425   }
5426#line 5427 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5427    break;
5428
5429  case 276:
5430#line 2778 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5431    {
5432      void *ctx = state->linalloc;
5433      (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, (yyvsp[-1].expression));
5434      (yyval.node)->set_location_range((yylsp[-2]), (yylsp[-1]));
5435   }
5436#line 5437 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5437    break;
5438
5439  case 277:
5440#line 2784 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5441    {
5442      void *ctx = state->linalloc;
5443      (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL);
5444      (yyval.node)->set_location((yylsp[-1]));
5445   }
5446#line 5447 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5447    break;
5448
5449  case 278:
5450#line 2792 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5451    { (yyval.node) = (yyvsp[0].function_definition); }
5452#line 5453 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5453    break;
5454
5455  case 279:
5456#line 2793 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5457    { (yyval.node) = (yyvsp[0].node); }
5458#line 5459 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5459    break;
5460
5461  case 280:
5462#line 2794 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5463    { (yyval.node) = (yyvsp[0].node); }
5464#line 5465 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5465    break;
5466
5467  case 281:
5468#line 2795 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5469    { (yyval.node) = (yyvsp[0].node); }
5470#line 5471 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5471    break;
5472
5473  case 282:
5474#line 2796 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5475    { (yyval.node) = NULL; }
5476#line 5477 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5477    break;
5478
5479  case 283:
5480#line 2801 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5481    {
5482      void *ctx = state->linalloc;
5483      (yyval.function_definition) = new(ctx) ast_function_definition();
5484      (yyval.function_definition)->set_location_range((yylsp[-1]), (yylsp[0]));
5485      (yyval.function_definition)->prototype = (yyvsp[-1].function);
5486      (yyval.function_definition)->body = (yyvsp[0].compound_statement);
5487
5488      state->symbols->pop_scope();
5489   }
5490#line 5491 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5491    break;
5492
5493  case 284:
5494#line 2815 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5495    {
5496      (yyval.node) = (yyvsp[0].interface_block);
5497   }
5498#line 5499 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5499    break;
5500
5501  case 285:
5502#line 2819 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5503    {
5504      ast_interface_block *block = (ast_interface_block *) (yyvsp[0].node);
5505
5506      if (!(yyvsp[-1].type_qualifier).merge_qualifier(& (yylsp[-1]), state, block->layout, false,
5507                              block->layout.has_layout())) {
5508         YYERROR;
5509      }
5510
5511      block->layout = (yyvsp[-1].type_qualifier);
5512
5513      (yyval.node) = block;
5514   }
5515#line 5516 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5516    break;
5517
5518  case 286:
5519#line 2832 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5520    {
5521      ast_interface_block *block = (ast_interface_block *)(yyvsp[0].node);
5522
5523      if (!block->default_layout.flags.q.buffer) {
5524            _mesa_glsl_error(& (yylsp[-1]), state,
5525                             "memory qualifiers can only be used in the "
5526                             "declaration of shader storage blocks");
5527      }
5528      if (!(yyvsp[-1].type_qualifier).merge_qualifier(& (yylsp[-1]), state, block->layout, false)) {
5529         YYERROR;
5530      }
5531      block->layout = (yyvsp[-1].type_qualifier);
5532      (yyval.node) = block;
5533   }
5534#line 5535 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5535    break;
5536
5537  case 287:
5538#line 2850 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5539    {
5540      ast_interface_block *const block = (yyvsp[-1].interface_block);
5541
5542      if ((yyvsp[-6].type_qualifier).flags.q.uniform) {
5543         block->default_layout = *state->default_uniform_qualifier;
5544      } else if ((yyvsp[-6].type_qualifier).flags.q.buffer) {
5545         block->default_layout = *state->default_shader_storage_qualifier;
5546      }
5547      block->block_name = (yyvsp[-5].identifier);
5548      block->declarations.push_degenerate_list_at_head(& (yyvsp[-3].declarator_list)->link);
5549
5550      _mesa_ast_process_interface_block(& (yylsp[-6]), state, block, (yyvsp[-6].type_qualifier));
5551
5552      (yyval.interface_block) = block;
5553   }
5554#line 5555 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5555    break;
5556
5557  case 288:
5558#line 2869 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5559    {
5560      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
5561      (yyval.type_qualifier).flags.q.in = 1;
5562   }
5563#line 5564 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5564    break;
5565
5566  case 289:
5567#line 2874 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5568    {
5569      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
5570      (yyval.type_qualifier).flags.q.out = 1;
5571   }
5572#line 5573 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5573    break;
5574
5575  case 290:
5576#line 2879 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5577    {
5578      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
5579      (yyval.type_qualifier).flags.q.uniform = 1;
5580   }
5581#line 5582 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5582    break;
5583
5584  case 291:
5585#line 2884 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5586    {
5587      memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
5588      (yyval.type_qualifier).flags.q.buffer = 1;
5589   }
5590#line 5591 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5591    break;
5592
5593  case 292:
5594#line 2889 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5595    {
5596      if (!(yyvsp[-1].type_qualifier).flags.q.patch) {
5597         _mesa_glsl_error(&(yylsp[-1]), state, "invalid interface qualifier");
5598      }
5599      if ((yyvsp[0].type_qualifier).has_auxiliary_storage()) {
5600         _mesa_glsl_error(&(yylsp[-1]), state, "duplicate patch qualifier");
5601      }
5602      (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
5603      (yyval.type_qualifier).flags.q.patch = 1;
5604   }
5605#line 5606 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5606    break;
5607
5608  case 293:
5609#line 2903 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5610    {
5611      (yyval.interface_block) = new(state->linalloc) ast_interface_block(NULL, NULL);
5612   }
5613#line 5614 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5614    break;
5615
5616  case 294:
5617#line 2907 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5618    {
5619      (yyval.interface_block) = new(state->linalloc) ast_interface_block((yyvsp[0].identifier), NULL);
5620      (yyval.interface_block)->set_location((yylsp[0]));
5621   }
5622#line 5623 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5623    break;
5624
5625  case 295:
5626#line 2912 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5627    {
5628      (yyval.interface_block) = new(state->linalloc) ast_interface_block((yyvsp[-1].identifier), (yyvsp[0].array_specifier));
5629      (yyval.interface_block)->set_location_range((yylsp[-1]), (yylsp[0]));
5630   }
5631#line 5632 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5632    break;
5633
5634  case 296:
5635#line 2920 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5636    {
5637      (yyval.declarator_list) = (yyvsp[0].declarator_list);
5638      (yyvsp[0].declarator_list)->link.self_link();
5639   }
5640#line 5641 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5641    break;
5642
5643  case 297:
5644#line 2925 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5645    {
5646      (yyval.declarator_list) = (yyvsp[-1].declarator_list);
5647      (yyvsp[0].declarator_list)->link.insert_before(& (yyval.declarator_list)->link);
5648   }
5649#line 5650 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5650    break;
5651
5652  case 298:
5653#line 2933 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5654    {
5655      void *ctx = state->linalloc;
5656      ast_fully_specified_type *type = (yyvsp[-2].fully_specified_type);
5657      type->set_location((yylsp[-2]));
5658
5659      if (type->qualifier.flags.q.attribute) {
5660         _mesa_glsl_error(& (yylsp[-2]), state,
5661                          "keyword 'attribute' cannot be used with "
5662                          "interface block member");
5663      } else if (type->qualifier.flags.q.varying) {
5664         _mesa_glsl_error(& (yylsp[-2]), state,
5665                          "keyword 'varying' cannot be used with "
5666                          "interface block member");
5667      }
5668
5669      (yyval.declarator_list) = new(ctx) ast_declarator_list(type);
5670      (yyval.declarator_list)->set_location((yylsp[-1]));
5671
5672      (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[-1].declaration)->link);
5673   }
5674#line 5675 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5675    break;
5676
5677  case 299:
5678#line 2957 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5679    {
5680      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
5681      if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[-1]), state, (yyvsp[0].type_qualifier), false, true)) {
5682         YYERROR;
5683      }
5684   }
5685#line 5686 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5686    break;
5687
5688  case 301:
5689#line 2968 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5690    {
5691      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
5692      if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[-1]), state, (yyvsp[0].type_qualifier), false, true)) {
5693         YYERROR;
5694      }
5695   }
5696#line 5697 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5697    break;
5698
5699  case 303:
5700#line 2979 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5701    {
5702      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
5703      if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[-1]), state, (yyvsp[0].type_qualifier), false, true)) {
5704         YYERROR;
5705      }
5706      if (!(yyval.type_qualifier).validate_in_qualifier(& (yylsp[-1]), state)) {
5707         YYERROR;
5708      }
5709   }
5710#line 5711 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5711    break;
5712
5713  case 304:
5714#line 2989 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5715    {
5716      if (!(yyvsp[-2].type_qualifier).validate_in_qualifier(& (yylsp[-2]), state)) {
5717         YYERROR;
5718      }
5719   }
5720#line 5721 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5721    break;
5722
5723  case 305:
5724#line 2998 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5725    {
5726      (yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
5727      if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[-1]), state, (yyvsp[0].type_qualifier), false, true)) {
5728         YYERROR;
5729      }
5730      if (!(yyval.type_qualifier).validate_out_qualifier(& (yylsp[-1]), state)) {
5731         YYERROR;
5732      }
5733   }
5734#line 5735 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5735    break;
5736
5737  case 306:
5738#line 3008 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5739    {
5740      if (!(yyvsp[-2].type_qualifier).validate_out_qualifier(& (yylsp[-2]), state)) {
5741         YYERROR;
5742      }
5743   }
5744#line 5745 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5745    break;
5746
5747  case 307:
5748#line 3017 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5749    {
5750      (yyval.node) = NULL;
5751      if (!state->default_uniform_qualifier->
5752             merge_qualifier(& (yylsp[0]), state, (yyvsp[0].type_qualifier), false)) {
5753         YYERROR;
5754      }
5755      if (!state->default_uniform_qualifier->
5756             push_to_global(& (yylsp[0]), state)) {
5757         YYERROR;
5758      }
5759   }
5760#line 5761 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5761    break;
5762
5763  case 308:
5764#line 3029 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5765    {
5766      (yyval.node) = NULL;
5767      if (!state->default_shader_storage_qualifier->
5768             merge_qualifier(& (yylsp[0]), state, (yyvsp[0].type_qualifier), false)) {
5769         YYERROR;
5770      }
5771      if (!state->default_shader_storage_qualifier->
5772             push_to_global(& (yylsp[0]), state)) {
5773         YYERROR;
5774      }
5775
5776      /* From the GLSL 4.50 spec, section 4.4.5:
5777       *
5778       *     "It is a compile-time error to specify the binding identifier for
5779       *     the global scope or for block member declarations."
5780       */
5781      if (state->default_shader_storage_qualifier->flags.q.explicit_binding) {
5782         _mesa_glsl_error(& (yylsp[0]), state,
5783                          "binding qualifier cannot be set for default layout");
5784      }
5785   }
5786#line 5787 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5787    break;
5788
5789  case 309:
5790#line 3051 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5791    {
5792      (yyval.node) = NULL;
5793      if (!(yyvsp[0].type_qualifier).merge_into_in_qualifier(& (yylsp[0]), state, (yyval.node))) {
5794         YYERROR;
5795      }
5796      if (!state->in_qualifier->push_to_global(& (yylsp[0]), state)) {
5797         YYERROR;
5798      }
5799   }
5800#line 5801 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5801    break;
5802
5803  case 310:
5804#line 3061 "../src/compiler/glsl/glsl_parser.yy" /* yacc.c:1645  */
5805    {
5806      (yyval.node) = NULL;
5807      if (!(yyvsp[0].type_qualifier).merge_into_out_qualifier(& (yylsp[0]), state, (yyval.node))) {
5808         YYERROR;
5809      }
5810      if (!state->out_qualifier->push_to_global(& (yylsp[0]), state)) {
5811         YYERROR;
5812      }
5813   }
5814#line 5815 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5815    break;
5816
5817
5818#line 5819 "src/compiler/glsl/glsl_parser.cpp" /* yacc.c:1645  */
5819      default: break;
5820    }
5821  /* User semantic actions sometimes alter yychar, and that requires
5822     that yytoken be updated with the new translation.  We take the
5823     approach of translating immediately before every use of yytoken.
5824     One alternative is translating here after every semantic action,
5825     but that translation would be missed if the semantic action invokes
5826     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
5827     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
5828     incorrect destructor might then be invoked immediately.  In the
5829     case of YYERROR or YYBACKUP, subsequent parser actions might lead
5830     to an incorrect destructor call or verbose syntax error message
5831     before the lookahead is translated.  */
5832  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
5833
5834  YYPOPSTACK (yylen);
5835  yylen = 0;
5836  YY_STACK_PRINT (yyss, yyssp);
5837
5838  *++yyvsp = yyval;
5839  *++yylsp = yyloc;
5840
5841  /* Now 'shift' the result of the reduction.  Determine what state
5842     that goes to, based on the state we popped back to and the rule
5843     number reduced by.  */
5844  {
5845    const int yylhs = yyr1[yyn] - YYNTOKENS;
5846    const int yyi = yypgoto[yylhs] + *yyssp;
5847    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
5848               ? yytable[yyi]
5849               : yydefgoto[yylhs]);
5850  }
5851
5852  goto yynewstate;
5853
5854
5855/*--------------------------------------.
5856| yyerrlab -- here on detecting error.  |
5857`--------------------------------------*/
5858yyerrlab:
5859  /* Make sure we have latest lookahead translation.  See comments at
5860     user semantic actions for why this is necessary.  */
5861  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
5862
5863  /* If not already recovering from an error, report this error.  */
5864  if (!yyerrstatus)
5865    {
5866      ++yynerrs;
5867#if ! YYERROR_VERBOSE
5868      yyerror (&yylloc, state, YY_("syntax error"));
5869#else
5870# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
5871                                        yyssp, yytoken)
5872      {
5873        char const *yymsgp = YY_("syntax error");
5874        int yysyntax_error_status;
5875        yysyntax_error_status = YYSYNTAX_ERROR;
5876        if (yysyntax_error_status == 0)
5877          yymsgp = yymsg;
5878        else if (yysyntax_error_status == 1)
5879          {
5880            if (yymsg != yymsgbuf)
5881              YYSTACK_FREE (yymsg);
5882            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
5883            if (!yymsg)
5884              {
5885                yymsg = yymsgbuf;
5886                yymsg_alloc = sizeof yymsgbuf;
5887                yysyntax_error_status = 2;
5888              }
5889            else
5890              {
5891                yysyntax_error_status = YYSYNTAX_ERROR;
5892                yymsgp = yymsg;
5893              }
5894          }
5895        yyerror (&yylloc, state, yymsgp);
5896        if (yysyntax_error_status == 2)
5897          goto yyexhaustedlab;
5898      }
5899# undef YYSYNTAX_ERROR
5900#endif
5901    }
5902
5903  yyerror_range[1] = yylloc;
5904
5905  if (yyerrstatus == 3)
5906    {
5907      /* If just tried and failed to reuse lookahead token after an
5908         error, discard it.  */
5909
5910      if (yychar <= YYEOF)
5911        {
5912          /* Return failure if at end of input.  */
5913          if (yychar == YYEOF)
5914            YYABORT;
5915        }
5916      else
5917        {
5918          yydestruct ("Error: discarding",
5919                      yytoken, &yylval, &yylloc, state);
5920          yychar = YYEMPTY;
5921        }
5922    }
5923
5924  /* Else will try to reuse lookahead token after shifting the error
5925     token.  */
5926  goto yyerrlab1;
5927
5928
5929/*---------------------------------------------------.
5930| yyerrorlab -- error raised explicitly by YYERROR.  |
5931`---------------------------------------------------*/
5932yyerrorlab:
5933
5934  /* Pacify compilers like GCC when the user code never invokes
5935     YYERROR and the label yyerrorlab therefore never appears in user
5936     code.  */
5937  if (/*CONSTCOND*/ 0)
5938     goto yyerrorlab;
5939
5940  /* Do not reclaim the symbols of the rule whose action triggered
5941     this YYERROR.  */
5942  YYPOPSTACK (yylen);
5943  yylen = 0;
5944  YY_STACK_PRINT (yyss, yyssp);
5945  yystate = *yyssp;
5946  goto yyerrlab1;
5947
5948
5949/*-------------------------------------------------------------.
5950| yyerrlab1 -- common code for both syntax error and YYERROR.  |
5951`-------------------------------------------------------------*/
5952yyerrlab1:
5953  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
5954
5955  for (;;)
5956    {
5957      yyn = yypact[yystate];
5958      if (!yypact_value_is_default (yyn))
5959        {
5960          yyn += YYTERROR;
5961          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5962            {
5963              yyn = yytable[yyn];
5964              if (0 < yyn)
5965                break;
5966            }
5967        }
5968
5969      /* Pop the current state because it cannot handle the error token.  */
5970      if (yyssp == yyss)
5971        YYABORT;
5972
5973      yyerror_range[1] = *yylsp;
5974      yydestruct ("Error: popping",
5975                  yystos[yystate], yyvsp, yylsp, state);
5976      YYPOPSTACK (1);
5977      yystate = *yyssp;
5978      YY_STACK_PRINT (yyss, yyssp);
5979    }
5980
5981  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
5982  *++yyvsp = yylval;
5983  YY_IGNORE_MAYBE_UNINITIALIZED_END
5984
5985  yyerror_range[2] = yylloc;
5986  /* Using YYLLOC is tempting, but would change the location of
5987     the lookahead.  YYLOC is available though.  */
5988  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
5989  *++yylsp = yyloc;
5990
5991  /* Shift the error token.  */
5992  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5993
5994  yystate = yyn;
5995  goto yynewstate;
5996
5997
5998/*-------------------------------------.
5999| yyacceptlab -- YYACCEPT comes here.  |
6000`-------------------------------------*/
6001yyacceptlab:
6002  yyresult = 0;
6003  goto yyreturn;
6004
6005/*-----------------------------------.
6006| yyabortlab -- YYABORT comes here.  |
6007`-----------------------------------*/
6008yyabortlab:
6009  yyresult = 1;
6010  goto yyreturn;
6011
6012#if !defined yyoverflow || YYERROR_VERBOSE
6013/*-------------------------------------------------.
6014| yyexhaustedlab -- memory exhaustion comes here.  |
6015`-------------------------------------------------*/
6016yyexhaustedlab:
6017  yyerror (&yylloc, state, YY_("memory exhausted"));
6018  yyresult = 2;
6019  /* Fall through.  */
6020#endif
6021
6022yyreturn:
6023  if (yychar != YYEMPTY)
6024    {
6025      /* Make sure we have latest lookahead translation.  See comments at
6026         user semantic actions for why this is necessary.  */
6027      yytoken = YYTRANSLATE (yychar);
6028      yydestruct ("Cleanup: discarding lookahead",
6029                  yytoken, &yylval, &yylloc, state);
6030    }
6031  /* Do not reclaim the symbols of the rule whose action triggered
6032     this YYABORT or YYACCEPT.  */
6033  YYPOPSTACK (yylen);
6034  YY_STACK_PRINT (yyss, yyssp);
6035  while (yyssp != yyss)
6036    {
6037      yydestruct ("Cleanup: popping",
6038                  yystos[*yyssp], yyvsp, yylsp, state);
6039      YYPOPSTACK (1);
6040    }
6041#ifndef yyoverflow
6042  if (yyss != yyssa)
6043    YYSTACK_FREE (yyss);
6044#endif
6045#if YYERROR_VERBOSE
6046  if (yymsg != yymsgbuf)
6047    YYSTACK_FREE (yymsg);
6048#endif
6049  return yyresult;
6050}
6051