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