program_parse.tab.c revision e64d31b9
1e64d31b9Smaya/* A Bison parser, made by GNU Bison 3.2.4. */ 2e64d31b9Smaya 3e64d31b9Smaya/* Bison implementation for Yacc-like parsers in C 4e64d31b9Smaya 5e64d31b9Smaya Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. 6e64d31b9Smaya 7e64d31b9Smaya This program is free software: you can redistribute it and/or modify 8e64d31b9Smaya it under the terms of the GNU General Public License as published by 9e64d31b9Smaya the Free Software Foundation, either version 3 of the License, or 10e64d31b9Smaya (at your option) any later version. 11e64d31b9Smaya 12e64d31b9Smaya This program is distributed in the hope that it will be useful, 13e64d31b9Smaya but WITHOUT ANY WARRANTY; without even the implied warranty of 14e64d31b9Smaya MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15e64d31b9Smaya GNU General Public License for more details. 16e64d31b9Smaya 17e64d31b9Smaya You should have received a copy of the GNU General Public License 18e64d31b9Smaya along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19e64d31b9Smaya 20e64d31b9Smaya/* As a special exception, you may create a larger work that contains 21e64d31b9Smaya part or all of the Bison parser skeleton and distribute that work 22e64d31b9Smaya under terms of your choice, so long as that work isn't itself a 23e64d31b9Smaya parser generator using the skeleton or a modified version thereof 24e64d31b9Smaya as a parser skeleton. Alternatively, if you modify or redistribute 25e64d31b9Smaya the parser skeleton itself, you may (at your option) remove this 26e64d31b9Smaya special exception, which will cause the skeleton and the resulting 27e64d31b9Smaya Bison output files to be licensed under the GNU General Public 28e64d31b9Smaya License without this special exception. 29e64d31b9Smaya 30e64d31b9Smaya This special exception was added by the Free Software Foundation in 31e64d31b9Smaya version 2.2 of Bison. */ 32e64d31b9Smaya 33e64d31b9Smaya/* C LALR(1) parser skeleton written by Richard Stallman, by 34e64d31b9Smaya simplifying the original so-called "semantic" parser. */ 35e64d31b9Smaya 36e64d31b9Smaya/* All symbols defined below should begin with yy or YY, to avoid 37e64d31b9Smaya infringing on user name space. This should be done even for local 38e64d31b9Smaya variables, as they might otherwise be expanded by user macros. 39e64d31b9Smaya There are some unavoidable exceptions within include files to 40e64d31b9Smaya define necessary library symbols; they are noted "INFRINGES ON 41e64d31b9Smaya USER NAME SPACE" below. */ 42e64d31b9Smaya 43e64d31b9Smaya/* Undocumented macros, especially those whose name start with YY_, 44e64d31b9Smaya are private implementation details. Do not rely on them. */ 45e64d31b9Smaya 46e64d31b9Smaya/* Identify Bison output. */ 47e64d31b9Smaya#define YYBISON 1 48e64d31b9Smaya 49e64d31b9Smaya/* Bison version. */ 50e64d31b9Smaya#define YYBISON_VERSION "3.2.4" 51e64d31b9Smaya 52e64d31b9Smaya/* Skeleton name. */ 53e64d31b9Smaya#define YYSKELETON_NAME "yacc.c" 54e64d31b9Smaya 55e64d31b9Smaya/* Pure parsers. */ 56e64d31b9Smaya#define YYPURE 1 57e64d31b9Smaya 58e64d31b9Smaya/* Push parsers. */ 59e64d31b9Smaya#define YYPUSH 0 60e64d31b9Smaya 61e64d31b9Smaya/* Pull parsers. */ 62e64d31b9Smaya#define YYPULL 1 63e64d31b9Smaya 64e64d31b9Smaya 65e64d31b9Smaya/* Substitute the variable and function names. */ 66e64d31b9Smaya#define yyparse _mesa_program_parse 67e64d31b9Smaya#define yylex _mesa_program_lex 68e64d31b9Smaya#define yyerror _mesa_program_error 69e64d31b9Smaya#define yydebug _mesa_program_debug 70e64d31b9Smaya#define yynerrs _mesa_program_nerrs 71e64d31b9Smaya 72e64d31b9Smaya 73e64d31b9Smaya/* First part of user prologue. */ 74e64d31b9Smaya#line 1 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:338 */ 75e64d31b9Smaya 76e64d31b9Smaya/* 77e64d31b9Smaya * Copyright © 2009 Intel Corporation 78e64d31b9Smaya * 79e64d31b9Smaya * Permission is hereby granted, free of charge, to any person obtaining a 80e64d31b9Smaya * copy of this software and associated documentation files (the "Software"), 81e64d31b9Smaya * to deal in the Software without restriction, including without limitation 82e64d31b9Smaya * the rights to use, copy, modify, merge, publish, distribute, sublicense, 83e64d31b9Smaya * and/or sell copies of the Software, and to permit persons to whom the 84e64d31b9Smaya * Software is furnished to do so, subject to the following conditions: 85e64d31b9Smaya * 86e64d31b9Smaya * The above copyright notice and this permission notice (including the next 87e64d31b9Smaya * paragraph) shall be included in all copies or substantial portions of the 88e64d31b9Smaya * Software. 89e64d31b9Smaya * 90e64d31b9Smaya * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 91e64d31b9Smaya * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 92e64d31b9Smaya * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 93e64d31b9Smaya * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 94e64d31b9Smaya * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 95e64d31b9Smaya * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 96e64d31b9Smaya * DEALINGS IN THE SOFTWARE. 97e64d31b9Smaya */ 98e64d31b9Smaya 99e64d31b9Smaya#include <stdarg.h> 100e64d31b9Smaya#include <stdio.h> 101e64d31b9Smaya#include <stdlib.h> 102e64d31b9Smaya#include <string.h> 103e64d31b9Smaya 104e64d31b9Smaya#include "main/errors.h" 105e64d31b9Smaya#include "main/mtypes.h" 106e64d31b9Smaya#include "main/imports.h" 107e64d31b9Smaya#include "program/program.h" 108e64d31b9Smaya#include "program/prog_parameter.h" 109e64d31b9Smaya#include "program/prog_parameter_layout.h" 110e64d31b9Smaya#include "program/prog_statevars.h" 111e64d31b9Smaya#include "program/prog_instruction.h" 112e64d31b9Smaya 113e64d31b9Smaya#include "program/symbol_table.h" 114e64d31b9Smaya#include "program/program_parser.h" 115e64d31b9Smaya 116e64d31b9Smaya#include "util/u_math.h" 117e64d31b9Smaya 118e64d31b9Smayaextern void *yy_scan_string(char *); 119e64d31b9Smayaextern void yy_delete_buffer(void *); 120e64d31b9Smaya 121e64d31b9Smayastatic struct asm_symbol *declare_variable(struct asm_parser_state *state, 122e64d31b9Smaya char *name, enum asm_type t, struct YYLTYPE *locp); 123e64d31b9Smaya 124e64d31b9Smayastatic int add_state_reference(struct gl_program_parameter_list *param_list, 125e64d31b9Smaya const gl_state_index16 tokens[STATE_LENGTH]); 126e64d31b9Smaya 127e64d31b9Smayastatic int initialize_symbol_from_state(struct gl_program *prog, 128e64d31b9Smaya struct asm_symbol *param_var, const gl_state_index16 tokens[STATE_LENGTH]); 129e64d31b9Smaya 130e64d31b9Smayastatic int initialize_symbol_from_param(struct gl_program *prog, 131e64d31b9Smaya struct asm_symbol *param_var, const gl_state_index16 tokens[STATE_LENGTH]); 132e64d31b9Smaya 133e64d31b9Smayastatic int initialize_symbol_from_const(struct gl_program *prog, 134e64d31b9Smaya struct asm_symbol *param_var, const struct asm_vector *vec, 135e64d31b9Smaya GLboolean allowSwizzle); 136e64d31b9Smaya 137e64d31b9Smayastatic int yyparse(struct asm_parser_state *state); 138e64d31b9Smaya 139e64d31b9Smayastatic char *make_error_string(const char *fmt, ...); 140e64d31b9Smaya 141e64d31b9Smayastatic void yyerror(struct YYLTYPE *locp, struct asm_parser_state *state, 142e64d31b9Smaya const char *s); 143e64d31b9Smaya 144e64d31b9Smayastatic int validate_inputs(struct YYLTYPE *locp, 145e64d31b9Smaya struct asm_parser_state *state); 146e64d31b9Smaya 147e64d31b9Smayastatic void init_dst_reg(struct prog_dst_register *r); 148e64d31b9Smaya 149e64d31b9Smayastatic void set_dst_reg(struct prog_dst_register *r, 150e64d31b9Smaya gl_register_file file, GLint index); 151e64d31b9Smaya 152e64d31b9Smayastatic void init_src_reg(struct asm_src_register *r); 153e64d31b9Smaya 154e64d31b9Smayastatic void set_src_reg(struct asm_src_register *r, 155e64d31b9Smaya gl_register_file file, GLint index); 156e64d31b9Smaya 157e64d31b9Smayastatic void set_src_reg_swz(struct asm_src_register *r, 158e64d31b9Smaya gl_register_file file, GLint index, GLuint swizzle); 159e64d31b9Smaya 160e64d31b9Smayastatic void asm_instruction_set_operands(struct asm_instruction *inst, 161e64d31b9Smaya const struct prog_dst_register *dst, const struct asm_src_register *src0, 162e64d31b9Smaya const struct asm_src_register *src1, const struct asm_src_register *src2); 163e64d31b9Smaya 164e64d31b9Smayastatic struct asm_instruction *asm_instruction_ctor(enum prog_opcode op, 165e64d31b9Smaya const struct prog_dst_register *dst, const struct asm_src_register *src0, 166e64d31b9Smaya const struct asm_src_register *src1, const struct asm_src_register *src2); 167e64d31b9Smaya 168e64d31b9Smayastatic struct asm_instruction *asm_instruction_copy_ctor( 169e64d31b9Smaya const struct prog_instruction *base, const struct prog_dst_register *dst, 170e64d31b9Smaya const struct asm_src_register *src0, const struct asm_src_register *src1, 171e64d31b9Smaya const struct asm_src_register *src2); 172e64d31b9Smaya 173e64d31b9Smaya#ifndef FALSE 174e64d31b9Smaya#define FALSE 0 175e64d31b9Smaya#define TRUE (!FALSE) 176e64d31b9Smaya#endif 177e64d31b9Smaya 178e64d31b9Smaya#define YYLLOC_DEFAULT(Current, Rhs, N) \ 179e64d31b9Smaya do { \ 180e64d31b9Smaya if (N) { \ 181e64d31b9Smaya (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ 182e64d31b9Smaya (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \ 183e64d31b9Smaya (Current).position = YYRHSLOC(Rhs, 1).position; \ 184e64d31b9Smaya (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ 185e64d31b9Smaya (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ 186e64d31b9Smaya } else { \ 187e64d31b9Smaya (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \ 188e64d31b9Smaya (Current).last_line = (Current).first_line; \ 189e64d31b9Smaya (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \ 190e64d31b9Smaya (Current).last_column = (Current).first_column; \ 191e64d31b9Smaya (Current).position = YYRHSLOC(Rhs, 0).position \ 192e64d31b9Smaya + (Current).first_column; \ 193e64d31b9Smaya } \ 194e64d31b9Smaya } while(0) 195e64d31b9Smaya 196e64d31b9Smaya#line 197 "program_parse.tab.c" /* yacc.c:338 */ 197e64d31b9Smaya# ifndef YY_NULLPTR 198e64d31b9Smaya# if defined __cplusplus 199e64d31b9Smaya# if 201103L <= __cplusplus 200e64d31b9Smaya# define YY_NULLPTR nullptr 201e64d31b9Smaya# else 202e64d31b9Smaya# define YY_NULLPTR 0 203e64d31b9Smaya# endif 204e64d31b9Smaya# else 205e64d31b9Smaya# define YY_NULLPTR ((void*)0) 206e64d31b9Smaya# endif 207e64d31b9Smaya# endif 208e64d31b9Smaya 209e64d31b9Smaya/* Enabling verbose error messages. */ 210e64d31b9Smaya#ifdef YYERROR_VERBOSE 211e64d31b9Smaya# undef YYERROR_VERBOSE 212e64d31b9Smaya# define YYERROR_VERBOSE 1 213e64d31b9Smaya#else 214e64d31b9Smaya# define YYERROR_VERBOSE 1 215e64d31b9Smaya#endif 216e64d31b9Smaya 217e64d31b9Smaya/* In a future release of Bison, this section will be replaced 218e64d31b9Smaya by #include "program_parse.tab.h". */ 219e64d31b9Smaya#ifndef YY__MESA_PROGRAM_PROGRAM_PARSE_TAB_H_INCLUDED 220e64d31b9Smaya# define YY__MESA_PROGRAM_PROGRAM_PARSE_TAB_H_INCLUDED 221e64d31b9Smaya/* Debug traces. */ 222e64d31b9Smaya#ifndef YYDEBUG 223e64d31b9Smaya# define YYDEBUG 0 224e64d31b9Smaya#endif 225e64d31b9Smaya#if YYDEBUG 226e64d31b9Smayaextern int _mesa_program_debug; 227e64d31b9Smaya#endif 228e64d31b9Smaya 229e64d31b9Smaya/* Token type. */ 230e64d31b9Smaya#ifndef YYTOKENTYPE 231e64d31b9Smaya# define YYTOKENTYPE 232e64d31b9Smaya enum yytokentype 233e64d31b9Smaya { 234e64d31b9Smaya ARBvp_10 = 258, 235e64d31b9Smaya ARBfp_10 = 259, 236e64d31b9Smaya ADDRESS = 260, 237e64d31b9Smaya ALIAS = 261, 238e64d31b9Smaya ATTRIB = 262, 239e64d31b9Smaya OPTION = 263, 240e64d31b9Smaya OUTPUT = 264, 241e64d31b9Smaya PARAM = 265, 242e64d31b9Smaya TEMP = 266, 243e64d31b9Smaya END = 267, 244e64d31b9Smaya BIN_OP = 268, 245e64d31b9Smaya BINSC_OP = 269, 246e64d31b9Smaya SAMPLE_OP = 270, 247e64d31b9Smaya SCALAR_OP = 271, 248e64d31b9Smaya TRI_OP = 272, 249e64d31b9Smaya VECTOR_OP = 273, 250e64d31b9Smaya ARL = 274, 251e64d31b9Smaya KIL = 275, 252e64d31b9Smaya SWZ = 276, 253e64d31b9Smaya TXD_OP = 277, 254e64d31b9Smaya INTEGER = 278, 255e64d31b9Smaya REAL = 279, 256e64d31b9Smaya AMBIENT = 280, 257e64d31b9Smaya ATTENUATION = 281, 258e64d31b9Smaya BACK = 282, 259e64d31b9Smaya CLIP = 283, 260e64d31b9Smaya COLOR = 284, 261e64d31b9Smaya DEPTH = 285, 262e64d31b9Smaya DIFFUSE = 286, 263e64d31b9Smaya DIRECTION = 287, 264e64d31b9Smaya EMISSION = 288, 265e64d31b9Smaya ENV = 289, 266e64d31b9Smaya EYE = 290, 267e64d31b9Smaya FOG = 291, 268e64d31b9Smaya FOGCOORD = 292, 269e64d31b9Smaya FRAGMENT = 293, 270e64d31b9Smaya FRONT = 294, 271e64d31b9Smaya HALF = 295, 272e64d31b9Smaya INVERSE = 296, 273e64d31b9Smaya INVTRANS = 297, 274e64d31b9Smaya LIGHT = 298, 275e64d31b9Smaya LIGHTMODEL = 299, 276e64d31b9Smaya LIGHTPROD = 300, 277e64d31b9Smaya LOCAL = 301, 278e64d31b9Smaya MATERIAL = 302, 279e64d31b9Smaya MAT_PROGRAM = 303, 280e64d31b9Smaya MATRIX = 304, 281e64d31b9Smaya MATRIXINDEX = 305, 282e64d31b9Smaya MODELVIEW = 306, 283e64d31b9Smaya MVP = 307, 284e64d31b9Smaya NORMAL = 308, 285e64d31b9Smaya OBJECT = 309, 286e64d31b9Smaya PALETTE = 310, 287e64d31b9Smaya PARAMS = 311, 288e64d31b9Smaya PLANE = 312, 289e64d31b9Smaya POINT_TOK = 313, 290e64d31b9Smaya POINTSIZE = 314, 291e64d31b9Smaya POSITION = 315, 292e64d31b9Smaya PRIMARY = 316, 293e64d31b9Smaya PROGRAM = 317, 294e64d31b9Smaya PROJECTION = 318, 295e64d31b9Smaya RANGE = 319, 296e64d31b9Smaya RESULT = 320, 297e64d31b9Smaya ROW = 321, 298e64d31b9Smaya SCENECOLOR = 322, 299e64d31b9Smaya SECONDARY = 323, 300e64d31b9Smaya SHININESS = 324, 301e64d31b9Smaya SIZE_TOK = 325, 302e64d31b9Smaya SPECULAR = 326, 303e64d31b9Smaya SPOT = 327, 304e64d31b9Smaya STATE = 328, 305e64d31b9Smaya TEXCOORD = 329, 306e64d31b9Smaya TEXENV = 330, 307e64d31b9Smaya TEXGEN = 331, 308e64d31b9Smaya TEXGEN_Q = 332, 309e64d31b9Smaya TEXGEN_R = 333, 310e64d31b9Smaya TEXGEN_S = 334, 311e64d31b9Smaya TEXGEN_T = 335, 312e64d31b9Smaya TEXTURE = 336, 313e64d31b9Smaya TRANSPOSE = 337, 314e64d31b9Smaya TEXTURE_UNIT = 338, 315e64d31b9Smaya TEX_1D = 339, 316e64d31b9Smaya TEX_2D = 340, 317e64d31b9Smaya TEX_3D = 341, 318e64d31b9Smaya TEX_CUBE = 342, 319e64d31b9Smaya TEX_RECT = 343, 320e64d31b9Smaya TEX_SHADOW1D = 344, 321e64d31b9Smaya TEX_SHADOW2D = 345, 322e64d31b9Smaya TEX_SHADOWRECT = 346, 323e64d31b9Smaya TEX_ARRAY1D = 347, 324e64d31b9Smaya TEX_ARRAY2D = 348, 325e64d31b9Smaya TEX_ARRAYSHADOW1D = 349, 326e64d31b9Smaya TEX_ARRAYSHADOW2D = 350, 327e64d31b9Smaya VERTEX = 351, 328e64d31b9Smaya VTXATTRIB = 352, 329e64d31b9Smaya IDENTIFIER = 353, 330e64d31b9Smaya USED_IDENTIFIER = 354, 331e64d31b9Smaya MASK4 = 355, 332e64d31b9Smaya MASK3 = 356, 333e64d31b9Smaya MASK2 = 357, 334e64d31b9Smaya MASK1 = 358, 335e64d31b9Smaya SWIZZLE = 359, 336e64d31b9Smaya DOT_DOT = 360, 337e64d31b9Smaya DOT = 361 338e64d31b9Smaya }; 339e64d31b9Smaya#endif 340e64d31b9Smaya 341e64d31b9Smaya/* Value type. */ 342e64d31b9Smaya#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 343e64d31b9Smaya 344e64d31b9Smayaunion YYSTYPE 345e64d31b9Smaya{ 346e64d31b9Smaya#line 129 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:353 */ 347e64d31b9Smaya 348e64d31b9Smaya struct asm_instruction *inst; 349e64d31b9Smaya struct asm_symbol *sym; 350e64d31b9Smaya struct asm_symbol temp_sym; 351e64d31b9Smaya struct asm_swizzle_mask swiz_mask; 352e64d31b9Smaya struct asm_src_register src_reg; 353e64d31b9Smaya struct prog_dst_register dst_reg; 354e64d31b9Smaya struct prog_instruction temp_inst; 355e64d31b9Smaya char *string; 356e64d31b9Smaya unsigned result; 357e64d31b9Smaya unsigned attrib; 358e64d31b9Smaya int integer; 359e64d31b9Smaya float real; 360e64d31b9Smaya gl_state_index16 state[STATE_LENGTH]; 361e64d31b9Smaya int negate; 362e64d31b9Smaya struct asm_vector vector; 363e64d31b9Smaya enum prog_opcode opcode; 364e64d31b9Smaya 365e64d31b9Smaya struct { 366e64d31b9Smaya unsigned swz; 367e64d31b9Smaya unsigned rgba_valid:1; 368e64d31b9Smaya unsigned xyzw_valid:1; 369e64d31b9Smaya unsigned negate:1; 370e64d31b9Smaya } ext_swizzle; 371e64d31b9Smaya 372e64d31b9Smaya#line 373 "program_parse.tab.c" /* yacc.c:353 */ 373e64d31b9Smaya}; 374e64d31b9Smaya 375e64d31b9Smayatypedef union YYSTYPE YYSTYPE; 376e64d31b9Smaya# define YYSTYPE_IS_TRIVIAL 1 377e64d31b9Smaya# define YYSTYPE_IS_DECLARED 1 378e64d31b9Smaya#endif 379e64d31b9Smaya 380e64d31b9Smaya/* Location type. */ 381e64d31b9Smaya#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED 382e64d31b9Smayatypedef struct YYLTYPE YYLTYPE; 383e64d31b9Smayastruct YYLTYPE 384e64d31b9Smaya{ 385e64d31b9Smaya int first_line; 386e64d31b9Smaya int first_column; 387e64d31b9Smaya int last_line; 388e64d31b9Smaya int last_column; 389e64d31b9Smaya}; 390e64d31b9Smaya# define YYLTYPE_IS_DECLARED 1 391e64d31b9Smaya# define YYLTYPE_IS_TRIVIAL 1 392e64d31b9Smaya#endif 393e64d31b9Smaya 394e64d31b9Smaya 395e64d31b9Smaya 396e64d31b9Smayaint _mesa_program_parse (struct asm_parser_state *state); 397e64d31b9Smaya 398e64d31b9Smaya#endif /* !YY__MESA_PROGRAM_PROGRAM_PARSE_TAB_H_INCLUDED */ 399e64d31b9Smaya 400e64d31b9Smaya/* Second part of user prologue. */ 401e64d31b9Smaya#line 271 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:355 */ 402e64d31b9Smaya 403e64d31b9Smayaextern int 404e64d31b9Smaya_mesa_program_lexer_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, 405e64d31b9Smaya void *yyscanner); 406e64d31b9Smaya 407e64d31b9Smayastatic int 408e64d31b9Smayayylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, 409e64d31b9Smaya struct asm_parser_state *state) 410e64d31b9Smaya{ 411e64d31b9Smaya return _mesa_program_lexer_lex(yylval_param, yylloc_param, state->scanner); 412e64d31b9Smaya} 413e64d31b9Smaya 414e64d31b9Smaya#line 415 "program_parse.tab.c" /* yacc.c:355 */ 415e64d31b9Smaya 416e64d31b9Smaya#ifdef short 417e64d31b9Smaya# undef short 418e64d31b9Smaya#endif 419e64d31b9Smaya 420e64d31b9Smaya#ifdef YYTYPE_UINT8 421e64d31b9Smayatypedef YYTYPE_UINT8 yytype_uint8; 422e64d31b9Smaya#else 423e64d31b9Smayatypedef unsigned char yytype_uint8; 424e64d31b9Smaya#endif 425e64d31b9Smaya 426e64d31b9Smaya#ifdef YYTYPE_INT8 427e64d31b9Smayatypedef YYTYPE_INT8 yytype_int8; 428e64d31b9Smaya#else 429e64d31b9Smayatypedef signed char yytype_int8; 430e64d31b9Smaya#endif 431e64d31b9Smaya 432e64d31b9Smaya#ifdef YYTYPE_UINT16 433e64d31b9Smayatypedef YYTYPE_UINT16 yytype_uint16; 434e64d31b9Smaya#else 435e64d31b9Smayatypedef unsigned short yytype_uint16; 436e64d31b9Smaya#endif 437e64d31b9Smaya 438e64d31b9Smaya#ifdef YYTYPE_INT16 439e64d31b9Smayatypedef YYTYPE_INT16 yytype_int16; 440e64d31b9Smaya#else 441e64d31b9Smayatypedef short yytype_int16; 442e64d31b9Smaya#endif 443e64d31b9Smaya 444e64d31b9Smaya#ifndef YYSIZE_T 445e64d31b9Smaya# ifdef __SIZE_TYPE__ 446e64d31b9Smaya# define YYSIZE_T __SIZE_TYPE__ 447e64d31b9Smaya# elif defined size_t 448e64d31b9Smaya# define YYSIZE_T size_t 449e64d31b9Smaya# elif ! defined YYSIZE_T 450e64d31b9Smaya# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 451e64d31b9Smaya# define YYSIZE_T size_t 452e64d31b9Smaya# else 453e64d31b9Smaya# define YYSIZE_T unsigned 454e64d31b9Smaya# endif 455e64d31b9Smaya#endif 456e64d31b9Smaya 457e64d31b9Smaya#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 458e64d31b9Smaya 459e64d31b9Smaya#ifndef YY_ 460e64d31b9Smaya# if defined YYENABLE_NLS && YYENABLE_NLS 461e64d31b9Smaya# if ENABLE_NLS 462e64d31b9Smaya# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 463e64d31b9Smaya# define YY_(Msgid) dgettext ("bison-runtime", Msgid) 464e64d31b9Smaya# endif 465e64d31b9Smaya# endif 466e64d31b9Smaya# ifndef YY_ 467e64d31b9Smaya# define YY_(Msgid) Msgid 468e64d31b9Smaya# endif 469e64d31b9Smaya#endif 470e64d31b9Smaya 471e64d31b9Smaya#ifndef YY_ATTRIBUTE 472e64d31b9Smaya# if (defined __GNUC__ \ 473e64d31b9Smaya && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 474e64d31b9Smaya || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 475e64d31b9Smaya# define YY_ATTRIBUTE(Spec) __attribute__(Spec) 476e64d31b9Smaya# else 477e64d31b9Smaya# define YY_ATTRIBUTE(Spec) /* empty */ 478e64d31b9Smaya# endif 479e64d31b9Smaya#endif 480e64d31b9Smaya 481e64d31b9Smaya#ifndef YY_ATTRIBUTE_PURE 482e64d31b9Smaya# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 483e64d31b9Smaya#endif 484e64d31b9Smaya 485e64d31b9Smaya#ifndef YY_ATTRIBUTE_UNUSED 486e64d31b9Smaya# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 487e64d31b9Smaya#endif 488e64d31b9Smaya 489e64d31b9Smaya/* Suppress unused-variable warnings by "using" E. */ 490e64d31b9Smaya#if ! defined lint || defined __GNUC__ 491e64d31b9Smaya# define YYUSE(E) ((void) (E)) 492e64d31b9Smaya#else 493e64d31b9Smaya# define YYUSE(E) /* empty */ 494e64d31b9Smaya#endif 495e64d31b9Smaya 496e64d31b9Smaya#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 497e64d31b9Smaya/* Suppress an incorrect diagnostic about yylval being uninitialized. */ 498e64d31b9Smaya# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 499e64d31b9Smaya _Pragma ("GCC diagnostic push") \ 500e64d31b9Smaya _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 501e64d31b9Smaya _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 502e64d31b9Smaya# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 503e64d31b9Smaya _Pragma ("GCC diagnostic pop") 504e64d31b9Smaya#else 505e64d31b9Smaya# define YY_INITIAL_VALUE(Value) Value 506e64d31b9Smaya#endif 507e64d31b9Smaya#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 508e64d31b9Smaya# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 509e64d31b9Smaya# define YY_IGNORE_MAYBE_UNINITIALIZED_END 510e64d31b9Smaya#endif 511e64d31b9Smaya#ifndef YY_INITIAL_VALUE 512e64d31b9Smaya# define YY_INITIAL_VALUE(Value) /* Nothing. */ 513e64d31b9Smaya#endif 514e64d31b9Smaya 515e64d31b9Smaya 516e64d31b9Smaya#if ! defined yyoverflow || YYERROR_VERBOSE 517e64d31b9Smaya 518e64d31b9Smaya/* The parser invokes alloca or malloc; define the necessary symbols. */ 519e64d31b9Smaya 520e64d31b9Smaya# ifdef YYSTACK_USE_ALLOCA 521e64d31b9Smaya# if YYSTACK_USE_ALLOCA 522e64d31b9Smaya# ifdef __GNUC__ 523e64d31b9Smaya# define YYSTACK_ALLOC __builtin_alloca 524e64d31b9Smaya# elif defined __BUILTIN_VA_ARG_INCR 525e64d31b9Smaya# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 526e64d31b9Smaya# elif defined _AIX 527e64d31b9Smaya# define YYSTACK_ALLOC __alloca 528e64d31b9Smaya# elif defined _MSC_VER 529e64d31b9Smaya# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 530e64d31b9Smaya# define alloca _alloca 531e64d31b9Smaya# else 532e64d31b9Smaya# define YYSTACK_ALLOC alloca 533e64d31b9Smaya# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 534e64d31b9Smaya# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 535e64d31b9Smaya /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 536e64d31b9Smaya# ifndef EXIT_SUCCESS 537e64d31b9Smaya# define EXIT_SUCCESS 0 538e64d31b9Smaya# endif 539e64d31b9Smaya# endif 540e64d31b9Smaya# endif 541e64d31b9Smaya# endif 542e64d31b9Smaya# endif 543e64d31b9Smaya 544e64d31b9Smaya# ifdef YYSTACK_ALLOC 545e64d31b9Smaya /* Pacify GCC's 'empty if-body' warning. */ 546e64d31b9Smaya# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 547e64d31b9Smaya# ifndef YYSTACK_ALLOC_MAXIMUM 548e64d31b9Smaya /* The OS might guarantee only one guard page at the bottom of the stack, 549e64d31b9Smaya and a page size can be as small as 4096 bytes. So we cannot safely 550e64d31b9Smaya invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 551e64d31b9Smaya to allow for a few compiler-allocated temporary stack slots. */ 552e64d31b9Smaya# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 553e64d31b9Smaya# endif 554e64d31b9Smaya# else 555e64d31b9Smaya# define YYSTACK_ALLOC YYMALLOC 556e64d31b9Smaya# define YYSTACK_FREE YYFREE 557e64d31b9Smaya# ifndef YYSTACK_ALLOC_MAXIMUM 558e64d31b9Smaya# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 559e64d31b9Smaya# endif 560e64d31b9Smaya# if (defined __cplusplus && ! defined EXIT_SUCCESS \ 561e64d31b9Smaya && ! ((defined YYMALLOC || defined malloc) \ 562e64d31b9Smaya && (defined YYFREE || defined free))) 563e64d31b9Smaya# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 564e64d31b9Smaya# ifndef EXIT_SUCCESS 565e64d31b9Smaya# define EXIT_SUCCESS 0 566e64d31b9Smaya# endif 567e64d31b9Smaya# endif 568e64d31b9Smaya# ifndef YYMALLOC 569e64d31b9Smaya# define YYMALLOC malloc 570e64d31b9Smaya# if ! defined malloc && ! defined EXIT_SUCCESS 571e64d31b9Smayavoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 572e64d31b9Smaya# endif 573e64d31b9Smaya# endif 574e64d31b9Smaya# ifndef YYFREE 575e64d31b9Smaya# define YYFREE free 576e64d31b9Smaya# if ! defined free && ! defined EXIT_SUCCESS 577e64d31b9Smayavoid free (void *); /* INFRINGES ON USER NAME SPACE */ 578e64d31b9Smaya# endif 579e64d31b9Smaya# endif 580e64d31b9Smaya# endif 581e64d31b9Smaya#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 582e64d31b9Smaya 583e64d31b9Smaya 584e64d31b9Smaya#if (! defined yyoverflow \ 585e64d31b9Smaya && (! defined __cplusplus \ 586e64d31b9Smaya || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ 587e64d31b9Smaya && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 588e64d31b9Smaya 589e64d31b9Smaya/* A type that is properly aligned for any stack member. */ 590e64d31b9Smayaunion yyalloc 591e64d31b9Smaya{ 592e64d31b9Smaya yytype_int16 yyss_alloc; 593e64d31b9Smaya YYSTYPE yyvs_alloc; 594e64d31b9Smaya YYLTYPE yyls_alloc; 595e64d31b9Smaya}; 596e64d31b9Smaya 597e64d31b9Smaya/* The size of the maximum gap between one aligned stack and the next. */ 598e64d31b9Smaya# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 599e64d31b9Smaya 600e64d31b9Smaya/* The size of an array large to enough to hold all stacks, each with 601e64d31b9Smaya N elements. */ 602e64d31b9Smaya# define YYSTACK_BYTES(N) \ 603e64d31b9Smaya ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ 604e64d31b9Smaya + 2 * YYSTACK_GAP_MAXIMUM) 605e64d31b9Smaya 606e64d31b9Smaya# define YYCOPY_NEEDED 1 607e64d31b9Smaya 608e64d31b9Smaya/* Relocate STACK from its old location to the new one. The 609e64d31b9Smaya local variables YYSIZE and YYSTACKSIZE give the old and new number of 610e64d31b9Smaya elements in the stack, and YYPTR gives the new location of the 611e64d31b9Smaya stack. Advance YYPTR to a properly aligned location for the next 612e64d31b9Smaya stack. */ 613e64d31b9Smaya# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 614e64d31b9Smaya do \ 615e64d31b9Smaya { \ 616e64d31b9Smaya YYSIZE_T yynewbytes; \ 617e64d31b9Smaya YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 618e64d31b9Smaya Stack = &yyptr->Stack_alloc; \ 619e64d31b9Smaya yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 620e64d31b9Smaya yyptr += yynewbytes / sizeof (*yyptr); \ 621e64d31b9Smaya } \ 622e64d31b9Smaya while (0) 623e64d31b9Smaya 624e64d31b9Smaya#endif 625e64d31b9Smaya 626e64d31b9Smaya#if defined YYCOPY_NEEDED && YYCOPY_NEEDED 627e64d31b9Smaya/* Copy COUNT objects from SRC to DST. The source and destination do 628e64d31b9Smaya not overlap. */ 629e64d31b9Smaya# ifndef YYCOPY 630e64d31b9Smaya# if defined __GNUC__ && 1 < __GNUC__ 631e64d31b9Smaya# define YYCOPY(Dst, Src, Count) \ 632e64d31b9Smaya __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 633e64d31b9Smaya# else 634e64d31b9Smaya# define YYCOPY(Dst, Src, Count) \ 635e64d31b9Smaya do \ 636e64d31b9Smaya { \ 637e64d31b9Smaya YYSIZE_T yyi; \ 638e64d31b9Smaya for (yyi = 0; yyi < (Count); yyi++) \ 639e64d31b9Smaya (Dst)[yyi] = (Src)[yyi]; \ 640e64d31b9Smaya } \ 641e64d31b9Smaya while (0) 642e64d31b9Smaya# endif 643e64d31b9Smaya# endif 644e64d31b9Smaya#endif /* !YYCOPY_NEEDED */ 645e64d31b9Smaya 646e64d31b9Smaya/* YYFINAL -- State number of the termination state. */ 647e64d31b9Smaya#define YYFINAL 5 648e64d31b9Smaya/* YYLAST -- Last index in YYTABLE. */ 649e64d31b9Smaya#define YYLAST 353 650e64d31b9Smaya 651e64d31b9Smaya/* YYNTOKENS -- Number of terminals. */ 652e64d31b9Smaya#define YYNTOKENS 116 653e64d31b9Smaya/* YYNNTS -- Number of nonterminals. */ 654e64d31b9Smaya#define YYNNTS 136 655e64d31b9Smaya/* YYNRULES -- Number of rules. */ 656e64d31b9Smaya#define YYNRULES 267 657e64d31b9Smaya/* YYNSTATES -- Number of states. */ 658e64d31b9Smaya#define YYNSTATES 450 659e64d31b9Smaya 660e64d31b9Smaya/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 661e64d31b9Smaya by yylex, with out-of-bounds checking. */ 662e64d31b9Smaya#define YYUNDEFTOK 2 663e64d31b9Smaya#define YYMAXUTOK 361 664e64d31b9Smaya 665e64d31b9Smaya#define YYTRANSLATE(YYX) \ 666e64d31b9Smaya ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 667e64d31b9Smaya 668e64d31b9Smaya/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 669e64d31b9Smaya as returned by yylex, without out-of-bounds checking. */ 670e64d31b9Smayastatic const yytype_uint8 yytranslate[] = 671e64d31b9Smaya{ 672e64d31b9Smaya 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 673e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 674e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 675e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 676e64d31b9Smaya 2, 2, 2, 111, 108, 112, 2, 2, 2, 2, 677e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 107, 678e64d31b9Smaya 2, 113, 2, 2, 2, 2, 2, 2, 2, 2, 679e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 680e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 681e64d31b9Smaya 2, 109, 2, 110, 2, 2, 2, 2, 2, 2, 682e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 683e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 684e64d31b9Smaya 2, 2, 2, 114, 2, 115, 2, 2, 2, 2, 685e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 686e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 687e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 688e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 689e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 690e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 691e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 692e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 693e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 694e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 695e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 696e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 697e64d31b9Smaya 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 698e64d31b9Smaya 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 699e64d31b9Smaya 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 700e64d31b9Smaya 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 701e64d31b9Smaya 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 702e64d31b9Smaya 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 703e64d31b9Smaya 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 704e64d31b9Smaya 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 705e64d31b9Smaya 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 706e64d31b9Smaya 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 707e64d31b9Smaya 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 708e64d31b9Smaya 105, 106 709e64d31b9Smaya}; 710e64d31b9Smaya 711e64d31b9Smaya#if YYDEBUG 712e64d31b9Smaya /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 713e64d31b9Smayastatic const yytype_uint16 yyrline[] = 714e64d31b9Smaya{ 715e64d31b9Smaya 0, 286, 286, 289, 297, 309, 310, 313, 337, 338, 716e64d31b9Smaya 341, 356, 359, 364, 371, 372, 373, 374, 375, 376, 717e64d31b9Smaya 377, 380, 381, 382, 385, 391, 397, 403, 410, 416, 718e64d31b9Smaya 423, 467, 474, 518, 524, 525, 526, 527, 528, 529, 719e64d31b9Smaya 530, 531, 532, 533, 534, 535, 538, 550, 560, 569, 720e64d31b9Smaya 582, 604, 611, 644, 651, 667, 726, 769, 778, 800, 721e64d31b9Smaya 810, 814, 843, 862, 862, 864, 871, 883, 884, 885, 722e64d31b9Smaya 888, 902, 916, 936, 947, 959, 961, 962, 963, 964, 723e64d31b9Smaya 967, 967, 967, 967, 968, 971, 972, 973, 974, 975, 724e64d31b9Smaya 976, 979, 998, 1002, 1008, 1012, 1016, 1020, 1024, 1028, 725e64d31b9Smaya 1033, 1039, 1050, 1052, 1056, 1060, 1064, 1070, 1070, 1072, 726e64d31b9Smaya 1090, 1116, 1119, 1134, 1140, 1146, 1147, 1154, 1160, 1166, 727e64d31b9Smaya 1174, 1180, 1186, 1194, 1200, 1206, 1214, 1215, 1218, 1219, 728e64d31b9Smaya 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1231, 729e64d31b9Smaya 1240, 1244, 1248, 1254, 1263, 1267, 1271, 1280, 1284, 1290, 730e64d31b9Smaya 1296, 1303, 1308, 1316, 1326, 1328, 1336, 1342, 1346, 1350, 731e64d31b9Smaya 1356, 1367, 1376, 1380, 1385, 1389, 1393, 1397, 1403, 1410, 732e64d31b9Smaya 1414, 1420, 1428, 1439, 1446, 1450, 1456, 1466, 1477, 1481, 733e64d31b9Smaya 1499, 1508, 1511, 1517, 1521, 1525, 1531, 1542, 1547, 1552, 734e64d31b9Smaya 1557, 1562, 1567, 1575, 1578, 1583, 1596, 1604, 1615, 1623, 735e64d31b9Smaya 1623, 1625, 1625, 1627, 1637, 1642, 1649, 1659, 1668, 1673, 736e64d31b9Smaya 1680, 1690, 1700, 1712, 1712, 1713, 1713, 1715, 1725, 1733, 737e64d31b9Smaya 1743, 1751, 1759, 1768, 1779, 1783, 1789, 1790, 1791, 1794, 738e64d31b9Smaya 1794, 1797, 1797, 1800, 1807, 1816, 1830, 1839, 1848, 1852, 739e64d31b9Smaya 1861, 1870, 1881, 1888, 1898, 1926, 1935, 1947, 1950, 1959, 740e64d31b9Smaya 1970, 1971, 1972, 1975, 1976, 1977, 1980, 1981, 1984, 1985, 741e64d31b9Smaya 1988, 1989, 1992, 2003, 2014, 2025, 2051, 2052 742e64d31b9Smaya}; 743e64d31b9Smaya#endif 744e64d31b9Smaya 745e64d31b9Smaya#if YYDEBUG || YYERROR_VERBOSE || 1 746e64d31b9Smaya/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 747e64d31b9Smaya First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 748e64d31b9Smayastatic const char *const yytname[] = 749e64d31b9Smaya{ 750e64d31b9Smaya "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS", 751e64d31b9Smaya "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP", 752e64d31b9Smaya "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL", 753e64d31b9Smaya "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", 754e64d31b9Smaya "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", 755e64d31b9Smaya "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", 756e64d31b9Smaya "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL", 757e64d31b9Smaya "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL", 758e64d31b9Smaya "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK", "POINTSIZE", 759e64d31b9Smaya "POSITION", "PRIMARY", "PROGRAM", "PROJECTION", "RANGE", "RESULT", "ROW", 760e64d31b9Smaya "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE_TOK", "SPECULAR", "SPOT", 761e64d31b9Smaya "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R", 762e64d31b9Smaya "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D", 763e64d31b9Smaya "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D", 764e64d31b9Smaya "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D", 765e64d31b9Smaya "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB", 766e64d31b9Smaya "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", 767e64d31b9Smaya "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", 768e64d31b9Smaya "'='", "'{'", "'}'", "$accept", "program", "language", "optionSequence", 769e64d31b9Smaya "option", "statementSequence", "statement", "instruction", 770e64d31b9Smaya "ALU_instruction", "TexInstruction", "ARL_instruction", 771e64d31b9Smaya "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", 772e64d31b9Smaya "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction", 773e64d31b9Smaya "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget", 774e64d31b9Smaya "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg", 775e64d31b9Smaya "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp", 776e64d31b9Smaya "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem", 777e64d31b9Smaya "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset", 778e64d31b9Smaya "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent", 779e64d31b9Smaya "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask", 780e64d31b9Smaya "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem", 781e64d31b9Smaya "vtxAttribNum", "vtxWeightNum", "fragAttribItem", "PARAM_statement", 782e64d31b9Smaya "PARAM_singleStmt", "PARAM_multipleStmt", "optArraySize", 783e64d31b9Smaya "paramSingleInit", "paramMultipleInit", "paramMultInitList", 784e64d31b9Smaya "paramSingleItemDecl", "paramSingleItemUse", "paramMultipleItem", 785e64d31b9Smaya "stateMultipleItem", "stateSingleItem", "stateMaterialItem", 786e64d31b9Smaya "stateMatProperty", "stateLightItem", "stateLightProperty", 787e64d31b9Smaya "stateSpotProperty", "stateLightModelItem", "stateLModProperty", 788e64d31b9Smaya "stateLightProdItem", "stateLProdProperty", "stateTexEnvItem", 789e64d31b9Smaya "stateTexEnvProperty", "ambDiffSpecProperty", "stateLightNumber", 790e64d31b9Smaya "stateTexGenItem", "stateTexGenType", "stateTexGenCoord", "stateFogItem", 791e64d31b9Smaya "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum", 792e64d31b9Smaya "statePointItem", "statePointProperty", "stateMatrixRow", 793e64d31b9Smaya "stateMatrixRows", "optMatrixRows", "stateMatrixItem", 794e64d31b9Smaya "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum", 795e64d31b9Smaya "stateMatrixName", "stateOptModMatNum", "stateModMatNum", 796e64d31b9Smaya "statePaletteMatNum", "stateProgramMatNum", "stateDepthItem", 797e64d31b9Smaya "programSingleItem", "programMultipleItem", "progEnvParams", 798e64d31b9Smaya "progEnvParamNums", "progEnvParam", "progLocalParams", 799e64d31b9Smaya "progLocalParamNums", "progLocalParam", "progEnvParamNum", 800e64d31b9Smaya "progLocalParamNum", "paramConstDecl", "paramConstUse", 801e64d31b9Smaya "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector", 802e64d31b9Smaya "signedFloatConstant", "optionalSign", "TEMP_statement", "@1", 803e64d31b9Smaya "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement", 804e64d31b9Smaya "resultBinding", "resultColBinding", "optResultFaceType", 805e64d31b9Smaya "optResultColorType", "optFaceType", "optColorType", 806e64d31b9Smaya "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", 807e64d31b9Smaya "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", 808e64d31b9Smaya "ALIAS_statement", "string", YY_NULLPTR 809e64d31b9Smaya}; 810e64d31b9Smaya#endif 811e64d31b9Smaya 812e64d31b9Smaya# ifdef YYPRINT 813e64d31b9Smaya/* YYTOKNUM[NUM] -- (External) token number corresponding to the 814e64d31b9Smaya (internal) symbol number NUM (which must be that of a token). */ 815e64d31b9Smayastatic const yytype_uint16 yytoknum[] = 816e64d31b9Smaya{ 817e64d31b9Smaya 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 818e64d31b9Smaya 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 819e64d31b9Smaya 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 820e64d31b9Smaya 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 821e64d31b9Smaya 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 822e64d31b9Smaya 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 823e64d31b9Smaya 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 824e64d31b9Smaya 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 825e64d31b9Smaya 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 826e64d31b9Smaya 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 827e64d31b9Smaya 355, 356, 357, 358, 359, 360, 361, 59, 44, 91, 828e64d31b9Smaya 93, 43, 45, 61, 123, 125 829e64d31b9Smaya}; 830e64d31b9Smaya# endif 831e64d31b9Smaya 832e64d31b9Smaya#define YYPACT_NINF -383 833e64d31b9Smaya 834e64d31b9Smaya#define yypact_value_is_default(Yystate) \ 835e64d31b9Smaya (!!((Yystate) == (-383))) 836e64d31b9Smaya 837e64d31b9Smaya#define YYTABLE_NINF -63 838e64d31b9Smaya 839e64d31b9Smaya#define yytable_value_is_error(Yytable_value) \ 840e64d31b9Smaya 0 841e64d31b9Smaya 842e64d31b9Smaya /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 843e64d31b9Smaya STATE-NUM. */ 844e64d31b9Smayastatic const yytype_int16 yypact[] = 845e64d31b9Smaya{ 846e64d31b9Smaya 117, -383, -383, 30, -383, -383, 25, 78, -383, 177, 847e64d31b9Smaya -383, -383, -36, -383, -21, -19, -1, 1, -383, -383, 848e64d31b9Smaya -33, -33, -33, -33, -33, -33, -17, 106, -33, -33, 849e64d31b9Smaya -383, 52, -383, -383, -383, -383, -383, -383, -383, -383, 850e64d31b9Smaya -383, -383, -383, -383, 54, -383, -383, -383, -383, -383, 851e64d31b9Smaya -383, -383, -383, -383, 14, 51, 58, 65, 44, 14, 852e64d31b9Smaya 86, -383, 72, 67, -383, 77, 119, 120, 123, 124, 853e64d31b9Smaya -383, 125, 131, -383, -383, -383, -16, 127, 128, -383, 854e64d31b9Smaya -383, -383, 134, 145, -15, 178, 115, -26, -383, 134, 855e64d31b9Smaya -14, -383, -383, -383, -383, 136, -383, 106, -383, -383, 856e64d31b9Smaya -383, -383, -383, 106, 106, 106, 106, 106, 106, -383, 857e64d31b9Smaya -383, -383, -383, 31, 80, 64, -10, 137, 106, 32, 858e64d31b9Smaya 138, -383, -383, -383, -383, -383, -383, -383, -383, -383, 859e64d31b9Smaya -16, 106, 150, -383, -383, -383, -383, 139, -383, -383, 860e64d31b9Smaya -383, -383, -383, -383, -383, 202, -383, -383, 227, 49, 861e64d31b9Smaya 228, -383, 146, 147, -16, 148, -383, 149, -383, -383, 862e64d31b9Smaya 73, -383, -383, 136, -383, 143, 151, 152, 189, 5, 863e64d31b9Smaya 153, 28, 154, 92, 100, 2, 155, 136, -383, -383, 864e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, -383, 192, -383, 865e64d31b9Smaya 73, -383, 157, -383, -383, 136, 158, -383, 35, -383, 866e64d31b9Smaya -383, -383, -383, -3, 160, 163, -383, 159, -383, -383, 867e64d31b9Smaya 164, -383, -383, -383, -383, 165, 106, 106, -383, 156, 868e64d31b9Smaya 190, 106, -383, -383, -383, -383, 253, 254, 255, -383, 869e64d31b9Smaya -383, -383, -383, 256, -383, -383, -383, -383, 213, 256, 870e64d31b9Smaya 4, 172, 173, -383, 174, -383, 136, 7, -383, -383, 871e64d31b9Smaya -383, 261, 257, 16, 176, -383, 264, -383, 265, 106, 872e64d31b9Smaya -383, -383, 179, -383, -383, 187, 106, 106, 180, -383, 873e64d31b9Smaya -383, -383, -383, -383, -383, -383, 182, 184, 185, -383, 874e64d31b9Smaya 186, -383, 188, -383, 194, -383, 195, -383, 196, -383, 875e64d31b9Smaya -383, -383, -383, -383, -383, -383, 272, 274, -383, 276, 876e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, 197, -383, -383, 877e64d31b9Smaya -383, -383, 144, 277, -383, 198, -383, 199, 39, -383, 878e64d31b9Smaya -383, 118, -383, 193, 3, 203, -8, 279, -383, 116, 879e64d31b9Smaya 106, -383, -383, 258, 102, 92, -383, 200, -383, 204, 880e64d31b9Smaya -383, 206, -383, -383, -383, -383, -383, -383, -383, 207, 881e64d31b9Smaya -383, -383, 106, -383, 289, 290, -383, 106, -383, -383, 882e64d31b9Smaya -383, 106, 91, 64, 41, -383, -383, -383, -383, -383, 883e64d31b9Smaya -383, -383, -383, 208, -383, -383, -383, -383, -383, -383, 884e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, 885e64d31b9Smaya -383, -383, 287, -383, -383, 13, -383, -383, -383, -383, 886e64d31b9Smaya 50, -383, -383, -383, -383, 212, 214, 218, 219, -383, 887e64d31b9Smaya 263, -8, -383, -383, -383, -383, -383, -383, 106, -383, 888e64d31b9Smaya 106, 190, 253, 254, 221, -383, -383, 217, 215, 226, 889e64d31b9Smaya 211, 230, 229, 231, 277, -383, 106, 116, -383, 253, 890e64d31b9Smaya -383, 254, -47, -383, -383, -383, -383, 277, 232, -383 891e64d31b9Smaya}; 892e64d31b9Smaya 893e64d31b9Smaya /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 894e64d31b9Smaya Performed when YYTABLE does not specify something else to do. Zero 895e64d31b9Smaya means the default is an error. */ 896e64d31b9Smayastatic const yytype_uint16 yydefact[] = 897e64d31b9Smaya{ 898e64d31b9Smaya 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, 899e64d31b9Smaya 266, 267, 0, 231, 0, 0, 0, 0, 229, 2, 900e64d31b9Smaya 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 901e64d31b9Smaya 8, 0, 12, 13, 14, 15, 16, 17, 18, 19, 902e64d31b9Smaya 21, 22, 23, 20, 0, 85, 86, 107, 108, 87, 903e64d31b9Smaya 88, 89, 90, 7, 0, 0, 0, 0, 0, 0, 904e64d31b9Smaya 0, 61, 0, 84, 60, 0, 0, 0, 0, 0, 905e64d31b9Smaya 72, 0, 0, 226, 227, 31, 0, 0, 0, 10, 906e64d31b9Smaya 11, 234, 232, 0, 0, 0, 111, 228, 109, 230, 907e64d31b9Smaya 243, 241, 237, 239, 236, 256, 238, 228, 80, 81, 908e64d31b9Smaya 82, 83, 50, 228, 228, 228, 228, 228, 228, 74, 909e64d31b9Smaya 51, 219, 218, 0, 0, 0, 0, 56, 228, 79, 910e64d31b9Smaya 0, 57, 59, 120, 121, 199, 200, 122, 215, 216, 911e64d31b9Smaya 0, 228, 0, 265, 91, 235, 112, 0, 113, 117, 912e64d31b9Smaya 118, 119, 213, 214, 217, 0, 246, 245, 0, 247, 913e64d31b9Smaya 0, 240, 0, 0, 0, 0, 26, 0, 25, 24, 914e64d31b9Smaya 253, 105, 103, 256, 93, 0, 0, 0, 0, 0, 915e64d31b9Smaya 0, 250, 0, 250, 0, 0, 260, 256, 128, 129, 916e64d31b9Smaya 130, 131, 133, 132, 134, 135, 136, 137, 0, 138, 917e64d31b9Smaya 253, 97, 0, 95, 94, 256, 0, 92, 0, 77, 918e64d31b9Smaya 76, 78, 49, 0, 0, 0, 233, 0, 225, 224, 919e64d31b9Smaya 0, 248, 249, 242, 262, 0, 228, 228, 47, 0, 920e64d31b9Smaya 0, 228, 254, 255, 104, 106, 0, 0, 0, 198, 921e64d31b9Smaya 169, 170, 168, 0, 151, 252, 251, 150, 0, 0, 922e64d31b9Smaya 0, 0, 193, 189, 0, 188, 256, 181, 175, 174, 923e64d31b9Smaya 173, 0, 0, 0, 0, 96, 0, 98, 0, 228, 924e64d31b9Smaya 220, 65, 0, 63, 64, 0, 228, 228, 0, 110, 925e64d31b9Smaya 244, 257, 28, 27, 75, 48, 258, 0, 0, 211, 926e64d31b9Smaya 0, 212, 0, 172, 0, 160, 0, 152, 0, 157, 927e64d31b9Smaya 158, 141, 142, 159, 139, 140, 0, 0, 187, 0, 928e64d31b9Smaya 190, 183, 185, 184, 180, 182, 264, 0, 156, 155, 929e64d31b9Smaya 162, 163, 0, 0, 102, 0, 101, 0, 0, 58, 930e64d31b9Smaya 73, 67, 46, 0, 0, 0, 228, 0, 33, 0, 931e64d31b9Smaya 228, 206, 210, 0, 0, 250, 197, 0, 195, 0, 932e64d31b9Smaya 196, 0, 261, 167, 166, 164, 165, 161, 186, 0, 933e64d31b9Smaya 99, 100, 228, 221, 0, 0, 66, 228, 54, 53, 934e64d31b9Smaya 55, 228, 0, 0, 0, 115, 123, 126, 124, 201, 935e64d31b9Smaya 202, 125, 263, 0, 34, 35, 36, 37, 38, 39, 936e64d31b9Smaya 40, 41, 42, 43, 44, 45, 30, 29, 171, 146, 937e64d31b9Smaya 148, 145, 0, 143, 144, 0, 192, 194, 191, 176, 938e64d31b9Smaya 0, 70, 68, 71, 69, 0, 0, 0, 0, 127, 939e64d31b9Smaya 178, 228, 114, 259, 149, 147, 153, 154, 228, 222, 940e64d31b9Smaya 228, 0, 0, 0, 0, 177, 116, 0, 0, 0, 941e64d31b9Smaya 0, 204, 0, 208, 0, 223, 228, 0, 203, 0, 942e64d31b9Smaya 207, 0, 0, 52, 32, 205, 209, 0, 0, 179 943e64d31b9Smaya}; 944e64d31b9Smaya 945e64d31b9Smaya /* YYPGOTO[NTERM-NUM]. */ 946e64d31b9Smayastatic const yytype_int16 yypgoto[] = 947e64d31b9Smaya{ 948e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, 949e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, -383, -383, -84, 950e64d31b9Smaya -97, -383, -99, -383, -92, 191, -383, -383, -346, -383, 951e64d31b9Smaya -78, -383, -383, -383, -383, -383, -383, -383, -383, 135, 952e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, 259, -383, -383, 953e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, 954e64d31b9Smaya -383, -70, -383, -86, -383, -383, -383, -383, -383, -383, 955e64d31b9Smaya -383, -383, -383, -383, -383, -317, 105, -383, -383, -383, 956e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, -383, -383, -18, 957e64d31b9Smaya -383, -383, -378, -383, -383, -383, -383, -383, -383, 260, 958e64d31b9Smaya -383, -383, -383, -383, -383, -383, -383, -377, -382, 266, 959e64d31b9Smaya -383, -383, -383, -85, -115, -87, -383, -383, -383, -383, 960e64d31b9Smaya 291, -383, 267, -383, -383, -383, -169, 161, -153, -383, 961e64d31b9Smaya -383, -383, -383, -383, -383, 22 962e64d31b9Smaya}; 963e64d31b9Smaya 964e64d31b9Smaya /* YYDEFGOTO[NTERM-NUM]. */ 965e64d31b9Smayastatic const yytype_int16 yydefgoto[] = 966e64d31b9Smaya{ 967e64d31b9Smaya -1, 3, 4, 6, 8, 9, 30, 31, 32, 33, 968e64d31b9Smaya 34, 35, 36, 37, 38, 39, 40, 41, 42, 277, 969e64d31b9Smaya 386, 43, 153, 218, 75, 62, 71, 322, 323, 359, 970e64d31b9Smaya 119, 63, 120, 262, 263, 264, 356, 402, 404, 72, 971e64d31b9Smaya 321, 110, 275, 202, 102, 44, 45, 121, 197, 317, 972e64d31b9Smaya 315, 164, 46, 47, 48, 137, 88, 269, 364, 138, 973e64d31b9Smaya 122, 365, 366, 123, 178, 294, 179, 393, 415, 180, 974e64d31b9Smaya 237, 181, 416, 182, 309, 295, 286, 183, 312, 347, 975e64d31b9Smaya 184, 232, 185, 284, 186, 250, 187, 409, 425, 188, 976e64d31b9Smaya 304, 305, 349, 247, 298, 339, 341, 337, 189, 124, 977e64d31b9Smaya 368, 369, 430, 125, 370, 432, 126, 280, 282, 371, 978e64d31b9Smaya 127, 142, 128, 129, 144, 76, 49, 59, 50, 54, 979e64d31b9Smaya 82, 51, 64, 96, 149, 213, 238, 224, 151, 328, 980e64d31b9Smaya 252, 215, 373, 307, 52, 12 981e64d31b9Smaya}; 982e64d31b9Smaya 983e64d31b9Smaya /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 984e64d31b9Smaya positive, shift that token. If negative, reduce the rule whose 985e64d31b9Smaya number is the opposite. If YYTABLE_NINF, syntax error. */ 986e64d31b9Smayastatic const yytype_int16 yytable[] = 987e64d31b9Smaya{ 988e64d31b9Smaya 145, 139, 143, 198, 240, 152, 156, 111, 112, 159, 989e64d31b9Smaya 225, 405, 155, 146, 157, 158, 154, 394, 154, 190, 990e64d31b9Smaya 261, 154, 113, 113, 253, 147, 358, 191, 248, 289, 991e64d31b9Smaya 5, 145, 60, 7, 230, 290, 114, 291, 289, 205, 992e64d31b9Smaya 192, 433, 257, 193, 290, 431, 114, 115, 301, 302, 993e64d31b9Smaya 194, 310, 204, 234, 362, 235, 442, 115, 447, 446, 994e64d31b9Smaya 160, 231, 445, 399, 195, 363, 61, 236, 161, 448, 995e64d31b9Smaya 311, 53, 249, 292, 428, 293, 219, 55, 417, 56, 996e64d31b9Smaya 116, 116, 70, 117, 293, 73, 74, 196, 118, 303, 997e64d31b9Smaya 443, 162, 167, 300, 168, 148, 70, 57, 118, 58, 998e64d31b9Smaya 169, 10, 11, 73, 74, 163, 118, 170, 171, 172, 999e64d31b9Smaya 211, 173, 81, 174, 165, 90, 91, 212, 273, 235, 1000e64d31b9Smaya 1, 2, 175, 92, 272, 407, 166, 289, 389, 278, 1001e64d31b9Smaya 154, 236, 199, 290, 222, 200, 201, 408, 136, 176, 1002e64d31b9Smaya 177, 223, 390, 259, 318, 93, 94, 352, 241, 411, 1003e64d31b9Smaya 260, 242, 243, 86, 353, 244, 412, 87, 418, 79, 1004e64d31b9Smaya 95, 80, 391, 245, 83, 419, 395, 98, 99, 100, 1005e64d31b9Smaya 101, 84, 145, 293, 392, 325, 10, 11, 85, 324, 1006e64d31b9Smaya 97, 246, 13, 14, 15, 103, 16, 17, 18, 19, 1007e64d31b9Smaya 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 1008e64d31b9Smaya 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 1009e64d31b9Smaya 384, 385, 65, 66, 67, 68, 69, 73, 74, 77, 1010e64d31b9Smaya 78, 343, 344, 345, 346, 208, 209, 104, 105, 354, 1011e64d31b9Smaya 355, 106, 107, 108, 109, 130, 131, 400, 387, 145, 1012e64d31b9Smaya 367, 143, 132, 60, 133, 150, -62, 203, 206, 207, 1013e64d31b9Smaya 210, 214, 226, 229, 216, 217, 220, 221, 254, 274, 1014e64d31b9Smaya 227, 228, 233, 239, 251, 145, 256, 258, 266, 406, 1015e64d31b9Smaya 324, 267, 268, 276, 270, 271, 279, 281, 283, 285, 1016e64d31b9Smaya 287, 296, 297, 299, 306, 313, 308, 314, 316, 319, 1017e64d31b9Smaya 320, 327, 329, 330, 326, 336, 331, 338, 332, 340, 1018e64d31b9Smaya 348, 357, 372, 427, 333, 334, 335, 342, 350, 351, 1019e64d31b9Smaya 396, 361, 401, 403, 397, 388, 398, 399, 413, 414, 1020e64d31b9Smaya 420, 438, 421, 436, 145, 367, 143, 422, 423, 424, 1021e64d31b9Smaya 434, 145, 435, 324, 437, 439, 441, 429, 265, 440, 1022e64d31b9Smaya 444, 426, 449, 134, 288, 410, 360, 140, 0, 324, 1023e64d31b9Smaya 89, 255, 135, 141 1024e64d31b9Smaya}; 1025e64d31b9Smaya 1026e64d31b9Smayastatic const yytype_int16 yycheck[] = 1027e64d31b9Smaya{ 1028e64d31b9Smaya 87, 87, 87, 118, 173, 97, 105, 23, 24, 108, 1029e64d31b9Smaya 163, 357, 104, 27, 106, 107, 103, 334, 105, 29, 1030e64d31b9Smaya 23, 108, 38, 38, 177, 39, 23, 37, 26, 25, 1031e64d31b9Smaya 0, 118, 65, 8, 29, 31, 62, 33, 25, 131, 1032e64d31b9Smaya 50, 423, 195, 53, 31, 422, 62, 73, 41, 42, 1033e64d31b9Smaya 60, 35, 130, 25, 62, 27, 434, 73, 105, 441, 1034e64d31b9Smaya 29, 56, 439, 110, 74, 73, 99, 39, 37, 447, 1035e64d31b9Smaya 54, 107, 70, 69, 420, 71, 154, 98, 395, 98, 1036e64d31b9Smaya 96, 96, 99, 99, 71, 111, 112, 97, 114, 82, 1037e64d31b9Smaya 436, 60, 28, 246, 30, 109, 99, 98, 114, 98, 1038e64d31b9Smaya 36, 98, 99, 111, 112, 74, 114, 43, 44, 45, 1039e64d31b9Smaya 61, 47, 98, 49, 34, 29, 30, 68, 217, 27, 1040e64d31b9Smaya 3, 4, 58, 37, 216, 34, 46, 25, 26, 221, 1041e64d31b9Smaya 217, 39, 100, 31, 61, 103, 104, 46, 23, 75, 1042e64d31b9Smaya 76, 68, 40, 108, 259, 59, 60, 108, 48, 108, 1043e64d31b9Smaya 115, 51, 52, 109, 115, 55, 115, 113, 108, 107, 1044e64d31b9Smaya 74, 107, 60, 63, 113, 115, 335, 100, 101, 102, 1045e64d31b9Smaya 103, 113, 259, 71, 72, 267, 98, 99, 113, 266, 1046e64d31b9Smaya 108, 81, 5, 6, 7, 108, 9, 10, 11, 12, 1047e64d31b9Smaya 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1048e64d31b9Smaya 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 1049e64d31b9Smaya 94, 95, 21, 22, 23, 24, 25, 111, 112, 28, 1050e64d31b9Smaya 29, 77, 78, 79, 80, 23, 24, 108, 108, 111, 1051e64d31b9Smaya 112, 108, 108, 108, 103, 108, 108, 352, 330, 326, 1052e64d31b9Smaya 326, 326, 108, 65, 99, 109, 109, 109, 98, 110, 1053e64d31b9Smaya 23, 23, 109, 64, 108, 108, 108, 108, 66, 103, 1054e64d31b9Smaya 109, 109, 109, 109, 109, 352, 109, 109, 108, 361, 1055e64d31b9Smaya 357, 108, 113, 83, 110, 110, 23, 23, 23, 23, 1056e64d31b9Smaya 67, 109, 109, 109, 23, 109, 29, 23, 23, 110, 1057e64d31b9Smaya 103, 109, 108, 108, 114, 23, 110, 23, 110, 23, 1058e64d31b9Smaya 23, 108, 23, 418, 110, 110, 110, 110, 110, 110, 1059e64d31b9Smaya 110, 108, 23, 23, 110, 57, 110, 110, 110, 32, 1060e64d31b9Smaya 108, 110, 108, 108, 411, 411, 411, 109, 109, 66, 1061e64d31b9Smaya 109, 418, 115, 420, 108, 105, 105, 421, 203, 110, 1062e64d31b9Smaya 437, 411, 110, 84, 239, 363, 324, 87, -1, 436, 1063e64d31b9Smaya 59, 190, 85, 87 1064e64d31b9Smaya}; 1065e64d31b9Smaya 1066e64d31b9Smaya /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 1067e64d31b9Smaya symbol of state STATE-NUM. */ 1068e64d31b9Smayastatic const yytype_uint8 yystos[] = 1069e64d31b9Smaya{ 1070e64d31b9Smaya 0, 3, 4, 117, 118, 0, 119, 8, 120, 121, 1071e64d31b9Smaya 98, 99, 251, 5, 6, 7, 9, 10, 11, 12, 1072e64d31b9Smaya 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1073e64d31b9Smaya 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 1074e64d31b9Smaya 132, 133, 134, 137, 161, 162, 168, 169, 170, 232, 1075e64d31b9Smaya 234, 237, 250, 107, 235, 98, 98, 98, 98, 233, 1076e64d31b9Smaya 65, 99, 141, 147, 238, 141, 141, 141, 141, 141, 1077e64d31b9Smaya 99, 142, 155, 111, 112, 140, 231, 141, 141, 107, 1078e64d31b9Smaya 107, 98, 236, 113, 113, 113, 109, 113, 172, 236, 1079e64d31b9Smaya 29, 30, 37, 59, 60, 74, 239, 108, 100, 101, 1080e64d31b9Smaya 102, 103, 160, 108, 108, 108, 108, 108, 108, 103, 1081e64d31b9Smaya 157, 23, 24, 38, 62, 73, 96, 99, 114, 146, 1082e64d31b9Smaya 148, 163, 176, 179, 215, 219, 222, 226, 228, 229, 1083e64d31b9Smaya 108, 108, 108, 99, 163, 238, 23, 171, 175, 179, 1084e64d31b9Smaya 215, 225, 227, 229, 230, 231, 27, 39, 109, 240, 1085e64d31b9Smaya 109, 244, 140, 138, 231, 140, 138, 140, 140, 138, 1086e64d31b9Smaya 29, 37, 60, 74, 167, 34, 46, 28, 30, 36, 1087e64d31b9Smaya 43, 44, 45, 47, 49, 58, 75, 76, 180, 182, 1088e64d31b9Smaya 185, 187, 189, 193, 196, 198, 200, 202, 205, 214, 1089e64d31b9Smaya 29, 37, 50, 53, 60, 74, 97, 164, 230, 100, 1090e64d31b9Smaya 103, 104, 159, 109, 146, 140, 98, 110, 23, 24, 1091e64d31b9Smaya 23, 61, 68, 241, 23, 247, 108, 108, 139, 146, 1092e64d31b9Smaya 108, 108, 61, 68, 243, 244, 109, 109, 109, 64, 1093e64d31b9Smaya 29, 56, 197, 109, 25, 27, 39, 186, 242, 109, 1094e64d31b9Smaya 242, 48, 51, 52, 55, 63, 81, 209, 26, 70, 1095e64d31b9Smaya 201, 109, 246, 244, 66, 243, 109, 244, 109, 108, 1096e64d31b9Smaya 115, 23, 149, 150, 151, 155, 108, 108, 113, 173, 1097e64d31b9Smaya 110, 110, 140, 138, 103, 158, 83, 135, 140, 23, 1098e64d31b9Smaya 223, 23, 224, 23, 199, 23, 192, 67, 192, 25, 1099e64d31b9Smaya 31, 33, 69, 71, 181, 191, 109, 109, 210, 109, 1100e64d31b9Smaya 244, 41, 42, 82, 206, 207, 23, 249, 29, 190, 1101e64d31b9Smaya 35, 54, 194, 109, 23, 166, 23, 165, 230, 110, 1102e64d31b9Smaya 103, 156, 143, 144, 231, 140, 114, 109, 245, 108, 1103e64d31b9Smaya 108, 110, 110, 110, 110, 110, 23, 213, 23, 211, 1104e64d31b9Smaya 23, 212, 110, 77, 78, 79, 80, 195, 23, 208, 1105e64d31b9Smaya 110, 110, 108, 115, 111, 112, 152, 108, 23, 145, 1106e64d31b9Smaya 251, 108, 62, 73, 174, 177, 178, 179, 216, 217, 1107e64d31b9Smaya 220, 225, 23, 248, 84, 85, 86, 87, 88, 89, 1108e64d31b9Smaya 90, 91, 92, 93, 94, 95, 136, 140, 57, 26, 1109e64d31b9Smaya 40, 60, 72, 183, 191, 242, 110, 110, 110, 110, 1110e64d31b9Smaya 230, 23, 153, 23, 154, 144, 140, 34, 46, 203, 1111e64d31b9Smaya 205, 108, 115, 110, 32, 184, 188, 191, 108, 115, 1112e64d31b9Smaya 108, 108, 109, 109, 66, 204, 177, 230, 144, 135, 1113e64d31b9Smaya 218, 223, 221, 224, 109, 115, 108, 108, 110, 105, 1114e64d31b9Smaya 110, 105, 208, 144, 136, 223, 224, 105, 208, 110 1115e64d31b9Smaya}; 1116e64d31b9Smaya 1117e64d31b9Smaya /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 1118e64d31b9Smayastatic const yytype_uint8 yyr1[] = 1119e64d31b9Smaya{ 1120e64d31b9Smaya 0, 116, 117, 118, 118, 119, 119, 120, 121, 121, 1121e64d31b9Smaya 122, 122, 123, 123, 124, 124, 124, 124, 124, 124, 1122e64d31b9Smaya 124, 125, 125, 125, 126, 127, 128, 129, 130, 131, 1123e64d31b9Smaya 132, 133, 134, 135, 136, 136, 136, 136, 136, 136, 1124e64d31b9Smaya 136, 136, 136, 136, 136, 136, 137, 138, 139, 140, 1125e64d31b9Smaya 141, 142, 143, 144, 145, 145, 146, 146, 146, 146, 1126e64d31b9Smaya 147, 147, 148, 149, 149, 150, 151, 152, 152, 152, 1127e64d31b9Smaya 153, 154, 155, 156, 157, 158, 159, 159, 159, 159, 1128e64d31b9Smaya 160, 160, 160, 160, 160, 161, 161, 161, 161, 161, 1129e64d31b9Smaya 161, 162, 163, 163, 164, 164, 164, 164, 164, 164, 1130e64d31b9Smaya 164, 165, 166, 167, 167, 167, 167, 168, 168, 169, 1131e64d31b9Smaya 170, 171, 171, 172, 173, 174, 174, 175, 175, 175, 1132e64d31b9Smaya 176, 176, 176, 177, 177, 177, 178, 178, 179, 179, 1133e64d31b9Smaya 179, 179, 179, 179, 179, 179, 179, 179, 179, 180, 1134e64d31b9Smaya 181, 181, 181, 182, 183, 183, 183, 183, 183, 184, 1135e64d31b9Smaya 185, 186, 186, 187, 188, 189, 190, 191, 191, 191, 1136e64d31b9Smaya 192, 193, 194, 194, 195, 195, 195, 195, 196, 197, 1137e64d31b9Smaya 197, 198, 199, 200, 201, 201, 202, 203, 204, 204, 1138e64d31b9Smaya 205, 206, 206, 207, 207, 207, 208, 209, 209, 209, 1139e64d31b9Smaya 209, 209, 209, 210, 210, 211, 212, 213, 214, 215, 1140e64d31b9Smaya 215, 216, 216, 217, 218, 218, 219, 220, 221, 221, 1141e64d31b9Smaya 222, 223, 224, 225, 225, 226, 226, 227, 228, 228, 1142e64d31b9Smaya 229, 229, 229, 229, 230, 230, 231, 231, 231, 233, 1143e64d31b9Smaya 232, 235, 234, 236, 236, 237, 238, 238, 238, 238, 1144e64d31b9Smaya 238, 238, 239, 240, 240, 240, 240, 241, 241, 241, 1145e64d31b9Smaya 242, 242, 242, 243, 243, 243, 244, 244, 245, 245, 1146e64d31b9Smaya 246, 246, 247, 248, 249, 250, 251, 251 1147e64d31b9Smaya}; 1148e64d31b9Smaya 1149e64d31b9Smaya /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ 1150e64d31b9Smayastatic const yytype_uint8 yyr2[] = 1151e64d31b9Smaya{ 1152e64d31b9Smaya 0, 2, 4, 1, 1, 2, 0, 3, 2, 0, 1153e64d31b9Smaya 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1154e64d31b9Smaya 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, 1155e64d31b9Smaya 8, 2, 12, 2, 1, 1, 1, 1, 1, 1, 1156e64d31b9Smaya 1, 1, 1, 1, 1, 1, 6, 2, 2, 3, 1157e64d31b9Smaya 2, 2, 7, 2, 1, 1, 1, 1, 4, 1, 1158e64d31b9Smaya 1, 1, 1, 1, 1, 1, 3, 0, 2, 2, 1159e64d31b9Smaya 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1160e64d31b9Smaya 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1161e64d31b9Smaya 1, 4, 2, 2, 1, 1, 2, 1, 2, 4, 1162e64d31b9Smaya 4, 1, 1, 1, 2, 1, 2, 1, 1, 3, 1163e64d31b9Smaya 6, 0, 1, 2, 4, 1, 3, 1, 1, 1, 1164e64d31b9Smaya 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1165e64d31b9Smaya 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1166e64d31b9Smaya 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1167e64d31b9Smaya 2, 1, 2, 6, 1, 3, 1, 1, 1, 1, 1168e64d31b9Smaya 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1169e64d31b9Smaya 1, 5, 1, 2, 1, 1, 5, 2, 0, 6, 1170e64d31b9Smaya 3, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1171e64d31b9Smaya 2, 4, 4, 0, 3, 1, 1, 1, 2, 1, 1172e64d31b9Smaya 1, 1, 1, 5, 1, 3, 5, 5, 1, 3, 1173e64d31b9Smaya 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1174e64d31b9Smaya 3, 5, 7, 9, 2, 2, 1, 1, 0, 0, 1175e64d31b9Smaya 3, 0, 3, 3, 1, 4, 2, 2, 2, 2, 1176e64d31b9Smaya 3, 2, 3, 0, 3, 1, 1, 0, 1, 1, 1177e64d31b9Smaya 0, 1, 1, 0, 1, 1, 0, 3, 0, 3, 1178e64d31b9Smaya 0, 3, 1, 1, 1, 4, 1, 1 1179e64d31b9Smaya}; 1180e64d31b9Smaya 1181e64d31b9Smaya 1182e64d31b9Smaya#define yyerrok (yyerrstatus = 0) 1183e64d31b9Smaya#define yyclearin (yychar = YYEMPTY) 1184e64d31b9Smaya#define YYEMPTY (-2) 1185e64d31b9Smaya#define YYEOF 0 1186e64d31b9Smaya 1187e64d31b9Smaya#define YYACCEPT goto yyacceptlab 1188e64d31b9Smaya#define YYABORT goto yyabortlab 1189e64d31b9Smaya#define YYERROR goto yyerrorlab 1190e64d31b9Smaya 1191e64d31b9Smaya 1192e64d31b9Smaya#define YYRECOVERING() (!!yyerrstatus) 1193e64d31b9Smaya 1194e64d31b9Smaya#define YYBACKUP(Token, Value) \ 1195e64d31b9Smayado \ 1196e64d31b9Smaya if (yychar == YYEMPTY) \ 1197e64d31b9Smaya { \ 1198e64d31b9Smaya yychar = (Token); \ 1199e64d31b9Smaya yylval = (Value); \ 1200e64d31b9Smaya YYPOPSTACK (yylen); \ 1201e64d31b9Smaya yystate = *yyssp; \ 1202e64d31b9Smaya goto yybackup; \ 1203e64d31b9Smaya } \ 1204e64d31b9Smaya else \ 1205e64d31b9Smaya { \ 1206e64d31b9Smaya yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \ 1207e64d31b9Smaya YYERROR; \ 1208e64d31b9Smaya } \ 1209e64d31b9Smayawhile (0) 1210e64d31b9Smaya 1211e64d31b9Smaya/* Error token number */ 1212e64d31b9Smaya#define YYTERROR 1 1213e64d31b9Smaya#define YYERRCODE 256 1214e64d31b9Smaya 1215e64d31b9Smaya 1216e64d31b9Smaya/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 1217e64d31b9Smaya If N is 0, then set CURRENT to the empty location which ends 1218e64d31b9Smaya the previous symbol: RHS[0] (always defined). */ 1219e64d31b9Smaya 1220e64d31b9Smaya#ifndef YYLLOC_DEFAULT 1221e64d31b9Smaya# define YYLLOC_DEFAULT(Current, Rhs, N) \ 1222e64d31b9Smaya do \ 1223e64d31b9Smaya if (N) \ 1224e64d31b9Smaya { \ 1225e64d31b9Smaya (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 1226e64d31b9Smaya (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 1227e64d31b9Smaya (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 1228e64d31b9Smaya (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 1229e64d31b9Smaya } \ 1230e64d31b9Smaya else \ 1231e64d31b9Smaya { \ 1232e64d31b9Smaya (Current).first_line = (Current).last_line = \ 1233e64d31b9Smaya YYRHSLOC (Rhs, 0).last_line; \ 1234e64d31b9Smaya (Current).first_column = (Current).last_column = \ 1235e64d31b9Smaya YYRHSLOC (Rhs, 0).last_column; \ 1236e64d31b9Smaya } \ 1237e64d31b9Smaya while (0) 1238e64d31b9Smaya#endif 1239e64d31b9Smaya 1240e64d31b9Smaya#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 1241e64d31b9Smaya 1242e64d31b9Smaya 1243e64d31b9Smaya/* Enable debugging if requested. */ 1244e64d31b9Smaya#if YYDEBUG 1245e64d31b9Smaya 1246e64d31b9Smaya# ifndef YYFPRINTF 1247e64d31b9Smaya# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 1248e64d31b9Smaya# define YYFPRINTF fprintf 1249e64d31b9Smaya# endif 1250e64d31b9Smaya 1251e64d31b9Smaya# define YYDPRINTF(Args) \ 1252e64d31b9Smayado { \ 1253e64d31b9Smaya if (yydebug) \ 1254e64d31b9Smaya YYFPRINTF Args; \ 1255e64d31b9Smaya} while (0) 1256e64d31b9Smaya 1257e64d31b9Smaya 1258e64d31b9Smaya/* YY_LOCATION_PRINT -- Print the location on the stream. 1259e64d31b9Smaya This macro was not mandated originally: define only if we know 1260e64d31b9Smaya we won't break user code: when these are the locations we know. */ 1261e64d31b9Smaya 1262e64d31b9Smaya#ifndef YY_LOCATION_PRINT 1263e64d31b9Smaya# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 1264e64d31b9Smaya 1265e64d31b9Smaya/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ 1266e64d31b9Smaya 1267e64d31b9SmayaYY_ATTRIBUTE_UNUSED 1268e64d31b9Smayastatic int 1269e64d31b9Smayayy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) 1270e64d31b9Smaya{ 1271e64d31b9Smaya int res = 0; 1272e64d31b9Smaya int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; 1273e64d31b9Smaya if (0 <= yylocp->first_line) 1274e64d31b9Smaya { 1275e64d31b9Smaya res += YYFPRINTF (yyo, "%d", yylocp->first_line); 1276e64d31b9Smaya if (0 <= yylocp->first_column) 1277e64d31b9Smaya res += YYFPRINTF (yyo, ".%d", yylocp->first_column); 1278e64d31b9Smaya } 1279e64d31b9Smaya if (0 <= yylocp->last_line) 1280e64d31b9Smaya { 1281e64d31b9Smaya if (yylocp->first_line < yylocp->last_line) 1282e64d31b9Smaya { 1283e64d31b9Smaya res += YYFPRINTF (yyo, "-%d", yylocp->last_line); 1284e64d31b9Smaya if (0 <= end_col) 1285e64d31b9Smaya res += YYFPRINTF (yyo, ".%d", end_col); 1286e64d31b9Smaya } 1287e64d31b9Smaya else if (0 <= end_col && yylocp->first_column < end_col) 1288e64d31b9Smaya res += YYFPRINTF (yyo, "-%d", end_col); 1289e64d31b9Smaya } 1290e64d31b9Smaya return res; 1291e64d31b9Smaya } 1292e64d31b9Smaya 1293e64d31b9Smaya# define YY_LOCATION_PRINT(File, Loc) \ 1294e64d31b9Smaya yy_location_print_ (File, &(Loc)) 1295e64d31b9Smaya 1296e64d31b9Smaya# else 1297e64d31b9Smaya# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 1298e64d31b9Smaya# endif 1299e64d31b9Smaya#endif 1300e64d31b9Smaya 1301e64d31b9Smaya 1302e64d31b9Smaya# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 1303e64d31b9Smayado { \ 1304e64d31b9Smaya if (yydebug) \ 1305e64d31b9Smaya { \ 1306e64d31b9Smaya YYFPRINTF (stderr, "%s ", Title); \ 1307e64d31b9Smaya yy_symbol_print (stderr, \ 1308e64d31b9Smaya Type, Value, Location, state); \ 1309e64d31b9Smaya YYFPRINTF (stderr, "\n"); \ 1310e64d31b9Smaya } \ 1311e64d31b9Smaya} while (0) 1312e64d31b9Smaya 1313e64d31b9Smaya 1314e64d31b9Smaya/*-----------------------------------. 1315e64d31b9Smaya| Print this symbol's value on YYO. | 1316e64d31b9Smaya`-----------------------------------*/ 1317e64d31b9Smaya 1318e64d31b9Smayastatic void 1319e64d31b9Smayayy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct asm_parser_state *state) 1320e64d31b9Smaya{ 1321e64d31b9Smaya FILE *yyoutput = yyo; 1322e64d31b9Smaya YYUSE (yyoutput); 1323e64d31b9Smaya YYUSE (yylocationp); 1324e64d31b9Smaya YYUSE (state); 1325e64d31b9Smaya if (!yyvaluep) 1326e64d31b9Smaya return; 1327e64d31b9Smaya# ifdef YYPRINT 1328e64d31b9Smaya if (yytype < YYNTOKENS) 1329e64d31b9Smaya YYPRINT (yyo, yytoknum[yytype], *yyvaluep); 1330e64d31b9Smaya# endif 1331e64d31b9Smaya YYUSE (yytype); 1332e64d31b9Smaya} 1333e64d31b9Smaya 1334e64d31b9Smaya 1335e64d31b9Smaya/*---------------------------. 1336e64d31b9Smaya| Print this symbol on YYO. | 1337e64d31b9Smaya`---------------------------*/ 1338e64d31b9Smaya 1339e64d31b9Smayastatic void 1340e64d31b9Smayayy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct asm_parser_state *state) 1341e64d31b9Smaya{ 1342e64d31b9Smaya YYFPRINTF (yyo, "%s %s (", 1343e64d31b9Smaya yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 1344e64d31b9Smaya 1345e64d31b9Smaya YY_LOCATION_PRINT (yyo, *yylocationp); 1346e64d31b9Smaya YYFPRINTF (yyo, ": "); 1347e64d31b9Smaya yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, state); 1348e64d31b9Smaya YYFPRINTF (yyo, ")"); 1349e64d31b9Smaya} 1350e64d31b9Smaya 1351e64d31b9Smaya/*------------------------------------------------------------------. 1352e64d31b9Smaya| yy_stack_print -- Print the state stack from its BOTTOM up to its | 1353e64d31b9Smaya| TOP (included). | 1354e64d31b9Smaya`------------------------------------------------------------------*/ 1355e64d31b9Smaya 1356e64d31b9Smayastatic void 1357e64d31b9Smayayy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 1358e64d31b9Smaya{ 1359e64d31b9Smaya YYFPRINTF (stderr, "Stack now"); 1360e64d31b9Smaya for (; yybottom <= yytop; yybottom++) 1361e64d31b9Smaya { 1362e64d31b9Smaya int yybot = *yybottom; 1363e64d31b9Smaya YYFPRINTF (stderr, " %d", yybot); 1364e64d31b9Smaya } 1365e64d31b9Smaya YYFPRINTF (stderr, "\n"); 1366e64d31b9Smaya} 1367e64d31b9Smaya 1368e64d31b9Smaya# define YY_STACK_PRINT(Bottom, Top) \ 1369e64d31b9Smayado { \ 1370e64d31b9Smaya if (yydebug) \ 1371e64d31b9Smaya yy_stack_print ((Bottom), (Top)); \ 1372e64d31b9Smaya} while (0) 1373e64d31b9Smaya 1374e64d31b9Smaya 1375e64d31b9Smaya/*------------------------------------------------. 1376e64d31b9Smaya| Report that the YYRULE is going to be reduced. | 1377e64d31b9Smaya`------------------------------------------------*/ 1378e64d31b9Smaya 1379e64d31b9Smayastatic void 1380e64d31b9Smayayy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, struct asm_parser_state *state) 1381e64d31b9Smaya{ 1382e64d31b9Smaya unsigned long yylno = yyrline[yyrule]; 1383e64d31b9Smaya int yynrhs = yyr2[yyrule]; 1384e64d31b9Smaya int yyi; 1385e64d31b9Smaya YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 1386e64d31b9Smaya yyrule - 1, yylno); 1387e64d31b9Smaya /* The symbols being reduced. */ 1388e64d31b9Smaya for (yyi = 0; yyi < yynrhs; yyi++) 1389e64d31b9Smaya { 1390e64d31b9Smaya YYFPRINTF (stderr, " $%d = ", yyi + 1); 1391e64d31b9Smaya yy_symbol_print (stderr, 1392e64d31b9Smaya yystos[yyssp[yyi + 1 - yynrhs]], 1393e64d31b9Smaya &(yyvsp[(yyi + 1) - (yynrhs)]) 1394e64d31b9Smaya , &(yylsp[(yyi + 1) - (yynrhs)]) , state); 1395e64d31b9Smaya YYFPRINTF (stderr, "\n"); 1396e64d31b9Smaya } 1397e64d31b9Smaya} 1398e64d31b9Smaya 1399e64d31b9Smaya# define YY_REDUCE_PRINT(Rule) \ 1400e64d31b9Smayado { \ 1401e64d31b9Smaya if (yydebug) \ 1402e64d31b9Smaya yy_reduce_print (yyssp, yyvsp, yylsp, Rule, state); \ 1403e64d31b9Smaya} while (0) 1404e64d31b9Smaya 1405e64d31b9Smaya/* Nonzero means print parse trace. It is left uninitialized so that 1406e64d31b9Smaya multiple parsers can coexist. */ 1407e64d31b9Smayaint yydebug; 1408e64d31b9Smaya#else /* !YYDEBUG */ 1409e64d31b9Smaya# define YYDPRINTF(Args) 1410e64d31b9Smaya# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 1411e64d31b9Smaya# define YY_STACK_PRINT(Bottom, Top) 1412e64d31b9Smaya# define YY_REDUCE_PRINT(Rule) 1413e64d31b9Smaya#endif /* !YYDEBUG */ 1414e64d31b9Smaya 1415e64d31b9Smaya 1416e64d31b9Smaya/* YYINITDEPTH -- initial size of the parser's stacks. */ 1417e64d31b9Smaya#ifndef YYINITDEPTH 1418e64d31b9Smaya# define YYINITDEPTH 200 1419e64d31b9Smaya#endif 1420e64d31b9Smaya 1421e64d31b9Smaya/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 1422e64d31b9Smaya if the built-in stack extension method is used). 1423e64d31b9Smaya 1424e64d31b9Smaya Do not make this value too large; the results are undefined if 1425e64d31b9Smaya YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 1426e64d31b9Smaya evaluated with infinite-precision integer arithmetic. */ 1427e64d31b9Smaya 1428e64d31b9Smaya#ifndef YYMAXDEPTH 1429e64d31b9Smaya# define YYMAXDEPTH 10000 1430e64d31b9Smaya#endif 1431e64d31b9Smaya 1432e64d31b9Smaya 1433e64d31b9Smaya#if YYERROR_VERBOSE 1434e64d31b9Smaya 1435e64d31b9Smaya# ifndef yystrlen 1436e64d31b9Smaya# if defined __GLIBC__ && defined _STRING_H 1437e64d31b9Smaya# define yystrlen strlen 1438e64d31b9Smaya# else 1439e64d31b9Smaya/* Return the length of YYSTR. */ 1440e64d31b9Smayastatic YYSIZE_T 1441e64d31b9Smayayystrlen (const char *yystr) 1442e64d31b9Smaya{ 1443e64d31b9Smaya YYSIZE_T yylen; 1444e64d31b9Smaya for (yylen = 0; yystr[yylen]; yylen++) 1445e64d31b9Smaya continue; 1446e64d31b9Smaya return yylen; 1447e64d31b9Smaya} 1448e64d31b9Smaya# endif 1449e64d31b9Smaya# endif 1450e64d31b9Smaya 1451e64d31b9Smaya# ifndef yystpcpy 1452e64d31b9Smaya# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1453e64d31b9Smaya# define yystpcpy stpcpy 1454e64d31b9Smaya# else 1455e64d31b9Smaya/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 1456e64d31b9Smaya YYDEST. */ 1457e64d31b9Smayastatic char * 1458e64d31b9Smayayystpcpy (char *yydest, const char *yysrc) 1459e64d31b9Smaya{ 1460e64d31b9Smaya char *yyd = yydest; 1461e64d31b9Smaya const char *yys = yysrc; 1462e64d31b9Smaya 1463e64d31b9Smaya while ((*yyd++ = *yys++) != '\0') 1464e64d31b9Smaya continue; 1465e64d31b9Smaya 1466e64d31b9Smaya return yyd - 1; 1467e64d31b9Smaya} 1468e64d31b9Smaya# endif 1469e64d31b9Smaya# endif 1470e64d31b9Smaya 1471e64d31b9Smaya# ifndef yytnamerr 1472e64d31b9Smaya/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1473e64d31b9Smaya quotes and backslashes, so that it's suitable for yyerror. The 1474e64d31b9Smaya heuristic is that double-quoting is unnecessary unless the string 1475e64d31b9Smaya contains an apostrophe, a comma, or backslash (other than 1476e64d31b9Smaya backslash-backslash). YYSTR is taken from yytname. If YYRES is 1477e64d31b9Smaya null, do not copy; instead, return the length of what the result 1478e64d31b9Smaya would have been. */ 1479e64d31b9Smayastatic YYSIZE_T 1480e64d31b9Smayayytnamerr (char *yyres, const char *yystr) 1481e64d31b9Smaya{ 1482e64d31b9Smaya if (*yystr == '"') 1483e64d31b9Smaya { 1484e64d31b9Smaya YYSIZE_T yyn = 0; 1485e64d31b9Smaya char const *yyp = yystr; 1486e64d31b9Smaya 1487e64d31b9Smaya for (;;) 1488e64d31b9Smaya switch (*++yyp) 1489e64d31b9Smaya { 1490e64d31b9Smaya case '\'': 1491e64d31b9Smaya case ',': 1492e64d31b9Smaya goto do_not_strip_quotes; 1493e64d31b9Smaya 1494e64d31b9Smaya case '\\': 1495e64d31b9Smaya if (*++yyp != '\\') 1496e64d31b9Smaya goto do_not_strip_quotes; 1497e64d31b9Smaya /* Fall through. */ 1498e64d31b9Smaya default: 1499e64d31b9Smaya if (yyres) 1500e64d31b9Smaya yyres[yyn] = *yyp; 1501e64d31b9Smaya yyn++; 1502e64d31b9Smaya break; 1503e64d31b9Smaya 1504e64d31b9Smaya case '"': 1505e64d31b9Smaya if (yyres) 1506e64d31b9Smaya yyres[yyn] = '\0'; 1507e64d31b9Smaya return yyn; 1508e64d31b9Smaya } 1509e64d31b9Smaya do_not_strip_quotes: ; 1510e64d31b9Smaya } 1511e64d31b9Smaya 1512e64d31b9Smaya if (! yyres) 1513e64d31b9Smaya return yystrlen (yystr); 1514e64d31b9Smaya 1515e64d31b9Smaya return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); 1516e64d31b9Smaya} 1517e64d31b9Smaya# endif 1518e64d31b9Smaya 1519e64d31b9Smaya/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 1520e64d31b9Smaya about the unexpected token YYTOKEN for the state stack whose top is 1521e64d31b9Smaya YYSSP. 1522e64d31b9Smaya 1523e64d31b9Smaya Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 1524e64d31b9Smaya not large enough to hold the message. In that case, also set 1525e64d31b9Smaya *YYMSG_ALLOC to the required number of bytes. Return 2 if the 1526e64d31b9Smaya required number of bytes is too large to store. */ 1527e64d31b9Smayastatic int 1528e64d31b9Smayayysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 1529e64d31b9Smaya yytype_int16 *yyssp, int yytoken) 1530e64d31b9Smaya{ 1531e64d31b9Smaya YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 1532e64d31b9Smaya YYSIZE_T yysize = yysize0; 1533e64d31b9Smaya enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1534e64d31b9Smaya /* Internationalized format string. */ 1535e64d31b9Smaya const char *yyformat = YY_NULLPTR; 1536e64d31b9Smaya /* Arguments of yyformat. */ 1537e64d31b9Smaya char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1538e64d31b9Smaya /* Number of reported tokens (one for the "unexpected", one per 1539e64d31b9Smaya "expected"). */ 1540e64d31b9Smaya int yycount = 0; 1541e64d31b9Smaya 1542e64d31b9Smaya /* There are many possibilities here to consider: 1543e64d31b9Smaya - If this state is a consistent state with a default action, then 1544e64d31b9Smaya the only way this function was invoked is if the default action 1545e64d31b9Smaya is an error action. In that case, don't check for expected 1546e64d31b9Smaya tokens because there are none. 1547e64d31b9Smaya - The only way there can be no lookahead present (in yychar) is if 1548e64d31b9Smaya this state is a consistent state with a default action. Thus, 1549e64d31b9Smaya detecting the absence of a lookahead is sufficient to determine 1550e64d31b9Smaya that there is no unexpected or expected token to report. In that 1551e64d31b9Smaya case, just report a simple "syntax error". 1552e64d31b9Smaya - Don't assume there isn't a lookahead just because this state is a 1553e64d31b9Smaya consistent state with a default action. There might have been a 1554e64d31b9Smaya previous inconsistent state, consistent state with a non-default 1555e64d31b9Smaya action, or user semantic action that manipulated yychar. 1556e64d31b9Smaya - Of course, the expected token list depends on states to have 1557e64d31b9Smaya correct lookahead information, and it depends on the parser not 1558e64d31b9Smaya to perform extra reductions after fetching a lookahead from the 1559e64d31b9Smaya scanner and before detecting a syntax error. Thus, state merging 1560e64d31b9Smaya (from LALR or IELR) and default reductions corrupt the expected 1561e64d31b9Smaya token list. However, the list is correct for canonical LR with 1562e64d31b9Smaya one exception: it will still contain any token that will not be 1563e64d31b9Smaya accepted due to an error action in a later state. 1564e64d31b9Smaya */ 1565e64d31b9Smaya if (yytoken != YYEMPTY) 1566e64d31b9Smaya { 1567e64d31b9Smaya int yyn = yypact[*yyssp]; 1568e64d31b9Smaya yyarg[yycount++] = yytname[yytoken]; 1569e64d31b9Smaya if (!yypact_value_is_default (yyn)) 1570e64d31b9Smaya { 1571e64d31b9Smaya /* Start YYX at -YYN if negative to avoid negative indexes in 1572e64d31b9Smaya YYCHECK. In other words, skip the first -YYN actions for 1573e64d31b9Smaya this state because they are default actions. */ 1574e64d31b9Smaya int yyxbegin = yyn < 0 ? -yyn : 0; 1575e64d31b9Smaya /* Stay within bounds of both yycheck and yytname. */ 1576e64d31b9Smaya int yychecklim = YYLAST - yyn + 1; 1577e64d31b9Smaya int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1578e64d31b9Smaya int yyx; 1579e64d31b9Smaya 1580e64d31b9Smaya for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1581e64d31b9Smaya if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 1582e64d31b9Smaya && !yytable_value_is_error (yytable[yyx + yyn])) 1583e64d31b9Smaya { 1584e64d31b9Smaya if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1585e64d31b9Smaya { 1586e64d31b9Smaya yycount = 1; 1587e64d31b9Smaya yysize = yysize0; 1588e64d31b9Smaya break; 1589e64d31b9Smaya } 1590e64d31b9Smaya yyarg[yycount++] = yytname[yyx]; 1591e64d31b9Smaya { 1592e64d31b9Smaya YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 1593e64d31b9Smaya if (! (yysize <= yysize1 1594e64d31b9Smaya && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1595e64d31b9Smaya return 2; 1596e64d31b9Smaya yysize = yysize1; 1597e64d31b9Smaya } 1598e64d31b9Smaya } 1599e64d31b9Smaya } 1600e64d31b9Smaya } 1601e64d31b9Smaya 1602e64d31b9Smaya switch (yycount) 1603e64d31b9Smaya { 1604e64d31b9Smaya# define YYCASE_(N, S) \ 1605e64d31b9Smaya case N: \ 1606e64d31b9Smaya yyformat = S; \ 1607e64d31b9Smaya break 1608e64d31b9Smaya default: /* Avoid compiler warnings. */ 1609e64d31b9Smaya YYCASE_(0, YY_("syntax error")); 1610e64d31b9Smaya YYCASE_(1, YY_("syntax error, unexpected %s")); 1611e64d31b9Smaya YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1612e64d31b9Smaya YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1613e64d31b9Smaya YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1614e64d31b9Smaya YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1615e64d31b9Smaya# undef YYCASE_ 1616e64d31b9Smaya } 1617e64d31b9Smaya 1618e64d31b9Smaya { 1619e64d31b9Smaya YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 1620e64d31b9Smaya if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1621e64d31b9Smaya return 2; 1622e64d31b9Smaya yysize = yysize1; 1623e64d31b9Smaya } 1624e64d31b9Smaya 1625e64d31b9Smaya if (*yymsg_alloc < yysize) 1626e64d31b9Smaya { 1627e64d31b9Smaya *yymsg_alloc = 2 * yysize; 1628e64d31b9Smaya if (! (yysize <= *yymsg_alloc 1629e64d31b9Smaya && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1630e64d31b9Smaya *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1631e64d31b9Smaya return 1; 1632e64d31b9Smaya } 1633e64d31b9Smaya 1634e64d31b9Smaya /* Avoid sprintf, as that infringes on the user's name space. 1635e64d31b9Smaya Don't have undefined behavior even if the translation 1636e64d31b9Smaya produced a string with the wrong number of "%s"s. */ 1637e64d31b9Smaya { 1638e64d31b9Smaya char *yyp = *yymsg; 1639e64d31b9Smaya int yyi = 0; 1640e64d31b9Smaya while ((*yyp = *yyformat) != '\0') 1641e64d31b9Smaya if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1642e64d31b9Smaya { 1643e64d31b9Smaya yyp += yytnamerr (yyp, yyarg[yyi++]); 1644e64d31b9Smaya yyformat += 2; 1645e64d31b9Smaya } 1646e64d31b9Smaya else 1647e64d31b9Smaya { 1648e64d31b9Smaya yyp++; 1649e64d31b9Smaya yyformat++; 1650e64d31b9Smaya } 1651e64d31b9Smaya } 1652e64d31b9Smaya return 0; 1653e64d31b9Smaya} 1654e64d31b9Smaya#endif /* YYERROR_VERBOSE */ 1655e64d31b9Smaya 1656e64d31b9Smaya/*-----------------------------------------------. 1657e64d31b9Smaya| Release the memory associated to this symbol. | 1658e64d31b9Smaya`-----------------------------------------------*/ 1659e64d31b9Smaya 1660e64d31b9Smayastatic void 1661e64d31b9Smayayydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct asm_parser_state *state) 1662e64d31b9Smaya{ 1663e64d31b9Smaya YYUSE (yyvaluep); 1664e64d31b9Smaya YYUSE (yylocationp); 1665e64d31b9Smaya YYUSE (state); 1666e64d31b9Smaya if (!yymsg) 1667e64d31b9Smaya yymsg = "Deleting"; 1668e64d31b9Smaya YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1669e64d31b9Smaya 1670e64d31b9Smaya YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1671e64d31b9Smaya YYUSE (yytype); 1672e64d31b9Smaya YY_IGNORE_MAYBE_UNINITIALIZED_END 1673e64d31b9Smaya} 1674e64d31b9Smaya 1675e64d31b9Smaya 1676e64d31b9Smaya 1677e64d31b9Smaya 1678e64d31b9Smaya/*----------. 1679e64d31b9Smaya| yyparse. | 1680e64d31b9Smaya`----------*/ 1681e64d31b9Smaya 1682e64d31b9Smayaint 1683e64d31b9Smayayyparse (struct asm_parser_state *state) 1684e64d31b9Smaya{ 1685e64d31b9Smaya/* The lookahead symbol. */ 1686e64d31b9Smayaint yychar; 1687e64d31b9Smaya 1688e64d31b9Smaya 1689e64d31b9Smaya/* The semantic value of the lookahead symbol. */ 1690e64d31b9Smaya/* Default value used for initialization, for pacifying older GCCs 1691e64d31b9Smaya or non-GCC compilers. */ 1692e64d31b9SmayaYY_INITIAL_VALUE (static YYSTYPE yyval_default;) 1693e64d31b9SmayaYYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); 1694e64d31b9Smaya 1695e64d31b9Smaya/* Location data for the lookahead symbol. */ 1696e64d31b9Smayastatic YYLTYPE yyloc_default 1697e64d31b9Smaya# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 1698e64d31b9Smaya = { 1, 1, 1, 1 } 1699e64d31b9Smaya# endif 1700e64d31b9Smaya; 1701e64d31b9SmayaYYLTYPE yylloc = yyloc_default; 1702e64d31b9Smaya 1703e64d31b9Smaya /* Number of syntax errors so far. */ 1704e64d31b9Smaya int yynerrs; 1705e64d31b9Smaya 1706e64d31b9Smaya int yystate; 1707e64d31b9Smaya /* Number of tokens to shift before error messages enabled. */ 1708e64d31b9Smaya int yyerrstatus; 1709e64d31b9Smaya 1710e64d31b9Smaya /* The stacks and their tools: 1711e64d31b9Smaya 'yyss': related to states. 1712e64d31b9Smaya 'yyvs': related to semantic values. 1713e64d31b9Smaya 'yyls': related to locations. 1714e64d31b9Smaya 1715e64d31b9Smaya Refer to the stacks through separate pointers, to allow yyoverflow 1716e64d31b9Smaya to reallocate them elsewhere. */ 1717e64d31b9Smaya 1718e64d31b9Smaya /* The state stack. */ 1719e64d31b9Smaya yytype_int16 yyssa[YYINITDEPTH]; 1720e64d31b9Smaya yytype_int16 *yyss; 1721e64d31b9Smaya yytype_int16 *yyssp; 1722e64d31b9Smaya 1723e64d31b9Smaya /* The semantic value stack. */ 1724e64d31b9Smaya YYSTYPE yyvsa[YYINITDEPTH]; 1725e64d31b9Smaya YYSTYPE *yyvs; 1726e64d31b9Smaya YYSTYPE *yyvsp; 1727e64d31b9Smaya 1728e64d31b9Smaya /* The location stack. */ 1729e64d31b9Smaya YYLTYPE yylsa[YYINITDEPTH]; 1730e64d31b9Smaya YYLTYPE *yyls; 1731e64d31b9Smaya YYLTYPE *yylsp; 1732e64d31b9Smaya 1733e64d31b9Smaya /* The locations where the error started and ended. */ 1734e64d31b9Smaya YYLTYPE yyerror_range[3]; 1735e64d31b9Smaya 1736e64d31b9Smaya YYSIZE_T yystacksize; 1737e64d31b9Smaya 1738e64d31b9Smaya int yyn; 1739e64d31b9Smaya int yyresult; 1740e64d31b9Smaya /* Lookahead token as an internal (translated) token number. */ 1741e64d31b9Smaya int yytoken = 0; 1742e64d31b9Smaya /* The variables used to return semantic value and location from the 1743e64d31b9Smaya action routines. */ 1744e64d31b9Smaya YYSTYPE yyval; 1745e64d31b9Smaya YYLTYPE yyloc; 1746e64d31b9Smaya 1747e64d31b9Smaya#if YYERROR_VERBOSE 1748e64d31b9Smaya /* Buffer for error messages, and its allocated size. */ 1749e64d31b9Smaya char yymsgbuf[128]; 1750e64d31b9Smaya char *yymsg = yymsgbuf; 1751e64d31b9Smaya YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1752e64d31b9Smaya#endif 1753e64d31b9Smaya 1754e64d31b9Smaya#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) 1755e64d31b9Smaya 1756e64d31b9Smaya /* The number of symbols on the RHS of the reduced rule. 1757e64d31b9Smaya Keep to zero when no symbol should be popped. */ 1758e64d31b9Smaya int yylen = 0; 1759e64d31b9Smaya 1760e64d31b9Smaya yyssp = yyss = yyssa; 1761e64d31b9Smaya yyvsp = yyvs = yyvsa; 1762e64d31b9Smaya yylsp = yyls = yylsa; 1763e64d31b9Smaya yystacksize = YYINITDEPTH; 1764e64d31b9Smaya 1765e64d31b9Smaya YYDPRINTF ((stderr, "Starting parse\n")); 1766e64d31b9Smaya 1767e64d31b9Smaya yystate = 0; 1768e64d31b9Smaya yyerrstatus = 0; 1769e64d31b9Smaya yynerrs = 0; 1770e64d31b9Smaya yychar = YYEMPTY; /* Cause a token to be read. */ 1771e64d31b9Smaya yylsp[0] = yylloc; 1772e64d31b9Smaya goto yysetstate; 1773e64d31b9Smaya 1774e64d31b9Smaya/*------------------------------------------------------------. 1775e64d31b9Smaya| yynewstate -- Push a new state, which is found in yystate. | 1776e64d31b9Smaya`------------------------------------------------------------*/ 1777e64d31b9Smaya yynewstate: 1778e64d31b9Smaya /* In all cases, when you get here, the value and location stacks 1779e64d31b9Smaya have just been pushed. So pushing a state here evens the stacks. */ 1780e64d31b9Smaya yyssp++; 1781e64d31b9Smaya 1782e64d31b9Smaya yysetstate: 1783e64d31b9Smaya *yyssp = (yytype_int16) yystate; 1784e64d31b9Smaya 1785e64d31b9Smaya if (yyss + yystacksize - 1 <= yyssp) 1786e64d31b9Smaya { 1787e64d31b9Smaya /* Get the current used size of the three stacks, in elements. */ 1788e64d31b9Smaya YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); 1789e64d31b9Smaya 1790e64d31b9Smaya#ifdef yyoverflow 1791e64d31b9Smaya { 1792e64d31b9Smaya /* Give user a chance to reallocate the stack. Use copies of 1793e64d31b9Smaya these so that the &'s don't force the real ones into 1794e64d31b9Smaya memory. */ 1795e64d31b9Smaya YYSTYPE *yyvs1 = yyvs; 1796e64d31b9Smaya yytype_int16 *yyss1 = yyss; 1797e64d31b9Smaya YYLTYPE *yyls1 = yyls; 1798e64d31b9Smaya 1799e64d31b9Smaya /* Each stack pointer address is followed by the size of the 1800e64d31b9Smaya data in use in that stack, in bytes. This used to be a 1801e64d31b9Smaya conditional around just the two extra args, but that might 1802e64d31b9Smaya be undefined if yyoverflow is a macro. */ 1803e64d31b9Smaya yyoverflow (YY_("memory exhausted"), 1804e64d31b9Smaya &yyss1, yysize * sizeof (*yyssp), 1805e64d31b9Smaya &yyvs1, yysize * sizeof (*yyvsp), 1806e64d31b9Smaya &yyls1, yysize * sizeof (*yylsp), 1807e64d31b9Smaya &yystacksize); 1808e64d31b9Smaya yyss = yyss1; 1809e64d31b9Smaya yyvs = yyvs1; 1810e64d31b9Smaya yyls = yyls1; 1811e64d31b9Smaya } 1812e64d31b9Smaya#else /* no yyoverflow */ 1813e64d31b9Smaya# ifndef YYSTACK_RELOCATE 1814e64d31b9Smaya goto yyexhaustedlab; 1815e64d31b9Smaya# else 1816e64d31b9Smaya /* Extend the stack our own way. */ 1817e64d31b9Smaya if (YYMAXDEPTH <= yystacksize) 1818e64d31b9Smaya goto yyexhaustedlab; 1819e64d31b9Smaya yystacksize *= 2; 1820e64d31b9Smaya if (YYMAXDEPTH < yystacksize) 1821e64d31b9Smaya yystacksize = YYMAXDEPTH; 1822e64d31b9Smaya 1823e64d31b9Smaya { 1824e64d31b9Smaya yytype_int16 *yyss1 = yyss; 1825e64d31b9Smaya union yyalloc *yyptr = 1826e64d31b9Smaya (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1827e64d31b9Smaya if (! yyptr) 1828e64d31b9Smaya goto yyexhaustedlab; 1829e64d31b9Smaya YYSTACK_RELOCATE (yyss_alloc, yyss); 1830e64d31b9Smaya YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1831e64d31b9Smaya YYSTACK_RELOCATE (yyls_alloc, yyls); 1832e64d31b9Smaya# undef YYSTACK_RELOCATE 1833e64d31b9Smaya if (yyss1 != yyssa) 1834e64d31b9Smaya YYSTACK_FREE (yyss1); 1835e64d31b9Smaya } 1836e64d31b9Smaya# endif 1837e64d31b9Smaya#endif /* no yyoverflow */ 1838e64d31b9Smaya 1839e64d31b9Smaya yyssp = yyss + yysize - 1; 1840e64d31b9Smaya yyvsp = yyvs + yysize - 1; 1841e64d31b9Smaya yylsp = yyls + yysize - 1; 1842e64d31b9Smaya 1843e64d31b9Smaya YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1844e64d31b9Smaya (unsigned long) yystacksize)); 1845e64d31b9Smaya 1846e64d31b9Smaya if (yyss + yystacksize - 1 <= yyssp) 1847e64d31b9Smaya YYABORT; 1848e64d31b9Smaya } 1849e64d31b9Smaya 1850e64d31b9Smaya YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1851e64d31b9Smaya 1852e64d31b9Smaya if (yystate == YYFINAL) 1853e64d31b9Smaya YYACCEPT; 1854e64d31b9Smaya 1855e64d31b9Smaya goto yybackup; 1856e64d31b9Smaya 1857e64d31b9Smaya/*-----------. 1858e64d31b9Smaya| yybackup. | 1859e64d31b9Smaya`-----------*/ 1860e64d31b9Smayayybackup: 1861e64d31b9Smaya 1862e64d31b9Smaya /* Do appropriate processing given the current state. Read a 1863e64d31b9Smaya lookahead token if we need one and don't already have one. */ 1864e64d31b9Smaya 1865e64d31b9Smaya /* First try to decide what to do without reference to lookahead token. */ 1866e64d31b9Smaya yyn = yypact[yystate]; 1867e64d31b9Smaya if (yypact_value_is_default (yyn)) 1868e64d31b9Smaya goto yydefault; 1869e64d31b9Smaya 1870e64d31b9Smaya /* Not known => get a lookahead token if don't already have one. */ 1871e64d31b9Smaya 1872e64d31b9Smaya /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1873e64d31b9Smaya if (yychar == YYEMPTY) 1874e64d31b9Smaya { 1875e64d31b9Smaya YYDPRINTF ((stderr, "Reading a token: ")); 1876e64d31b9Smaya yychar = yylex (&yylval, &yylloc, state); 1877e64d31b9Smaya } 1878e64d31b9Smaya 1879e64d31b9Smaya if (yychar <= YYEOF) 1880e64d31b9Smaya { 1881e64d31b9Smaya yychar = yytoken = YYEOF; 1882e64d31b9Smaya YYDPRINTF ((stderr, "Now at end of input.\n")); 1883e64d31b9Smaya } 1884e64d31b9Smaya else 1885e64d31b9Smaya { 1886e64d31b9Smaya yytoken = YYTRANSLATE (yychar); 1887e64d31b9Smaya YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1888e64d31b9Smaya } 1889e64d31b9Smaya 1890e64d31b9Smaya /* If the proper action on seeing token YYTOKEN is to reduce or to 1891e64d31b9Smaya detect an error, take that action. */ 1892e64d31b9Smaya yyn += yytoken; 1893e64d31b9Smaya if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1894e64d31b9Smaya goto yydefault; 1895e64d31b9Smaya yyn = yytable[yyn]; 1896e64d31b9Smaya if (yyn <= 0) 1897e64d31b9Smaya { 1898e64d31b9Smaya if (yytable_value_is_error (yyn)) 1899e64d31b9Smaya goto yyerrlab; 1900e64d31b9Smaya yyn = -yyn; 1901e64d31b9Smaya goto yyreduce; 1902e64d31b9Smaya } 1903e64d31b9Smaya 1904e64d31b9Smaya /* Count tokens shifted since error; after three, turn off error 1905e64d31b9Smaya status. */ 1906e64d31b9Smaya if (yyerrstatus) 1907e64d31b9Smaya yyerrstatus--; 1908e64d31b9Smaya 1909e64d31b9Smaya /* Shift the lookahead token. */ 1910e64d31b9Smaya YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1911e64d31b9Smaya 1912e64d31b9Smaya /* Discard the shifted token. */ 1913e64d31b9Smaya yychar = YYEMPTY; 1914e64d31b9Smaya 1915e64d31b9Smaya yystate = yyn; 1916e64d31b9Smaya YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1917e64d31b9Smaya *++yyvsp = yylval; 1918e64d31b9Smaya YY_IGNORE_MAYBE_UNINITIALIZED_END 1919e64d31b9Smaya *++yylsp = yylloc; 1920e64d31b9Smaya goto yynewstate; 1921e64d31b9Smaya 1922e64d31b9Smaya 1923e64d31b9Smaya/*-----------------------------------------------------------. 1924e64d31b9Smaya| yydefault -- do the default action for the current state. | 1925e64d31b9Smaya`-----------------------------------------------------------*/ 1926e64d31b9Smayayydefault: 1927e64d31b9Smaya yyn = yydefact[yystate]; 1928e64d31b9Smaya if (yyn == 0) 1929e64d31b9Smaya goto yyerrlab; 1930e64d31b9Smaya goto yyreduce; 1931e64d31b9Smaya 1932e64d31b9Smaya 1933e64d31b9Smaya/*-----------------------------. 1934e64d31b9Smaya| yyreduce -- Do a reduction. | 1935e64d31b9Smaya`-----------------------------*/ 1936e64d31b9Smayayyreduce: 1937e64d31b9Smaya /* yyn is the number of a rule to reduce with. */ 1938e64d31b9Smaya yylen = yyr2[yyn]; 1939e64d31b9Smaya 1940e64d31b9Smaya /* If YYLEN is nonzero, implement the default value of the action: 1941e64d31b9Smaya '$$ = $1'. 1942e64d31b9Smaya 1943e64d31b9Smaya Otherwise, the following line sets YYVAL to garbage. 1944e64d31b9Smaya This behavior is undocumented and Bison 1945e64d31b9Smaya users should not rely upon it. Assigning to YYVAL 1946e64d31b9Smaya unconditionally makes the parser a bit smaller, and it avoids a 1947e64d31b9Smaya GCC warning that YYVAL may be used uninitialized. */ 1948e64d31b9Smaya yyval = yyvsp[1-yylen]; 1949e64d31b9Smaya 1950e64d31b9Smaya /* Default location. */ 1951e64d31b9Smaya YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); 1952e64d31b9Smaya yyerror_range[1] = yyloc; 1953e64d31b9Smaya YY_REDUCE_PRINT (yyn); 1954e64d31b9Smaya switch (yyn) 1955e64d31b9Smaya { 1956e64d31b9Smaya case 3: 1957e64d31b9Smaya#line 290 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 1958e64d31b9Smaya { 1959e64d31b9Smaya if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { 1960e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid fragment program header"); 1961e64d31b9Smaya 1962e64d31b9Smaya } 1963e64d31b9Smaya state->mode = ARB_vertex; 1964e64d31b9Smaya } 1965e64d31b9Smaya#line 1966 "program_parse.tab.c" /* yacc.c:1645 */ 1966e64d31b9Smaya break; 1967e64d31b9Smaya 1968e64d31b9Smaya case 4: 1969e64d31b9Smaya#line 298 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 1970e64d31b9Smaya { 1971e64d31b9Smaya if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { 1972e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid vertex program header"); 1973e64d31b9Smaya } 1974e64d31b9Smaya state->mode = ARB_fragment; 1975e64d31b9Smaya 1976e64d31b9Smaya state->option.TexRect = 1977e64d31b9Smaya (state->ctx->Extensions.NV_texture_rectangle != GL_FALSE); 1978e64d31b9Smaya } 1979e64d31b9Smaya#line 1980 "program_parse.tab.c" /* yacc.c:1645 */ 1980e64d31b9Smaya break; 1981e64d31b9Smaya 1982e64d31b9Smaya case 7: 1983e64d31b9Smaya#line 314 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 1984e64d31b9Smaya { 1985e64d31b9Smaya int valid = 0; 1986e64d31b9Smaya 1987e64d31b9Smaya if (state->mode == ARB_vertex) { 1988e64d31b9Smaya valid = _mesa_ARBvp_parse_option(state, (yyvsp[-1].string)); 1989e64d31b9Smaya } else if (state->mode == ARB_fragment) { 1990e64d31b9Smaya valid = _mesa_ARBfp_parse_option(state, (yyvsp[-1].string)); 1991e64d31b9Smaya } 1992e64d31b9Smaya 1993e64d31b9Smaya 1994e64d31b9Smaya free((yyvsp[-1].string)); 1995e64d31b9Smaya 1996e64d31b9Smaya if (!valid) { 1997e64d31b9Smaya const char *const err_str = (state->mode == ARB_vertex) 1998e64d31b9Smaya ? "invalid ARB vertex program option" 1999e64d31b9Smaya : "invalid ARB fragment program option"; 2000e64d31b9Smaya 2001e64d31b9Smaya yyerror(& (yylsp[-1]), state, err_str); 2002e64d31b9Smaya YYERROR; 2003e64d31b9Smaya } 2004e64d31b9Smaya } 2005e64d31b9Smaya#line 2006 "program_parse.tab.c" /* yacc.c:1645 */ 2006e64d31b9Smaya break; 2007e64d31b9Smaya 2008e64d31b9Smaya case 10: 2009e64d31b9Smaya#line 342 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2010e64d31b9Smaya { 2011e64d31b9Smaya if ((yyvsp[-1].inst) != NULL) { 2012e64d31b9Smaya if (state->inst_tail == NULL) { 2013e64d31b9Smaya state->inst_head = (yyvsp[-1].inst); 2014e64d31b9Smaya } else { 2015e64d31b9Smaya state->inst_tail->next = (yyvsp[-1].inst); 2016e64d31b9Smaya } 2017e64d31b9Smaya 2018e64d31b9Smaya state->inst_tail = (yyvsp[-1].inst); 2019e64d31b9Smaya (yyvsp[-1].inst)->next = NULL; 2020e64d31b9Smaya 2021e64d31b9Smaya state->prog->arb.NumInstructions++; 2022e64d31b9Smaya } 2023e64d31b9Smaya } 2024e64d31b9Smaya#line 2025 "program_parse.tab.c" /* yacc.c:1645 */ 2025e64d31b9Smaya break; 2026e64d31b9Smaya 2027e64d31b9Smaya case 12: 2028e64d31b9Smaya#line 360 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2029e64d31b9Smaya { 2030e64d31b9Smaya (yyval.inst) = (yyvsp[0].inst); 2031e64d31b9Smaya state->prog->arb.NumAluInstructions++; 2032e64d31b9Smaya } 2033e64d31b9Smaya#line 2034 "program_parse.tab.c" /* yacc.c:1645 */ 2034e64d31b9Smaya break; 2035e64d31b9Smaya 2036e64d31b9Smaya case 13: 2037e64d31b9Smaya#line 365 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2038e64d31b9Smaya { 2039e64d31b9Smaya (yyval.inst) = (yyvsp[0].inst); 2040e64d31b9Smaya state->prog->arb.NumTexInstructions++; 2041e64d31b9Smaya } 2042e64d31b9Smaya#line 2043 "program_parse.tab.c" /* yacc.c:1645 */ 2043e64d31b9Smaya break; 2044e64d31b9Smaya 2045e64d31b9Smaya case 24: 2046e64d31b9Smaya#line 386 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2047e64d31b9Smaya { 2048e64d31b9Smaya (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[-2].dst_reg), & (yyvsp[0].src_reg), NULL, NULL); 2049e64d31b9Smaya } 2050e64d31b9Smaya#line 2051 "program_parse.tab.c" /* yacc.c:1645 */ 2051e64d31b9Smaya break; 2052e64d31b9Smaya 2053e64d31b9Smaya case 25: 2054e64d31b9Smaya#line 392 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2055e64d31b9Smaya { 2056e64d31b9Smaya (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-3].temp_inst), & (yyvsp[-2].dst_reg), & (yyvsp[0].src_reg), NULL, NULL); 2057e64d31b9Smaya } 2058e64d31b9Smaya#line 2059 "program_parse.tab.c" /* yacc.c:1645 */ 2059e64d31b9Smaya break; 2060e64d31b9Smaya 2061e64d31b9Smaya case 26: 2062e64d31b9Smaya#line 398 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2063e64d31b9Smaya { 2064e64d31b9Smaya (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-3].temp_inst), & (yyvsp[-2].dst_reg), & (yyvsp[0].src_reg), NULL, NULL); 2065e64d31b9Smaya } 2066e64d31b9Smaya#line 2067 "program_parse.tab.c" /* yacc.c:1645 */ 2067e64d31b9Smaya break; 2068e64d31b9Smaya 2069e64d31b9Smaya case 27: 2070e64d31b9Smaya#line 404 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2071e64d31b9Smaya { 2072e64d31b9Smaya (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-5].temp_inst), & (yyvsp[-4].dst_reg), & (yyvsp[-2].src_reg), & (yyvsp[0].src_reg), NULL); 2073e64d31b9Smaya } 2074e64d31b9Smaya#line 2075 "program_parse.tab.c" /* yacc.c:1645 */ 2075e64d31b9Smaya break; 2076e64d31b9Smaya 2077e64d31b9Smaya case 28: 2078e64d31b9Smaya#line 411 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2079e64d31b9Smaya { 2080e64d31b9Smaya (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-5].temp_inst), & (yyvsp[-4].dst_reg), & (yyvsp[-2].src_reg), & (yyvsp[0].src_reg), NULL); 2081e64d31b9Smaya } 2082e64d31b9Smaya#line 2083 "program_parse.tab.c" /* yacc.c:1645 */ 2083e64d31b9Smaya break; 2084e64d31b9Smaya 2085e64d31b9Smaya case 29: 2086e64d31b9Smaya#line 418 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2087e64d31b9Smaya { 2088e64d31b9Smaya (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-7].temp_inst), & (yyvsp[-6].dst_reg), & (yyvsp[-4].src_reg), & (yyvsp[-2].src_reg), & (yyvsp[0].src_reg)); 2089e64d31b9Smaya } 2090e64d31b9Smaya#line 2091 "program_parse.tab.c" /* yacc.c:1645 */ 2091e64d31b9Smaya break; 2092e64d31b9Smaya 2093e64d31b9Smaya case 30: 2094e64d31b9Smaya#line 424 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2095e64d31b9Smaya { 2096e64d31b9Smaya (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-7].temp_inst), & (yyvsp[-6].dst_reg), & (yyvsp[-4].src_reg), NULL, NULL); 2097e64d31b9Smaya if ((yyval.inst) != NULL) { 2098e64d31b9Smaya const GLbitfield tex_mask = (1U << (yyvsp[-2].integer)); 2099e64d31b9Smaya GLbitfield shadow_tex = 0; 2100e64d31b9Smaya GLbitfield target_mask = 0; 2101e64d31b9Smaya 2102e64d31b9Smaya 2103e64d31b9Smaya (yyval.inst)->Base.TexSrcUnit = (yyvsp[-2].integer); 2104e64d31b9Smaya 2105e64d31b9Smaya if ((yyvsp[0].integer) < 0) { 2106e64d31b9Smaya shadow_tex = tex_mask; 2107e64d31b9Smaya 2108e64d31b9Smaya (yyval.inst)->Base.TexSrcTarget = -(yyvsp[0].integer); 2109e64d31b9Smaya (yyval.inst)->Base.TexShadow = 1; 2110e64d31b9Smaya } else { 2111e64d31b9Smaya (yyval.inst)->Base.TexSrcTarget = (yyvsp[0].integer); 2112e64d31b9Smaya } 2113e64d31b9Smaya 2114e64d31b9Smaya target_mask = (1U << (yyval.inst)->Base.TexSrcTarget); 2115e64d31b9Smaya 2116e64d31b9Smaya /* If this texture unit was previously accessed and that access 2117e64d31b9Smaya * had a different texture target, generate an error. 2118e64d31b9Smaya * 2119e64d31b9Smaya * If this texture unit was previously accessed and that access 2120e64d31b9Smaya * had a different shadow mode, generate an error. 2121e64d31b9Smaya */ 2122e64d31b9Smaya if ((state->prog->TexturesUsed[(yyvsp[-2].integer)] != 0) 2123e64d31b9Smaya && ((state->prog->TexturesUsed[(yyvsp[-2].integer)] != target_mask) 2124e64d31b9Smaya || ((state->prog->ShadowSamplers & tex_mask) 2125e64d31b9Smaya != shadow_tex))) { 2126e64d31b9Smaya yyerror(& (yylsp[0]), state, 2127e64d31b9Smaya "multiple targets used on one texture image unit"); 2128e64d31b9Smaya YYERROR; 2129e64d31b9Smaya } 2130e64d31b9Smaya 2131e64d31b9Smaya 2132e64d31b9Smaya state->prog->TexturesUsed[(yyvsp[-2].integer)] |= target_mask; 2133e64d31b9Smaya state->prog->ShadowSamplers |= shadow_tex; 2134e64d31b9Smaya } 2135e64d31b9Smaya } 2136e64d31b9Smaya#line 2137 "program_parse.tab.c" /* yacc.c:1645 */ 2137e64d31b9Smaya break; 2138e64d31b9Smaya 2139e64d31b9Smaya case 31: 2140e64d31b9Smaya#line 468 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2141e64d31b9Smaya { 2142e64d31b9Smaya (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[0].src_reg), NULL, NULL); 2143e64d31b9Smaya state->fragment.UsesKill = 1; 2144e64d31b9Smaya } 2145e64d31b9Smaya#line 2146 "program_parse.tab.c" /* yacc.c:1645 */ 2146e64d31b9Smaya break; 2147e64d31b9Smaya 2148e64d31b9Smaya case 32: 2149e64d31b9Smaya#line 475 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2150e64d31b9Smaya { 2151e64d31b9Smaya (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-11].temp_inst), & (yyvsp[-10].dst_reg), & (yyvsp[-8].src_reg), & (yyvsp[-6].src_reg), & (yyvsp[-4].src_reg)); 2152e64d31b9Smaya if ((yyval.inst) != NULL) { 2153e64d31b9Smaya const GLbitfield tex_mask = (1U << (yyvsp[-2].integer)); 2154e64d31b9Smaya GLbitfield shadow_tex = 0; 2155e64d31b9Smaya GLbitfield target_mask = 0; 2156e64d31b9Smaya 2157e64d31b9Smaya 2158e64d31b9Smaya (yyval.inst)->Base.TexSrcUnit = (yyvsp[-2].integer); 2159e64d31b9Smaya 2160e64d31b9Smaya if ((yyvsp[0].integer) < 0) { 2161e64d31b9Smaya shadow_tex = tex_mask; 2162e64d31b9Smaya 2163e64d31b9Smaya (yyval.inst)->Base.TexSrcTarget = -(yyvsp[0].integer); 2164e64d31b9Smaya (yyval.inst)->Base.TexShadow = 1; 2165e64d31b9Smaya } else { 2166e64d31b9Smaya (yyval.inst)->Base.TexSrcTarget = (yyvsp[0].integer); 2167e64d31b9Smaya } 2168e64d31b9Smaya 2169e64d31b9Smaya target_mask = (1U << (yyval.inst)->Base.TexSrcTarget); 2170e64d31b9Smaya 2171e64d31b9Smaya /* If this texture unit was previously accessed and that access 2172e64d31b9Smaya * had a different texture target, generate an error. 2173e64d31b9Smaya * 2174e64d31b9Smaya * If this texture unit was previously accessed and that access 2175e64d31b9Smaya * had a different shadow mode, generate an error. 2176e64d31b9Smaya */ 2177e64d31b9Smaya if ((state->prog->TexturesUsed[(yyvsp[-2].integer)] != 0) 2178e64d31b9Smaya && ((state->prog->TexturesUsed[(yyvsp[-2].integer)] != target_mask) 2179e64d31b9Smaya || ((state->prog->ShadowSamplers & tex_mask) 2180e64d31b9Smaya != shadow_tex))) { 2181e64d31b9Smaya yyerror(& (yylsp[0]), state, 2182e64d31b9Smaya "multiple targets used on one texture image unit"); 2183e64d31b9Smaya YYERROR; 2184e64d31b9Smaya } 2185e64d31b9Smaya 2186e64d31b9Smaya 2187e64d31b9Smaya state->prog->TexturesUsed[(yyvsp[-2].integer)] |= target_mask; 2188e64d31b9Smaya state->prog->ShadowSamplers |= shadow_tex; 2189e64d31b9Smaya } 2190e64d31b9Smaya } 2191e64d31b9Smaya#line 2192 "program_parse.tab.c" /* yacc.c:1645 */ 2192e64d31b9Smaya break; 2193e64d31b9Smaya 2194e64d31b9Smaya case 33: 2195e64d31b9Smaya#line 519 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2196e64d31b9Smaya { 2197e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 2198e64d31b9Smaya } 2199e64d31b9Smaya#line 2200 "program_parse.tab.c" /* yacc.c:1645 */ 2200e64d31b9Smaya break; 2201e64d31b9Smaya 2202e64d31b9Smaya case 34: 2203e64d31b9Smaya#line 524 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2204e64d31b9Smaya { (yyval.integer) = TEXTURE_1D_INDEX; } 2205e64d31b9Smaya#line 2206 "program_parse.tab.c" /* yacc.c:1645 */ 2206e64d31b9Smaya break; 2207e64d31b9Smaya 2208e64d31b9Smaya case 35: 2209e64d31b9Smaya#line 525 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2210e64d31b9Smaya { (yyval.integer) = TEXTURE_2D_INDEX; } 2211e64d31b9Smaya#line 2212 "program_parse.tab.c" /* yacc.c:1645 */ 2212e64d31b9Smaya break; 2213e64d31b9Smaya 2214e64d31b9Smaya case 36: 2215e64d31b9Smaya#line 526 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2216e64d31b9Smaya { (yyval.integer) = TEXTURE_3D_INDEX; } 2217e64d31b9Smaya#line 2218 "program_parse.tab.c" /* yacc.c:1645 */ 2218e64d31b9Smaya break; 2219e64d31b9Smaya 2220e64d31b9Smaya case 37: 2221e64d31b9Smaya#line 527 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2222e64d31b9Smaya { (yyval.integer) = TEXTURE_CUBE_INDEX; } 2223e64d31b9Smaya#line 2224 "program_parse.tab.c" /* yacc.c:1645 */ 2224e64d31b9Smaya break; 2225e64d31b9Smaya 2226e64d31b9Smaya case 38: 2227e64d31b9Smaya#line 528 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2228e64d31b9Smaya { (yyval.integer) = TEXTURE_RECT_INDEX; } 2229e64d31b9Smaya#line 2230 "program_parse.tab.c" /* yacc.c:1645 */ 2230e64d31b9Smaya break; 2231e64d31b9Smaya 2232e64d31b9Smaya case 39: 2233e64d31b9Smaya#line 529 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2234e64d31b9Smaya { (yyval.integer) = -TEXTURE_1D_INDEX; } 2235e64d31b9Smaya#line 2236 "program_parse.tab.c" /* yacc.c:1645 */ 2236e64d31b9Smaya break; 2237e64d31b9Smaya 2238e64d31b9Smaya case 40: 2239e64d31b9Smaya#line 530 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2240e64d31b9Smaya { (yyval.integer) = -TEXTURE_2D_INDEX; } 2241e64d31b9Smaya#line 2242 "program_parse.tab.c" /* yacc.c:1645 */ 2242e64d31b9Smaya break; 2243e64d31b9Smaya 2244e64d31b9Smaya case 41: 2245e64d31b9Smaya#line 531 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2246e64d31b9Smaya { (yyval.integer) = -TEXTURE_RECT_INDEX; } 2247e64d31b9Smaya#line 2248 "program_parse.tab.c" /* yacc.c:1645 */ 2248e64d31b9Smaya break; 2249e64d31b9Smaya 2250e64d31b9Smaya case 42: 2251e64d31b9Smaya#line 532 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2252e64d31b9Smaya { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; } 2253e64d31b9Smaya#line 2254 "program_parse.tab.c" /* yacc.c:1645 */ 2254e64d31b9Smaya break; 2255e64d31b9Smaya 2256e64d31b9Smaya case 43: 2257e64d31b9Smaya#line 533 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2258e64d31b9Smaya { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; } 2259e64d31b9Smaya#line 2260 "program_parse.tab.c" /* yacc.c:1645 */ 2260e64d31b9Smaya break; 2261e64d31b9Smaya 2262e64d31b9Smaya case 44: 2263e64d31b9Smaya#line 534 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2264e64d31b9Smaya { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; } 2265e64d31b9Smaya#line 2266 "program_parse.tab.c" /* yacc.c:1645 */ 2266e64d31b9Smaya break; 2267e64d31b9Smaya 2268e64d31b9Smaya case 45: 2269e64d31b9Smaya#line 535 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2270e64d31b9Smaya { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; } 2271e64d31b9Smaya#line 2272 "program_parse.tab.c" /* yacc.c:1645 */ 2272e64d31b9Smaya break; 2273e64d31b9Smaya 2274e64d31b9Smaya case 46: 2275e64d31b9Smaya#line 539 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2276e64d31b9Smaya { 2277e64d31b9Smaya /* FIXME: Is this correct? Should the extenedSwizzle be applied 2278e64d31b9Smaya * FIXME: to the existing swizzle? 2279e64d31b9Smaya */ 2280e64d31b9Smaya (yyvsp[-2].src_reg).Base.Swizzle = (yyvsp[0].swiz_mask).swizzle; 2281e64d31b9Smaya (yyvsp[-2].src_reg).Base.Negate = (yyvsp[0].swiz_mask).mask; 2282e64d31b9Smaya 2283e64d31b9Smaya (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-5].temp_inst), & (yyvsp[-4].dst_reg), & (yyvsp[-2].src_reg), NULL, NULL); 2284e64d31b9Smaya } 2285e64d31b9Smaya#line 2286 "program_parse.tab.c" /* yacc.c:1645 */ 2286e64d31b9Smaya break; 2287e64d31b9Smaya 2288e64d31b9Smaya case 47: 2289e64d31b9Smaya#line 551 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2290e64d31b9Smaya { 2291e64d31b9Smaya (yyval.src_reg) = (yyvsp[0].src_reg); 2292e64d31b9Smaya 2293e64d31b9Smaya if ((yyvsp[-1].negate)) { 2294e64d31b9Smaya (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; 2295e64d31b9Smaya } 2296e64d31b9Smaya } 2297e64d31b9Smaya#line 2298 "program_parse.tab.c" /* yacc.c:1645 */ 2298e64d31b9Smaya break; 2299e64d31b9Smaya 2300e64d31b9Smaya case 48: 2301e64d31b9Smaya#line 561 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2302e64d31b9Smaya { 2303e64d31b9Smaya (yyval.src_reg) = (yyvsp[-1].src_reg); 2304e64d31b9Smaya 2305e64d31b9Smaya (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, 2306e64d31b9Smaya (yyvsp[0].swiz_mask).swizzle); 2307e64d31b9Smaya } 2308e64d31b9Smaya#line 2309 "program_parse.tab.c" /* yacc.c:1645 */ 2309e64d31b9Smaya break; 2310e64d31b9Smaya 2311e64d31b9Smaya case 49: 2312e64d31b9Smaya#line 570 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2313e64d31b9Smaya { 2314e64d31b9Smaya (yyval.src_reg) = (yyvsp[-1].src_reg); 2315e64d31b9Smaya 2316e64d31b9Smaya if ((yyvsp[-2].negate)) { 2317e64d31b9Smaya (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; 2318e64d31b9Smaya } 2319e64d31b9Smaya 2320e64d31b9Smaya (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, 2321e64d31b9Smaya (yyvsp[0].swiz_mask).swizzle); 2322e64d31b9Smaya } 2323e64d31b9Smaya#line 2324 "program_parse.tab.c" /* yacc.c:1645 */ 2324e64d31b9Smaya break; 2325e64d31b9Smaya 2326e64d31b9Smaya case 50: 2327e64d31b9Smaya#line 583 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2328e64d31b9Smaya { 2329e64d31b9Smaya (yyval.dst_reg) = (yyvsp[-1].dst_reg); 2330e64d31b9Smaya (yyval.dst_reg).WriteMask = (yyvsp[0].swiz_mask).mask; 2331e64d31b9Smaya 2332e64d31b9Smaya if ((yyval.dst_reg).File == PROGRAM_OUTPUT) { 2333e64d31b9Smaya /* Technically speaking, this should check that it is in 2334e64d31b9Smaya * vertex program mode. However, PositionInvariant can never be 2335e64d31b9Smaya * set in fragment program mode, so it is somewhat irrelevant. 2336e64d31b9Smaya */ 2337e64d31b9Smaya if (state->option.PositionInvariant 2338e64d31b9Smaya && ((yyval.dst_reg).Index == VARYING_SLOT_POS)) { 2339e64d31b9Smaya yyerror(& (yylsp[-1]), state, "position-invariant programs cannot " 2340e64d31b9Smaya "write position"); 2341e64d31b9Smaya YYERROR; 2342e64d31b9Smaya } 2343e64d31b9Smaya 2344e64d31b9Smaya state->prog->info.outputs_written |= BITFIELD64_BIT((yyval.dst_reg).Index); 2345e64d31b9Smaya } 2346e64d31b9Smaya } 2347e64d31b9Smaya#line 2348 "program_parse.tab.c" /* yacc.c:1645 */ 2348e64d31b9Smaya break; 2349e64d31b9Smaya 2350e64d31b9Smaya case 51: 2351e64d31b9Smaya#line 605 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2352e64d31b9Smaya { 2353e64d31b9Smaya set_dst_reg(& (yyval.dst_reg), PROGRAM_ADDRESS, 0); 2354e64d31b9Smaya (yyval.dst_reg).WriteMask = (yyvsp[0].swiz_mask).mask; 2355e64d31b9Smaya } 2356e64d31b9Smaya#line 2357 "program_parse.tab.c" /* yacc.c:1645 */ 2357e64d31b9Smaya break; 2358e64d31b9Smaya 2359e64d31b9Smaya case 52: 2360e64d31b9Smaya#line 612 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2361e64d31b9Smaya { 2362e64d31b9Smaya const unsigned xyzw_valid = 2363e64d31b9Smaya ((yyvsp[-6].ext_swizzle).xyzw_valid << 0) 2364e64d31b9Smaya | ((yyvsp[-4].ext_swizzle).xyzw_valid << 1) 2365e64d31b9Smaya | ((yyvsp[-2].ext_swizzle).xyzw_valid << 2) 2366e64d31b9Smaya | ((yyvsp[0].ext_swizzle).xyzw_valid << 3); 2367e64d31b9Smaya const unsigned rgba_valid = 2368e64d31b9Smaya ((yyvsp[-6].ext_swizzle).rgba_valid << 0) 2369e64d31b9Smaya | ((yyvsp[-4].ext_swizzle).rgba_valid << 1) 2370e64d31b9Smaya | ((yyvsp[-2].ext_swizzle).rgba_valid << 2) 2371e64d31b9Smaya | ((yyvsp[0].ext_swizzle).rgba_valid << 3); 2372e64d31b9Smaya 2373e64d31b9Smaya /* All of the swizzle components have to be valid in either RGBA 2374e64d31b9Smaya * or XYZW. Note that 0 and 1 are valid in both, so both masks 2375e64d31b9Smaya * can have some bits set. 2376e64d31b9Smaya * 2377e64d31b9Smaya * We somewhat deviate from the spec here. It would be really hard 2378e64d31b9Smaya * to figure out which component is the error, and there probably 2379e64d31b9Smaya * isn't a lot of benefit. 2380e64d31b9Smaya */ 2381e64d31b9Smaya if ((rgba_valid != 0x0f) && (xyzw_valid != 0x0f)) { 2382e64d31b9Smaya yyerror(& (yylsp[-6]), state, "cannot combine RGBA and XYZW swizzle " 2383e64d31b9Smaya "components"); 2384e64d31b9Smaya YYERROR; 2385e64d31b9Smaya } 2386e64d31b9Smaya 2387e64d31b9Smaya (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[-6].ext_swizzle).swz, (yyvsp[-4].ext_swizzle).swz, (yyvsp[-2].ext_swizzle).swz, (yyvsp[0].ext_swizzle).swz); 2388e64d31b9Smaya (yyval.swiz_mask).mask = ((yyvsp[-6].ext_swizzle).negate) | ((yyvsp[-4].ext_swizzle).negate << 1) | ((yyvsp[-2].ext_swizzle).negate << 2) 2389e64d31b9Smaya | ((yyvsp[0].ext_swizzle).negate << 3); 2390e64d31b9Smaya } 2391e64d31b9Smaya#line 2392 "program_parse.tab.c" /* yacc.c:1645 */ 2392e64d31b9Smaya break; 2393e64d31b9Smaya 2394e64d31b9Smaya case 53: 2395e64d31b9Smaya#line 645 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2396e64d31b9Smaya { 2397e64d31b9Smaya (yyval.ext_swizzle) = (yyvsp[0].ext_swizzle); 2398e64d31b9Smaya (yyval.ext_swizzle).negate = ((yyvsp[-1].negate)) ? 1 : 0; 2399e64d31b9Smaya } 2400e64d31b9Smaya#line 2401 "program_parse.tab.c" /* yacc.c:1645 */ 2401e64d31b9Smaya break; 2402e64d31b9Smaya 2403e64d31b9Smaya case 54: 2404e64d31b9Smaya#line 652 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2405e64d31b9Smaya { 2406e64d31b9Smaya if (((yyvsp[0].integer) != 0) && ((yyvsp[0].integer) != 1)) { 2407e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid extended swizzle selector"); 2408e64d31b9Smaya YYERROR; 2409e64d31b9Smaya } 2410e64d31b9Smaya 2411e64d31b9Smaya (yyval.ext_swizzle).swz = ((yyvsp[0].integer) == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE; 2412e64d31b9Smaya (yyval.ext_swizzle).negate = 0; 2413e64d31b9Smaya 2414e64d31b9Smaya /* 0 and 1 are valid for both RGBA swizzle names and XYZW 2415e64d31b9Smaya * swizzle names. 2416e64d31b9Smaya */ 2417e64d31b9Smaya (yyval.ext_swizzle).xyzw_valid = 1; 2418e64d31b9Smaya (yyval.ext_swizzle).rgba_valid = 1; 2419e64d31b9Smaya } 2420e64d31b9Smaya#line 2421 "program_parse.tab.c" /* yacc.c:1645 */ 2421e64d31b9Smaya break; 2422e64d31b9Smaya 2423e64d31b9Smaya case 55: 2424e64d31b9Smaya#line 668 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2425e64d31b9Smaya { 2426e64d31b9Smaya char s; 2427e64d31b9Smaya 2428e64d31b9Smaya if (strlen((yyvsp[0].string)) > 1) { 2429e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid extended swizzle selector"); 2430e64d31b9Smaya YYERROR; 2431e64d31b9Smaya } 2432e64d31b9Smaya 2433e64d31b9Smaya s = (yyvsp[0].string)[0]; 2434e64d31b9Smaya free((yyvsp[0].string)); 2435e64d31b9Smaya 2436e64d31b9Smaya (yyval.ext_swizzle).rgba_valid = 0; 2437e64d31b9Smaya (yyval.ext_swizzle).xyzw_valid = 0; 2438e64d31b9Smaya (yyval.ext_swizzle).negate = 0; 2439e64d31b9Smaya 2440e64d31b9Smaya switch (s) { 2441e64d31b9Smaya case 'x': 2442e64d31b9Smaya (yyval.ext_swizzle).swz = SWIZZLE_X; 2443e64d31b9Smaya (yyval.ext_swizzle).xyzw_valid = 1; 2444e64d31b9Smaya break; 2445e64d31b9Smaya case 'y': 2446e64d31b9Smaya (yyval.ext_swizzle).swz = SWIZZLE_Y; 2447e64d31b9Smaya (yyval.ext_swizzle).xyzw_valid = 1; 2448e64d31b9Smaya break; 2449e64d31b9Smaya case 'z': 2450e64d31b9Smaya (yyval.ext_swizzle).swz = SWIZZLE_Z; 2451e64d31b9Smaya (yyval.ext_swizzle).xyzw_valid = 1; 2452e64d31b9Smaya break; 2453e64d31b9Smaya case 'w': 2454e64d31b9Smaya (yyval.ext_swizzle).swz = SWIZZLE_W; 2455e64d31b9Smaya (yyval.ext_swizzle).xyzw_valid = 1; 2456e64d31b9Smaya break; 2457e64d31b9Smaya 2458e64d31b9Smaya case 'r': 2459e64d31b9Smaya (yyval.ext_swizzle).swz = SWIZZLE_X; 2460e64d31b9Smaya (yyval.ext_swizzle).rgba_valid = 1; 2461e64d31b9Smaya break; 2462e64d31b9Smaya case 'g': 2463e64d31b9Smaya (yyval.ext_swizzle).swz = SWIZZLE_Y; 2464e64d31b9Smaya (yyval.ext_swizzle).rgba_valid = 1; 2465e64d31b9Smaya break; 2466e64d31b9Smaya case 'b': 2467e64d31b9Smaya (yyval.ext_swizzle).swz = SWIZZLE_Z; 2468e64d31b9Smaya (yyval.ext_swizzle).rgba_valid = 1; 2469e64d31b9Smaya break; 2470e64d31b9Smaya case 'a': 2471e64d31b9Smaya (yyval.ext_swizzle).swz = SWIZZLE_W; 2472e64d31b9Smaya (yyval.ext_swizzle).rgba_valid = 1; 2473e64d31b9Smaya break; 2474e64d31b9Smaya 2475e64d31b9Smaya default: 2476e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid extended swizzle selector"); 2477e64d31b9Smaya YYERROR; 2478e64d31b9Smaya break; 2479e64d31b9Smaya } 2480e64d31b9Smaya } 2481e64d31b9Smaya#line 2482 "program_parse.tab.c" /* yacc.c:1645 */ 2482e64d31b9Smaya break; 2483e64d31b9Smaya 2484e64d31b9Smaya case 56: 2485e64d31b9Smaya#line 727 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2486e64d31b9Smaya { 2487e64d31b9Smaya struct asm_symbol *const s = (struct asm_symbol *) 2488e64d31b9Smaya _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string)); 2489e64d31b9Smaya 2490e64d31b9Smaya free((yyvsp[0].string)); 2491e64d31b9Smaya 2492e64d31b9Smaya if (s == NULL) { 2493e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid operand variable"); 2494e64d31b9Smaya YYERROR; 2495e64d31b9Smaya } else if ((s->type != at_param) && (s->type != at_temp) 2496e64d31b9Smaya && (s->type != at_attrib)) { 2497e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid operand variable"); 2498e64d31b9Smaya YYERROR; 2499e64d31b9Smaya } else if ((s->type == at_param) && s->param_is_array) { 2500e64d31b9Smaya yyerror(& (yylsp[0]), state, "non-array access to array PARAM"); 2501e64d31b9Smaya YYERROR; 2502e64d31b9Smaya } 2503e64d31b9Smaya 2504e64d31b9Smaya init_src_reg(& (yyval.src_reg)); 2505e64d31b9Smaya switch (s->type) { 2506e64d31b9Smaya case at_temp: 2507e64d31b9Smaya set_src_reg(& (yyval.src_reg), PROGRAM_TEMPORARY, s->temp_binding); 2508e64d31b9Smaya break; 2509e64d31b9Smaya case at_param: 2510e64d31b9Smaya set_src_reg_swz(& (yyval.src_reg), s->param_binding_type, 2511e64d31b9Smaya s->param_binding_begin, 2512e64d31b9Smaya s->param_binding_swizzle); 2513e64d31b9Smaya break; 2514e64d31b9Smaya case at_attrib: 2515e64d31b9Smaya set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, s->attrib_binding); 2516e64d31b9Smaya state->prog->info.inputs_read |= BITFIELD64_BIT((yyval.src_reg).Base.Index); 2517e64d31b9Smaya 2518e64d31b9Smaya if (!validate_inputs(& (yylsp[0]), state)) { 2519e64d31b9Smaya YYERROR; 2520e64d31b9Smaya } 2521e64d31b9Smaya break; 2522e64d31b9Smaya 2523e64d31b9Smaya default: 2524e64d31b9Smaya YYERROR; 2525e64d31b9Smaya break; 2526e64d31b9Smaya } 2527e64d31b9Smaya } 2528e64d31b9Smaya#line 2529 "program_parse.tab.c" /* yacc.c:1645 */ 2529e64d31b9Smaya break; 2530e64d31b9Smaya 2531e64d31b9Smaya case 57: 2532e64d31b9Smaya#line 770 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2533e64d31b9Smaya { 2534e64d31b9Smaya set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, (yyvsp[0].attrib)); 2535e64d31b9Smaya state->prog->info.inputs_read |= BITFIELD64_BIT((yyval.src_reg).Base.Index); 2536e64d31b9Smaya 2537e64d31b9Smaya if (!validate_inputs(& (yylsp[0]), state)) { 2538e64d31b9Smaya YYERROR; 2539e64d31b9Smaya } 2540e64d31b9Smaya } 2541e64d31b9Smaya#line 2542 "program_parse.tab.c" /* yacc.c:1645 */ 2542e64d31b9Smaya break; 2543e64d31b9Smaya 2544e64d31b9Smaya case 58: 2545e64d31b9Smaya#line 779 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2546e64d31b9Smaya { 2547e64d31b9Smaya if (! (yyvsp[-1].src_reg).Base.RelAddr 2548e64d31b9Smaya && ((unsigned) (yyvsp[-1].src_reg).Base.Index >= (yyvsp[-3].sym)->param_binding_length)) { 2549e64d31b9Smaya yyerror(& (yylsp[-1]), state, "out of bounds array access"); 2550e64d31b9Smaya YYERROR; 2551e64d31b9Smaya } 2552e64d31b9Smaya 2553e64d31b9Smaya init_src_reg(& (yyval.src_reg)); 2554e64d31b9Smaya (yyval.src_reg).Base.File = (yyvsp[-3].sym)->param_binding_type; 2555e64d31b9Smaya 2556e64d31b9Smaya if ((yyvsp[-1].src_reg).Base.RelAddr) { 2557e64d31b9Smaya state->prog->arb.IndirectRegisterFiles |= (1 << (yyval.src_reg).Base.File); 2558e64d31b9Smaya (yyvsp[-3].sym)->param_accessed_indirectly = 1; 2559e64d31b9Smaya 2560e64d31b9Smaya (yyval.src_reg).Base.RelAddr = 1; 2561e64d31b9Smaya (yyval.src_reg).Base.Index = (yyvsp[-1].src_reg).Base.Index; 2562e64d31b9Smaya (yyval.src_reg).Symbol = (yyvsp[-3].sym); 2563e64d31b9Smaya } else { 2564e64d31b9Smaya (yyval.src_reg).Base.Index = (yyvsp[-3].sym)->param_binding_begin + (yyvsp[-1].src_reg).Base.Index; 2565e64d31b9Smaya } 2566e64d31b9Smaya } 2567e64d31b9Smaya#line 2568 "program_parse.tab.c" /* yacc.c:1645 */ 2568e64d31b9Smaya break; 2569e64d31b9Smaya 2570e64d31b9Smaya case 59: 2571e64d31b9Smaya#line 801 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2572e64d31b9Smaya { 2573e64d31b9Smaya gl_register_file file = ((yyvsp[0].temp_sym).name != NULL) 2574e64d31b9Smaya ? (yyvsp[0].temp_sym).param_binding_type 2575e64d31b9Smaya : PROGRAM_CONSTANT; 2576e64d31b9Smaya set_src_reg_swz(& (yyval.src_reg), file, (yyvsp[0].temp_sym).param_binding_begin, 2577e64d31b9Smaya (yyvsp[0].temp_sym).param_binding_swizzle); 2578e64d31b9Smaya } 2579e64d31b9Smaya#line 2580 "program_parse.tab.c" /* yacc.c:1645 */ 2580e64d31b9Smaya break; 2581e64d31b9Smaya 2582e64d31b9Smaya case 60: 2583e64d31b9Smaya#line 811 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2584e64d31b9Smaya { 2585e64d31b9Smaya set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, (yyvsp[0].result)); 2586e64d31b9Smaya } 2587e64d31b9Smaya#line 2588 "program_parse.tab.c" /* yacc.c:1645 */ 2588e64d31b9Smaya break; 2589e64d31b9Smaya 2590e64d31b9Smaya case 61: 2591e64d31b9Smaya#line 815 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2592e64d31b9Smaya { 2593e64d31b9Smaya struct asm_symbol *const s = (struct asm_symbol *) 2594e64d31b9Smaya _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string)); 2595e64d31b9Smaya 2596e64d31b9Smaya free((yyvsp[0].string)); 2597e64d31b9Smaya 2598e64d31b9Smaya if (s == NULL) { 2599e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid operand variable"); 2600e64d31b9Smaya YYERROR; 2601e64d31b9Smaya } else if ((s->type != at_output) && (s->type != at_temp)) { 2602e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid operand variable"); 2603e64d31b9Smaya YYERROR; 2604e64d31b9Smaya } 2605e64d31b9Smaya 2606e64d31b9Smaya switch (s->type) { 2607e64d31b9Smaya case at_temp: 2608e64d31b9Smaya set_dst_reg(& (yyval.dst_reg), PROGRAM_TEMPORARY, s->temp_binding); 2609e64d31b9Smaya break; 2610e64d31b9Smaya case at_output: 2611e64d31b9Smaya set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, s->output_binding); 2612e64d31b9Smaya break; 2613e64d31b9Smaya default: 2614e64d31b9Smaya set_dst_reg(& (yyval.dst_reg), s->param_binding_type, s->param_binding_begin); 2615e64d31b9Smaya break; 2616e64d31b9Smaya } 2617e64d31b9Smaya } 2618e64d31b9Smaya#line 2619 "program_parse.tab.c" /* yacc.c:1645 */ 2619e64d31b9Smaya break; 2620e64d31b9Smaya 2621e64d31b9Smaya case 62: 2622e64d31b9Smaya#line 844 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2623e64d31b9Smaya { 2624e64d31b9Smaya struct asm_symbol *const s = (struct asm_symbol *) 2625e64d31b9Smaya _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string)); 2626e64d31b9Smaya 2627e64d31b9Smaya free((yyvsp[0].string)); 2628e64d31b9Smaya 2629e64d31b9Smaya if (s == NULL) { 2630e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid operand variable"); 2631e64d31b9Smaya YYERROR; 2632e64d31b9Smaya } else if ((s->type != at_param) || !s->param_is_array) { 2633e64d31b9Smaya yyerror(& (yylsp[0]), state, "array access to non-PARAM variable"); 2634e64d31b9Smaya YYERROR; 2635e64d31b9Smaya } else { 2636e64d31b9Smaya (yyval.sym) = s; 2637e64d31b9Smaya } 2638e64d31b9Smaya } 2639e64d31b9Smaya#line 2640 "program_parse.tab.c" /* yacc.c:1645 */ 2640e64d31b9Smaya break; 2641e64d31b9Smaya 2642e64d31b9Smaya case 65: 2643e64d31b9Smaya#line 865 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2644e64d31b9Smaya { 2645e64d31b9Smaya init_src_reg(& (yyval.src_reg)); 2646e64d31b9Smaya (yyval.src_reg).Base.Index = (yyvsp[0].integer); 2647e64d31b9Smaya } 2648e64d31b9Smaya#line 2649 "program_parse.tab.c" /* yacc.c:1645 */ 2649e64d31b9Smaya break; 2650e64d31b9Smaya 2651e64d31b9Smaya case 66: 2652e64d31b9Smaya#line 872 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2653e64d31b9Smaya { 2654e64d31b9Smaya /* FINISHME: Add support for multiple address registers. 2655e64d31b9Smaya */ 2656e64d31b9Smaya /* FINISHME: Add support for 4-component address registers. 2657e64d31b9Smaya */ 2658e64d31b9Smaya init_src_reg(& (yyval.src_reg)); 2659e64d31b9Smaya (yyval.src_reg).Base.RelAddr = 1; 2660e64d31b9Smaya (yyval.src_reg).Base.Index = (yyvsp[0].integer); 2661e64d31b9Smaya } 2662e64d31b9Smaya#line 2663 "program_parse.tab.c" /* yacc.c:1645 */ 2663e64d31b9Smaya break; 2664e64d31b9Smaya 2665e64d31b9Smaya case 67: 2666e64d31b9Smaya#line 883 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2667e64d31b9Smaya { (yyval.integer) = 0; } 2668e64d31b9Smaya#line 2669 "program_parse.tab.c" /* yacc.c:1645 */ 2669e64d31b9Smaya break; 2670e64d31b9Smaya 2671e64d31b9Smaya case 68: 2672e64d31b9Smaya#line 884 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2673e64d31b9Smaya { (yyval.integer) = (yyvsp[0].integer); } 2674e64d31b9Smaya#line 2675 "program_parse.tab.c" /* yacc.c:1645 */ 2675e64d31b9Smaya break; 2676e64d31b9Smaya 2677e64d31b9Smaya case 69: 2678e64d31b9Smaya#line 885 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2679e64d31b9Smaya { (yyval.integer) = -(yyvsp[0].integer); } 2680e64d31b9Smaya#line 2681 "program_parse.tab.c" /* yacc.c:1645 */ 2681e64d31b9Smaya break; 2682e64d31b9Smaya 2683e64d31b9Smaya case 70: 2684e64d31b9Smaya#line 889 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2685e64d31b9Smaya { 2686e64d31b9Smaya if (((yyvsp[0].integer) < 0) || ((yyvsp[0].integer) > (state->limits->MaxAddressOffset - 1))) { 2687e64d31b9Smaya char s[100]; 2688e64d31b9Smaya _mesa_snprintf(s, sizeof(s), 2689e64d31b9Smaya "relative address offset too large (%d)", (yyvsp[0].integer)); 2690e64d31b9Smaya yyerror(& (yylsp[0]), state, s); 2691e64d31b9Smaya YYERROR; 2692e64d31b9Smaya } else { 2693e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 2694e64d31b9Smaya } 2695e64d31b9Smaya } 2696e64d31b9Smaya#line 2697 "program_parse.tab.c" /* yacc.c:1645 */ 2697e64d31b9Smaya break; 2698e64d31b9Smaya 2699e64d31b9Smaya case 71: 2700e64d31b9Smaya#line 903 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2701e64d31b9Smaya { 2702e64d31b9Smaya if (((yyvsp[0].integer) < 0) || ((yyvsp[0].integer) > state->limits->MaxAddressOffset)) { 2703e64d31b9Smaya char s[100]; 2704e64d31b9Smaya _mesa_snprintf(s, sizeof(s), 2705e64d31b9Smaya "relative address offset too large (%d)", (yyvsp[0].integer)); 2706e64d31b9Smaya yyerror(& (yylsp[0]), state, s); 2707e64d31b9Smaya YYERROR; 2708e64d31b9Smaya } else { 2709e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 2710e64d31b9Smaya } 2711e64d31b9Smaya } 2712e64d31b9Smaya#line 2713 "program_parse.tab.c" /* yacc.c:1645 */ 2713e64d31b9Smaya break; 2714e64d31b9Smaya 2715e64d31b9Smaya case 72: 2716e64d31b9Smaya#line 917 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2717e64d31b9Smaya { 2718e64d31b9Smaya struct asm_symbol *const s = (struct asm_symbol *) 2719e64d31b9Smaya _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string)); 2720e64d31b9Smaya 2721e64d31b9Smaya free((yyvsp[0].string)); 2722e64d31b9Smaya 2723e64d31b9Smaya if (s == NULL) { 2724e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid array member"); 2725e64d31b9Smaya YYERROR; 2726e64d31b9Smaya } else if (s->type != at_address) { 2727e64d31b9Smaya yyerror(& (yylsp[0]), state, 2728e64d31b9Smaya "invalid variable for indexed array access"); 2729e64d31b9Smaya YYERROR; 2730e64d31b9Smaya } else { 2731e64d31b9Smaya (yyval.sym) = s; 2732e64d31b9Smaya } 2733e64d31b9Smaya } 2734e64d31b9Smaya#line 2735 "program_parse.tab.c" /* yacc.c:1645 */ 2735e64d31b9Smaya break; 2736e64d31b9Smaya 2737e64d31b9Smaya case 73: 2738e64d31b9Smaya#line 937 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2739e64d31b9Smaya { 2740e64d31b9Smaya if ((yyvsp[0].swiz_mask).mask != WRITEMASK_X) { 2741e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid address component selector"); 2742e64d31b9Smaya YYERROR; 2743e64d31b9Smaya } else { 2744e64d31b9Smaya (yyval.swiz_mask) = (yyvsp[0].swiz_mask); 2745e64d31b9Smaya } 2746e64d31b9Smaya } 2747e64d31b9Smaya#line 2748 "program_parse.tab.c" /* yacc.c:1645 */ 2748e64d31b9Smaya break; 2749e64d31b9Smaya 2750e64d31b9Smaya case 74: 2751e64d31b9Smaya#line 948 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2752e64d31b9Smaya { 2753e64d31b9Smaya if ((yyvsp[0].swiz_mask).mask != WRITEMASK_X) { 2754e64d31b9Smaya yyerror(& (yylsp[0]), state, 2755e64d31b9Smaya "address register write mask must be \".x\""); 2756e64d31b9Smaya YYERROR; 2757e64d31b9Smaya } else { 2758e64d31b9Smaya (yyval.swiz_mask) = (yyvsp[0].swiz_mask); 2759e64d31b9Smaya } 2760e64d31b9Smaya } 2761e64d31b9Smaya#line 2762 "program_parse.tab.c" /* yacc.c:1645 */ 2762e64d31b9Smaya break; 2763e64d31b9Smaya 2764e64d31b9Smaya case 79: 2765e64d31b9Smaya#line 964 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2766e64d31b9Smaya { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; } 2767e64d31b9Smaya#line 2768 "program_parse.tab.c" /* yacc.c:1645 */ 2768e64d31b9Smaya break; 2769e64d31b9Smaya 2770e64d31b9Smaya case 84: 2771e64d31b9Smaya#line 968 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2772e64d31b9Smaya { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; } 2773e64d31b9Smaya#line 2774 "program_parse.tab.c" /* yacc.c:1645 */ 2774e64d31b9Smaya break; 2775e64d31b9Smaya 2776e64d31b9Smaya case 91: 2777e64d31b9Smaya#line 980 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2778e64d31b9Smaya { 2779e64d31b9Smaya struct asm_symbol *const s = 2780e64d31b9Smaya declare_variable(state, (yyvsp[-2].string), at_attrib, & (yylsp[-2])); 2781e64d31b9Smaya 2782e64d31b9Smaya if (s == NULL) { 2783e64d31b9Smaya free((yyvsp[-2].string)); 2784e64d31b9Smaya YYERROR; 2785e64d31b9Smaya } else { 2786e64d31b9Smaya s->attrib_binding = (yyvsp[0].attrib); 2787e64d31b9Smaya state->InputsBound |= BITFIELD64_BIT(s->attrib_binding); 2788e64d31b9Smaya 2789e64d31b9Smaya if (!validate_inputs(& (yylsp[0]), state)) { 2790e64d31b9Smaya YYERROR; 2791e64d31b9Smaya } 2792e64d31b9Smaya } 2793e64d31b9Smaya } 2794e64d31b9Smaya#line 2795 "program_parse.tab.c" /* yacc.c:1645 */ 2795e64d31b9Smaya break; 2796e64d31b9Smaya 2797e64d31b9Smaya case 92: 2798e64d31b9Smaya#line 999 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2799e64d31b9Smaya { 2800e64d31b9Smaya (yyval.attrib) = (yyvsp[0].attrib); 2801e64d31b9Smaya } 2802e64d31b9Smaya#line 2803 "program_parse.tab.c" /* yacc.c:1645 */ 2803e64d31b9Smaya break; 2804e64d31b9Smaya 2805e64d31b9Smaya case 93: 2806e64d31b9Smaya#line 1003 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2807e64d31b9Smaya { 2808e64d31b9Smaya (yyval.attrib) = (yyvsp[0].attrib); 2809e64d31b9Smaya } 2810e64d31b9Smaya#line 2811 "program_parse.tab.c" /* yacc.c:1645 */ 2811e64d31b9Smaya break; 2812e64d31b9Smaya 2813e64d31b9Smaya case 94: 2814e64d31b9Smaya#line 1009 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2815e64d31b9Smaya { 2816e64d31b9Smaya (yyval.attrib) = VERT_ATTRIB_POS; 2817e64d31b9Smaya } 2818e64d31b9Smaya#line 2819 "program_parse.tab.c" /* yacc.c:1645 */ 2819e64d31b9Smaya break; 2820e64d31b9Smaya 2821e64d31b9Smaya case 95: 2822e64d31b9Smaya#line 1013 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2823e64d31b9Smaya { 2824e64d31b9Smaya (yyval.attrib) = VERT_ATTRIB_NORMAL; 2825e64d31b9Smaya } 2826e64d31b9Smaya#line 2827 "program_parse.tab.c" /* yacc.c:1645 */ 2827e64d31b9Smaya break; 2828e64d31b9Smaya 2829e64d31b9Smaya case 96: 2830e64d31b9Smaya#line 1017 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2831e64d31b9Smaya { 2832e64d31b9Smaya (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[0].integer); 2833e64d31b9Smaya } 2834e64d31b9Smaya#line 2835 "program_parse.tab.c" /* yacc.c:1645 */ 2835e64d31b9Smaya break; 2836e64d31b9Smaya 2837e64d31b9Smaya case 97: 2838e64d31b9Smaya#line 1021 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2839e64d31b9Smaya { 2840e64d31b9Smaya (yyval.attrib) = VERT_ATTRIB_FOG; 2841e64d31b9Smaya } 2842e64d31b9Smaya#line 2843 "program_parse.tab.c" /* yacc.c:1645 */ 2843e64d31b9Smaya break; 2844e64d31b9Smaya 2845e64d31b9Smaya case 98: 2846e64d31b9Smaya#line 1025 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2847e64d31b9Smaya { 2848e64d31b9Smaya (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[0].integer); 2849e64d31b9Smaya } 2850e64d31b9Smaya#line 2851 "program_parse.tab.c" /* yacc.c:1645 */ 2851e64d31b9Smaya break; 2852e64d31b9Smaya 2853e64d31b9Smaya case 99: 2854e64d31b9Smaya#line 1029 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2855e64d31b9Smaya { 2856e64d31b9Smaya yyerror(& (yylsp[-3]), state, "GL_ARB_matrix_palette not supported"); 2857e64d31b9Smaya YYERROR; 2858e64d31b9Smaya } 2859e64d31b9Smaya#line 2860 "program_parse.tab.c" /* yacc.c:1645 */ 2860e64d31b9Smaya break; 2861e64d31b9Smaya 2862e64d31b9Smaya case 100: 2863e64d31b9Smaya#line 1034 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2864e64d31b9Smaya { 2865e64d31b9Smaya (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[-1].integer); 2866e64d31b9Smaya } 2867e64d31b9Smaya#line 2868 "program_parse.tab.c" /* yacc.c:1645 */ 2868e64d31b9Smaya break; 2869e64d31b9Smaya 2870e64d31b9Smaya case 101: 2871e64d31b9Smaya#line 1040 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2872e64d31b9Smaya { 2873e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->limits->MaxAttribs) { 2874e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid vertex attribute reference"); 2875e64d31b9Smaya YYERROR; 2876e64d31b9Smaya } 2877e64d31b9Smaya 2878e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 2879e64d31b9Smaya } 2880e64d31b9Smaya#line 2881 "program_parse.tab.c" /* yacc.c:1645 */ 2881e64d31b9Smaya break; 2882e64d31b9Smaya 2883e64d31b9Smaya case 103: 2884e64d31b9Smaya#line 1053 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2885e64d31b9Smaya { 2886e64d31b9Smaya (yyval.attrib) = VARYING_SLOT_POS; 2887e64d31b9Smaya } 2888e64d31b9Smaya#line 2889 "program_parse.tab.c" /* yacc.c:1645 */ 2889e64d31b9Smaya break; 2890e64d31b9Smaya 2891e64d31b9Smaya case 104: 2892e64d31b9Smaya#line 1057 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2893e64d31b9Smaya { 2894e64d31b9Smaya (yyval.attrib) = VARYING_SLOT_COL0 + (yyvsp[0].integer); 2895e64d31b9Smaya } 2896e64d31b9Smaya#line 2897 "program_parse.tab.c" /* yacc.c:1645 */ 2897e64d31b9Smaya break; 2898e64d31b9Smaya 2899e64d31b9Smaya case 105: 2900e64d31b9Smaya#line 1061 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2901e64d31b9Smaya { 2902e64d31b9Smaya (yyval.attrib) = VARYING_SLOT_FOGC; 2903e64d31b9Smaya } 2904e64d31b9Smaya#line 2905 "program_parse.tab.c" /* yacc.c:1645 */ 2905e64d31b9Smaya break; 2906e64d31b9Smaya 2907e64d31b9Smaya case 106: 2908e64d31b9Smaya#line 1065 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2909e64d31b9Smaya { 2910e64d31b9Smaya (yyval.attrib) = VARYING_SLOT_TEX0 + (yyvsp[0].integer); 2911e64d31b9Smaya } 2912e64d31b9Smaya#line 2913 "program_parse.tab.c" /* yacc.c:1645 */ 2913e64d31b9Smaya break; 2914e64d31b9Smaya 2915e64d31b9Smaya case 109: 2916e64d31b9Smaya#line 1073 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2917e64d31b9Smaya { 2918e64d31b9Smaya struct asm_symbol *const s = 2919e64d31b9Smaya declare_variable(state, (yyvsp[-1].string), at_param, & (yylsp[-1])); 2920e64d31b9Smaya 2921e64d31b9Smaya if (s == NULL) { 2922e64d31b9Smaya free((yyvsp[-1].string)); 2923e64d31b9Smaya YYERROR; 2924e64d31b9Smaya } else { 2925e64d31b9Smaya s->param_binding_type = (yyvsp[0].temp_sym).param_binding_type; 2926e64d31b9Smaya s->param_binding_begin = (yyvsp[0].temp_sym).param_binding_begin; 2927e64d31b9Smaya s->param_binding_length = (yyvsp[0].temp_sym).param_binding_length; 2928e64d31b9Smaya s->param_binding_swizzle = (yyvsp[0].temp_sym).param_binding_swizzle; 2929e64d31b9Smaya s->param_is_array = 0; 2930e64d31b9Smaya } 2931e64d31b9Smaya } 2932e64d31b9Smaya#line 2933 "program_parse.tab.c" /* yacc.c:1645 */ 2933e64d31b9Smaya break; 2934e64d31b9Smaya 2935e64d31b9Smaya case 110: 2936e64d31b9Smaya#line 1091 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2937e64d31b9Smaya { 2938e64d31b9Smaya if (((yyvsp[-2].integer) != 0) && ((unsigned) (yyvsp[-2].integer) != (yyvsp[0].temp_sym).param_binding_length)) { 2939e64d31b9Smaya free((yyvsp[-4].string)); 2940e64d31b9Smaya yyerror(& (yylsp[-2]), state, 2941e64d31b9Smaya "parameter array size and number of bindings must match"); 2942e64d31b9Smaya YYERROR; 2943e64d31b9Smaya } else { 2944e64d31b9Smaya struct asm_symbol *const s = 2945e64d31b9Smaya declare_variable(state, (yyvsp[-4].string), (yyvsp[0].temp_sym).type, & (yylsp[-4])); 2946e64d31b9Smaya 2947e64d31b9Smaya if (s == NULL) { 2948e64d31b9Smaya free((yyvsp[-4].string)); 2949e64d31b9Smaya YYERROR; 2950e64d31b9Smaya } else { 2951e64d31b9Smaya s->param_binding_type = (yyvsp[0].temp_sym).param_binding_type; 2952e64d31b9Smaya s->param_binding_begin = (yyvsp[0].temp_sym).param_binding_begin; 2953e64d31b9Smaya s->param_binding_length = (yyvsp[0].temp_sym).param_binding_length; 2954e64d31b9Smaya s->param_binding_swizzle = SWIZZLE_XYZW; 2955e64d31b9Smaya s->param_is_array = 1; 2956e64d31b9Smaya } 2957e64d31b9Smaya } 2958e64d31b9Smaya } 2959e64d31b9Smaya#line 2960 "program_parse.tab.c" /* yacc.c:1645 */ 2960e64d31b9Smaya break; 2961e64d31b9Smaya 2962e64d31b9Smaya case 111: 2963e64d31b9Smaya#line 1116 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2964e64d31b9Smaya { 2965e64d31b9Smaya (yyval.integer) = 0; 2966e64d31b9Smaya } 2967e64d31b9Smaya#line 2968 "program_parse.tab.c" /* yacc.c:1645 */ 2968e64d31b9Smaya break; 2969e64d31b9Smaya 2970e64d31b9Smaya case 112: 2971e64d31b9Smaya#line 1120 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2972e64d31b9Smaya { 2973e64d31b9Smaya if (((yyvsp[0].integer) < 1) || ((unsigned) (yyvsp[0].integer) > state->limits->MaxParameters)) { 2974e64d31b9Smaya char msg[100]; 2975e64d31b9Smaya _mesa_snprintf(msg, sizeof(msg), 2976e64d31b9Smaya "invalid parameter array size (size=%d max=%u)", 2977e64d31b9Smaya (yyvsp[0].integer), state->limits->MaxParameters); 2978e64d31b9Smaya yyerror(& (yylsp[0]), state, msg); 2979e64d31b9Smaya YYERROR; 2980e64d31b9Smaya } else { 2981e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 2982e64d31b9Smaya } 2983e64d31b9Smaya } 2984e64d31b9Smaya#line 2985 "program_parse.tab.c" /* yacc.c:1645 */ 2985e64d31b9Smaya break; 2986e64d31b9Smaya 2987e64d31b9Smaya case 113: 2988e64d31b9Smaya#line 1135 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2989e64d31b9Smaya { 2990e64d31b9Smaya (yyval.temp_sym) = (yyvsp[0].temp_sym); 2991e64d31b9Smaya } 2992e64d31b9Smaya#line 2993 "program_parse.tab.c" /* yacc.c:1645 */ 2993e64d31b9Smaya break; 2994e64d31b9Smaya 2995e64d31b9Smaya case 114: 2996e64d31b9Smaya#line 1141 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 2997e64d31b9Smaya { 2998e64d31b9Smaya (yyval.temp_sym) = (yyvsp[-1].temp_sym); 2999e64d31b9Smaya } 3000e64d31b9Smaya#line 3001 "program_parse.tab.c" /* yacc.c:1645 */ 3001e64d31b9Smaya break; 3002e64d31b9Smaya 3003e64d31b9Smaya case 116: 3004e64d31b9Smaya#line 1148 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3005e64d31b9Smaya { 3006e64d31b9Smaya (yyvsp[-2].temp_sym).param_binding_length += (yyvsp[0].temp_sym).param_binding_length; 3007e64d31b9Smaya (yyval.temp_sym) = (yyvsp[-2].temp_sym); 3008e64d31b9Smaya } 3009e64d31b9Smaya#line 3010 "program_parse.tab.c" /* yacc.c:1645 */ 3010e64d31b9Smaya break; 3011e64d31b9Smaya 3012e64d31b9Smaya case 117: 3013e64d31b9Smaya#line 1155 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3014e64d31b9Smaya { 3015e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3016e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3017e64d31b9Smaya initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[0].state)); 3018e64d31b9Smaya } 3019e64d31b9Smaya#line 3020 "program_parse.tab.c" /* yacc.c:1645 */ 3020e64d31b9Smaya break; 3021e64d31b9Smaya 3022e64d31b9Smaya case 118: 3023e64d31b9Smaya#line 1161 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3024e64d31b9Smaya { 3025e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3026e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3027e64d31b9Smaya initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[0].state)); 3028e64d31b9Smaya } 3029e64d31b9Smaya#line 3030 "program_parse.tab.c" /* yacc.c:1645 */ 3030e64d31b9Smaya break; 3031e64d31b9Smaya 3032e64d31b9Smaya case 119: 3033e64d31b9Smaya#line 1167 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3034e64d31b9Smaya { 3035e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3036e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3037e64d31b9Smaya initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[0].vector), GL_TRUE); 3038e64d31b9Smaya } 3039e64d31b9Smaya#line 3040 "program_parse.tab.c" /* yacc.c:1645 */ 3040e64d31b9Smaya break; 3041e64d31b9Smaya 3042e64d31b9Smaya case 120: 3043e64d31b9Smaya#line 1175 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3044e64d31b9Smaya { 3045e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3046e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3047e64d31b9Smaya initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[0].state)); 3048e64d31b9Smaya } 3049e64d31b9Smaya#line 3050 "program_parse.tab.c" /* yacc.c:1645 */ 3050e64d31b9Smaya break; 3051e64d31b9Smaya 3052e64d31b9Smaya case 121: 3053e64d31b9Smaya#line 1181 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3054e64d31b9Smaya { 3055e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3056e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3057e64d31b9Smaya initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[0].state)); 3058e64d31b9Smaya } 3059e64d31b9Smaya#line 3060 "program_parse.tab.c" /* yacc.c:1645 */ 3060e64d31b9Smaya break; 3061e64d31b9Smaya 3062e64d31b9Smaya case 122: 3063e64d31b9Smaya#line 1187 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3064e64d31b9Smaya { 3065e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3066e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3067e64d31b9Smaya initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[0].vector), GL_TRUE); 3068e64d31b9Smaya } 3069e64d31b9Smaya#line 3070 "program_parse.tab.c" /* yacc.c:1645 */ 3070e64d31b9Smaya break; 3071e64d31b9Smaya 3072e64d31b9Smaya case 123: 3073e64d31b9Smaya#line 1195 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3074e64d31b9Smaya { 3075e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3076e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3077e64d31b9Smaya initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[0].state)); 3078e64d31b9Smaya } 3079e64d31b9Smaya#line 3080 "program_parse.tab.c" /* yacc.c:1645 */ 3080e64d31b9Smaya break; 3081e64d31b9Smaya 3082e64d31b9Smaya case 124: 3083e64d31b9Smaya#line 1201 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3084e64d31b9Smaya { 3085e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3086e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3087e64d31b9Smaya initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[0].state)); 3088e64d31b9Smaya } 3089e64d31b9Smaya#line 3090 "program_parse.tab.c" /* yacc.c:1645 */ 3090e64d31b9Smaya break; 3091e64d31b9Smaya 3092e64d31b9Smaya case 125: 3093e64d31b9Smaya#line 1207 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3094e64d31b9Smaya { 3095e64d31b9Smaya memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); 3096e64d31b9Smaya (yyval.temp_sym).param_binding_begin = ~0; 3097e64d31b9Smaya initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[0].vector), GL_FALSE); 3098e64d31b9Smaya } 3099e64d31b9Smaya#line 3100 "program_parse.tab.c" /* yacc.c:1645 */ 3100e64d31b9Smaya break; 3101e64d31b9Smaya 3102e64d31b9Smaya case 126: 3103e64d31b9Smaya#line 1214 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3104e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3105e64d31b9Smaya#line 3106 "program_parse.tab.c" /* yacc.c:1645 */ 3106e64d31b9Smaya break; 3107e64d31b9Smaya 3108e64d31b9Smaya case 127: 3109e64d31b9Smaya#line 1215 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3110e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3111e64d31b9Smaya#line 3112 "program_parse.tab.c" /* yacc.c:1645 */ 3112e64d31b9Smaya break; 3113e64d31b9Smaya 3114e64d31b9Smaya case 128: 3115e64d31b9Smaya#line 1218 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3116e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3117e64d31b9Smaya#line 3118 "program_parse.tab.c" /* yacc.c:1645 */ 3118e64d31b9Smaya break; 3119e64d31b9Smaya 3120e64d31b9Smaya case 129: 3121e64d31b9Smaya#line 1219 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3122e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3123e64d31b9Smaya#line 3124 "program_parse.tab.c" /* yacc.c:1645 */ 3124e64d31b9Smaya break; 3125e64d31b9Smaya 3126e64d31b9Smaya case 130: 3127e64d31b9Smaya#line 1220 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3128e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3129e64d31b9Smaya#line 3130 "program_parse.tab.c" /* yacc.c:1645 */ 3130e64d31b9Smaya break; 3131e64d31b9Smaya 3132e64d31b9Smaya case 131: 3133e64d31b9Smaya#line 1221 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3134e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3135e64d31b9Smaya#line 3136 "program_parse.tab.c" /* yacc.c:1645 */ 3136e64d31b9Smaya break; 3137e64d31b9Smaya 3138e64d31b9Smaya case 132: 3139e64d31b9Smaya#line 1222 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3140e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3141e64d31b9Smaya#line 3142 "program_parse.tab.c" /* yacc.c:1645 */ 3142e64d31b9Smaya break; 3143e64d31b9Smaya 3144e64d31b9Smaya case 133: 3145e64d31b9Smaya#line 1223 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3146e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3147e64d31b9Smaya#line 3148 "program_parse.tab.c" /* yacc.c:1645 */ 3148e64d31b9Smaya break; 3149e64d31b9Smaya 3150e64d31b9Smaya case 134: 3151e64d31b9Smaya#line 1224 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3152e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3153e64d31b9Smaya#line 3154 "program_parse.tab.c" /* yacc.c:1645 */ 3154e64d31b9Smaya break; 3155e64d31b9Smaya 3156e64d31b9Smaya case 135: 3157e64d31b9Smaya#line 1225 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3158e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3159e64d31b9Smaya#line 3160 "program_parse.tab.c" /* yacc.c:1645 */ 3160e64d31b9Smaya break; 3161e64d31b9Smaya 3162e64d31b9Smaya case 136: 3163e64d31b9Smaya#line 1226 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3164e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3165e64d31b9Smaya#line 3166 "program_parse.tab.c" /* yacc.c:1645 */ 3166e64d31b9Smaya break; 3167e64d31b9Smaya 3168e64d31b9Smaya case 137: 3169e64d31b9Smaya#line 1227 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3170e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3171e64d31b9Smaya#line 3172 "program_parse.tab.c" /* yacc.c:1645 */ 3172e64d31b9Smaya break; 3173e64d31b9Smaya 3174e64d31b9Smaya case 138: 3175e64d31b9Smaya#line 1228 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3176e64d31b9Smaya { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); } 3177e64d31b9Smaya#line 3178 "program_parse.tab.c" /* yacc.c:1645 */ 3178e64d31b9Smaya break; 3179e64d31b9Smaya 3180e64d31b9Smaya case 139: 3181e64d31b9Smaya#line 1232 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3182e64d31b9Smaya { 3183e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3184e64d31b9Smaya (yyval.state)[0] = STATE_MATERIAL; 3185e64d31b9Smaya (yyval.state)[1] = (yyvsp[-1].integer); 3186e64d31b9Smaya (yyval.state)[2] = (yyvsp[0].integer); 3187e64d31b9Smaya } 3188e64d31b9Smaya#line 3189 "program_parse.tab.c" /* yacc.c:1645 */ 3189e64d31b9Smaya break; 3190e64d31b9Smaya 3191e64d31b9Smaya case 140: 3192e64d31b9Smaya#line 1241 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3193e64d31b9Smaya { 3194e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3195e64d31b9Smaya } 3196e64d31b9Smaya#line 3197 "program_parse.tab.c" /* yacc.c:1645 */ 3197e64d31b9Smaya break; 3198e64d31b9Smaya 3199e64d31b9Smaya case 141: 3200e64d31b9Smaya#line 1245 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3201e64d31b9Smaya { 3202e64d31b9Smaya (yyval.integer) = STATE_EMISSION; 3203e64d31b9Smaya } 3204e64d31b9Smaya#line 3205 "program_parse.tab.c" /* yacc.c:1645 */ 3205e64d31b9Smaya break; 3206e64d31b9Smaya 3207e64d31b9Smaya case 142: 3208e64d31b9Smaya#line 1249 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3209e64d31b9Smaya { 3210e64d31b9Smaya (yyval.integer) = STATE_SHININESS; 3211e64d31b9Smaya } 3212e64d31b9Smaya#line 3213 "program_parse.tab.c" /* yacc.c:1645 */ 3213e64d31b9Smaya break; 3214e64d31b9Smaya 3215e64d31b9Smaya case 143: 3216e64d31b9Smaya#line 1255 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3217e64d31b9Smaya { 3218e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3219e64d31b9Smaya (yyval.state)[0] = STATE_LIGHT; 3220e64d31b9Smaya (yyval.state)[1] = (yyvsp[-2].integer); 3221e64d31b9Smaya (yyval.state)[2] = (yyvsp[0].integer); 3222e64d31b9Smaya } 3223e64d31b9Smaya#line 3224 "program_parse.tab.c" /* yacc.c:1645 */ 3224e64d31b9Smaya break; 3225e64d31b9Smaya 3226e64d31b9Smaya case 144: 3227e64d31b9Smaya#line 1264 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3228e64d31b9Smaya { 3229e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3230e64d31b9Smaya } 3231e64d31b9Smaya#line 3232 "program_parse.tab.c" /* yacc.c:1645 */ 3232e64d31b9Smaya break; 3233e64d31b9Smaya 3234e64d31b9Smaya case 145: 3235e64d31b9Smaya#line 1268 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3236e64d31b9Smaya { 3237e64d31b9Smaya (yyval.integer) = STATE_POSITION; 3238e64d31b9Smaya } 3239e64d31b9Smaya#line 3240 "program_parse.tab.c" /* yacc.c:1645 */ 3240e64d31b9Smaya break; 3241e64d31b9Smaya 3242e64d31b9Smaya case 146: 3243e64d31b9Smaya#line 1272 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3244e64d31b9Smaya { 3245e64d31b9Smaya if (!state->ctx->Extensions.EXT_point_parameters) { 3246e64d31b9Smaya yyerror(& (yylsp[0]), state, "GL_ARB_point_parameters not supported"); 3247e64d31b9Smaya YYERROR; 3248e64d31b9Smaya } 3249e64d31b9Smaya 3250e64d31b9Smaya (yyval.integer) = STATE_ATTENUATION; 3251e64d31b9Smaya } 3252e64d31b9Smaya#line 3253 "program_parse.tab.c" /* yacc.c:1645 */ 3253e64d31b9Smaya break; 3254e64d31b9Smaya 3255e64d31b9Smaya case 147: 3256e64d31b9Smaya#line 1281 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3257e64d31b9Smaya { 3258e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3259e64d31b9Smaya } 3260e64d31b9Smaya#line 3261 "program_parse.tab.c" /* yacc.c:1645 */ 3261e64d31b9Smaya break; 3262e64d31b9Smaya 3263e64d31b9Smaya case 148: 3264e64d31b9Smaya#line 1285 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3265e64d31b9Smaya { 3266e64d31b9Smaya (yyval.integer) = STATE_HALF_VECTOR; 3267e64d31b9Smaya } 3268e64d31b9Smaya#line 3269 "program_parse.tab.c" /* yacc.c:1645 */ 3269e64d31b9Smaya break; 3270e64d31b9Smaya 3271e64d31b9Smaya case 149: 3272e64d31b9Smaya#line 1291 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3273e64d31b9Smaya { 3274e64d31b9Smaya (yyval.integer) = STATE_SPOT_DIRECTION; 3275e64d31b9Smaya } 3276e64d31b9Smaya#line 3277 "program_parse.tab.c" /* yacc.c:1645 */ 3277e64d31b9Smaya break; 3278e64d31b9Smaya 3279e64d31b9Smaya case 150: 3280e64d31b9Smaya#line 1297 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3281e64d31b9Smaya { 3282e64d31b9Smaya (yyval.state)[0] = (yyvsp[0].state)[0]; 3283e64d31b9Smaya (yyval.state)[1] = (yyvsp[0].state)[1]; 3284e64d31b9Smaya } 3285e64d31b9Smaya#line 3286 "program_parse.tab.c" /* yacc.c:1645 */ 3286e64d31b9Smaya break; 3287e64d31b9Smaya 3288e64d31b9Smaya case 151: 3289e64d31b9Smaya#line 1304 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3290e64d31b9Smaya { 3291e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3292e64d31b9Smaya (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; 3293e64d31b9Smaya } 3294e64d31b9Smaya#line 3295 "program_parse.tab.c" /* yacc.c:1645 */ 3295e64d31b9Smaya break; 3296e64d31b9Smaya 3297e64d31b9Smaya case 152: 3298e64d31b9Smaya#line 1309 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3299e64d31b9Smaya { 3300e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3301e64d31b9Smaya (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; 3302e64d31b9Smaya (yyval.state)[1] = (yyvsp[-1].integer); 3303e64d31b9Smaya } 3304e64d31b9Smaya#line 3305 "program_parse.tab.c" /* yacc.c:1645 */ 3305e64d31b9Smaya break; 3306e64d31b9Smaya 3307e64d31b9Smaya case 153: 3308e64d31b9Smaya#line 1317 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3309e64d31b9Smaya { 3310e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3311e64d31b9Smaya (yyval.state)[0] = STATE_LIGHTPROD; 3312e64d31b9Smaya (yyval.state)[1] = (yyvsp[-3].integer); 3313e64d31b9Smaya (yyval.state)[2] = (yyvsp[-1].integer); 3314e64d31b9Smaya (yyval.state)[3] = (yyvsp[0].integer); 3315e64d31b9Smaya } 3316e64d31b9Smaya#line 3317 "program_parse.tab.c" /* yacc.c:1645 */ 3317e64d31b9Smaya break; 3318e64d31b9Smaya 3319e64d31b9Smaya case 155: 3320e64d31b9Smaya#line 1329 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3321e64d31b9Smaya { 3322e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3323e64d31b9Smaya (yyval.state)[0] = (yyvsp[0].integer); 3324e64d31b9Smaya (yyval.state)[1] = (yyvsp[-1].integer); 3325e64d31b9Smaya } 3326e64d31b9Smaya#line 3327 "program_parse.tab.c" /* yacc.c:1645 */ 3327e64d31b9Smaya break; 3328e64d31b9Smaya 3329e64d31b9Smaya case 156: 3330e64d31b9Smaya#line 1337 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3331e64d31b9Smaya { 3332e64d31b9Smaya (yyval.integer) = STATE_TEXENV_COLOR; 3333e64d31b9Smaya } 3334e64d31b9Smaya#line 3335 "program_parse.tab.c" /* yacc.c:1645 */ 3335e64d31b9Smaya break; 3336e64d31b9Smaya 3337e64d31b9Smaya case 157: 3338e64d31b9Smaya#line 1343 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3339e64d31b9Smaya { 3340e64d31b9Smaya (yyval.integer) = STATE_AMBIENT; 3341e64d31b9Smaya } 3342e64d31b9Smaya#line 3343 "program_parse.tab.c" /* yacc.c:1645 */ 3343e64d31b9Smaya break; 3344e64d31b9Smaya 3345e64d31b9Smaya case 158: 3346e64d31b9Smaya#line 1347 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3347e64d31b9Smaya { 3348e64d31b9Smaya (yyval.integer) = STATE_DIFFUSE; 3349e64d31b9Smaya } 3350e64d31b9Smaya#line 3351 "program_parse.tab.c" /* yacc.c:1645 */ 3351e64d31b9Smaya break; 3352e64d31b9Smaya 3353e64d31b9Smaya case 159: 3354e64d31b9Smaya#line 1351 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3355e64d31b9Smaya { 3356e64d31b9Smaya (yyval.integer) = STATE_SPECULAR; 3357e64d31b9Smaya } 3358e64d31b9Smaya#line 3359 "program_parse.tab.c" /* yacc.c:1645 */ 3359e64d31b9Smaya break; 3360e64d31b9Smaya 3361e64d31b9Smaya case 160: 3362e64d31b9Smaya#line 1357 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3363e64d31b9Smaya { 3364e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->MaxLights) { 3365e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid light selector"); 3366e64d31b9Smaya YYERROR; 3367e64d31b9Smaya } 3368e64d31b9Smaya 3369e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3370e64d31b9Smaya } 3371e64d31b9Smaya#line 3372 "program_parse.tab.c" /* yacc.c:1645 */ 3372e64d31b9Smaya break; 3373e64d31b9Smaya 3374e64d31b9Smaya case 161: 3375e64d31b9Smaya#line 1368 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3376e64d31b9Smaya { 3377e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3378e64d31b9Smaya (yyval.state)[0] = STATE_TEXGEN; 3379e64d31b9Smaya (yyval.state)[1] = (yyvsp[-2].integer); 3380e64d31b9Smaya (yyval.state)[2] = (yyvsp[-1].integer) + (yyvsp[0].integer); 3381e64d31b9Smaya } 3382e64d31b9Smaya#line 3383 "program_parse.tab.c" /* yacc.c:1645 */ 3383e64d31b9Smaya break; 3384e64d31b9Smaya 3385e64d31b9Smaya case 162: 3386e64d31b9Smaya#line 1377 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3387e64d31b9Smaya { 3388e64d31b9Smaya (yyval.integer) = STATE_TEXGEN_EYE_S; 3389e64d31b9Smaya } 3390e64d31b9Smaya#line 3391 "program_parse.tab.c" /* yacc.c:1645 */ 3391e64d31b9Smaya break; 3392e64d31b9Smaya 3393e64d31b9Smaya case 163: 3394e64d31b9Smaya#line 1381 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3395e64d31b9Smaya { 3396e64d31b9Smaya (yyval.integer) = STATE_TEXGEN_OBJECT_S; 3397e64d31b9Smaya } 3398e64d31b9Smaya#line 3399 "program_parse.tab.c" /* yacc.c:1645 */ 3399e64d31b9Smaya break; 3400e64d31b9Smaya 3401e64d31b9Smaya case 164: 3402e64d31b9Smaya#line 1386 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3403e64d31b9Smaya { 3404e64d31b9Smaya (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; 3405e64d31b9Smaya } 3406e64d31b9Smaya#line 3407 "program_parse.tab.c" /* yacc.c:1645 */ 3407e64d31b9Smaya break; 3408e64d31b9Smaya 3409e64d31b9Smaya case 165: 3410e64d31b9Smaya#line 1390 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3411e64d31b9Smaya { 3412e64d31b9Smaya (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; 3413e64d31b9Smaya } 3414e64d31b9Smaya#line 3415 "program_parse.tab.c" /* yacc.c:1645 */ 3415e64d31b9Smaya break; 3416e64d31b9Smaya 3417e64d31b9Smaya case 166: 3418e64d31b9Smaya#line 1394 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3419e64d31b9Smaya { 3420e64d31b9Smaya (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; 3421e64d31b9Smaya } 3422e64d31b9Smaya#line 3423 "program_parse.tab.c" /* yacc.c:1645 */ 3423e64d31b9Smaya break; 3424e64d31b9Smaya 3425e64d31b9Smaya case 167: 3426e64d31b9Smaya#line 1398 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3427e64d31b9Smaya { 3428e64d31b9Smaya (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; 3429e64d31b9Smaya } 3430e64d31b9Smaya#line 3431 "program_parse.tab.c" /* yacc.c:1645 */ 3431e64d31b9Smaya break; 3432e64d31b9Smaya 3433e64d31b9Smaya case 168: 3434e64d31b9Smaya#line 1404 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3435e64d31b9Smaya { 3436e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3437e64d31b9Smaya (yyval.state)[0] = (yyvsp[0].integer); 3438e64d31b9Smaya } 3439e64d31b9Smaya#line 3440 "program_parse.tab.c" /* yacc.c:1645 */ 3440e64d31b9Smaya break; 3441e64d31b9Smaya 3442e64d31b9Smaya case 169: 3443e64d31b9Smaya#line 1411 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3444e64d31b9Smaya { 3445e64d31b9Smaya (yyval.integer) = STATE_FOG_COLOR; 3446e64d31b9Smaya } 3447e64d31b9Smaya#line 3448 "program_parse.tab.c" /* yacc.c:1645 */ 3448e64d31b9Smaya break; 3449e64d31b9Smaya 3450e64d31b9Smaya case 170: 3451e64d31b9Smaya#line 1415 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3452e64d31b9Smaya { 3453e64d31b9Smaya (yyval.integer) = STATE_FOG_PARAMS; 3454e64d31b9Smaya } 3455e64d31b9Smaya#line 3456 "program_parse.tab.c" /* yacc.c:1645 */ 3456e64d31b9Smaya break; 3457e64d31b9Smaya 3458e64d31b9Smaya case 171: 3459e64d31b9Smaya#line 1421 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3460e64d31b9Smaya { 3461e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3462e64d31b9Smaya (yyval.state)[0] = STATE_CLIPPLANE; 3463e64d31b9Smaya (yyval.state)[1] = (yyvsp[-2].integer); 3464e64d31b9Smaya } 3465e64d31b9Smaya#line 3466 "program_parse.tab.c" /* yacc.c:1645 */ 3466e64d31b9Smaya break; 3467e64d31b9Smaya 3468e64d31b9Smaya case 172: 3469e64d31b9Smaya#line 1429 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3470e64d31b9Smaya { 3471e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->MaxClipPlanes) { 3472e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid clip plane selector"); 3473e64d31b9Smaya YYERROR; 3474e64d31b9Smaya } 3475e64d31b9Smaya 3476e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3477e64d31b9Smaya } 3478e64d31b9Smaya#line 3479 "program_parse.tab.c" /* yacc.c:1645 */ 3479e64d31b9Smaya break; 3480e64d31b9Smaya 3481e64d31b9Smaya case 173: 3482e64d31b9Smaya#line 1440 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3483e64d31b9Smaya { 3484e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3485e64d31b9Smaya (yyval.state)[0] = (yyvsp[0].integer); 3486e64d31b9Smaya } 3487e64d31b9Smaya#line 3488 "program_parse.tab.c" /* yacc.c:1645 */ 3488e64d31b9Smaya break; 3489e64d31b9Smaya 3490e64d31b9Smaya case 174: 3491e64d31b9Smaya#line 1447 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3492e64d31b9Smaya { 3493e64d31b9Smaya (yyval.integer) = STATE_POINT_SIZE; 3494e64d31b9Smaya } 3495e64d31b9Smaya#line 3496 "program_parse.tab.c" /* yacc.c:1645 */ 3496e64d31b9Smaya break; 3497e64d31b9Smaya 3498e64d31b9Smaya case 175: 3499e64d31b9Smaya#line 1451 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3500e64d31b9Smaya { 3501e64d31b9Smaya (yyval.integer) = STATE_POINT_ATTENUATION; 3502e64d31b9Smaya } 3503e64d31b9Smaya#line 3504 "program_parse.tab.c" /* yacc.c:1645 */ 3504e64d31b9Smaya break; 3505e64d31b9Smaya 3506e64d31b9Smaya case 176: 3507e64d31b9Smaya#line 1457 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3508e64d31b9Smaya { 3509e64d31b9Smaya (yyval.state)[0] = (yyvsp[-4].state)[0]; 3510e64d31b9Smaya (yyval.state)[1] = (yyvsp[-4].state)[1]; 3511e64d31b9Smaya (yyval.state)[2] = (yyvsp[-1].integer); 3512e64d31b9Smaya (yyval.state)[3] = (yyvsp[-1].integer); 3513e64d31b9Smaya (yyval.state)[4] = (yyvsp[-4].state)[2]; 3514e64d31b9Smaya } 3515e64d31b9Smaya#line 3516 "program_parse.tab.c" /* yacc.c:1645 */ 3516e64d31b9Smaya break; 3517e64d31b9Smaya 3518e64d31b9Smaya case 177: 3519e64d31b9Smaya#line 1467 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3520e64d31b9Smaya { 3521e64d31b9Smaya (yyval.state)[0] = (yyvsp[-1].state)[0]; 3522e64d31b9Smaya (yyval.state)[1] = (yyvsp[-1].state)[1]; 3523e64d31b9Smaya (yyval.state)[2] = (yyvsp[0].state)[2]; 3524e64d31b9Smaya (yyval.state)[3] = (yyvsp[0].state)[3]; 3525e64d31b9Smaya (yyval.state)[4] = (yyvsp[-1].state)[2]; 3526e64d31b9Smaya } 3527e64d31b9Smaya#line 3528 "program_parse.tab.c" /* yacc.c:1645 */ 3528e64d31b9Smaya break; 3529e64d31b9Smaya 3530e64d31b9Smaya case 178: 3531e64d31b9Smaya#line 1477 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3532e64d31b9Smaya { 3533e64d31b9Smaya (yyval.state)[2] = 0; 3534e64d31b9Smaya (yyval.state)[3] = 3; 3535e64d31b9Smaya } 3536e64d31b9Smaya#line 3537 "program_parse.tab.c" /* yacc.c:1645 */ 3537e64d31b9Smaya break; 3538e64d31b9Smaya 3539e64d31b9Smaya case 179: 3540e64d31b9Smaya#line 1482 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3541e64d31b9Smaya { 3542e64d31b9Smaya /* It seems logical that the matrix row range specifier would have 3543e64d31b9Smaya * to specify a range or more than one row (i.e., $5 > $3). 3544e64d31b9Smaya * However, the ARB_vertex_program spec says "a program will fail 3545e64d31b9Smaya * to load if <a> is greater than <b>." This means that $3 == $5 3546e64d31b9Smaya * is valid. 3547e64d31b9Smaya */ 3548e64d31b9Smaya if ((yyvsp[-3].integer) > (yyvsp[-1].integer)) { 3549e64d31b9Smaya yyerror(& (yylsp[-3]), state, "invalid matrix row range"); 3550e64d31b9Smaya YYERROR; 3551e64d31b9Smaya } 3552e64d31b9Smaya 3553e64d31b9Smaya (yyval.state)[2] = (yyvsp[-3].integer); 3554e64d31b9Smaya (yyval.state)[3] = (yyvsp[-1].integer); 3555e64d31b9Smaya } 3556e64d31b9Smaya#line 3557 "program_parse.tab.c" /* yacc.c:1645 */ 3557e64d31b9Smaya break; 3558e64d31b9Smaya 3559e64d31b9Smaya case 180: 3560e64d31b9Smaya#line 1500 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3561e64d31b9Smaya { 3562e64d31b9Smaya (yyval.state)[0] = (yyvsp[-1].state)[0]; 3563e64d31b9Smaya (yyval.state)[1] = (yyvsp[-1].state)[1]; 3564e64d31b9Smaya (yyval.state)[2] = (yyvsp[0].integer); 3565e64d31b9Smaya } 3566e64d31b9Smaya#line 3567 "program_parse.tab.c" /* yacc.c:1645 */ 3567e64d31b9Smaya break; 3568e64d31b9Smaya 3569e64d31b9Smaya case 181: 3570e64d31b9Smaya#line 1508 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3571e64d31b9Smaya { 3572e64d31b9Smaya (yyval.integer) = 0; 3573e64d31b9Smaya } 3574e64d31b9Smaya#line 3575 "program_parse.tab.c" /* yacc.c:1645 */ 3575e64d31b9Smaya break; 3576e64d31b9Smaya 3577e64d31b9Smaya case 182: 3578e64d31b9Smaya#line 1512 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3579e64d31b9Smaya { 3580e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3581e64d31b9Smaya } 3582e64d31b9Smaya#line 3583 "program_parse.tab.c" /* yacc.c:1645 */ 3583e64d31b9Smaya break; 3584e64d31b9Smaya 3585e64d31b9Smaya case 183: 3586e64d31b9Smaya#line 1518 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3587e64d31b9Smaya { 3588e64d31b9Smaya (yyval.integer) = STATE_MATRIX_INVERSE; 3589e64d31b9Smaya } 3590e64d31b9Smaya#line 3591 "program_parse.tab.c" /* yacc.c:1645 */ 3591e64d31b9Smaya break; 3592e64d31b9Smaya 3593e64d31b9Smaya case 184: 3594e64d31b9Smaya#line 1522 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3595e64d31b9Smaya { 3596e64d31b9Smaya (yyval.integer) = STATE_MATRIX_TRANSPOSE; 3597e64d31b9Smaya } 3598e64d31b9Smaya#line 3599 "program_parse.tab.c" /* yacc.c:1645 */ 3599e64d31b9Smaya break; 3600e64d31b9Smaya 3601e64d31b9Smaya case 185: 3602e64d31b9Smaya#line 1526 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3603e64d31b9Smaya { 3604e64d31b9Smaya (yyval.integer) = STATE_MATRIX_INVTRANS; 3605e64d31b9Smaya } 3606e64d31b9Smaya#line 3607 "program_parse.tab.c" /* yacc.c:1645 */ 3607e64d31b9Smaya break; 3608e64d31b9Smaya 3609e64d31b9Smaya case 186: 3610e64d31b9Smaya#line 1532 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3611e64d31b9Smaya { 3612e64d31b9Smaya if ((yyvsp[0].integer) > 3) { 3613e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid matrix row reference"); 3614e64d31b9Smaya YYERROR; 3615e64d31b9Smaya } 3616e64d31b9Smaya 3617e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3618e64d31b9Smaya } 3619e64d31b9Smaya#line 3620 "program_parse.tab.c" /* yacc.c:1645 */ 3620e64d31b9Smaya break; 3621e64d31b9Smaya 3622e64d31b9Smaya case 187: 3623e64d31b9Smaya#line 1543 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3624e64d31b9Smaya { 3625e64d31b9Smaya (yyval.state)[0] = STATE_MODELVIEW_MATRIX; 3626e64d31b9Smaya (yyval.state)[1] = (yyvsp[0].integer); 3627e64d31b9Smaya } 3628e64d31b9Smaya#line 3629 "program_parse.tab.c" /* yacc.c:1645 */ 3629e64d31b9Smaya break; 3630e64d31b9Smaya 3631e64d31b9Smaya case 188: 3632e64d31b9Smaya#line 1548 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3633e64d31b9Smaya { 3634e64d31b9Smaya (yyval.state)[0] = STATE_PROJECTION_MATRIX; 3635e64d31b9Smaya (yyval.state)[1] = 0; 3636e64d31b9Smaya } 3637e64d31b9Smaya#line 3638 "program_parse.tab.c" /* yacc.c:1645 */ 3638e64d31b9Smaya break; 3639e64d31b9Smaya 3640e64d31b9Smaya case 189: 3641e64d31b9Smaya#line 1553 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3642e64d31b9Smaya { 3643e64d31b9Smaya (yyval.state)[0] = STATE_MVP_MATRIX; 3644e64d31b9Smaya (yyval.state)[1] = 0; 3645e64d31b9Smaya } 3646e64d31b9Smaya#line 3647 "program_parse.tab.c" /* yacc.c:1645 */ 3647e64d31b9Smaya break; 3648e64d31b9Smaya 3649e64d31b9Smaya case 190: 3650e64d31b9Smaya#line 1558 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3651e64d31b9Smaya { 3652e64d31b9Smaya (yyval.state)[0] = STATE_TEXTURE_MATRIX; 3653e64d31b9Smaya (yyval.state)[1] = (yyvsp[0].integer); 3654e64d31b9Smaya } 3655e64d31b9Smaya#line 3656 "program_parse.tab.c" /* yacc.c:1645 */ 3656e64d31b9Smaya break; 3657e64d31b9Smaya 3658e64d31b9Smaya case 191: 3659e64d31b9Smaya#line 1563 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3660e64d31b9Smaya { 3661e64d31b9Smaya yyerror(& (yylsp[-3]), state, "GL_ARB_matrix_palette not supported"); 3662e64d31b9Smaya YYERROR; 3663e64d31b9Smaya } 3664e64d31b9Smaya#line 3665 "program_parse.tab.c" /* yacc.c:1645 */ 3665e64d31b9Smaya break; 3666e64d31b9Smaya 3667e64d31b9Smaya case 192: 3668e64d31b9Smaya#line 1568 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3669e64d31b9Smaya { 3670e64d31b9Smaya (yyval.state)[0] = STATE_PROGRAM_MATRIX; 3671e64d31b9Smaya (yyval.state)[1] = (yyvsp[-1].integer); 3672e64d31b9Smaya } 3673e64d31b9Smaya#line 3674 "program_parse.tab.c" /* yacc.c:1645 */ 3674e64d31b9Smaya break; 3675e64d31b9Smaya 3676e64d31b9Smaya case 193: 3677e64d31b9Smaya#line 1575 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3678e64d31b9Smaya { 3679e64d31b9Smaya (yyval.integer) = 0; 3680e64d31b9Smaya } 3681e64d31b9Smaya#line 3682 "program_parse.tab.c" /* yacc.c:1645 */ 3682e64d31b9Smaya break; 3683e64d31b9Smaya 3684e64d31b9Smaya case 194: 3685e64d31b9Smaya#line 1579 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3686e64d31b9Smaya { 3687e64d31b9Smaya (yyval.integer) = (yyvsp[-1].integer); 3688e64d31b9Smaya } 3689e64d31b9Smaya#line 3690 "program_parse.tab.c" /* yacc.c:1645 */ 3690e64d31b9Smaya break; 3691e64d31b9Smaya 3692e64d31b9Smaya case 195: 3693e64d31b9Smaya#line 1584 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3694e64d31b9Smaya { 3695e64d31b9Smaya /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix 3696e64d31b9Smaya * zero is valid. 3697e64d31b9Smaya */ 3698e64d31b9Smaya if ((yyvsp[0].integer) != 0) { 3699e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid modelview matrix index"); 3700e64d31b9Smaya YYERROR; 3701e64d31b9Smaya } 3702e64d31b9Smaya 3703e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3704e64d31b9Smaya } 3705e64d31b9Smaya#line 3706 "program_parse.tab.c" /* yacc.c:1645 */ 3706e64d31b9Smaya break; 3707e64d31b9Smaya 3708e64d31b9Smaya case 196: 3709e64d31b9Smaya#line 1597 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3710e64d31b9Smaya { 3711e64d31b9Smaya /* Since GL_ARB_matrix_palette isn't supported, just let any value 3712e64d31b9Smaya * through here. The error will be generated later. 3713e64d31b9Smaya */ 3714e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3715e64d31b9Smaya } 3716e64d31b9Smaya#line 3717 "program_parse.tab.c" /* yacc.c:1645 */ 3717e64d31b9Smaya break; 3718e64d31b9Smaya 3719e64d31b9Smaya case 197: 3720e64d31b9Smaya#line 1605 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3721e64d31b9Smaya { 3722e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->MaxProgramMatrices) { 3723e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program matrix selector"); 3724e64d31b9Smaya YYERROR; 3725e64d31b9Smaya } 3726e64d31b9Smaya 3727e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3728e64d31b9Smaya } 3729e64d31b9Smaya#line 3730 "program_parse.tab.c" /* yacc.c:1645 */ 3730e64d31b9Smaya break; 3731e64d31b9Smaya 3732e64d31b9Smaya case 198: 3733e64d31b9Smaya#line 1616 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3734e64d31b9Smaya { 3735e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3736e64d31b9Smaya (yyval.state)[0] = STATE_DEPTH_RANGE; 3737e64d31b9Smaya } 3738e64d31b9Smaya#line 3739 "program_parse.tab.c" /* yacc.c:1645 */ 3739e64d31b9Smaya break; 3740e64d31b9Smaya 3741e64d31b9Smaya case 203: 3742e64d31b9Smaya#line 1628 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3743e64d31b9Smaya { 3744e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3745e64d31b9Smaya (yyval.state)[0] = state->state_param_enum; 3746e64d31b9Smaya (yyval.state)[1] = STATE_ENV; 3747e64d31b9Smaya (yyval.state)[2] = (yyvsp[-1].state)[0]; 3748e64d31b9Smaya (yyval.state)[3] = (yyvsp[-1].state)[1]; 3749e64d31b9Smaya } 3750e64d31b9Smaya#line 3751 "program_parse.tab.c" /* yacc.c:1645 */ 3751e64d31b9Smaya break; 3752e64d31b9Smaya 3753e64d31b9Smaya case 204: 3754e64d31b9Smaya#line 1638 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3755e64d31b9Smaya { 3756e64d31b9Smaya (yyval.state)[0] = (yyvsp[0].integer); 3757e64d31b9Smaya (yyval.state)[1] = (yyvsp[0].integer); 3758e64d31b9Smaya } 3759e64d31b9Smaya#line 3760 "program_parse.tab.c" /* yacc.c:1645 */ 3760e64d31b9Smaya break; 3761e64d31b9Smaya 3762e64d31b9Smaya case 205: 3763e64d31b9Smaya#line 1643 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3764e64d31b9Smaya { 3765e64d31b9Smaya (yyval.state)[0] = (yyvsp[-2].integer); 3766e64d31b9Smaya (yyval.state)[1] = (yyvsp[0].integer); 3767e64d31b9Smaya } 3768e64d31b9Smaya#line 3769 "program_parse.tab.c" /* yacc.c:1645 */ 3769e64d31b9Smaya break; 3770e64d31b9Smaya 3771e64d31b9Smaya case 206: 3772e64d31b9Smaya#line 1650 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3773e64d31b9Smaya { 3774e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3775e64d31b9Smaya (yyval.state)[0] = state->state_param_enum; 3776e64d31b9Smaya (yyval.state)[1] = STATE_ENV; 3777e64d31b9Smaya (yyval.state)[2] = (yyvsp[-1].integer); 3778e64d31b9Smaya (yyval.state)[3] = (yyvsp[-1].integer); 3779e64d31b9Smaya } 3780e64d31b9Smaya#line 3781 "program_parse.tab.c" /* yacc.c:1645 */ 3781e64d31b9Smaya break; 3782e64d31b9Smaya 3783e64d31b9Smaya case 207: 3784e64d31b9Smaya#line 1660 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3785e64d31b9Smaya { 3786e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3787e64d31b9Smaya (yyval.state)[0] = state->state_param_enum; 3788e64d31b9Smaya (yyval.state)[1] = STATE_LOCAL; 3789e64d31b9Smaya (yyval.state)[2] = (yyvsp[-1].state)[0]; 3790e64d31b9Smaya (yyval.state)[3] = (yyvsp[-1].state)[1]; 3791e64d31b9Smaya } 3792e64d31b9Smaya#line 3793 "program_parse.tab.c" /* yacc.c:1645 */ 3793e64d31b9Smaya break; 3794e64d31b9Smaya 3795e64d31b9Smaya case 208: 3796e64d31b9Smaya#line 1669 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3797e64d31b9Smaya { 3798e64d31b9Smaya (yyval.state)[0] = (yyvsp[0].integer); 3799e64d31b9Smaya (yyval.state)[1] = (yyvsp[0].integer); 3800e64d31b9Smaya } 3801e64d31b9Smaya#line 3802 "program_parse.tab.c" /* yacc.c:1645 */ 3802e64d31b9Smaya break; 3803e64d31b9Smaya 3804e64d31b9Smaya case 209: 3805e64d31b9Smaya#line 1674 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3806e64d31b9Smaya { 3807e64d31b9Smaya (yyval.state)[0] = (yyvsp[-2].integer); 3808e64d31b9Smaya (yyval.state)[1] = (yyvsp[0].integer); 3809e64d31b9Smaya } 3810e64d31b9Smaya#line 3811 "program_parse.tab.c" /* yacc.c:1645 */ 3811e64d31b9Smaya break; 3812e64d31b9Smaya 3813e64d31b9Smaya case 210: 3814e64d31b9Smaya#line 1681 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3815e64d31b9Smaya { 3816e64d31b9Smaya memset((yyval.state), 0, sizeof((yyval.state))); 3817e64d31b9Smaya (yyval.state)[0] = state->state_param_enum; 3818e64d31b9Smaya (yyval.state)[1] = STATE_LOCAL; 3819e64d31b9Smaya (yyval.state)[2] = (yyvsp[-1].integer); 3820e64d31b9Smaya (yyval.state)[3] = (yyvsp[-1].integer); 3821e64d31b9Smaya } 3822e64d31b9Smaya#line 3823 "program_parse.tab.c" /* yacc.c:1645 */ 3823e64d31b9Smaya break; 3824e64d31b9Smaya 3825e64d31b9Smaya case 211: 3826e64d31b9Smaya#line 1691 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3827e64d31b9Smaya { 3828e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->limits->MaxEnvParams) { 3829e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid environment parameter reference"); 3830e64d31b9Smaya YYERROR; 3831e64d31b9Smaya } 3832e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3833e64d31b9Smaya } 3834e64d31b9Smaya#line 3835 "program_parse.tab.c" /* yacc.c:1645 */ 3835e64d31b9Smaya break; 3836e64d31b9Smaya 3837e64d31b9Smaya case 212: 3838e64d31b9Smaya#line 1701 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3839e64d31b9Smaya { 3840e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->limits->MaxLocalParams) { 3841e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid local parameter reference"); 3842e64d31b9Smaya YYERROR; 3843e64d31b9Smaya } 3844e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 3845e64d31b9Smaya } 3846e64d31b9Smaya#line 3847 "program_parse.tab.c" /* yacc.c:1645 */ 3847e64d31b9Smaya break; 3848e64d31b9Smaya 3849e64d31b9Smaya case 217: 3850e64d31b9Smaya#line 1716 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3851e64d31b9Smaya { 3852e64d31b9Smaya (yyval.vector).count = 4; 3853e64d31b9Smaya (yyval.vector).data[0].f = (yyvsp[0].real); 3854e64d31b9Smaya (yyval.vector).data[1].f = (yyvsp[0].real); 3855e64d31b9Smaya (yyval.vector).data[2].f = (yyvsp[0].real); 3856e64d31b9Smaya (yyval.vector).data[3].f = (yyvsp[0].real); 3857e64d31b9Smaya } 3858e64d31b9Smaya#line 3859 "program_parse.tab.c" /* yacc.c:1645 */ 3859e64d31b9Smaya break; 3860e64d31b9Smaya 3861e64d31b9Smaya case 218: 3862e64d31b9Smaya#line 1726 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3863e64d31b9Smaya { 3864e64d31b9Smaya (yyval.vector).count = 1; 3865e64d31b9Smaya (yyval.vector).data[0].f = (yyvsp[0].real); 3866e64d31b9Smaya (yyval.vector).data[1].f = (yyvsp[0].real); 3867e64d31b9Smaya (yyval.vector).data[2].f = (yyvsp[0].real); 3868e64d31b9Smaya (yyval.vector).data[3].f = (yyvsp[0].real); 3869e64d31b9Smaya } 3870e64d31b9Smaya#line 3871 "program_parse.tab.c" /* yacc.c:1645 */ 3871e64d31b9Smaya break; 3872e64d31b9Smaya 3873e64d31b9Smaya case 219: 3874e64d31b9Smaya#line 1734 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3875e64d31b9Smaya { 3876e64d31b9Smaya (yyval.vector).count = 1; 3877e64d31b9Smaya (yyval.vector).data[0].f = (float) (yyvsp[0].integer); 3878e64d31b9Smaya (yyval.vector).data[1].f = (float) (yyvsp[0].integer); 3879e64d31b9Smaya (yyval.vector).data[2].f = (float) (yyvsp[0].integer); 3880e64d31b9Smaya (yyval.vector).data[3].f = (float) (yyvsp[0].integer); 3881e64d31b9Smaya } 3882e64d31b9Smaya#line 3883 "program_parse.tab.c" /* yacc.c:1645 */ 3883e64d31b9Smaya break; 3884e64d31b9Smaya 3885e64d31b9Smaya case 220: 3886e64d31b9Smaya#line 1744 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3887e64d31b9Smaya { 3888e64d31b9Smaya (yyval.vector).count = 4; 3889e64d31b9Smaya (yyval.vector).data[0].f = (yyvsp[-1].real); 3890e64d31b9Smaya (yyval.vector).data[1].f = 0.0f; 3891e64d31b9Smaya (yyval.vector).data[2].f = 0.0f; 3892e64d31b9Smaya (yyval.vector).data[3].f = 1.0f; 3893e64d31b9Smaya } 3894e64d31b9Smaya#line 3895 "program_parse.tab.c" /* yacc.c:1645 */ 3895e64d31b9Smaya break; 3896e64d31b9Smaya 3897e64d31b9Smaya case 221: 3898e64d31b9Smaya#line 1752 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3899e64d31b9Smaya { 3900e64d31b9Smaya (yyval.vector).count = 4; 3901e64d31b9Smaya (yyval.vector).data[0].f = (yyvsp[-3].real); 3902e64d31b9Smaya (yyval.vector).data[1].f = (yyvsp[-1].real); 3903e64d31b9Smaya (yyval.vector).data[2].f = 0.0f; 3904e64d31b9Smaya (yyval.vector).data[3].f = 1.0f; 3905e64d31b9Smaya } 3906e64d31b9Smaya#line 3907 "program_parse.tab.c" /* yacc.c:1645 */ 3907e64d31b9Smaya break; 3908e64d31b9Smaya 3909e64d31b9Smaya case 222: 3910e64d31b9Smaya#line 1761 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3911e64d31b9Smaya { 3912e64d31b9Smaya (yyval.vector).count = 4; 3913e64d31b9Smaya (yyval.vector).data[0].f = (yyvsp[-5].real); 3914e64d31b9Smaya (yyval.vector).data[1].f = (yyvsp[-3].real); 3915e64d31b9Smaya (yyval.vector).data[2].f = (yyvsp[-1].real); 3916e64d31b9Smaya (yyval.vector).data[3].f = 1.0f; 3917e64d31b9Smaya } 3918e64d31b9Smaya#line 3919 "program_parse.tab.c" /* yacc.c:1645 */ 3919e64d31b9Smaya break; 3920e64d31b9Smaya 3921e64d31b9Smaya case 223: 3922e64d31b9Smaya#line 1770 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3923e64d31b9Smaya { 3924e64d31b9Smaya (yyval.vector).count = 4; 3925e64d31b9Smaya (yyval.vector).data[0].f = (yyvsp[-7].real); 3926e64d31b9Smaya (yyval.vector).data[1].f = (yyvsp[-5].real); 3927e64d31b9Smaya (yyval.vector).data[2].f = (yyvsp[-3].real); 3928e64d31b9Smaya (yyval.vector).data[3].f = (yyvsp[-1].real); 3929e64d31b9Smaya } 3930e64d31b9Smaya#line 3931 "program_parse.tab.c" /* yacc.c:1645 */ 3931e64d31b9Smaya break; 3932e64d31b9Smaya 3933e64d31b9Smaya case 224: 3934e64d31b9Smaya#line 1780 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3935e64d31b9Smaya { 3936e64d31b9Smaya (yyval.real) = ((yyvsp[-1].negate)) ? -(yyvsp[0].real) : (yyvsp[0].real); 3937e64d31b9Smaya } 3938e64d31b9Smaya#line 3939 "program_parse.tab.c" /* yacc.c:1645 */ 3939e64d31b9Smaya break; 3940e64d31b9Smaya 3941e64d31b9Smaya case 225: 3942e64d31b9Smaya#line 1784 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3943e64d31b9Smaya { 3944e64d31b9Smaya (yyval.real) = (float)(((yyvsp[-1].negate)) ? -(yyvsp[0].integer) : (yyvsp[0].integer)); 3945e64d31b9Smaya } 3946e64d31b9Smaya#line 3947 "program_parse.tab.c" /* yacc.c:1645 */ 3947e64d31b9Smaya break; 3948e64d31b9Smaya 3949e64d31b9Smaya case 226: 3950e64d31b9Smaya#line 1789 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3951e64d31b9Smaya { (yyval.negate) = FALSE; } 3952e64d31b9Smaya#line 3953 "program_parse.tab.c" /* yacc.c:1645 */ 3953e64d31b9Smaya break; 3954e64d31b9Smaya 3955e64d31b9Smaya case 227: 3956e64d31b9Smaya#line 1790 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3957e64d31b9Smaya { (yyval.negate) = TRUE; } 3958e64d31b9Smaya#line 3959 "program_parse.tab.c" /* yacc.c:1645 */ 3959e64d31b9Smaya break; 3960e64d31b9Smaya 3961e64d31b9Smaya case 228: 3962e64d31b9Smaya#line 1791 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3963e64d31b9Smaya { (yyval.negate) = FALSE; } 3964e64d31b9Smaya#line 3965 "program_parse.tab.c" /* yacc.c:1645 */ 3965e64d31b9Smaya break; 3966e64d31b9Smaya 3967e64d31b9Smaya case 229: 3968e64d31b9Smaya#line 1794 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3969e64d31b9Smaya { (yyval.integer) = (yyvsp[0].integer); } 3970e64d31b9Smaya#line 3971 "program_parse.tab.c" /* yacc.c:1645 */ 3971e64d31b9Smaya break; 3972e64d31b9Smaya 3973e64d31b9Smaya case 231: 3974e64d31b9Smaya#line 1797 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3975e64d31b9Smaya { (yyval.integer) = (yyvsp[0].integer); } 3976e64d31b9Smaya#line 3977 "program_parse.tab.c" /* yacc.c:1645 */ 3977e64d31b9Smaya break; 3978e64d31b9Smaya 3979e64d31b9Smaya case 233: 3980e64d31b9Smaya#line 1801 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3981e64d31b9Smaya { 3982e64d31b9Smaya if (!declare_variable(state, (yyvsp[0].string), (yyvsp[-3].integer), & (yylsp[0]))) { 3983e64d31b9Smaya free((yyvsp[0].string)); 3984e64d31b9Smaya YYERROR; 3985e64d31b9Smaya } 3986e64d31b9Smaya } 3987e64d31b9Smaya#line 3988 "program_parse.tab.c" /* yacc.c:1645 */ 3988e64d31b9Smaya break; 3989e64d31b9Smaya 3990e64d31b9Smaya case 234: 3991e64d31b9Smaya#line 1808 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 3992e64d31b9Smaya { 3993e64d31b9Smaya if (!declare_variable(state, (yyvsp[0].string), (yyvsp[-1].integer), & (yylsp[0]))) { 3994e64d31b9Smaya free((yyvsp[0].string)); 3995e64d31b9Smaya YYERROR; 3996e64d31b9Smaya } 3997e64d31b9Smaya } 3998e64d31b9Smaya#line 3999 "program_parse.tab.c" /* yacc.c:1645 */ 3999e64d31b9Smaya break; 4000e64d31b9Smaya 4001e64d31b9Smaya case 235: 4002e64d31b9Smaya#line 1817 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4003e64d31b9Smaya { 4004e64d31b9Smaya struct asm_symbol *const s = 4005e64d31b9Smaya declare_variable(state, (yyvsp[-2].string), at_output, & (yylsp[-2])); 4006e64d31b9Smaya 4007e64d31b9Smaya if (s == NULL) { 4008e64d31b9Smaya free((yyvsp[-2].string)); 4009e64d31b9Smaya YYERROR; 4010e64d31b9Smaya } else { 4011e64d31b9Smaya s->output_binding = (yyvsp[0].result); 4012e64d31b9Smaya } 4013e64d31b9Smaya } 4014e64d31b9Smaya#line 4015 "program_parse.tab.c" /* yacc.c:1645 */ 4015e64d31b9Smaya break; 4016e64d31b9Smaya 4017e64d31b9Smaya case 236: 4018e64d31b9Smaya#line 1831 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4019e64d31b9Smaya { 4020e64d31b9Smaya if (state->mode == ARB_vertex) { 4021e64d31b9Smaya (yyval.result) = VARYING_SLOT_POS; 4022e64d31b9Smaya } else { 4023e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program result name"); 4024e64d31b9Smaya YYERROR; 4025e64d31b9Smaya } 4026e64d31b9Smaya } 4027e64d31b9Smaya#line 4028 "program_parse.tab.c" /* yacc.c:1645 */ 4028e64d31b9Smaya break; 4029e64d31b9Smaya 4030e64d31b9Smaya case 237: 4031e64d31b9Smaya#line 1840 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4032e64d31b9Smaya { 4033e64d31b9Smaya if (state->mode == ARB_vertex) { 4034e64d31b9Smaya (yyval.result) = VARYING_SLOT_FOGC; 4035e64d31b9Smaya } else { 4036e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program result name"); 4037e64d31b9Smaya YYERROR; 4038e64d31b9Smaya } 4039e64d31b9Smaya } 4040e64d31b9Smaya#line 4041 "program_parse.tab.c" /* yacc.c:1645 */ 4041e64d31b9Smaya break; 4042e64d31b9Smaya 4043e64d31b9Smaya case 238: 4044e64d31b9Smaya#line 1849 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4045e64d31b9Smaya { 4046e64d31b9Smaya (yyval.result) = (yyvsp[0].result); 4047e64d31b9Smaya } 4048e64d31b9Smaya#line 4049 "program_parse.tab.c" /* yacc.c:1645 */ 4049e64d31b9Smaya break; 4050e64d31b9Smaya 4051e64d31b9Smaya case 239: 4052e64d31b9Smaya#line 1853 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4053e64d31b9Smaya { 4054e64d31b9Smaya if (state->mode == ARB_vertex) { 4055e64d31b9Smaya (yyval.result) = VARYING_SLOT_PSIZ; 4056e64d31b9Smaya } else { 4057e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program result name"); 4058e64d31b9Smaya YYERROR; 4059e64d31b9Smaya } 4060e64d31b9Smaya } 4061e64d31b9Smaya#line 4062 "program_parse.tab.c" /* yacc.c:1645 */ 4062e64d31b9Smaya break; 4063e64d31b9Smaya 4064e64d31b9Smaya case 240: 4065e64d31b9Smaya#line 1862 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4066e64d31b9Smaya { 4067e64d31b9Smaya if (state->mode == ARB_vertex) { 4068e64d31b9Smaya (yyval.result) = VARYING_SLOT_TEX0 + (yyvsp[0].integer); 4069e64d31b9Smaya } else { 4070e64d31b9Smaya yyerror(& (yylsp[-1]), state, "invalid program result name"); 4071e64d31b9Smaya YYERROR; 4072e64d31b9Smaya } 4073e64d31b9Smaya } 4074e64d31b9Smaya#line 4075 "program_parse.tab.c" /* yacc.c:1645 */ 4075e64d31b9Smaya break; 4076e64d31b9Smaya 4077e64d31b9Smaya case 241: 4078e64d31b9Smaya#line 1871 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4079e64d31b9Smaya { 4080e64d31b9Smaya if (state->mode == ARB_fragment) { 4081e64d31b9Smaya (yyval.result) = FRAG_RESULT_DEPTH; 4082e64d31b9Smaya } else { 4083e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program result name"); 4084e64d31b9Smaya YYERROR; 4085e64d31b9Smaya } 4086e64d31b9Smaya } 4087e64d31b9Smaya#line 4088 "program_parse.tab.c" /* yacc.c:1645 */ 4088e64d31b9Smaya break; 4089e64d31b9Smaya 4090e64d31b9Smaya case 242: 4091e64d31b9Smaya#line 1882 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4092e64d31b9Smaya { 4093e64d31b9Smaya (yyval.result) = (yyvsp[-1].integer) + (yyvsp[0].integer); 4094e64d31b9Smaya } 4095e64d31b9Smaya#line 4096 "program_parse.tab.c" /* yacc.c:1645 */ 4096e64d31b9Smaya break; 4097e64d31b9Smaya 4098e64d31b9Smaya case 243: 4099e64d31b9Smaya#line 1888 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4100e64d31b9Smaya { 4101e64d31b9Smaya if (state->mode == ARB_vertex) { 4102e64d31b9Smaya (yyval.integer) = VARYING_SLOT_COL0; 4103e64d31b9Smaya } else { 4104e64d31b9Smaya if (state->option.DrawBuffers) 4105e64d31b9Smaya (yyval.integer) = FRAG_RESULT_DATA0; 4106e64d31b9Smaya else 4107e64d31b9Smaya (yyval.integer) = FRAG_RESULT_COLOR; 4108e64d31b9Smaya } 4109e64d31b9Smaya } 4110e64d31b9Smaya#line 4111 "program_parse.tab.c" /* yacc.c:1645 */ 4111e64d31b9Smaya break; 4112e64d31b9Smaya 4113e64d31b9Smaya case 244: 4114e64d31b9Smaya#line 1899 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4115e64d31b9Smaya { 4116e64d31b9Smaya if (state->mode == ARB_vertex) { 4117e64d31b9Smaya yyerror(& (yylsp[-2]), state, "invalid program result name"); 4118e64d31b9Smaya YYERROR; 4119e64d31b9Smaya } else { 4120e64d31b9Smaya if (!state->option.DrawBuffers) { 4121e64d31b9Smaya /* From the ARB_draw_buffers spec (same text exists 4122e64d31b9Smaya * for ATI_draw_buffers): 4123e64d31b9Smaya * 4124e64d31b9Smaya * If this option is not specified, a fragment 4125e64d31b9Smaya * program that attempts to bind 4126e64d31b9Smaya * "result.color[n]" will fail to load, and only 4127e64d31b9Smaya * "result.color" will be allowed. 4128e64d31b9Smaya */ 4129e64d31b9Smaya yyerror(& (yylsp[-2]), state, 4130e64d31b9Smaya "result.color[] used without " 4131e64d31b9Smaya "`OPTION ARB_draw_buffers' or " 4132e64d31b9Smaya "`OPTION ATI_draw_buffers'"); 4133e64d31b9Smaya YYERROR; 4134e64d31b9Smaya } else if ((yyvsp[-1].integer) >= state->MaxDrawBuffers) { 4135e64d31b9Smaya yyerror(& (yylsp[-2]), state, 4136e64d31b9Smaya "result.color[] exceeds MAX_DRAW_BUFFERS_ARB"); 4137e64d31b9Smaya YYERROR; 4138e64d31b9Smaya } 4139e64d31b9Smaya (yyval.integer) = FRAG_RESULT_DATA0 + (yyvsp[-1].integer); 4140e64d31b9Smaya } 4141e64d31b9Smaya } 4142e64d31b9Smaya#line 4143 "program_parse.tab.c" /* yacc.c:1645 */ 4143e64d31b9Smaya break; 4144e64d31b9Smaya 4145e64d31b9Smaya case 245: 4146e64d31b9Smaya#line 1927 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4147e64d31b9Smaya { 4148e64d31b9Smaya if (state->mode == ARB_vertex) { 4149e64d31b9Smaya (yyval.integer) = VARYING_SLOT_COL0; 4150e64d31b9Smaya } else { 4151e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program result name"); 4152e64d31b9Smaya YYERROR; 4153e64d31b9Smaya } 4154e64d31b9Smaya } 4155e64d31b9Smaya#line 4156 "program_parse.tab.c" /* yacc.c:1645 */ 4156e64d31b9Smaya break; 4157e64d31b9Smaya 4158e64d31b9Smaya case 246: 4159e64d31b9Smaya#line 1936 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4160e64d31b9Smaya { 4161e64d31b9Smaya if (state->mode == ARB_vertex) { 4162e64d31b9Smaya (yyval.integer) = VARYING_SLOT_BFC0; 4163e64d31b9Smaya } else { 4164e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program result name"); 4165e64d31b9Smaya YYERROR; 4166e64d31b9Smaya } 4167e64d31b9Smaya } 4168e64d31b9Smaya#line 4169 "program_parse.tab.c" /* yacc.c:1645 */ 4169e64d31b9Smaya break; 4170e64d31b9Smaya 4171e64d31b9Smaya case 247: 4172e64d31b9Smaya#line 1947 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4173e64d31b9Smaya { 4174e64d31b9Smaya (yyval.integer) = 0; 4175e64d31b9Smaya } 4176e64d31b9Smaya#line 4177 "program_parse.tab.c" /* yacc.c:1645 */ 4177e64d31b9Smaya break; 4178e64d31b9Smaya 4179e64d31b9Smaya case 248: 4180e64d31b9Smaya#line 1951 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4181e64d31b9Smaya { 4182e64d31b9Smaya if (state->mode == ARB_vertex) { 4183e64d31b9Smaya (yyval.integer) = 0; 4184e64d31b9Smaya } else { 4185e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program result name"); 4186e64d31b9Smaya YYERROR; 4187e64d31b9Smaya } 4188e64d31b9Smaya } 4189e64d31b9Smaya#line 4190 "program_parse.tab.c" /* yacc.c:1645 */ 4190e64d31b9Smaya break; 4191e64d31b9Smaya 4192e64d31b9Smaya case 249: 4193e64d31b9Smaya#line 1960 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4194e64d31b9Smaya { 4195e64d31b9Smaya if (state->mode == ARB_vertex) { 4196e64d31b9Smaya (yyval.integer) = 1; 4197e64d31b9Smaya } else { 4198e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid program result name"); 4199e64d31b9Smaya YYERROR; 4200e64d31b9Smaya } 4201e64d31b9Smaya } 4202e64d31b9Smaya#line 4203 "program_parse.tab.c" /* yacc.c:1645 */ 4203e64d31b9Smaya break; 4204e64d31b9Smaya 4205e64d31b9Smaya case 250: 4206e64d31b9Smaya#line 1970 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4207e64d31b9Smaya { (yyval.integer) = 0; } 4208e64d31b9Smaya#line 4209 "program_parse.tab.c" /* yacc.c:1645 */ 4209e64d31b9Smaya break; 4210e64d31b9Smaya 4211e64d31b9Smaya case 251: 4212e64d31b9Smaya#line 1971 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4213e64d31b9Smaya { (yyval.integer) = 0; } 4214e64d31b9Smaya#line 4215 "program_parse.tab.c" /* yacc.c:1645 */ 4215e64d31b9Smaya break; 4216e64d31b9Smaya 4217e64d31b9Smaya case 252: 4218e64d31b9Smaya#line 1972 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4219e64d31b9Smaya { (yyval.integer) = 1; } 4220e64d31b9Smaya#line 4221 "program_parse.tab.c" /* yacc.c:1645 */ 4221e64d31b9Smaya break; 4222e64d31b9Smaya 4223e64d31b9Smaya case 253: 4224e64d31b9Smaya#line 1975 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4225e64d31b9Smaya { (yyval.integer) = 0; } 4226e64d31b9Smaya#line 4227 "program_parse.tab.c" /* yacc.c:1645 */ 4227e64d31b9Smaya break; 4228e64d31b9Smaya 4229e64d31b9Smaya case 254: 4230e64d31b9Smaya#line 1976 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4231e64d31b9Smaya { (yyval.integer) = 0; } 4232e64d31b9Smaya#line 4233 "program_parse.tab.c" /* yacc.c:1645 */ 4233e64d31b9Smaya break; 4234e64d31b9Smaya 4235e64d31b9Smaya case 255: 4236e64d31b9Smaya#line 1977 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4237e64d31b9Smaya { (yyval.integer) = 1; } 4238e64d31b9Smaya#line 4239 "program_parse.tab.c" /* yacc.c:1645 */ 4239e64d31b9Smaya break; 4240e64d31b9Smaya 4241e64d31b9Smaya case 256: 4242e64d31b9Smaya#line 1980 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4243e64d31b9Smaya { (yyval.integer) = 0; } 4244e64d31b9Smaya#line 4245 "program_parse.tab.c" /* yacc.c:1645 */ 4245e64d31b9Smaya break; 4246e64d31b9Smaya 4247e64d31b9Smaya case 257: 4248e64d31b9Smaya#line 1981 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4249e64d31b9Smaya { (yyval.integer) = (yyvsp[-1].integer); } 4250e64d31b9Smaya#line 4251 "program_parse.tab.c" /* yacc.c:1645 */ 4251e64d31b9Smaya break; 4252e64d31b9Smaya 4253e64d31b9Smaya case 258: 4254e64d31b9Smaya#line 1984 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4255e64d31b9Smaya { (yyval.integer) = 0; } 4256e64d31b9Smaya#line 4257 "program_parse.tab.c" /* yacc.c:1645 */ 4257e64d31b9Smaya break; 4258e64d31b9Smaya 4259e64d31b9Smaya case 259: 4260e64d31b9Smaya#line 1985 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4261e64d31b9Smaya { (yyval.integer) = (yyvsp[-1].integer); } 4262e64d31b9Smaya#line 4263 "program_parse.tab.c" /* yacc.c:1645 */ 4263e64d31b9Smaya break; 4264e64d31b9Smaya 4265e64d31b9Smaya case 260: 4266e64d31b9Smaya#line 1988 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4267e64d31b9Smaya { (yyval.integer) = 0; } 4268e64d31b9Smaya#line 4269 "program_parse.tab.c" /* yacc.c:1645 */ 4269e64d31b9Smaya break; 4270e64d31b9Smaya 4271e64d31b9Smaya case 261: 4272e64d31b9Smaya#line 1989 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4273e64d31b9Smaya { (yyval.integer) = (yyvsp[-1].integer); } 4274e64d31b9Smaya#line 4275 "program_parse.tab.c" /* yacc.c:1645 */ 4275e64d31b9Smaya break; 4276e64d31b9Smaya 4277e64d31b9Smaya case 262: 4278e64d31b9Smaya#line 1993 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4279e64d31b9Smaya { 4280e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->MaxTextureCoordUnits) { 4281e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid texture coordinate unit selector"); 4282e64d31b9Smaya YYERROR; 4283e64d31b9Smaya } 4284e64d31b9Smaya 4285e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 4286e64d31b9Smaya } 4287e64d31b9Smaya#line 4288 "program_parse.tab.c" /* yacc.c:1645 */ 4288e64d31b9Smaya break; 4289e64d31b9Smaya 4290e64d31b9Smaya case 263: 4291e64d31b9Smaya#line 2004 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4292e64d31b9Smaya { 4293e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->MaxTextureImageUnits) { 4294e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid texture image unit selector"); 4295e64d31b9Smaya YYERROR; 4296e64d31b9Smaya } 4297e64d31b9Smaya 4298e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 4299e64d31b9Smaya } 4300e64d31b9Smaya#line 4301 "program_parse.tab.c" /* yacc.c:1645 */ 4301e64d31b9Smaya break; 4302e64d31b9Smaya 4303e64d31b9Smaya case 264: 4304e64d31b9Smaya#line 2015 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4305e64d31b9Smaya { 4306e64d31b9Smaya if ((unsigned) (yyvsp[0].integer) >= state->MaxTextureUnits) { 4307e64d31b9Smaya yyerror(& (yylsp[0]), state, "invalid texture unit selector"); 4308e64d31b9Smaya YYERROR; 4309e64d31b9Smaya } 4310e64d31b9Smaya 4311e64d31b9Smaya (yyval.integer) = (yyvsp[0].integer); 4312e64d31b9Smaya } 4313e64d31b9Smaya#line 4314 "program_parse.tab.c" /* yacc.c:1645 */ 4314e64d31b9Smaya break; 4315e64d31b9Smaya 4316e64d31b9Smaya case 265: 4317e64d31b9Smaya#line 2026 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1645 */ 4318e64d31b9Smaya { 4319e64d31b9Smaya struct asm_symbol *exist = (struct asm_symbol *) 4320e64d31b9Smaya _mesa_symbol_table_find_symbol(state->st, (yyvsp[-2].string)); 4321e64d31b9Smaya struct asm_symbol *target = (struct asm_symbol *) 4322e64d31b9Smaya _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string)); 4323e64d31b9Smaya 4324e64d31b9Smaya free((yyvsp[0].string)); 4325e64d31b9Smaya 4326e64d31b9Smaya if (exist != NULL) { 4327e64d31b9Smaya char m[1000]; 4328e64d31b9Smaya _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[-2].string)); 4329e64d31b9Smaya free((yyvsp[-2].string)); 4330e64d31b9Smaya yyerror(& (yylsp[-2]), state, m); 4331e64d31b9Smaya YYERROR; 4332e64d31b9Smaya } else if (target == NULL) { 4333e64d31b9Smaya free((yyvsp[-2].string)); 4334e64d31b9Smaya yyerror(& (yylsp[0]), state, 4335e64d31b9Smaya "undefined variable binding in ALIAS statement"); 4336e64d31b9Smaya YYERROR; 4337e64d31b9Smaya } else { 4338e64d31b9Smaya _mesa_symbol_table_add_symbol(state->st, (yyvsp[-2].string), target); 4339e64d31b9Smaya } 4340e64d31b9Smaya } 4341e64d31b9Smaya#line 4342 "program_parse.tab.c" /* yacc.c:1645 */ 4342e64d31b9Smaya break; 4343e64d31b9Smaya 4344e64d31b9Smaya 4345e64d31b9Smaya#line 4346 "program_parse.tab.c" /* yacc.c:1645 */ 4346e64d31b9Smaya default: break; 4347e64d31b9Smaya } 4348e64d31b9Smaya /* User semantic actions sometimes alter yychar, and that requires 4349e64d31b9Smaya that yytoken be updated with the new translation. We take the 4350e64d31b9Smaya approach of translating immediately before every use of yytoken. 4351e64d31b9Smaya One alternative is translating here after every semantic action, 4352e64d31b9Smaya but that translation would be missed if the semantic action invokes 4353e64d31b9Smaya YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 4354e64d31b9Smaya if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 4355e64d31b9Smaya incorrect destructor might then be invoked immediately. In the 4356e64d31b9Smaya case of YYERROR or YYBACKUP, subsequent parser actions might lead 4357e64d31b9Smaya to an incorrect destructor call or verbose syntax error message 4358e64d31b9Smaya before the lookahead is translated. */ 4359e64d31b9Smaya YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 4360e64d31b9Smaya 4361e64d31b9Smaya YYPOPSTACK (yylen); 4362e64d31b9Smaya yylen = 0; 4363e64d31b9Smaya YY_STACK_PRINT (yyss, yyssp); 4364e64d31b9Smaya 4365e64d31b9Smaya *++yyvsp = yyval; 4366e64d31b9Smaya *++yylsp = yyloc; 4367e64d31b9Smaya 4368e64d31b9Smaya /* Now 'shift' the result of the reduction. Determine what state 4369e64d31b9Smaya that goes to, based on the state we popped back to and the rule 4370e64d31b9Smaya number reduced by. */ 4371e64d31b9Smaya { 4372e64d31b9Smaya const int yylhs = yyr1[yyn] - YYNTOKENS; 4373e64d31b9Smaya const int yyi = yypgoto[yylhs] + *yyssp; 4374e64d31b9Smaya yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp 4375e64d31b9Smaya ? yytable[yyi] 4376e64d31b9Smaya : yydefgoto[yylhs]); 4377e64d31b9Smaya } 4378e64d31b9Smaya 4379e64d31b9Smaya goto yynewstate; 4380e64d31b9Smaya 4381e64d31b9Smaya 4382e64d31b9Smaya/*--------------------------------------. 4383e64d31b9Smaya| yyerrlab -- here on detecting error. | 4384e64d31b9Smaya`--------------------------------------*/ 4385e64d31b9Smayayyerrlab: 4386e64d31b9Smaya /* Make sure we have latest lookahead translation. See comments at 4387e64d31b9Smaya user semantic actions for why this is necessary. */ 4388e64d31b9Smaya yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 4389e64d31b9Smaya 4390e64d31b9Smaya /* If not already recovering from an error, report this error. */ 4391e64d31b9Smaya if (!yyerrstatus) 4392e64d31b9Smaya { 4393e64d31b9Smaya ++yynerrs; 4394e64d31b9Smaya#if ! YYERROR_VERBOSE 4395e64d31b9Smaya yyerror (&yylloc, state, YY_("syntax error")); 4396e64d31b9Smaya#else 4397e64d31b9Smaya# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 4398e64d31b9Smaya yyssp, yytoken) 4399e64d31b9Smaya { 4400e64d31b9Smaya char const *yymsgp = YY_("syntax error"); 4401e64d31b9Smaya int yysyntax_error_status; 4402e64d31b9Smaya yysyntax_error_status = YYSYNTAX_ERROR; 4403e64d31b9Smaya if (yysyntax_error_status == 0) 4404e64d31b9Smaya yymsgp = yymsg; 4405e64d31b9Smaya else if (yysyntax_error_status == 1) 4406e64d31b9Smaya { 4407e64d31b9Smaya if (yymsg != yymsgbuf) 4408e64d31b9Smaya YYSTACK_FREE (yymsg); 4409e64d31b9Smaya yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 4410e64d31b9Smaya if (!yymsg) 4411e64d31b9Smaya { 4412e64d31b9Smaya yymsg = yymsgbuf; 4413e64d31b9Smaya yymsg_alloc = sizeof yymsgbuf; 4414e64d31b9Smaya yysyntax_error_status = 2; 4415e64d31b9Smaya } 4416e64d31b9Smaya else 4417e64d31b9Smaya { 4418e64d31b9Smaya yysyntax_error_status = YYSYNTAX_ERROR; 4419e64d31b9Smaya yymsgp = yymsg; 4420e64d31b9Smaya } 4421e64d31b9Smaya } 4422e64d31b9Smaya yyerror (&yylloc, state, yymsgp); 4423e64d31b9Smaya if (yysyntax_error_status == 2) 4424e64d31b9Smaya goto yyexhaustedlab; 4425e64d31b9Smaya } 4426e64d31b9Smaya# undef YYSYNTAX_ERROR 4427e64d31b9Smaya#endif 4428e64d31b9Smaya } 4429e64d31b9Smaya 4430e64d31b9Smaya yyerror_range[1] = yylloc; 4431e64d31b9Smaya 4432e64d31b9Smaya if (yyerrstatus == 3) 4433e64d31b9Smaya { 4434e64d31b9Smaya /* If just tried and failed to reuse lookahead token after an 4435e64d31b9Smaya error, discard it. */ 4436e64d31b9Smaya 4437e64d31b9Smaya if (yychar <= YYEOF) 4438e64d31b9Smaya { 4439e64d31b9Smaya /* Return failure if at end of input. */ 4440e64d31b9Smaya if (yychar == YYEOF) 4441e64d31b9Smaya YYABORT; 4442e64d31b9Smaya } 4443e64d31b9Smaya else 4444e64d31b9Smaya { 4445e64d31b9Smaya yydestruct ("Error: discarding", 4446e64d31b9Smaya yytoken, &yylval, &yylloc, state); 4447e64d31b9Smaya yychar = YYEMPTY; 4448e64d31b9Smaya } 4449e64d31b9Smaya } 4450e64d31b9Smaya 4451e64d31b9Smaya /* Else will try to reuse lookahead token after shifting the error 4452e64d31b9Smaya token. */ 4453e64d31b9Smaya goto yyerrlab1; 4454e64d31b9Smaya 4455e64d31b9Smaya 4456e64d31b9Smaya/*---------------------------------------------------. 4457e64d31b9Smaya| yyerrorlab -- error raised explicitly by YYERROR. | 4458e64d31b9Smaya`---------------------------------------------------*/ 4459e64d31b9Smayayyerrorlab: 4460e64d31b9Smaya 4461e64d31b9Smaya /* Pacify compilers like GCC when the user code never invokes 4462e64d31b9Smaya YYERROR and the label yyerrorlab therefore never appears in user 4463e64d31b9Smaya code. */ 4464e64d31b9Smaya if (/*CONSTCOND*/ 0) 4465e64d31b9Smaya goto yyerrorlab; 4466e64d31b9Smaya 4467e64d31b9Smaya /* Do not reclaim the symbols of the rule whose action triggered 4468e64d31b9Smaya this YYERROR. */ 4469e64d31b9Smaya YYPOPSTACK (yylen); 4470e64d31b9Smaya yylen = 0; 4471e64d31b9Smaya YY_STACK_PRINT (yyss, yyssp); 4472e64d31b9Smaya yystate = *yyssp; 4473e64d31b9Smaya goto yyerrlab1; 4474e64d31b9Smaya 4475e64d31b9Smaya 4476e64d31b9Smaya/*-------------------------------------------------------------. 4477e64d31b9Smaya| yyerrlab1 -- common code for both syntax error and YYERROR. | 4478e64d31b9Smaya`-------------------------------------------------------------*/ 4479e64d31b9Smayayyerrlab1: 4480e64d31b9Smaya yyerrstatus = 3; /* Each real token shifted decrements this. */ 4481e64d31b9Smaya 4482e64d31b9Smaya for (;;) 4483e64d31b9Smaya { 4484e64d31b9Smaya yyn = yypact[yystate]; 4485e64d31b9Smaya if (!yypact_value_is_default (yyn)) 4486e64d31b9Smaya { 4487e64d31b9Smaya yyn += YYTERROR; 4488e64d31b9Smaya if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 4489e64d31b9Smaya { 4490e64d31b9Smaya yyn = yytable[yyn]; 4491e64d31b9Smaya if (0 < yyn) 4492e64d31b9Smaya break; 4493e64d31b9Smaya } 4494e64d31b9Smaya } 4495e64d31b9Smaya 4496e64d31b9Smaya /* Pop the current state because it cannot handle the error token. */ 4497e64d31b9Smaya if (yyssp == yyss) 4498e64d31b9Smaya YYABORT; 4499e64d31b9Smaya 4500e64d31b9Smaya yyerror_range[1] = *yylsp; 4501e64d31b9Smaya yydestruct ("Error: popping", 4502e64d31b9Smaya yystos[yystate], yyvsp, yylsp, state); 4503e64d31b9Smaya YYPOPSTACK (1); 4504e64d31b9Smaya yystate = *yyssp; 4505e64d31b9Smaya YY_STACK_PRINT (yyss, yyssp); 4506e64d31b9Smaya } 4507e64d31b9Smaya 4508e64d31b9Smaya YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 4509e64d31b9Smaya *++yyvsp = yylval; 4510e64d31b9Smaya YY_IGNORE_MAYBE_UNINITIALIZED_END 4511e64d31b9Smaya 4512e64d31b9Smaya yyerror_range[2] = yylloc; 4513e64d31b9Smaya /* Using YYLLOC is tempting, but would change the location of 4514e64d31b9Smaya the lookahead. YYLOC is available though. */ 4515e64d31b9Smaya YYLLOC_DEFAULT (yyloc, yyerror_range, 2); 4516e64d31b9Smaya *++yylsp = yyloc; 4517e64d31b9Smaya 4518e64d31b9Smaya /* Shift the error token. */ 4519e64d31b9Smaya YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 4520e64d31b9Smaya 4521e64d31b9Smaya yystate = yyn; 4522e64d31b9Smaya goto yynewstate; 4523e64d31b9Smaya 4524e64d31b9Smaya 4525e64d31b9Smaya/*-------------------------------------. 4526e64d31b9Smaya| yyacceptlab -- YYACCEPT comes here. | 4527e64d31b9Smaya`-------------------------------------*/ 4528e64d31b9Smayayyacceptlab: 4529e64d31b9Smaya yyresult = 0; 4530e64d31b9Smaya goto yyreturn; 4531e64d31b9Smaya 4532e64d31b9Smaya/*-----------------------------------. 4533e64d31b9Smaya| yyabortlab -- YYABORT comes here. | 4534e64d31b9Smaya`-----------------------------------*/ 4535e64d31b9Smayayyabortlab: 4536e64d31b9Smaya yyresult = 1; 4537e64d31b9Smaya goto yyreturn; 4538e64d31b9Smaya 4539e64d31b9Smaya#if !defined yyoverflow || YYERROR_VERBOSE 4540e64d31b9Smaya/*-------------------------------------------------. 4541e64d31b9Smaya| yyexhaustedlab -- memory exhaustion comes here. | 4542e64d31b9Smaya`-------------------------------------------------*/ 4543e64d31b9Smayayyexhaustedlab: 4544e64d31b9Smaya yyerror (&yylloc, state, YY_("memory exhausted")); 4545e64d31b9Smaya yyresult = 2; 4546e64d31b9Smaya /* Fall through. */ 4547e64d31b9Smaya#endif 4548e64d31b9Smaya 4549e64d31b9Smayayyreturn: 4550e64d31b9Smaya if (yychar != YYEMPTY) 4551e64d31b9Smaya { 4552e64d31b9Smaya /* Make sure we have latest lookahead translation. See comments at 4553e64d31b9Smaya user semantic actions for why this is necessary. */ 4554e64d31b9Smaya yytoken = YYTRANSLATE (yychar); 4555e64d31b9Smaya yydestruct ("Cleanup: discarding lookahead", 4556e64d31b9Smaya yytoken, &yylval, &yylloc, state); 4557e64d31b9Smaya } 4558e64d31b9Smaya /* Do not reclaim the symbols of the rule whose action triggered 4559e64d31b9Smaya this YYABORT or YYACCEPT. */ 4560e64d31b9Smaya YYPOPSTACK (yylen); 4561e64d31b9Smaya YY_STACK_PRINT (yyss, yyssp); 4562e64d31b9Smaya while (yyssp != yyss) 4563e64d31b9Smaya { 4564e64d31b9Smaya yydestruct ("Cleanup: popping", 4565e64d31b9Smaya yystos[*yyssp], yyvsp, yylsp, state); 4566e64d31b9Smaya YYPOPSTACK (1); 4567e64d31b9Smaya } 4568e64d31b9Smaya#ifndef yyoverflow 4569e64d31b9Smaya if (yyss != yyssa) 4570e64d31b9Smaya YYSTACK_FREE (yyss); 4571e64d31b9Smaya#endif 4572e64d31b9Smaya#if YYERROR_VERBOSE 4573e64d31b9Smaya if (yymsg != yymsgbuf) 4574e64d31b9Smaya YYSTACK_FREE (yymsg); 4575e64d31b9Smaya#endif 4576e64d31b9Smaya return yyresult; 4577e64d31b9Smaya} 4578e64d31b9Smaya#line 2055 "/cvs/xsrc/external/mit/MesaLib/dist/src/mesa/program/program_parse.y" /* yacc.c:1903 */ 4579e64d31b9Smaya 4580e64d31b9Smaya 4581e64d31b9Smayavoid 4582e64d31b9Smayaasm_instruction_set_operands(struct asm_instruction *inst, 4583e64d31b9Smaya const struct prog_dst_register *dst, 4584e64d31b9Smaya const struct asm_src_register *src0, 4585e64d31b9Smaya const struct asm_src_register *src1, 4586e64d31b9Smaya const struct asm_src_register *src2) 4587e64d31b9Smaya{ 4588e64d31b9Smaya /* In the core ARB extensions only the KIL instruction doesn't have a 4589e64d31b9Smaya * destination register. 4590e64d31b9Smaya */ 4591e64d31b9Smaya if (dst == NULL) { 4592e64d31b9Smaya init_dst_reg(& inst->Base.DstReg); 4593e64d31b9Smaya } else { 4594e64d31b9Smaya inst->Base.DstReg = *dst; 4595e64d31b9Smaya } 4596e64d31b9Smaya 4597e64d31b9Smaya if (src0 != NULL) { 4598e64d31b9Smaya inst->Base.SrcReg[0] = src0->Base; 4599e64d31b9Smaya inst->SrcReg[0] = *src0; 4600e64d31b9Smaya } else { 4601e64d31b9Smaya init_src_reg(& inst->SrcReg[0]); 4602e64d31b9Smaya } 4603e64d31b9Smaya 4604e64d31b9Smaya if (src1 != NULL) { 4605e64d31b9Smaya inst->Base.SrcReg[1] = src1->Base; 4606e64d31b9Smaya inst->SrcReg[1] = *src1; 4607e64d31b9Smaya } else { 4608e64d31b9Smaya init_src_reg(& inst->SrcReg[1]); 4609e64d31b9Smaya } 4610e64d31b9Smaya 4611e64d31b9Smaya if (src2 != NULL) { 4612e64d31b9Smaya inst->Base.SrcReg[2] = src2->Base; 4613e64d31b9Smaya inst->SrcReg[2] = *src2; 4614e64d31b9Smaya } else { 4615e64d31b9Smaya init_src_reg(& inst->SrcReg[2]); 4616e64d31b9Smaya } 4617e64d31b9Smaya} 4618e64d31b9Smaya 4619e64d31b9Smaya 4620e64d31b9Smayastruct asm_instruction * 4621e64d31b9Smayaasm_instruction_ctor(enum prog_opcode op, 4622e64d31b9Smaya const struct prog_dst_register *dst, 4623e64d31b9Smaya const struct asm_src_register *src0, 4624e64d31b9Smaya const struct asm_src_register *src1, 4625e64d31b9Smaya const struct asm_src_register *src2) 4626e64d31b9Smaya{ 4627e64d31b9Smaya struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); 4628e64d31b9Smaya 4629e64d31b9Smaya if (inst) { 4630e64d31b9Smaya _mesa_init_instructions(& inst->Base, 1); 4631e64d31b9Smaya inst->Base.Opcode = op; 4632e64d31b9Smaya 4633e64d31b9Smaya asm_instruction_set_operands(inst, dst, src0, src1, src2); 4634e64d31b9Smaya } 4635e64d31b9Smaya 4636e64d31b9Smaya return inst; 4637e64d31b9Smaya} 4638e64d31b9Smaya 4639e64d31b9Smaya 4640e64d31b9Smayastruct asm_instruction * 4641e64d31b9Smayaasm_instruction_copy_ctor(const struct prog_instruction *base, 4642e64d31b9Smaya const struct prog_dst_register *dst, 4643e64d31b9Smaya const struct asm_src_register *src0, 4644e64d31b9Smaya const struct asm_src_register *src1, 4645e64d31b9Smaya const struct asm_src_register *src2) 4646e64d31b9Smaya{ 4647e64d31b9Smaya struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); 4648e64d31b9Smaya 4649e64d31b9Smaya if (inst) { 4650e64d31b9Smaya _mesa_init_instructions(& inst->Base, 1); 4651e64d31b9Smaya inst->Base.Opcode = base->Opcode; 4652e64d31b9Smaya inst->Base.Saturate = base->Saturate; 4653e64d31b9Smaya 4654e64d31b9Smaya asm_instruction_set_operands(inst, dst, src0, src1, src2); 4655e64d31b9Smaya } 4656e64d31b9Smaya 4657e64d31b9Smaya return inst; 4658e64d31b9Smaya} 4659e64d31b9Smaya 4660e64d31b9Smaya 4661e64d31b9Smayavoid 4662e64d31b9Smayainit_dst_reg(struct prog_dst_register *r) 4663e64d31b9Smaya{ 4664e64d31b9Smaya memset(r, 0, sizeof(*r)); 4665e64d31b9Smaya r->File = PROGRAM_UNDEFINED; 4666e64d31b9Smaya r->WriteMask = WRITEMASK_XYZW; 4667e64d31b9Smaya} 4668e64d31b9Smaya 4669e64d31b9Smaya 4670e64d31b9Smaya/** Like init_dst_reg() but set the File and Index fields. */ 4671e64d31b9Smayavoid 4672e64d31b9Smayaset_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index) 4673e64d31b9Smaya{ 4674e64d31b9Smaya const GLint maxIndex = 1 << INST_INDEX_BITS; 4675e64d31b9Smaya const GLint minIndex = 0; 4676e64d31b9Smaya assert(index >= minIndex); 4677e64d31b9Smaya (void) minIndex; 4678e64d31b9Smaya assert(index <= maxIndex); 4679e64d31b9Smaya (void) maxIndex; 4680e64d31b9Smaya assert(file == PROGRAM_TEMPORARY || 4681e64d31b9Smaya file == PROGRAM_ADDRESS || 4682e64d31b9Smaya file == PROGRAM_OUTPUT); 4683e64d31b9Smaya memset(r, 0, sizeof(*r)); 4684e64d31b9Smaya r->File = file; 4685e64d31b9Smaya r->Index = index; 4686e64d31b9Smaya r->WriteMask = WRITEMASK_XYZW; 4687e64d31b9Smaya} 4688e64d31b9Smaya 4689e64d31b9Smaya 4690e64d31b9Smayavoid 4691e64d31b9Smayainit_src_reg(struct asm_src_register *r) 4692e64d31b9Smaya{ 4693e64d31b9Smaya memset(r, 0, sizeof(*r)); 4694e64d31b9Smaya r->Base.File = PROGRAM_UNDEFINED; 4695e64d31b9Smaya r->Base.Swizzle = SWIZZLE_NOOP; 4696e64d31b9Smaya r->Symbol = NULL; 4697e64d31b9Smaya} 4698e64d31b9Smaya 4699e64d31b9Smaya 4700e64d31b9Smaya/** Like init_src_reg() but set the File and Index fields. 4701e64d31b9Smaya * \return GL_TRUE if a valid src register, GL_FALSE otherwise 4702e64d31b9Smaya */ 4703e64d31b9Smayavoid 4704e64d31b9Smayaset_src_reg(struct asm_src_register *r, gl_register_file file, GLint index) 4705e64d31b9Smaya{ 4706e64d31b9Smaya set_src_reg_swz(r, file, index, SWIZZLE_XYZW); 4707e64d31b9Smaya} 4708e64d31b9Smaya 4709e64d31b9Smaya 4710e64d31b9Smayavoid 4711e64d31b9Smayaset_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index, 4712e64d31b9Smaya GLuint swizzle) 4713e64d31b9Smaya{ 4714e64d31b9Smaya const GLint maxIndex = (1 << INST_INDEX_BITS) - 1; 4715e64d31b9Smaya const GLint minIndex = -(1 << INST_INDEX_BITS); 4716e64d31b9Smaya assert(file < PROGRAM_FILE_MAX); 4717e64d31b9Smaya assert(index >= minIndex); 4718e64d31b9Smaya (void) minIndex; 4719e64d31b9Smaya assert(index <= maxIndex); 4720e64d31b9Smaya (void) maxIndex; 4721e64d31b9Smaya memset(r, 0, sizeof(*r)); 4722e64d31b9Smaya r->Base.File = file; 4723e64d31b9Smaya r->Base.Index = index; 4724e64d31b9Smaya r->Base.Swizzle = swizzle; 4725e64d31b9Smaya r->Symbol = NULL; 4726e64d31b9Smaya} 4727e64d31b9Smaya 4728e64d31b9Smaya 4729e64d31b9Smaya/** 4730e64d31b9Smaya * Validate the set of inputs used by a program 4731e64d31b9Smaya * 4732e64d31b9Smaya * Validates that legal sets of inputs are used by the program. In this case 4733e64d31b9Smaya * "used" included both reading the input or binding the input to a name using 4734e64d31b9Smaya * the \c ATTRIB command. 4735e64d31b9Smaya * 4736e64d31b9Smaya * \return 4737e64d31b9Smaya * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise. 4738e64d31b9Smaya */ 4739e64d31b9Smayaint 4740e64d31b9Smayavalidate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state) 4741e64d31b9Smaya{ 4742e64d31b9Smaya const GLbitfield64 inputs = state->prog->info.inputs_read | state->InputsBound; 4743e64d31b9Smaya GLbitfield ff_inputs = 0; 4744e64d31b9Smaya 4745e64d31b9Smaya /* Since Mesa internal attribute indices are different from 4746e64d31b9Smaya * how NV_vertex_program defines attribute aliasing, we have to construct 4747e64d31b9Smaya * a separate usage mask based on how the aliasing is defined. 4748e64d31b9Smaya * 4749e64d31b9Smaya * Note that attribute aliasing is optional if NV_vertex_program is 4750e64d31b9Smaya * unsupported. 4751e64d31b9Smaya */ 4752e64d31b9Smaya if (inputs & VERT_BIT_POS) 4753e64d31b9Smaya ff_inputs |= 1 << 0; 4754e64d31b9Smaya if (inputs & VERT_BIT_NORMAL) 4755e64d31b9Smaya ff_inputs |= 1 << 2; 4756e64d31b9Smaya if (inputs & VERT_BIT_COLOR0) 4757e64d31b9Smaya ff_inputs |= 1 << 3; 4758e64d31b9Smaya if (inputs & VERT_BIT_COLOR1) 4759e64d31b9Smaya ff_inputs |= 1 << 4; 4760e64d31b9Smaya if (inputs & VERT_BIT_FOG) 4761e64d31b9Smaya ff_inputs |= 1 << 5; 4762e64d31b9Smaya 4763e64d31b9Smaya ff_inputs |= ((inputs & VERT_BIT_TEX_ALL) >> VERT_ATTRIB_TEX0) << 8; 4764e64d31b9Smaya 4765e64d31b9Smaya if ((ff_inputs & (inputs >> VERT_ATTRIB_GENERIC0)) != 0) { 4766e64d31b9Smaya yyerror(locp, state, "illegal use of generic attribute and name attribute"); 4767e64d31b9Smaya return 0; 4768e64d31b9Smaya } 4769e64d31b9Smaya 4770e64d31b9Smaya return 1; 4771e64d31b9Smaya} 4772e64d31b9Smaya 4773e64d31b9Smaya 4774e64d31b9Smayastruct asm_symbol * 4775e64d31b9Smayadeclare_variable(struct asm_parser_state *state, char *name, enum asm_type t, 4776e64d31b9Smaya struct YYLTYPE *locp) 4777e64d31b9Smaya{ 4778e64d31b9Smaya struct asm_symbol *s = NULL; 4779e64d31b9Smaya struct asm_symbol *exist = (struct asm_symbol *) 4780e64d31b9Smaya _mesa_symbol_table_find_symbol(state->st, name); 4781e64d31b9Smaya 4782e64d31b9Smaya 4783e64d31b9Smaya if (exist != NULL) { 4784e64d31b9Smaya yyerror(locp, state, "redeclared identifier"); 4785e64d31b9Smaya } else { 4786e64d31b9Smaya s = calloc(1, sizeof(struct asm_symbol)); 4787e64d31b9Smaya s->name = name; 4788e64d31b9Smaya s->type = t; 4789e64d31b9Smaya 4790e64d31b9Smaya switch (t) { 4791e64d31b9Smaya case at_temp: 4792e64d31b9Smaya if (state->prog->arb.NumTemporaries >= state->limits->MaxTemps) { 4793e64d31b9Smaya yyerror(locp, state, "too many temporaries declared"); 4794e64d31b9Smaya free(s); 4795e64d31b9Smaya return NULL; 4796e64d31b9Smaya } 4797e64d31b9Smaya 4798e64d31b9Smaya s->temp_binding = state->prog->arb.NumTemporaries; 4799e64d31b9Smaya state->prog->arb.NumTemporaries++; 4800e64d31b9Smaya break; 4801e64d31b9Smaya 4802e64d31b9Smaya case at_address: 4803e64d31b9Smaya if (state->prog->arb.NumAddressRegs >= 4804e64d31b9Smaya state->limits->MaxAddressRegs) { 4805e64d31b9Smaya yyerror(locp, state, "too many address registers declared"); 4806e64d31b9Smaya free(s); 4807e64d31b9Smaya return NULL; 4808e64d31b9Smaya } 4809e64d31b9Smaya 4810e64d31b9Smaya /* FINISHME: Add support for multiple address registers. 4811e64d31b9Smaya */ 4812e64d31b9Smaya state->prog->arb.NumAddressRegs++; 4813e64d31b9Smaya break; 4814e64d31b9Smaya 4815e64d31b9Smaya default: 4816e64d31b9Smaya break; 4817e64d31b9Smaya } 4818e64d31b9Smaya 4819e64d31b9Smaya _mesa_symbol_table_add_symbol(state->st, s->name, s); 4820e64d31b9Smaya s->next = state->sym; 4821e64d31b9Smaya state->sym = s; 4822e64d31b9Smaya } 4823e64d31b9Smaya 4824e64d31b9Smaya return s; 4825e64d31b9Smaya} 4826e64d31b9Smaya 4827e64d31b9Smaya 4828e64d31b9Smayaint add_state_reference(struct gl_program_parameter_list *param_list, 4829e64d31b9Smaya const gl_state_index16 tokens[STATE_LENGTH]) 4830e64d31b9Smaya{ 4831e64d31b9Smaya const GLuint size = 4; /* XXX fix */ 4832e64d31b9Smaya char *name; 4833e64d31b9Smaya GLint index; 4834e64d31b9Smaya 4835e64d31b9Smaya name = _mesa_program_state_string(tokens); 4836e64d31b9Smaya index = _mesa_add_parameter(param_list, PROGRAM_STATE_VAR, name, 4837e64d31b9Smaya size, GL_NONE, NULL, tokens, true); 4838e64d31b9Smaya param_list->StateFlags |= _mesa_program_state_flags(tokens); 4839e64d31b9Smaya 4840e64d31b9Smaya /* free name string here since we duplicated it in add_parameter() */ 4841e64d31b9Smaya free(name); 4842e64d31b9Smaya 4843e64d31b9Smaya return index; 4844e64d31b9Smaya} 4845e64d31b9Smaya 4846e64d31b9Smaya 4847e64d31b9Smayaint 4848e64d31b9Smayainitialize_symbol_from_state(struct gl_program *prog, 4849e64d31b9Smaya struct asm_symbol *param_var, 4850e64d31b9Smaya const gl_state_index16 tokens[STATE_LENGTH]) 4851e64d31b9Smaya{ 4852e64d31b9Smaya int idx = -1; 4853e64d31b9Smaya gl_state_index16 state_tokens[STATE_LENGTH]; 4854e64d31b9Smaya 4855e64d31b9Smaya 4856e64d31b9Smaya memcpy(state_tokens, tokens, sizeof(state_tokens)); 4857e64d31b9Smaya 4858e64d31b9Smaya param_var->type = at_param; 4859e64d31b9Smaya param_var->param_binding_type = PROGRAM_STATE_VAR; 4860e64d31b9Smaya 4861e64d31b9Smaya /* If we are adding a STATE_MATRIX that has multiple rows, we need to 4862e64d31b9Smaya * unroll it and call add_state_reference() for each row 4863e64d31b9Smaya */ 4864e64d31b9Smaya if ((state_tokens[0] == STATE_MODELVIEW_MATRIX || 4865e64d31b9Smaya state_tokens[0] == STATE_PROJECTION_MATRIX || 4866e64d31b9Smaya state_tokens[0] == STATE_MVP_MATRIX || 4867e64d31b9Smaya state_tokens[0] == STATE_TEXTURE_MATRIX || 4868e64d31b9Smaya state_tokens[0] == STATE_PROGRAM_MATRIX) 4869e64d31b9Smaya && (state_tokens[2] != state_tokens[3])) { 4870e64d31b9Smaya int row; 4871e64d31b9Smaya const int first_row = state_tokens[2]; 4872e64d31b9Smaya const int last_row = state_tokens[3]; 4873e64d31b9Smaya 4874e64d31b9Smaya for (row = first_row; row <= last_row; row++) { 4875e64d31b9Smaya state_tokens[2] = state_tokens[3] = row; 4876e64d31b9Smaya 4877e64d31b9Smaya idx = add_state_reference(prog->Parameters, state_tokens); 4878e64d31b9Smaya if (param_var->param_binding_begin == ~0U) { 4879e64d31b9Smaya param_var->param_binding_begin = idx; 4880e64d31b9Smaya param_var->param_binding_swizzle = SWIZZLE_XYZW; 4881e64d31b9Smaya } 4882e64d31b9Smaya 4883e64d31b9Smaya param_var->param_binding_length++; 4884e64d31b9Smaya } 4885e64d31b9Smaya } 4886e64d31b9Smaya else { 4887e64d31b9Smaya idx = add_state_reference(prog->Parameters, state_tokens); 4888e64d31b9Smaya if (param_var->param_binding_begin == ~0U) { 4889e64d31b9Smaya param_var->param_binding_begin = idx; 4890e64d31b9Smaya param_var->param_binding_swizzle = SWIZZLE_XYZW; 4891e64d31b9Smaya } 4892e64d31b9Smaya param_var->param_binding_length++; 4893e64d31b9Smaya } 4894e64d31b9Smaya 4895e64d31b9Smaya return idx; 4896e64d31b9Smaya} 4897e64d31b9Smaya 4898e64d31b9Smaya 4899e64d31b9Smayaint 4900e64d31b9Smayainitialize_symbol_from_param(struct gl_program *prog, 4901e64d31b9Smaya struct asm_symbol *param_var, 4902e64d31b9Smaya const gl_state_index16 tokens[STATE_LENGTH]) 4903e64d31b9Smaya{ 4904e64d31b9Smaya int idx = -1; 4905e64d31b9Smaya gl_state_index16 state_tokens[STATE_LENGTH]; 4906e64d31b9Smaya 4907e64d31b9Smaya 4908e64d31b9Smaya memcpy(state_tokens, tokens, sizeof(state_tokens)); 4909e64d31b9Smaya 4910e64d31b9Smaya assert((state_tokens[0] == STATE_VERTEX_PROGRAM) 4911e64d31b9Smaya || (state_tokens[0] == STATE_FRAGMENT_PROGRAM)); 4912e64d31b9Smaya assert((state_tokens[1] == STATE_ENV) 4913e64d31b9Smaya || (state_tokens[1] == STATE_LOCAL)); 4914e64d31b9Smaya 4915e64d31b9Smaya /* 4916e64d31b9Smaya * The param type is STATE_VAR. The program parameter entry will 4917e64d31b9Smaya * effectively be a pointer into the LOCAL or ENV parameter array. 4918e64d31b9Smaya */ 4919e64d31b9Smaya param_var->type = at_param; 4920e64d31b9Smaya param_var->param_binding_type = PROGRAM_STATE_VAR; 4921e64d31b9Smaya 4922e64d31b9Smaya /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements, 4923e64d31b9Smaya * we need to unroll it and call add_state_reference() for each row 4924e64d31b9Smaya */ 4925e64d31b9Smaya if (state_tokens[2] != state_tokens[3]) { 4926e64d31b9Smaya int row; 4927e64d31b9Smaya const int first_row = state_tokens[2]; 4928e64d31b9Smaya const int last_row = state_tokens[3]; 4929e64d31b9Smaya 4930e64d31b9Smaya for (row = first_row; row <= last_row; row++) { 4931e64d31b9Smaya state_tokens[2] = state_tokens[3] = row; 4932e64d31b9Smaya 4933e64d31b9Smaya idx = add_state_reference(prog->Parameters, state_tokens); 4934e64d31b9Smaya if (param_var->param_binding_begin == ~0U) { 4935e64d31b9Smaya param_var->param_binding_begin = idx; 4936e64d31b9Smaya param_var->param_binding_swizzle = SWIZZLE_XYZW; 4937e64d31b9Smaya } 4938e64d31b9Smaya param_var->param_binding_length++; 4939e64d31b9Smaya } 4940e64d31b9Smaya } 4941e64d31b9Smaya else { 4942e64d31b9Smaya idx = add_state_reference(prog->Parameters, state_tokens); 4943e64d31b9Smaya if (param_var->param_binding_begin == ~0U) { 4944e64d31b9Smaya param_var->param_binding_begin = idx; 4945e64d31b9Smaya param_var->param_binding_swizzle = SWIZZLE_XYZW; 4946e64d31b9Smaya } 4947e64d31b9Smaya param_var->param_binding_length++; 4948e64d31b9Smaya } 4949e64d31b9Smaya 4950e64d31b9Smaya return idx; 4951e64d31b9Smaya} 4952e64d31b9Smaya 4953e64d31b9Smaya 4954e64d31b9Smaya/** 4955e64d31b9Smaya * Put a float/vector constant/literal into the parameter list. 4956e64d31b9Smaya * \param param_var returns info about the parameter/constant's location, 4957e64d31b9Smaya * binding, type, etc. 4958e64d31b9Smaya * \param vec the vector/constant to add 4959e64d31b9Smaya * \param allowSwizzle if true, try to consolidate constants which only differ 4960e64d31b9Smaya * by a swizzle. We don't want to do this when building 4961e64d31b9Smaya * arrays of constants that may be indexed indirectly. 4962e64d31b9Smaya * \return index of the constant in the parameter list. 4963e64d31b9Smaya */ 4964e64d31b9Smayaint 4965e64d31b9Smayainitialize_symbol_from_const(struct gl_program *prog, 4966e64d31b9Smaya struct asm_symbol *param_var, 4967e64d31b9Smaya const struct asm_vector *vec, 4968e64d31b9Smaya GLboolean allowSwizzle) 4969e64d31b9Smaya{ 4970e64d31b9Smaya unsigned swizzle; 4971e64d31b9Smaya const int idx = _mesa_add_unnamed_constant(prog->Parameters, 4972e64d31b9Smaya vec->data, vec->count, 4973e64d31b9Smaya allowSwizzle ? &swizzle : NULL); 4974e64d31b9Smaya 4975e64d31b9Smaya param_var->type = at_param; 4976e64d31b9Smaya param_var->param_binding_type = PROGRAM_CONSTANT; 4977e64d31b9Smaya 4978e64d31b9Smaya if (param_var->param_binding_begin == ~0U) { 4979e64d31b9Smaya param_var->param_binding_begin = idx; 4980e64d31b9Smaya param_var->param_binding_swizzle = allowSwizzle ? swizzle : SWIZZLE_XYZW; 4981e64d31b9Smaya } 4982e64d31b9Smaya param_var->param_binding_length++; 4983e64d31b9Smaya 4984e64d31b9Smaya return idx; 4985e64d31b9Smaya} 4986e64d31b9Smaya 4987e64d31b9Smaya 4988e64d31b9Smayachar * 4989e64d31b9Smayamake_error_string(const char *fmt, ...) 4990e64d31b9Smaya{ 4991e64d31b9Smaya int length; 4992e64d31b9Smaya char *str; 4993e64d31b9Smaya va_list args; 4994e64d31b9Smaya 4995e64d31b9Smaya 4996e64d31b9Smaya /* Call vsnprintf once to determine how large the final string is. Call it 4997e64d31b9Smaya * again to do the actual formatting. from the vsnprintf manual page: 4998e64d31b9Smaya * 4999e64d31b9Smaya * Upon successful return, these functions return the number of 5000e64d31b9Smaya * characters printed (not including the trailing '\0' used to end 5001e64d31b9Smaya * output to strings). 5002e64d31b9Smaya */ 5003e64d31b9Smaya va_start(args, fmt); 5004e64d31b9Smaya length = 1 + vsnprintf(NULL, 0, fmt, args); 5005e64d31b9Smaya va_end(args); 5006e64d31b9Smaya 5007e64d31b9Smaya str = malloc(length); 5008e64d31b9Smaya if (str) { 5009e64d31b9Smaya va_start(args, fmt); 5010e64d31b9Smaya vsnprintf(str, length, fmt, args); 5011e64d31b9Smaya va_end(args); 5012e64d31b9Smaya } 5013e64d31b9Smaya 5014e64d31b9Smaya return str; 5015e64d31b9Smaya} 5016e64d31b9Smaya 5017e64d31b9Smaya 5018e64d31b9Smayavoid 5019e64d31b9Smayayyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) 5020e64d31b9Smaya{ 5021e64d31b9Smaya char *err_str; 5022e64d31b9Smaya 5023e64d31b9Smaya 5024e64d31b9Smaya err_str = make_error_string("glProgramStringARB(%s)\n", s); 5025e64d31b9Smaya if (err_str) { 5026e64d31b9Smaya _mesa_error(state->ctx, GL_INVALID_OPERATION, "%s", err_str); 5027e64d31b9Smaya free(err_str); 5028e64d31b9Smaya } 5029e64d31b9Smaya 5030e64d31b9Smaya err_str = make_error_string("line %u, char %u: error: %s\n", 5031e64d31b9Smaya locp->first_line, locp->first_column, s); 5032e64d31b9Smaya _mesa_set_program_error(state->ctx, locp->position, err_str); 5033e64d31b9Smaya 5034e64d31b9Smaya if (err_str) { 5035e64d31b9Smaya free(err_str); 5036e64d31b9Smaya } 5037e64d31b9Smaya} 5038e64d31b9Smaya 5039e64d31b9Smaya 5040e64d31b9SmayaGLboolean 5041e64d31b9Smaya_mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *str, 5042e64d31b9Smaya GLsizei len, struct asm_parser_state *state) 5043e64d31b9Smaya{ 5044e64d31b9Smaya struct asm_instruction *inst; 5045e64d31b9Smaya unsigned i; 5046e64d31b9Smaya GLubyte *strz; 5047e64d31b9Smaya GLboolean result = GL_FALSE; 5048e64d31b9Smaya void *temp; 5049e64d31b9Smaya struct asm_symbol *sym; 5050e64d31b9Smaya 5051e64d31b9Smaya state->ctx = ctx; 5052e64d31b9Smaya state->prog->Target = target; 5053e64d31b9Smaya state->prog->Parameters = _mesa_new_parameter_list(); 5054e64d31b9Smaya 5055e64d31b9Smaya /* Make a copy of the program string and force it to be NUL-terminated. 5056e64d31b9Smaya */ 5057e64d31b9Smaya strz = (GLubyte *) ralloc_size(state->mem_ctx, len + 1); 5058e64d31b9Smaya if (strz == NULL) { 5059e64d31b9Smaya _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); 5060e64d31b9Smaya return GL_FALSE; 5061e64d31b9Smaya } 5062e64d31b9Smaya memcpy (strz, str, len); 5063e64d31b9Smaya strz[len] = '\0'; 5064e64d31b9Smaya 5065e64d31b9Smaya state->prog->String = strz; 5066e64d31b9Smaya 5067e64d31b9Smaya state->st = _mesa_symbol_table_ctor(); 5068e64d31b9Smaya 5069e64d31b9Smaya state->limits = (target == GL_VERTEX_PROGRAM_ARB) 5070e64d31b9Smaya ? & ctx->Const.Program[MESA_SHADER_VERTEX] 5071e64d31b9Smaya : & ctx->Const.Program[MESA_SHADER_FRAGMENT]; 5072e64d31b9Smaya 5073e64d31b9Smaya state->MaxTextureImageUnits = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; 5074e64d31b9Smaya state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits; 5075e64d31b9Smaya state->MaxTextureUnits = ctx->Const.MaxTextureUnits; 5076e64d31b9Smaya state->MaxClipPlanes = ctx->Const.MaxClipPlanes; 5077e64d31b9Smaya state->MaxLights = ctx->Const.MaxLights; 5078e64d31b9Smaya state->MaxProgramMatrices = ctx->Const.MaxProgramMatrices; 5079e64d31b9Smaya state->MaxDrawBuffers = ctx->Const.MaxDrawBuffers; 5080e64d31b9Smaya 5081e64d31b9Smaya state->state_param_enum = (target == GL_VERTEX_PROGRAM_ARB) 5082e64d31b9Smaya ? STATE_VERTEX_PROGRAM : STATE_FRAGMENT_PROGRAM; 5083e64d31b9Smaya 5084e64d31b9Smaya _mesa_set_program_error(ctx, -1, NULL); 5085e64d31b9Smaya 5086e64d31b9Smaya _mesa_program_lexer_ctor(& state->scanner, state, (const char *) str, len); 5087e64d31b9Smaya yyparse(state); 5088e64d31b9Smaya _mesa_program_lexer_dtor(state->scanner); 5089e64d31b9Smaya 5090e64d31b9Smaya 5091e64d31b9Smaya if (ctx->Program.ErrorPos != -1) { 5092e64d31b9Smaya goto error; 5093e64d31b9Smaya } 5094e64d31b9Smaya 5095e64d31b9Smaya if (! _mesa_layout_parameters(state)) { 5096e64d31b9Smaya struct YYLTYPE loc; 5097e64d31b9Smaya 5098e64d31b9Smaya loc.first_line = 0; 5099e64d31b9Smaya loc.first_column = 0; 5100e64d31b9Smaya loc.position = len; 5101e64d31b9Smaya 5102e64d31b9Smaya yyerror(& loc, state, "invalid PARAM usage"); 5103e64d31b9Smaya goto error; 5104e64d31b9Smaya } 5105e64d31b9Smaya 5106e64d31b9Smaya 5107e64d31b9Smaya 5108e64d31b9Smaya /* Add one instruction to store the "END" instruction. 5109e64d31b9Smaya */ 5110e64d31b9Smaya state->prog->arb.Instructions = 5111e64d31b9Smaya rzalloc_array(state->mem_ctx, struct prog_instruction, 5112e64d31b9Smaya state->prog->arb.NumInstructions + 1); 5113e64d31b9Smaya 5114e64d31b9Smaya if (state->prog->arb.Instructions == NULL) { 5115e64d31b9Smaya goto error; 5116e64d31b9Smaya } 5117e64d31b9Smaya 5118e64d31b9Smaya inst = state->inst_head; 5119e64d31b9Smaya for (i = 0; i < state->prog->arb.NumInstructions; i++) { 5120e64d31b9Smaya struct asm_instruction *const temp = inst->next; 5121e64d31b9Smaya 5122e64d31b9Smaya state->prog->arb.Instructions[i] = inst->Base; 5123e64d31b9Smaya inst = temp; 5124e64d31b9Smaya } 5125e64d31b9Smaya 5126e64d31b9Smaya /* Finally, tag on an OPCODE_END instruction */ 5127e64d31b9Smaya { 5128e64d31b9Smaya const GLuint numInst = state->prog->arb.NumInstructions; 5129e64d31b9Smaya _mesa_init_instructions(state->prog->arb.Instructions + numInst, 1); 5130e64d31b9Smaya state->prog->arb.Instructions[numInst].Opcode = OPCODE_END; 5131e64d31b9Smaya } 5132e64d31b9Smaya state->prog->arb.NumInstructions++; 5133e64d31b9Smaya 5134e64d31b9Smaya state->prog->arb.NumParameters = state->prog->Parameters->NumParameters; 5135e64d31b9Smaya state->prog->arb.NumAttributes = 5136e64d31b9Smaya util_bitcount64(state->prog->info.inputs_read); 5137e64d31b9Smaya 5138e64d31b9Smaya /* 5139e64d31b9Smaya * Initialize native counts to logical counts. The device driver may 5140e64d31b9Smaya * change them if program is translated into a hardware program. 5141e64d31b9Smaya */ 5142e64d31b9Smaya state->prog->arb.NumNativeInstructions = state->prog->arb.NumInstructions; 5143e64d31b9Smaya state->prog->arb.NumNativeTemporaries = state->prog->arb.NumTemporaries; 5144e64d31b9Smaya state->prog->arb.NumNativeParameters = state->prog->arb.NumParameters; 5145e64d31b9Smaya state->prog->arb.NumNativeAttributes = state->prog->arb.NumAttributes; 5146e64d31b9Smaya state->prog->arb.NumNativeAddressRegs = state->prog->arb.NumAddressRegs; 5147e64d31b9Smaya 5148e64d31b9Smaya result = GL_TRUE; 5149e64d31b9Smaya 5150e64d31b9Smayaerror: 5151e64d31b9Smaya for (inst = state->inst_head; inst != NULL; inst = temp) { 5152e64d31b9Smaya temp = inst->next; 5153e64d31b9Smaya free(inst); 5154e64d31b9Smaya } 5155e64d31b9Smaya 5156e64d31b9Smaya state->inst_head = NULL; 5157e64d31b9Smaya state->inst_tail = NULL; 5158e64d31b9Smaya 5159e64d31b9Smaya for (sym = state->sym; sym != NULL; sym = temp) { 5160e64d31b9Smaya temp = sym->next; 5161e64d31b9Smaya 5162e64d31b9Smaya free((void *) sym->name); 5163e64d31b9Smaya free(sym); 5164e64d31b9Smaya } 5165e64d31b9Smaya state->sym = NULL; 5166e64d31b9Smaya 5167e64d31b9Smaya _mesa_symbol_table_dtor(state->st); 5168e64d31b9Smaya state->st = NULL; 5169e64d31b9Smaya 5170e64d31b9Smaya return result; 5171e64d31b9Smaya} 5172