196c5ddc4Srjs/* A Bison parser, made by GNU Bison 3.7.4.  */
2e64d31b9Smaya
3e64d31b9Smaya/* Bison implementation for Yacc-like parsers in C
4e64d31b9Smaya
596c5ddc4Srjs   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
696c5ddc4Srjs   Inc.
7e64d31b9Smaya
8e64d31b9Smaya   This program is free software: you can redistribute it and/or modify
9e64d31b9Smaya   it under the terms of the GNU General Public License as published by
10e64d31b9Smaya   the Free Software Foundation, either version 3 of the License, or
11e64d31b9Smaya   (at your option) any later version.
12e64d31b9Smaya
13e64d31b9Smaya   This program is distributed in the hope that it will be useful,
14e64d31b9Smaya   but WITHOUT ANY WARRANTY; without even the implied warranty of
15e64d31b9Smaya   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16e64d31b9Smaya   GNU General Public License for more details.
17e64d31b9Smaya
18e64d31b9Smaya   You should have received a copy of the GNU General Public License
19e64d31b9Smaya   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20e64d31b9Smaya
21e64d31b9Smaya/* As a special exception, you may create a larger work that contains
22e64d31b9Smaya   part or all of the Bison parser skeleton and distribute that work
23e64d31b9Smaya   under terms of your choice, so long as that work isn't itself a
24e64d31b9Smaya   parser generator using the skeleton or a modified version thereof
25e64d31b9Smaya   as a parser skeleton.  Alternatively, if you modify or redistribute
26e64d31b9Smaya   the parser skeleton itself, you may (at your option) remove this
27e64d31b9Smaya   special exception, which will cause the skeleton and the resulting
28e64d31b9Smaya   Bison output files to be licensed under the GNU General Public
29e64d31b9Smaya   License without this special exception.
30e64d31b9Smaya
31e64d31b9Smaya   This special exception was added by the Free Software Foundation in
32e64d31b9Smaya   version 2.2 of Bison.  */
33e64d31b9Smaya
34e64d31b9Smaya/* C LALR(1) parser skeleton written by Richard Stallman, by
35e64d31b9Smaya   simplifying the original so-called "semantic" parser.  */
36e64d31b9Smaya
3796c5ddc4Srjs/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
3896c5ddc4Srjs   especially those whose name start with YY_ or yy_.  They are
3996c5ddc4Srjs   private implementation details that can be changed or removed.  */
4096c5ddc4Srjs
41e64d31b9Smaya/* All symbols defined below should begin with yy or YY, to avoid
42e64d31b9Smaya   infringing on user name space.  This should be done even for local
43e64d31b9Smaya   variables, as they might otherwise be expanded by user macros.
44e64d31b9Smaya   There are some unavoidable exceptions within include files to
45e64d31b9Smaya   define necessary library symbols; they are noted "INFRINGES ON
46e64d31b9Smaya   USER NAME SPACE" below.  */
47e64d31b9Smaya
4896c5ddc4Srjs/* Identify Bison output, and Bison version.  */
4996c5ddc4Srjs#define YYBISON 30704
50e64d31b9Smaya
5196c5ddc4Srjs/* Bison version string.  */
5296c5ddc4Srjs#define YYBISON_VERSION "3.7.4"
53e64d31b9Smaya
54e64d31b9Smaya/* Skeleton name.  */
55e64d31b9Smaya#define YYSKELETON_NAME "yacc.c"
56e64d31b9Smaya
57e64d31b9Smaya/* Pure parsers.  */
58e64d31b9Smaya#define YYPURE 1
59e64d31b9Smaya
60e64d31b9Smaya/* Push parsers.  */
61e64d31b9Smaya#define YYPUSH 0
62e64d31b9Smaya
63e64d31b9Smaya/* Pull parsers.  */
64e64d31b9Smaya#define YYPULL 1
65e64d31b9Smaya
66e64d31b9Smaya
67e64d31b9Smaya
68e64d31b9Smaya
69e64d31b9Smaya/* First part of user prologue.  */
7096c5ddc4Srjs#line 1 "../src/mesa/program/program_parse.y"
71e64d31b9Smaya
72e64d31b9Smaya/*
73e64d31b9Smaya * Copyright © 2009 Intel Corporation
74e64d31b9Smaya *
75e64d31b9Smaya * Permission is hereby granted, free of charge, to any person obtaining a
76e64d31b9Smaya * copy of this software and associated documentation files (the "Software"),
77e64d31b9Smaya * to deal in the Software without restriction, including without limitation
78e64d31b9Smaya * the rights to use, copy, modify, merge, publish, distribute, sublicense,
79e64d31b9Smaya * and/or sell copies of the Software, and to permit persons to whom the
80e64d31b9Smaya * Software is furnished to do so, subject to the following conditions:
81e64d31b9Smaya *
82e64d31b9Smaya * The above copyright notice and this permission notice (including the next
83e64d31b9Smaya * paragraph) shall be included in all copies or substantial portions of the
84e64d31b9Smaya * Software.
85e64d31b9Smaya *
86e64d31b9Smaya * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
87e64d31b9Smaya * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
88e64d31b9Smaya * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
89e64d31b9Smaya * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
90e64d31b9Smaya * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91e64d31b9Smaya * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
92e64d31b9Smaya * DEALINGS IN THE SOFTWARE.
93e64d31b9Smaya */
94e64d31b9Smaya
95e64d31b9Smaya#include <stdarg.h>
96e64d31b9Smaya#include <stdio.h>
97e64d31b9Smaya#include <stdlib.h>
98e64d31b9Smaya#include <string.h>
99e64d31b9Smaya
100e64d31b9Smaya#include "main/errors.h"
101e64d31b9Smaya#include "main/mtypes.h"
10296c5ddc4Srjs
103e64d31b9Smaya#include "program/program.h"
104e64d31b9Smaya#include "program/prog_parameter.h"
105e64d31b9Smaya#include "program/prog_parameter_layout.h"
106e64d31b9Smaya#include "program/prog_statevars.h"
107e64d31b9Smaya#include "program/prog_instruction.h"
108e64d31b9Smaya
109e64d31b9Smaya#include "program/symbol_table.h"
110e64d31b9Smaya#include "program/program_parser.h"
111e64d31b9Smaya
112e64d31b9Smaya#include "util/u_math.h"
11396c5ddc4Srjs#include "util/u_memory.h"
11496c5ddc4Srjs
11596c5ddc4Srjsenum {
11696c5ddc4Srjs   STATE_MATRIX_NO_MODIFIER,
11796c5ddc4Srjs   STATE_MATRIX_INVERSE,
11896c5ddc4Srjs   STATE_MATRIX_TRANSPOSE,
11996c5ddc4Srjs   STATE_MATRIX_INVTRANS,
12096c5ddc4Srjs};
121e64d31b9Smaya
122e64d31b9Smayaextern void *yy_scan_string(char *);
123e64d31b9Smayaextern void yy_delete_buffer(void *);
124e64d31b9Smaya
125e64d31b9Smayastatic struct asm_symbol *declare_variable(struct asm_parser_state *state,
126e64d31b9Smaya    char *name, enum asm_type t, struct YYLTYPE *locp);
127e64d31b9Smaya
128e64d31b9Smayastatic int add_state_reference(struct gl_program_parameter_list *param_list,
129e64d31b9Smaya    const gl_state_index16 tokens[STATE_LENGTH]);
130e64d31b9Smaya
131e64d31b9Smayastatic int initialize_symbol_from_state(struct gl_program *prog,
132e64d31b9Smaya    struct asm_symbol *param_var, const gl_state_index16 tokens[STATE_LENGTH]);
133e64d31b9Smaya
134e64d31b9Smayastatic int initialize_symbol_from_param(struct gl_program *prog,
135e64d31b9Smaya    struct asm_symbol *param_var, const gl_state_index16 tokens[STATE_LENGTH]);
136e64d31b9Smaya
137e64d31b9Smayastatic int initialize_symbol_from_const(struct gl_program *prog,
138e64d31b9Smaya    struct asm_symbol *param_var, const struct asm_vector *vec,
139e64d31b9Smaya    GLboolean allowSwizzle);
140e64d31b9Smaya
141e64d31b9Smayastatic int yyparse(struct asm_parser_state *state);
142e64d31b9Smaya
143e64d31b9Smayastatic char *make_error_string(const char *fmt, ...);
144e64d31b9Smaya
145e64d31b9Smayastatic void yyerror(struct YYLTYPE *locp, struct asm_parser_state *state,
146e64d31b9Smaya    const char *s);
147e64d31b9Smaya
148e64d31b9Smayastatic int validate_inputs(struct YYLTYPE *locp,
149e64d31b9Smaya    struct asm_parser_state *state);
150e64d31b9Smaya
151e64d31b9Smayastatic void init_dst_reg(struct prog_dst_register *r);
152e64d31b9Smaya
153e64d31b9Smayastatic void set_dst_reg(struct prog_dst_register *r,
154e64d31b9Smaya                        gl_register_file file, GLint index);
155e64d31b9Smaya
156e64d31b9Smayastatic void init_src_reg(struct asm_src_register *r);
157e64d31b9Smaya
158e64d31b9Smayastatic void set_src_reg(struct asm_src_register *r,
159e64d31b9Smaya                        gl_register_file file, GLint index);
160e64d31b9Smaya
161e64d31b9Smayastatic void set_src_reg_swz(struct asm_src_register *r,
162e64d31b9Smaya                            gl_register_file file, GLint index, GLuint swizzle);
163e64d31b9Smaya
164e64d31b9Smayastatic void asm_instruction_set_operands(struct asm_instruction *inst,
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_ctor(enum prog_opcode op,
169e64d31b9Smaya    const struct prog_dst_register *dst, const struct asm_src_register *src0,
170e64d31b9Smaya    const struct asm_src_register *src1, const struct asm_src_register *src2);
171e64d31b9Smaya
172e64d31b9Smayastatic struct asm_instruction *asm_instruction_copy_ctor(
173e64d31b9Smaya    const struct prog_instruction *base, const struct prog_dst_register *dst,
174e64d31b9Smaya    const struct asm_src_register *src0, const struct asm_src_register *src1,
175e64d31b9Smaya    const struct asm_src_register *src2);
176e64d31b9Smaya
177e64d31b9Smaya#ifndef FALSE
178e64d31b9Smaya#define FALSE 0
179e64d31b9Smaya#define TRUE (!FALSE)
180e64d31b9Smaya#endif
181e64d31b9Smaya
182e64d31b9Smaya#define YYLLOC_DEFAULT(Current, Rhs, N)					\
183e64d31b9Smaya   do {									\
184e64d31b9Smaya      if (N) {							\
185e64d31b9Smaya	 (Current).first_line = YYRHSLOC(Rhs, 1).first_line;		\
186e64d31b9Smaya	 (Current).first_column = YYRHSLOC(Rhs, 1).first_column;	\
187e64d31b9Smaya	 (Current).position = YYRHSLOC(Rhs, 1).position;		\
188e64d31b9Smaya	 (Current).last_line = YYRHSLOC(Rhs, N).last_line;		\
189e64d31b9Smaya	 (Current).last_column = YYRHSLOC(Rhs, N).last_column;		\
190e64d31b9Smaya      } else {								\
191e64d31b9Smaya	 (Current).first_line = YYRHSLOC(Rhs, 0).last_line;		\
192e64d31b9Smaya	 (Current).last_line = (Current).first_line;			\
193e64d31b9Smaya	 (Current).first_column = YYRHSLOC(Rhs, 0).last_column;		\
194e64d31b9Smaya	 (Current).last_column = (Current).first_column;		\
195e64d31b9Smaya	 (Current).position = YYRHSLOC(Rhs, 0).position			\
196e64d31b9Smaya	    + (Current).first_column;					\
197e64d31b9Smaya      }									\
198e64d31b9Smaya   } while(0)
199e64d31b9Smaya
20096c5ddc4Srjs#line 201 "src/mesa/program/program_parse.tab.c"
20196c5ddc4Srjs
20296c5ddc4Srjs# ifndef YY_CAST
20396c5ddc4Srjs#  ifdef __cplusplus
20496c5ddc4Srjs#   define YY_CAST(Type, Val) static_cast<Type> (Val)
20596c5ddc4Srjs#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
20696c5ddc4Srjs#  else
20796c5ddc4Srjs#   define YY_CAST(Type, Val) ((Type) (Val))
20896c5ddc4Srjs#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
20996c5ddc4Srjs#  endif
21096c5ddc4Srjs# endif
211e64d31b9Smaya# ifndef YY_NULLPTR
212e64d31b9Smaya#  if defined __cplusplus
213e64d31b9Smaya#   if 201103L <= __cplusplus
214e64d31b9Smaya#    define YY_NULLPTR nullptr
215e64d31b9Smaya#   else
216e64d31b9Smaya#    define YY_NULLPTR 0
217e64d31b9Smaya#   endif
218e64d31b9Smaya#  else
219e64d31b9Smaya#   define YY_NULLPTR ((void*)0)
220e64d31b9Smaya#  endif
221e64d31b9Smaya# endif
222e64d31b9Smaya
22396c5ddc4Srjs#include "program_parse.tab.h"
22496c5ddc4Srjs/* Symbol kind.  */
22596c5ddc4Srjsenum yysymbol_kind_t
226e64d31b9Smaya{
22796c5ddc4Srjs  YYSYMBOL_YYEMPTY = -2,
22896c5ddc4Srjs  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
22996c5ddc4Srjs  YYSYMBOL_YYerror = 1,                    /* error  */
23096c5ddc4Srjs  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
23196c5ddc4Srjs  YYSYMBOL_ARBvp_10 = 3,                   /* ARBvp_10  */
23296c5ddc4Srjs  YYSYMBOL_ARBfp_10 = 4,                   /* ARBfp_10  */
23396c5ddc4Srjs  YYSYMBOL_ADDRESS = 5,                    /* ADDRESS  */
23496c5ddc4Srjs  YYSYMBOL_ALIAS = 6,                      /* ALIAS  */
23596c5ddc4Srjs  YYSYMBOL_ATTRIB = 7,                     /* ATTRIB  */
23696c5ddc4Srjs  YYSYMBOL_OPTION = 8,                     /* OPTION  */
23796c5ddc4Srjs  YYSYMBOL_OUTPUT = 9,                     /* OUTPUT  */
23896c5ddc4Srjs  YYSYMBOL_PARAM = 10,                     /* PARAM  */
23996c5ddc4Srjs  YYSYMBOL_TEMP = 11,                      /* TEMP  */
24096c5ddc4Srjs  YYSYMBOL_END = 12,                       /* END  */
24196c5ddc4Srjs  YYSYMBOL_BIN_OP = 13,                    /* BIN_OP  */
24296c5ddc4Srjs  YYSYMBOL_BINSC_OP = 14,                  /* BINSC_OP  */
24396c5ddc4Srjs  YYSYMBOL_SAMPLE_OP = 15,                 /* SAMPLE_OP  */
24496c5ddc4Srjs  YYSYMBOL_SCALAR_OP = 16,                 /* SCALAR_OP  */
24596c5ddc4Srjs  YYSYMBOL_TRI_OP = 17,                    /* TRI_OP  */
24696c5ddc4Srjs  YYSYMBOL_VECTOR_OP = 18,                 /* VECTOR_OP  */
24796c5ddc4Srjs  YYSYMBOL_ARL = 19,                       /* ARL  */
24896c5ddc4Srjs  YYSYMBOL_KIL = 20,                       /* KIL  */
24996c5ddc4Srjs  YYSYMBOL_SWZ = 21,                       /* SWZ  */
25096c5ddc4Srjs  YYSYMBOL_TXD_OP = 22,                    /* TXD_OP  */
25196c5ddc4Srjs  YYSYMBOL_INTEGER = 23,                   /* INTEGER  */
25296c5ddc4Srjs  YYSYMBOL_REAL = 24,                      /* REAL  */
25396c5ddc4Srjs  YYSYMBOL_AMBIENT = 25,                   /* AMBIENT  */
25496c5ddc4Srjs  YYSYMBOL_ATTENUATION = 26,               /* ATTENUATION  */
25596c5ddc4Srjs  YYSYMBOL_BACK = 27,                      /* BACK  */
25696c5ddc4Srjs  YYSYMBOL_CLIP = 28,                      /* CLIP  */
25796c5ddc4Srjs  YYSYMBOL_COLOR = 29,                     /* COLOR  */
25896c5ddc4Srjs  YYSYMBOL_DEPTH = 30,                     /* DEPTH  */
25996c5ddc4Srjs  YYSYMBOL_DIFFUSE = 31,                   /* DIFFUSE  */
26096c5ddc4Srjs  YYSYMBOL_DIRECTION = 32,                 /* DIRECTION  */
26196c5ddc4Srjs  YYSYMBOL_EMISSION = 33,                  /* EMISSION  */
26296c5ddc4Srjs  YYSYMBOL_ENV = 34,                       /* ENV  */
26396c5ddc4Srjs  YYSYMBOL_EYE = 35,                       /* EYE  */
26496c5ddc4Srjs  YYSYMBOL_FOG = 36,                       /* FOG  */
26596c5ddc4Srjs  YYSYMBOL_FOGCOORD = 37,                  /* FOGCOORD  */
26696c5ddc4Srjs  YYSYMBOL_FRAGMENT = 38,                  /* FRAGMENT  */
26796c5ddc4Srjs  YYSYMBOL_FRONT = 39,                     /* FRONT  */
26896c5ddc4Srjs  YYSYMBOL_HALF = 40,                      /* HALF  */
26996c5ddc4Srjs  YYSYMBOL_INVERSE = 41,                   /* INVERSE  */
27096c5ddc4Srjs  YYSYMBOL_INVTRANS = 42,                  /* INVTRANS  */
27196c5ddc4Srjs  YYSYMBOL_LIGHT = 43,                     /* LIGHT  */
27296c5ddc4Srjs  YYSYMBOL_LIGHTMODEL = 44,                /* LIGHTMODEL  */
27396c5ddc4Srjs  YYSYMBOL_LIGHTPROD = 45,                 /* LIGHTPROD  */
27496c5ddc4Srjs  YYSYMBOL_LOCAL = 46,                     /* LOCAL  */
27596c5ddc4Srjs  YYSYMBOL_MATERIAL = 47,                  /* MATERIAL  */
27696c5ddc4Srjs  YYSYMBOL_MAT_PROGRAM = 48,               /* MAT_PROGRAM  */
27796c5ddc4Srjs  YYSYMBOL_MATRIX = 49,                    /* MATRIX  */
27896c5ddc4Srjs  YYSYMBOL_MATRIXINDEX = 50,               /* MATRIXINDEX  */
27996c5ddc4Srjs  YYSYMBOL_MODELVIEW = 51,                 /* MODELVIEW  */
28096c5ddc4Srjs  YYSYMBOL_MVP = 52,                       /* MVP  */
28196c5ddc4Srjs  YYSYMBOL_NORMAL = 53,                    /* NORMAL  */
28296c5ddc4Srjs  YYSYMBOL_OBJECT = 54,                    /* OBJECT  */
28396c5ddc4Srjs  YYSYMBOL_PALETTE = 55,                   /* PALETTE  */
28496c5ddc4Srjs  YYSYMBOL_PARAMS = 56,                    /* PARAMS  */
28596c5ddc4Srjs  YYSYMBOL_PLANE = 57,                     /* PLANE  */
28696c5ddc4Srjs  YYSYMBOL_POINT_TOK = 58,                 /* POINT_TOK  */
28796c5ddc4Srjs  YYSYMBOL_POINTSIZE = 59,                 /* POINTSIZE  */
28896c5ddc4Srjs  YYSYMBOL_POSITION = 60,                  /* POSITION  */
28996c5ddc4Srjs  YYSYMBOL_PRIMARY = 61,                   /* PRIMARY  */
29096c5ddc4Srjs  YYSYMBOL_PROGRAM = 62,                   /* PROGRAM  */
29196c5ddc4Srjs  YYSYMBOL_PROJECTION = 63,                /* PROJECTION  */
29296c5ddc4Srjs  YYSYMBOL_RANGE = 64,                     /* RANGE  */
29396c5ddc4Srjs  YYSYMBOL_RESULT = 65,                    /* RESULT  */
29496c5ddc4Srjs  YYSYMBOL_ROW = 66,                       /* ROW  */
29596c5ddc4Srjs  YYSYMBOL_SCENECOLOR = 67,                /* SCENECOLOR  */
29696c5ddc4Srjs  YYSYMBOL_SECONDARY = 68,                 /* SECONDARY  */
29796c5ddc4Srjs  YYSYMBOL_SHININESS = 69,                 /* SHININESS  */
29896c5ddc4Srjs  YYSYMBOL_SIZE_TOK = 70,                  /* SIZE_TOK  */
29996c5ddc4Srjs  YYSYMBOL_SPECULAR = 71,                  /* SPECULAR  */
30096c5ddc4Srjs  YYSYMBOL_SPOT = 72,                      /* SPOT  */
30196c5ddc4Srjs  YYSYMBOL_STATE = 73,                     /* STATE  */
30296c5ddc4Srjs  YYSYMBOL_TEXCOORD = 74,                  /* TEXCOORD  */
30396c5ddc4Srjs  YYSYMBOL_TEXENV = 75,                    /* TEXENV  */
30496c5ddc4Srjs  YYSYMBOL_TEXGEN = 76,                    /* TEXGEN  */
30596c5ddc4Srjs  YYSYMBOL_TEXGEN_Q = 77,                  /* TEXGEN_Q  */
30696c5ddc4Srjs  YYSYMBOL_TEXGEN_R = 78,                  /* TEXGEN_R  */
30796c5ddc4Srjs  YYSYMBOL_TEXGEN_S = 79,                  /* TEXGEN_S  */
30896c5ddc4Srjs  YYSYMBOL_TEXGEN_T = 80,                  /* TEXGEN_T  */
30996c5ddc4Srjs  YYSYMBOL_TEXTURE = 81,                   /* TEXTURE  */
31096c5ddc4Srjs  YYSYMBOL_TRANSPOSE = 82,                 /* TRANSPOSE  */
31196c5ddc4Srjs  YYSYMBOL_TEXTURE_UNIT = 83,              /* TEXTURE_UNIT  */
31296c5ddc4Srjs  YYSYMBOL_TEX_1D = 84,                    /* TEX_1D  */
31396c5ddc4Srjs  YYSYMBOL_TEX_2D = 85,                    /* TEX_2D  */
31496c5ddc4Srjs  YYSYMBOL_TEX_3D = 86,                    /* TEX_3D  */
31596c5ddc4Srjs  YYSYMBOL_TEX_CUBE = 87,                  /* TEX_CUBE  */
31696c5ddc4Srjs  YYSYMBOL_TEX_RECT = 88,                  /* TEX_RECT  */
31796c5ddc4Srjs  YYSYMBOL_TEX_SHADOW1D = 89,              /* TEX_SHADOW1D  */
31896c5ddc4Srjs  YYSYMBOL_TEX_SHADOW2D = 90,              /* TEX_SHADOW2D  */
31996c5ddc4Srjs  YYSYMBOL_TEX_SHADOWRECT = 91,            /* TEX_SHADOWRECT  */
32096c5ddc4Srjs  YYSYMBOL_TEX_ARRAY1D = 92,               /* TEX_ARRAY1D  */
32196c5ddc4Srjs  YYSYMBOL_TEX_ARRAY2D = 93,               /* TEX_ARRAY2D  */
32296c5ddc4Srjs  YYSYMBOL_TEX_ARRAYSHADOW1D = 94,         /* TEX_ARRAYSHADOW1D  */
32396c5ddc4Srjs  YYSYMBOL_TEX_ARRAYSHADOW2D = 95,         /* TEX_ARRAYSHADOW2D  */
32496c5ddc4Srjs  YYSYMBOL_VERTEX = 96,                    /* VERTEX  */
32596c5ddc4Srjs  YYSYMBOL_VTXATTRIB = 97,                 /* VTXATTRIB  */
32696c5ddc4Srjs  YYSYMBOL_IDENTIFIER = 98,                /* IDENTIFIER  */
32796c5ddc4Srjs  YYSYMBOL_USED_IDENTIFIER = 99,           /* USED_IDENTIFIER  */
32896c5ddc4Srjs  YYSYMBOL_MASK4 = 100,                    /* MASK4  */
32996c5ddc4Srjs  YYSYMBOL_MASK3 = 101,                    /* MASK3  */
33096c5ddc4Srjs  YYSYMBOL_MASK2 = 102,                    /* MASK2  */
33196c5ddc4Srjs  YYSYMBOL_MASK1 = 103,                    /* MASK1  */
33296c5ddc4Srjs  YYSYMBOL_SWIZZLE = 104,                  /* SWIZZLE  */
33396c5ddc4Srjs  YYSYMBOL_DOT_DOT = 105,                  /* DOT_DOT  */
33496c5ddc4Srjs  YYSYMBOL_DOT = 106,                      /* DOT  */
33596c5ddc4Srjs  YYSYMBOL_107_ = 107,                     /* ';'  */
33696c5ddc4Srjs  YYSYMBOL_108_ = 108,                     /* ','  */
33796c5ddc4Srjs  YYSYMBOL_109_ = 109,                     /* '['  */
33896c5ddc4Srjs  YYSYMBOL_110_ = 110,                     /* ']'  */
33996c5ddc4Srjs  YYSYMBOL_111_ = 111,                     /* '+'  */
34096c5ddc4Srjs  YYSYMBOL_112_ = 112,                     /* '-'  */
34196c5ddc4Srjs  YYSYMBOL_113_ = 113,                     /* '='  */
34296c5ddc4Srjs  YYSYMBOL_114_ = 114,                     /* '{'  */
34396c5ddc4Srjs  YYSYMBOL_115_ = 115,                     /* '}'  */
34496c5ddc4Srjs  YYSYMBOL_YYACCEPT = 116,                 /* $accept  */
34596c5ddc4Srjs  YYSYMBOL_program = 117,                  /* program  */
34696c5ddc4Srjs  YYSYMBOL_language = 118,                 /* language  */
34796c5ddc4Srjs  YYSYMBOL_optionSequence = 119,           /* optionSequence  */
34896c5ddc4Srjs  YYSYMBOL_option = 120,                   /* option  */
34996c5ddc4Srjs  YYSYMBOL_statementSequence = 121,        /* statementSequence  */
35096c5ddc4Srjs  YYSYMBOL_statement = 122,                /* statement  */
35196c5ddc4Srjs  YYSYMBOL_instruction = 123,              /* instruction  */
35296c5ddc4Srjs  YYSYMBOL_ALU_instruction = 124,          /* ALU_instruction  */
35396c5ddc4Srjs  YYSYMBOL_TexInstruction = 125,           /* TexInstruction  */
35496c5ddc4Srjs  YYSYMBOL_ARL_instruction = 126,          /* ARL_instruction  */
35596c5ddc4Srjs  YYSYMBOL_VECTORop_instruction = 127,     /* VECTORop_instruction  */
35696c5ddc4Srjs  YYSYMBOL_SCALARop_instruction = 128,     /* SCALARop_instruction  */
35796c5ddc4Srjs  YYSYMBOL_BINSCop_instruction = 129,      /* BINSCop_instruction  */
35896c5ddc4Srjs  YYSYMBOL_BINop_instruction = 130,        /* BINop_instruction  */
35996c5ddc4Srjs  YYSYMBOL_TRIop_instruction = 131,        /* TRIop_instruction  */
36096c5ddc4Srjs  YYSYMBOL_SAMPLE_instruction = 132,       /* SAMPLE_instruction  */
36196c5ddc4Srjs  YYSYMBOL_KIL_instruction = 133,          /* KIL_instruction  */
36296c5ddc4Srjs  YYSYMBOL_TXD_instruction = 134,          /* TXD_instruction  */
36396c5ddc4Srjs  YYSYMBOL_texImageUnit = 135,             /* texImageUnit  */
36496c5ddc4Srjs  YYSYMBOL_texTarget = 136,                /* texTarget  */
36596c5ddc4Srjs  YYSYMBOL_SWZ_instruction = 137,          /* SWZ_instruction  */
36696c5ddc4Srjs  YYSYMBOL_scalarSrcReg = 138,             /* scalarSrcReg  */
36796c5ddc4Srjs  YYSYMBOL_scalarUse = 139,                /* scalarUse  */
36896c5ddc4Srjs  YYSYMBOL_swizzleSrcReg = 140,            /* swizzleSrcReg  */
36996c5ddc4Srjs  YYSYMBOL_maskedDstReg = 141,             /* maskedDstReg  */
37096c5ddc4Srjs  YYSYMBOL_maskedAddrReg = 142,            /* maskedAddrReg  */
37196c5ddc4Srjs  YYSYMBOL_extendedSwizzle = 143,          /* extendedSwizzle  */
37296c5ddc4Srjs  YYSYMBOL_extSwizComp = 144,              /* extSwizComp  */
37396c5ddc4Srjs  YYSYMBOL_extSwizSel = 145,               /* extSwizSel  */
37496c5ddc4Srjs  YYSYMBOL_srcReg = 146,                   /* srcReg  */
37596c5ddc4Srjs  YYSYMBOL_dstReg = 147,                   /* dstReg  */
37696c5ddc4Srjs  YYSYMBOL_progParamArray = 148,           /* progParamArray  */
37796c5ddc4Srjs  YYSYMBOL_progParamArrayMem = 149,        /* progParamArrayMem  */
37896c5ddc4Srjs  YYSYMBOL_progParamArrayAbs = 150,        /* progParamArrayAbs  */
37996c5ddc4Srjs  YYSYMBOL_progParamArrayRel = 151,        /* progParamArrayRel  */
38096c5ddc4Srjs  YYSYMBOL_addrRegRelOffset = 152,         /* addrRegRelOffset  */
38196c5ddc4Srjs  YYSYMBOL_addrRegPosOffset = 153,         /* addrRegPosOffset  */
38296c5ddc4Srjs  YYSYMBOL_addrRegNegOffset = 154,         /* addrRegNegOffset  */
38396c5ddc4Srjs  YYSYMBOL_addrReg = 155,                  /* addrReg  */
38496c5ddc4Srjs  YYSYMBOL_addrComponent = 156,            /* addrComponent  */
38596c5ddc4Srjs  YYSYMBOL_addrWriteMask = 157,            /* addrWriteMask  */
38696c5ddc4Srjs  YYSYMBOL_scalarSuffix = 158,             /* scalarSuffix  */
38796c5ddc4Srjs  YYSYMBOL_swizzleSuffix = 159,            /* swizzleSuffix  */
38896c5ddc4Srjs  YYSYMBOL_optionalMask = 160,             /* optionalMask  */
38996c5ddc4Srjs  YYSYMBOL_namingStatement = 161,          /* namingStatement  */
39096c5ddc4Srjs  YYSYMBOL_ATTRIB_statement = 162,         /* ATTRIB_statement  */
39196c5ddc4Srjs  YYSYMBOL_attribBinding = 163,            /* attribBinding  */
39296c5ddc4Srjs  YYSYMBOL_vtxAttribItem = 164,            /* vtxAttribItem  */
39396c5ddc4Srjs  YYSYMBOL_vtxAttribNum = 165,             /* vtxAttribNum  */
39496c5ddc4Srjs  YYSYMBOL_vtxWeightNum = 166,             /* vtxWeightNum  */
39596c5ddc4Srjs  YYSYMBOL_fragAttribItem = 167,           /* fragAttribItem  */
39696c5ddc4Srjs  YYSYMBOL_PARAM_statement = 168,          /* PARAM_statement  */
39796c5ddc4Srjs  YYSYMBOL_PARAM_singleStmt = 169,         /* PARAM_singleStmt  */
39896c5ddc4Srjs  YYSYMBOL_PARAM_multipleStmt = 170,       /* PARAM_multipleStmt  */
39996c5ddc4Srjs  YYSYMBOL_optArraySize = 171,             /* optArraySize  */
40096c5ddc4Srjs  YYSYMBOL_paramSingleInit = 172,          /* paramSingleInit  */
40196c5ddc4Srjs  YYSYMBOL_paramMultipleInit = 173,        /* paramMultipleInit  */
40296c5ddc4Srjs  YYSYMBOL_paramMultInitList = 174,        /* paramMultInitList  */
40396c5ddc4Srjs  YYSYMBOL_paramSingleItemDecl = 175,      /* paramSingleItemDecl  */
40496c5ddc4Srjs  YYSYMBOL_paramSingleItemUse = 176,       /* paramSingleItemUse  */
40596c5ddc4Srjs  YYSYMBOL_paramMultipleItem = 177,        /* paramMultipleItem  */
40696c5ddc4Srjs  YYSYMBOL_stateMultipleItem = 178,        /* stateMultipleItem  */
40796c5ddc4Srjs  YYSYMBOL_stateSingleItem = 179,          /* stateSingleItem  */
40896c5ddc4Srjs  YYSYMBOL_stateMaterialItem = 180,        /* stateMaterialItem  */
40996c5ddc4Srjs  YYSYMBOL_stateMatProperty = 181,         /* stateMatProperty  */
41096c5ddc4Srjs  YYSYMBOL_stateLightItem = 182,           /* stateLightItem  */
41196c5ddc4Srjs  YYSYMBOL_stateLightProperty = 183,       /* stateLightProperty  */
41296c5ddc4Srjs  YYSYMBOL_stateSpotProperty = 184,        /* stateSpotProperty  */
41396c5ddc4Srjs  YYSYMBOL_stateLightModelItem = 185,      /* stateLightModelItem  */
41496c5ddc4Srjs  YYSYMBOL_stateLModProperty = 186,        /* stateLModProperty  */
41596c5ddc4Srjs  YYSYMBOL_stateLightProdItem = 187,       /* stateLightProdItem  */
41696c5ddc4Srjs  YYSYMBOL_stateLProdProperty = 188,       /* stateLProdProperty  */
41796c5ddc4Srjs  YYSYMBOL_stateTexEnvItem = 189,          /* stateTexEnvItem  */
41896c5ddc4Srjs  YYSYMBOL_stateTexEnvProperty = 190,      /* stateTexEnvProperty  */
41996c5ddc4Srjs  YYSYMBOL_ambDiffSpecPropertyMaterial = 191, /* ambDiffSpecPropertyMaterial  */
42096c5ddc4Srjs  YYSYMBOL_ambDiffSpecPropertyLight = 192, /* ambDiffSpecPropertyLight  */
42196c5ddc4Srjs  YYSYMBOL_stateLightNumber = 193,         /* stateLightNumber  */
42296c5ddc4Srjs  YYSYMBOL_stateTexGenItem = 194,          /* stateTexGenItem  */
42396c5ddc4Srjs  YYSYMBOL_stateTexGenType = 195,          /* stateTexGenType  */
42496c5ddc4Srjs  YYSYMBOL_stateTexGenCoord = 196,         /* stateTexGenCoord  */
42596c5ddc4Srjs  YYSYMBOL_stateFogItem = 197,             /* stateFogItem  */
42696c5ddc4Srjs  YYSYMBOL_stateFogProperty = 198,         /* stateFogProperty  */
42796c5ddc4Srjs  YYSYMBOL_stateClipPlaneItem = 199,       /* stateClipPlaneItem  */
42896c5ddc4Srjs  YYSYMBOL_stateClipPlaneNum = 200,        /* stateClipPlaneNum  */
42996c5ddc4Srjs  YYSYMBOL_statePointItem = 201,           /* statePointItem  */
43096c5ddc4Srjs  YYSYMBOL_statePointProperty = 202,       /* statePointProperty  */
43196c5ddc4Srjs  YYSYMBOL_stateMatrixRow = 203,           /* stateMatrixRow  */
43296c5ddc4Srjs  YYSYMBOL_stateMatrixRows = 204,          /* stateMatrixRows  */
43396c5ddc4Srjs  YYSYMBOL_optMatrixRows = 205,            /* optMatrixRows  */
43496c5ddc4Srjs  YYSYMBOL_stateMatrixItem = 206,          /* stateMatrixItem  */
43596c5ddc4Srjs  YYSYMBOL_stateOptMatModifier = 207,      /* stateOptMatModifier  */
43696c5ddc4Srjs  YYSYMBOL_stateMatModifier = 208,         /* stateMatModifier  */
43796c5ddc4Srjs  YYSYMBOL_stateMatrixRowNum = 209,        /* stateMatrixRowNum  */
43896c5ddc4Srjs  YYSYMBOL_stateMatrixName = 210,          /* stateMatrixName  */
43996c5ddc4Srjs  YYSYMBOL_stateOptModMatNum = 211,        /* stateOptModMatNum  */
44096c5ddc4Srjs  YYSYMBOL_stateModMatNum = 212,           /* stateModMatNum  */
44196c5ddc4Srjs  YYSYMBOL_statePaletteMatNum = 213,       /* statePaletteMatNum  */
44296c5ddc4Srjs  YYSYMBOL_stateProgramMatNum = 214,       /* stateProgramMatNum  */
44396c5ddc4Srjs  YYSYMBOL_stateDepthItem = 215,           /* stateDepthItem  */
44496c5ddc4Srjs  YYSYMBOL_programSingleItem = 216,        /* programSingleItem  */
44596c5ddc4Srjs  YYSYMBOL_programMultipleItem = 217,      /* programMultipleItem  */
44696c5ddc4Srjs  YYSYMBOL_progEnvParams = 218,            /* progEnvParams  */
44796c5ddc4Srjs  YYSYMBOL_progEnvParamNums = 219,         /* progEnvParamNums  */
44896c5ddc4Srjs  YYSYMBOL_progEnvParam = 220,             /* progEnvParam  */
44996c5ddc4Srjs  YYSYMBOL_progLocalParams = 221,          /* progLocalParams  */
45096c5ddc4Srjs  YYSYMBOL_progLocalParamNums = 222,       /* progLocalParamNums  */
45196c5ddc4Srjs  YYSYMBOL_progLocalParam = 223,           /* progLocalParam  */
45296c5ddc4Srjs  YYSYMBOL_progEnvParamNum = 224,          /* progEnvParamNum  */
45396c5ddc4Srjs  YYSYMBOL_progLocalParamNum = 225,        /* progLocalParamNum  */
45496c5ddc4Srjs  YYSYMBOL_paramConstDecl = 226,           /* paramConstDecl  */
45596c5ddc4Srjs  YYSYMBOL_paramConstUse = 227,            /* paramConstUse  */
45696c5ddc4Srjs  YYSYMBOL_paramConstScalarDecl = 228,     /* paramConstScalarDecl  */
45796c5ddc4Srjs  YYSYMBOL_paramConstScalarUse = 229,      /* paramConstScalarUse  */
45896c5ddc4Srjs  YYSYMBOL_paramConstVector = 230,         /* paramConstVector  */
45996c5ddc4Srjs  YYSYMBOL_signedFloatConstant = 231,      /* signedFloatConstant  */
46096c5ddc4Srjs  YYSYMBOL_optionalSign = 232,             /* optionalSign  */
46196c5ddc4Srjs  YYSYMBOL_TEMP_statement = 233,           /* TEMP_statement  */
46296c5ddc4Srjs  YYSYMBOL_234_1 = 234,                    /* @1  */
46396c5ddc4Srjs  YYSYMBOL_ADDRESS_statement = 235,        /* ADDRESS_statement  */
46496c5ddc4Srjs  YYSYMBOL_236_2 = 236,                    /* @2  */
46596c5ddc4Srjs  YYSYMBOL_varNameList = 237,              /* varNameList  */
46696c5ddc4Srjs  YYSYMBOL_OUTPUT_statement = 238,         /* OUTPUT_statement  */
46796c5ddc4Srjs  YYSYMBOL_resultBinding = 239,            /* resultBinding  */
46896c5ddc4Srjs  YYSYMBOL_resultColBinding = 240,         /* resultColBinding  */
46996c5ddc4Srjs  YYSYMBOL_optResultFaceType = 241,        /* optResultFaceType  */
47096c5ddc4Srjs  YYSYMBOL_optResultColorType = 242,       /* optResultColorType  */
47196c5ddc4Srjs  YYSYMBOL_optFaceType = 243,              /* optFaceType  */
47296c5ddc4Srjs  YYSYMBOL_optColorType = 244,             /* optColorType  */
47396c5ddc4Srjs  YYSYMBOL_optTexCoordUnitNum = 245,       /* optTexCoordUnitNum  */
47496c5ddc4Srjs  YYSYMBOL_optTexImageUnitNum = 246,       /* optTexImageUnitNum  */
47596c5ddc4Srjs  YYSYMBOL_optLegacyTexUnitNum = 247,      /* optLegacyTexUnitNum  */
47696c5ddc4Srjs  YYSYMBOL_texCoordUnitNum = 248,          /* texCoordUnitNum  */
47796c5ddc4Srjs  YYSYMBOL_texImageUnitNum = 249,          /* texImageUnitNum  */
47896c5ddc4Srjs  YYSYMBOL_legacyTexUnitNum = 250,         /* legacyTexUnitNum  */
47996c5ddc4Srjs  YYSYMBOL_ALIAS_statement = 251,          /* ALIAS_statement  */
48096c5ddc4Srjs  YYSYMBOL_string = 252                    /* string  */
481e64d31b9Smaya};
48296c5ddc4Srjstypedef enum yysymbol_kind_t yysymbol_kind_t;
483e64d31b9Smaya
484e64d31b9Smaya
485e64d31b9Smaya/* Second part of user prologue.  */
48696c5ddc4Srjs#line 280 "../src/mesa/program/program_parse.y"
487e64d31b9Smaya
488e64d31b9Smayaextern int
489e64d31b9Smaya_mesa_program_lexer_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
490e64d31b9Smaya                        void *yyscanner);
491e64d31b9Smaya
492e64d31b9Smayastatic int
493e64d31b9Smayayylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
494e64d31b9Smaya      struct asm_parser_state *state)
495e64d31b9Smaya{
496e64d31b9Smaya   return _mesa_program_lexer_lex(yylval_param, yylloc_param, state->scanner);
497e64d31b9Smaya}
498e64d31b9Smaya
49996c5ddc4Srjs#line 500 "src/mesa/program/program_parse.tab.c"
50096c5ddc4Srjs
501e64d31b9Smaya
502e64d31b9Smaya#ifdef short
503e64d31b9Smaya# undef short
504e64d31b9Smaya#endif
505e64d31b9Smaya
50696c5ddc4Srjs/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
50796c5ddc4Srjs   <limits.h> and (if available) <stdint.h> are included
50896c5ddc4Srjs   so that the code can choose integer types of a good width.  */
50996c5ddc4Srjs
51096c5ddc4Srjs#ifndef __PTRDIFF_MAX__
51196c5ddc4Srjs# include <limits.h> /* INFRINGES ON USER NAME SPACE */
51296c5ddc4Srjs# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
51396c5ddc4Srjs#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
51496c5ddc4Srjs#  define YY_STDINT_H
51596c5ddc4Srjs# endif
516e64d31b9Smaya#endif
517e64d31b9Smaya
51896c5ddc4Srjs/* Narrow types that promote to a signed type and that can represent a
51996c5ddc4Srjs   signed or unsigned integer of at least N bits.  In tables they can
52096c5ddc4Srjs   save space and decrease cache pressure.  Promoting to a signed type
52196c5ddc4Srjs   helps avoid bugs in integer arithmetic.  */
52296c5ddc4Srjs
52396c5ddc4Srjs#ifdef __INT_LEAST8_MAX__
52496c5ddc4Srjstypedef __INT_LEAST8_TYPE__ yytype_int8;
52596c5ddc4Srjs#elif defined YY_STDINT_H
52696c5ddc4Srjstypedef int_least8_t yytype_int8;
527e64d31b9Smaya#else
528e64d31b9Smayatypedef signed char yytype_int8;
529e64d31b9Smaya#endif
530e64d31b9Smaya
53196c5ddc4Srjs#ifdef __INT_LEAST16_MAX__
53296c5ddc4Srjstypedef __INT_LEAST16_TYPE__ yytype_int16;
53396c5ddc4Srjs#elif defined YY_STDINT_H
53496c5ddc4Srjstypedef int_least16_t yytype_int16;
535e64d31b9Smaya#else
53696c5ddc4Srjstypedef short yytype_int16;
537e64d31b9Smaya#endif
538e64d31b9Smaya
53996c5ddc4Srjs#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
54096c5ddc4Srjstypedef __UINT_LEAST8_TYPE__ yytype_uint8;
54196c5ddc4Srjs#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
54296c5ddc4Srjs       && UINT_LEAST8_MAX <= INT_MAX)
54396c5ddc4Srjstypedef uint_least8_t yytype_uint8;
54496c5ddc4Srjs#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
54596c5ddc4Srjstypedef unsigned char yytype_uint8;
546e64d31b9Smaya#else
54796c5ddc4Srjstypedef short yytype_uint8;
54896c5ddc4Srjs#endif
54996c5ddc4Srjs
55096c5ddc4Srjs#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
55196c5ddc4Srjstypedef __UINT_LEAST16_TYPE__ yytype_uint16;
55296c5ddc4Srjs#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
55396c5ddc4Srjs       && UINT_LEAST16_MAX <= INT_MAX)
55496c5ddc4Srjstypedef uint_least16_t yytype_uint16;
55596c5ddc4Srjs#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
55696c5ddc4Srjstypedef unsigned short yytype_uint16;
55796c5ddc4Srjs#else
55896c5ddc4Srjstypedef int yytype_uint16;
55996c5ddc4Srjs#endif
56096c5ddc4Srjs
56196c5ddc4Srjs#ifndef YYPTRDIFF_T
56296c5ddc4Srjs# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
56396c5ddc4Srjs#  define YYPTRDIFF_T __PTRDIFF_TYPE__
56496c5ddc4Srjs#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
56596c5ddc4Srjs# elif defined PTRDIFF_MAX
56696c5ddc4Srjs#  ifndef ptrdiff_t
56796c5ddc4Srjs#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
56896c5ddc4Srjs#  endif
56996c5ddc4Srjs#  define YYPTRDIFF_T ptrdiff_t
57096c5ddc4Srjs#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
57196c5ddc4Srjs# else
57296c5ddc4Srjs#  define YYPTRDIFF_T long
57396c5ddc4Srjs#  define YYPTRDIFF_MAXIMUM LONG_MAX
57496c5ddc4Srjs# endif
575e64d31b9Smaya#endif
576e64d31b9Smaya
577e64d31b9Smaya#ifndef YYSIZE_T
578e64d31b9Smaya# ifdef __SIZE_TYPE__
579e64d31b9Smaya#  define YYSIZE_T __SIZE_TYPE__
580e64d31b9Smaya# elif defined size_t
581e64d31b9Smaya#  define YYSIZE_T size_t
58296c5ddc4Srjs# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
583e64d31b9Smaya#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
584e64d31b9Smaya#  define YYSIZE_T size_t
585e64d31b9Smaya# else
586e64d31b9Smaya#  define YYSIZE_T unsigned
587e64d31b9Smaya# endif
588e64d31b9Smaya#endif
589e64d31b9Smaya
59096c5ddc4Srjs#define YYSIZE_MAXIMUM                                  \
59196c5ddc4Srjs  YY_CAST (YYPTRDIFF_T,                                 \
59296c5ddc4Srjs           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
59396c5ddc4Srjs            ? YYPTRDIFF_MAXIMUM                         \
59496c5ddc4Srjs            : YY_CAST (YYSIZE_T, -1)))
59596c5ddc4Srjs
59696c5ddc4Srjs#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
59796c5ddc4Srjs
59896c5ddc4Srjs
59996c5ddc4Srjs/* Stored state numbers (used for stacks). */
60096c5ddc4Srjstypedef yytype_int16 yy_state_t;
60196c5ddc4Srjs
60296c5ddc4Srjs/* State numbers in computations.  */
60396c5ddc4Srjstypedef int yy_state_fast_t;
604e64d31b9Smaya
605e64d31b9Smaya#ifndef YY_
606e64d31b9Smaya# if defined YYENABLE_NLS && YYENABLE_NLS
607e64d31b9Smaya#  if ENABLE_NLS
608e64d31b9Smaya#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
609e64d31b9Smaya#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
610e64d31b9Smaya#  endif
611e64d31b9Smaya# endif
612e64d31b9Smaya# ifndef YY_
613e64d31b9Smaya#  define YY_(Msgid) Msgid
614e64d31b9Smaya# endif
615e64d31b9Smaya#endif
616e64d31b9Smaya
617e64d31b9Smaya
618e64d31b9Smaya#ifndef YY_ATTRIBUTE_PURE
61996c5ddc4Srjs# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
62096c5ddc4Srjs#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
62196c5ddc4Srjs# else
62296c5ddc4Srjs#  define YY_ATTRIBUTE_PURE
62396c5ddc4Srjs# endif
624e64d31b9Smaya#endif
625e64d31b9Smaya
626e64d31b9Smaya#ifndef YY_ATTRIBUTE_UNUSED
62796c5ddc4Srjs# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
62896c5ddc4Srjs#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
62996c5ddc4Srjs# else
63096c5ddc4Srjs#  define YY_ATTRIBUTE_UNUSED
63196c5ddc4Srjs# endif
632e64d31b9Smaya#endif
633e64d31b9Smaya
634e64d31b9Smaya/* Suppress unused-variable warnings by "using" E.  */
635e64d31b9Smaya#if ! defined lint || defined __GNUC__
636e64d31b9Smaya# define YYUSE(E) ((void) (E))
637e64d31b9Smaya#else
638e64d31b9Smaya# define YYUSE(E) /* empty */
639e64d31b9Smaya#endif
640e64d31b9Smaya
641e64d31b9Smaya#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
642e64d31b9Smaya/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
64396c5ddc4Srjs# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
64496c5ddc4Srjs    _Pragma ("GCC diagnostic push")                                     \
64596c5ddc4Srjs    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
646e64d31b9Smaya    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
64796c5ddc4Srjs# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
648e64d31b9Smaya    _Pragma ("GCC diagnostic pop")
649e64d31b9Smaya#else
650e64d31b9Smaya# define YY_INITIAL_VALUE(Value) Value
651e64d31b9Smaya#endif
652e64d31b9Smaya#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
653e64d31b9Smaya# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
654e64d31b9Smaya# define YY_IGNORE_MAYBE_UNINITIALIZED_END
655e64d31b9Smaya#endif
656e64d31b9Smaya#ifndef YY_INITIAL_VALUE
657e64d31b9Smaya# define YY_INITIAL_VALUE(Value) /* Nothing. */
658e64d31b9Smaya#endif
659e64d31b9Smaya
66096c5ddc4Srjs#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
66196c5ddc4Srjs# define YY_IGNORE_USELESS_CAST_BEGIN                          \
66296c5ddc4Srjs    _Pragma ("GCC diagnostic push")                            \
66396c5ddc4Srjs    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
66496c5ddc4Srjs# define YY_IGNORE_USELESS_CAST_END            \
66596c5ddc4Srjs    _Pragma ("GCC diagnostic pop")
66696c5ddc4Srjs#endif
66796c5ddc4Srjs#ifndef YY_IGNORE_USELESS_CAST_BEGIN
66896c5ddc4Srjs# define YY_IGNORE_USELESS_CAST_BEGIN
66996c5ddc4Srjs# define YY_IGNORE_USELESS_CAST_END
67096c5ddc4Srjs#endif
67196c5ddc4Srjs
672e64d31b9Smaya
67396c5ddc4Srjs#define YY_ASSERT(E) ((void) (0 && (E)))
67496c5ddc4Srjs
67596c5ddc4Srjs#if 1
676e64d31b9Smaya
677e64d31b9Smaya/* The parser invokes alloca or malloc; define the necessary symbols.  */
678e64d31b9Smaya
679e64d31b9Smaya# ifdef YYSTACK_USE_ALLOCA
680e64d31b9Smaya#  if YYSTACK_USE_ALLOCA
681e64d31b9Smaya#   ifdef __GNUC__
682e64d31b9Smaya#    define YYSTACK_ALLOC __builtin_alloca
683e64d31b9Smaya#   elif defined __BUILTIN_VA_ARG_INCR
684e64d31b9Smaya#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
685e64d31b9Smaya#   elif defined _AIX
686e64d31b9Smaya#    define YYSTACK_ALLOC __alloca
687e64d31b9Smaya#   elif defined _MSC_VER
688e64d31b9Smaya#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
689e64d31b9Smaya#    define alloca _alloca
690e64d31b9Smaya#   else
691e64d31b9Smaya#    define YYSTACK_ALLOC alloca
692e64d31b9Smaya#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
693e64d31b9Smaya#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
694e64d31b9Smaya      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
695e64d31b9Smaya#     ifndef EXIT_SUCCESS
696e64d31b9Smaya#      define EXIT_SUCCESS 0
697e64d31b9Smaya#     endif
698e64d31b9Smaya#    endif
699e64d31b9Smaya#   endif
700e64d31b9Smaya#  endif
701e64d31b9Smaya# endif
702e64d31b9Smaya
703e64d31b9Smaya# ifdef YYSTACK_ALLOC
704e64d31b9Smaya   /* Pacify GCC's 'empty if-body' warning.  */
705e64d31b9Smaya#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
706e64d31b9Smaya#  ifndef YYSTACK_ALLOC_MAXIMUM
707e64d31b9Smaya    /* The OS might guarantee only one guard page at the bottom of the stack,
708e64d31b9Smaya       and a page size can be as small as 4096 bytes.  So we cannot safely
709e64d31b9Smaya       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
710e64d31b9Smaya       to allow for a few compiler-allocated temporary stack slots.  */
711e64d31b9Smaya#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
712e64d31b9Smaya#  endif
713e64d31b9Smaya# else
714e64d31b9Smaya#  define YYSTACK_ALLOC YYMALLOC
715e64d31b9Smaya#  define YYSTACK_FREE YYFREE
716e64d31b9Smaya#  ifndef YYSTACK_ALLOC_MAXIMUM
717e64d31b9Smaya#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
718e64d31b9Smaya#  endif
719e64d31b9Smaya#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
720e64d31b9Smaya       && ! ((defined YYMALLOC || defined malloc) \
721e64d31b9Smaya             && (defined YYFREE || defined free)))
722e64d31b9Smaya#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
723e64d31b9Smaya#   ifndef EXIT_SUCCESS
724e64d31b9Smaya#    define EXIT_SUCCESS 0
725e64d31b9Smaya#   endif
726e64d31b9Smaya#  endif
727e64d31b9Smaya#  ifndef YYMALLOC
728e64d31b9Smaya#   define YYMALLOC malloc
729e64d31b9Smaya#   if ! defined malloc && ! defined EXIT_SUCCESS
730e64d31b9Smayavoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
731e64d31b9Smaya#   endif
732e64d31b9Smaya#  endif
733e64d31b9Smaya#  ifndef YYFREE
734e64d31b9Smaya#   define YYFREE free
735e64d31b9Smaya#   if ! defined free && ! defined EXIT_SUCCESS
736e64d31b9Smayavoid free (void *); /* INFRINGES ON USER NAME SPACE */
737e64d31b9Smaya#   endif
738e64d31b9Smaya#  endif
739e64d31b9Smaya# endif
74096c5ddc4Srjs#endif /* 1 */
741e64d31b9Smaya
742e64d31b9Smaya#if (! defined yyoverflow \
743e64d31b9Smaya     && (! defined __cplusplus \
744e64d31b9Smaya         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
745e64d31b9Smaya             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
746e64d31b9Smaya
747e64d31b9Smaya/* A type that is properly aligned for any stack member.  */
748e64d31b9Smayaunion yyalloc
749e64d31b9Smaya{
75096c5ddc4Srjs  yy_state_t yyss_alloc;
751e64d31b9Smaya  YYSTYPE yyvs_alloc;
752e64d31b9Smaya  YYLTYPE yyls_alloc;
753e64d31b9Smaya};
754e64d31b9Smaya
755e64d31b9Smaya/* The size of the maximum gap between one aligned stack and the next.  */
75696c5ddc4Srjs# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
757e64d31b9Smaya
758e64d31b9Smaya/* The size of an array large to enough to hold all stacks, each with
759e64d31b9Smaya   N elements.  */
760e64d31b9Smaya# define YYSTACK_BYTES(N) \
76196c5ddc4Srjs     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
76296c5ddc4Srjs             + YYSIZEOF (YYLTYPE)) \
763e64d31b9Smaya      + 2 * YYSTACK_GAP_MAXIMUM)
764e64d31b9Smaya
765e64d31b9Smaya# define YYCOPY_NEEDED 1
766e64d31b9Smaya
767e64d31b9Smaya/* Relocate STACK from its old location to the new one.  The
768e64d31b9Smaya   local variables YYSIZE and YYSTACKSIZE give the old and new number of
769e64d31b9Smaya   elements in the stack, and YYPTR gives the new location of the
770e64d31b9Smaya   stack.  Advance YYPTR to a properly aligned location for the next
771e64d31b9Smaya   stack.  */
772e64d31b9Smaya# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
773e64d31b9Smaya    do                                                                  \
774e64d31b9Smaya      {                                                                 \
77596c5ddc4Srjs        YYPTRDIFF_T yynewbytes;                                         \
776e64d31b9Smaya        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
777e64d31b9Smaya        Stack = &yyptr->Stack_alloc;                                    \
77896c5ddc4Srjs        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
77996c5ddc4Srjs        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
780e64d31b9Smaya      }                                                                 \
781e64d31b9Smaya    while (0)
782e64d31b9Smaya
783e64d31b9Smaya#endif
784e64d31b9Smaya
785e64d31b9Smaya#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
786e64d31b9Smaya/* Copy COUNT objects from SRC to DST.  The source and destination do
787e64d31b9Smaya   not overlap.  */
788e64d31b9Smaya# ifndef YYCOPY
789e64d31b9Smaya#  if defined __GNUC__ && 1 < __GNUC__
790e64d31b9Smaya#   define YYCOPY(Dst, Src, Count) \
79196c5ddc4Srjs      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
792e64d31b9Smaya#  else
793e64d31b9Smaya#   define YYCOPY(Dst, Src, Count)              \
794e64d31b9Smaya      do                                        \
795e64d31b9Smaya        {                                       \
79696c5ddc4Srjs          YYPTRDIFF_T yyi;                      \
797e64d31b9Smaya          for (yyi = 0; yyi < (Count); yyi++)   \
798e64d31b9Smaya            (Dst)[yyi] = (Src)[yyi];            \
799e64d31b9Smaya        }                                       \
800e64d31b9Smaya      while (0)
801e64d31b9Smaya#  endif
802e64d31b9Smaya# endif
803e64d31b9Smaya#endif /* !YYCOPY_NEEDED */
804e64d31b9Smaya
805e64d31b9Smaya/* YYFINAL -- State number of the termination state.  */
806e64d31b9Smaya#define YYFINAL  5
807e64d31b9Smaya/* YYLAST -- Last index in YYTABLE.  */
80896c5ddc4Srjs#define YYLAST   352
809e64d31b9Smaya
810e64d31b9Smaya/* YYNTOKENS -- Number of terminals.  */
811e64d31b9Smaya#define YYNTOKENS  116
812e64d31b9Smaya/* YYNNTS -- Number of nonterminals.  */
81396c5ddc4Srjs#define YYNNTS  137
814e64d31b9Smaya/* YYNRULES -- Number of rules.  */
81596c5ddc4Srjs#define YYNRULES  270
816e64d31b9Smaya/* YYNSTATES -- Number of states.  */
81796c5ddc4Srjs#define YYNSTATES  453
818e64d31b9Smaya
81996c5ddc4Srjs/* YYMAXUTOK -- Last valid token kind.  */
820e64d31b9Smaya#define YYMAXUTOK   361
821e64d31b9Smaya
82296c5ddc4Srjs
82396c5ddc4Srjs/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
82496c5ddc4Srjs   as returned by yylex, with out-of-bounds checking.  */
82596c5ddc4Srjs#define YYTRANSLATE(YYX)                                \
82696c5ddc4Srjs  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
82796c5ddc4Srjs   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
82896c5ddc4Srjs   : YYSYMBOL_YYUNDEF)
829e64d31b9Smaya
830e64d31b9Smaya/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
83196c5ddc4Srjs   as returned by yylex.  */
83296c5ddc4Srjsstatic const yytype_int8 yytranslate[] =
833e64d31b9Smaya{
834e64d31b9Smaya       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
835e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
836e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
837e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
838e64d31b9Smaya       2,     2,     2,   111,   108,   112,     2,     2,     2,     2,
839e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,   107,
840e64d31b9Smaya       2,   113,     2,     2,     2,     2,     2,     2,     2,     2,
841e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
842e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
843e64d31b9Smaya       2,   109,     2,   110,     2,     2,     2,     2,     2,     2,
844e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
845e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
846e64d31b9Smaya       2,     2,     2,   114,     2,   115,     2,     2,     2,     2,
847e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
848e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
849e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
850e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
851e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
852e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
853e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
854e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
855e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
856e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
857e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
858e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
859e64d31b9Smaya       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
860e64d31b9Smaya       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
861e64d31b9Smaya      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
862e64d31b9Smaya      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
863e64d31b9Smaya      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
864e64d31b9Smaya      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
865e64d31b9Smaya      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
866e64d31b9Smaya      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
867e64d31b9Smaya      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
868e64d31b9Smaya      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
869e64d31b9Smaya      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
870e64d31b9Smaya     105,   106
871e64d31b9Smaya};
872e64d31b9Smaya
873e64d31b9Smaya#if YYDEBUG
874e64d31b9Smaya  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
87596c5ddc4Srjsstatic const yytype_int16 yyrline[] =
876e64d31b9Smaya{
87796c5ddc4Srjs       0,   295,   295,   298,   306,   318,   319,   322,   346,   347,
87896c5ddc4Srjs     350,   365,   368,   373,   380,   381,   382,   383,   384,   385,
87996c5ddc4Srjs     386,   389,   390,   391,   394,   400,   406,   412,   419,   425,
88096c5ddc4Srjs     432,   476,   483,   527,   533,   534,   535,   536,   537,   538,
88196c5ddc4Srjs     539,   540,   541,   542,   543,   544,   547,   559,   569,   578,
88296c5ddc4Srjs     591,   613,   620,   653,   660,   676,   735,   778,   787,   809,
88396c5ddc4Srjs     819,   823,   852,   871,   871,   873,   880,   892,   893,   894,
88496c5ddc4Srjs     897,   911,   925,   945,   956,   968,   970,   971,   972,   973,
88596c5ddc4Srjs     976,   976,   976,   976,   977,   980,   981,   982,   983,   984,
88696c5ddc4Srjs     985,   988,  1007,  1011,  1017,  1021,  1025,  1029,  1033,  1037,
88796c5ddc4Srjs    1042,  1048,  1059,  1061,  1065,  1069,  1073,  1079,  1079,  1081,
88896c5ddc4Srjs    1099,  1125,  1128,  1143,  1149,  1155,  1156,  1163,  1169,  1175,
88996c5ddc4Srjs    1183,  1189,  1195,  1203,  1209,  1215,  1223,  1224,  1227,  1228,
89096c5ddc4Srjs    1229,  1230,  1231,  1232,  1233,  1234,  1235,  1236,  1237,  1240,
89196c5ddc4Srjs    1249,  1253,  1257,  1263,  1272,  1276,  1280,  1289,  1293,  1299,
89296c5ddc4Srjs    1305,  1312,  1317,  1325,  1335,  1337,  1345,  1351,  1355,  1359,
89396c5ddc4Srjs    1365,  1369,  1373,  1379,  1390,  1399,  1403,  1408,  1412,  1416,
89496c5ddc4Srjs    1420,  1426,  1433,  1437,  1443,  1451,  1462,  1469,  1473,  1479,
89596c5ddc4Srjs    1488,  1498,  1502,  1520,  1529,  1532,  1538,  1542,  1546,  1552,
89696c5ddc4Srjs    1563,  1568,  1573,  1578,  1583,  1588,  1596,  1599,  1604,  1617,
89796c5ddc4Srjs    1625,  1636,  1644,  1644,  1646,  1646,  1648,  1658,  1663,  1670,
89896c5ddc4Srjs    1680,  1689,  1694,  1701,  1711,  1721,  1733,  1733,  1734,  1734,
89996c5ddc4Srjs    1736,  1746,  1754,  1764,  1772,  1780,  1789,  1800,  1804,  1810,
90096c5ddc4Srjs    1811,  1812,  1815,  1815,  1818,  1818,  1821,  1828,  1837,  1851,
90196c5ddc4Srjs    1860,  1869,  1873,  1882,  1891,  1902,  1909,  1919,  1947,  1956,
90296c5ddc4Srjs    1968,  1971,  1980,  1991,  1992,  1993,  1996,  1997,  1998,  2001,
90396c5ddc4Srjs    2002,  2005,  2006,  2009,  2010,  2013,  2024,  2035,  2046,  2072,
90496c5ddc4Srjs    2073
905e64d31b9Smaya};
906e64d31b9Smaya#endif
907e64d31b9Smaya
90896c5ddc4Srjs/** Accessing symbol of state STATE.  */
90996c5ddc4Srjs#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
91096c5ddc4Srjs
91196c5ddc4Srjs#if 1
91296c5ddc4Srjs/* The user-facing name of the symbol whose (internal) number is
91396c5ddc4Srjs   YYSYMBOL.  No bounds checking.  */
91496c5ddc4Srjsstatic const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
91596c5ddc4Srjs
916e64d31b9Smaya/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
917e64d31b9Smaya   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
918e64d31b9Smayastatic const char *const yytname[] =
919e64d31b9Smaya{
92096c5ddc4Srjs  "\"end of file\"", "error", "\"invalid token\"", "ARBvp_10", "ARBfp_10",
92196c5ddc4Srjs  "ADDRESS", "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END",
92296c5ddc4Srjs  "BIN_OP", "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP",
92396c5ddc4Srjs  "ARL", "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT",
92496c5ddc4Srjs  "ATTENUATION", "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION",
92596c5ddc4Srjs  "EMISSION", "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF",
92696c5ddc4Srjs  "INVERSE", "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL",
92796c5ddc4Srjs  "MATERIAL", "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP",
92896c5ddc4Srjs  "NORMAL", "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK",
92996c5ddc4Srjs  "POINTSIZE", "POSITION", "PRIMARY", "PROGRAM", "PROJECTION", "RANGE",
93096c5ddc4Srjs  "RESULT", "ROW", "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE_TOK",
93196c5ddc4Srjs  "SPECULAR", "SPOT", "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q",
93296c5ddc4Srjs  "TEXGEN_R", "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE",
93396c5ddc4Srjs  "TEXTURE_UNIT", "TEX_1D", "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT",
93496c5ddc4Srjs  "TEX_SHADOW1D", "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D",
93596c5ddc4Srjs  "TEX_ARRAY2D", "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX",
93696c5ddc4Srjs  "VTXATTRIB", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2",
93796c5ddc4Srjs  "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'",
93896c5ddc4Srjs  "'-'", "'='", "'{'", "'}'", "$accept", "program", "language",
93996c5ddc4Srjs  "optionSequence", "option", "statementSequence", "statement",
94096c5ddc4Srjs  "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction",
941e64d31b9Smaya  "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction",
942e64d31b9Smaya  "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction",
943e64d31b9Smaya  "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget",
944e64d31b9Smaya  "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg",
945e64d31b9Smaya  "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp",
946e64d31b9Smaya  "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem",
947e64d31b9Smaya  "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset",
948e64d31b9Smaya  "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent",
949e64d31b9Smaya  "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask",
950e64d31b9Smaya  "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem",
951e64d31b9Smaya  "vtxAttribNum", "vtxWeightNum", "fragAttribItem", "PARAM_statement",
952e64d31b9Smaya  "PARAM_singleStmt", "PARAM_multipleStmt", "optArraySize",
953e64d31b9Smaya  "paramSingleInit", "paramMultipleInit", "paramMultInitList",
954e64d31b9Smaya  "paramSingleItemDecl", "paramSingleItemUse", "paramMultipleItem",
955e64d31b9Smaya  "stateMultipleItem", "stateSingleItem", "stateMaterialItem",
956e64d31b9Smaya  "stateMatProperty", "stateLightItem", "stateLightProperty",
957e64d31b9Smaya  "stateSpotProperty", "stateLightModelItem", "stateLModProperty",
958e64d31b9Smaya  "stateLightProdItem", "stateLProdProperty", "stateTexEnvItem",
95996c5ddc4Srjs  "stateTexEnvProperty", "ambDiffSpecPropertyMaterial",
96096c5ddc4Srjs  "ambDiffSpecPropertyLight", "stateLightNumber", "stateTexGenItem",
96196c5ddc4Srjs  "stateTexGenType", "stateTexGenCoord", "stateFogItem",
962e64d31b9Smaya  "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum",
963e64d31b9Smaya  "statePointItem", "statePointProperty", "stateMatrixRow",
964e64d31b9Smaya  "stateMatrixRows", "optMatrixRows", "stateMatrixItem",
965e64d31b9Smaya  "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum",
966e64d31b9Smaya  "stateMatrixName", "stateOptModMatNum", "stateModMatNum",
967e64d31b9Smaya  "statePaletteMatNum", "stateProgramMatNum", "stateDepthItem",
968e64d31b9Smaya  "programSingleItem", "programMultipleItem", "progEnvParams",
969e64d31b9Smaya  "progEnvParamNums", "progEnvParam", "progLocalParams",
970e64d31b9Smaya  "progLocalParamNums", "progLocalParam", "progEnvParamNum",
971e64d31b9Smaya  "progLocalParamNum", "paramConstDecl", "paramConstUse",
972e64d31b9Smaya  "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector",
973e64d31b9Smaya  "signedFloatConstant", "optionalSign", "TEMP_statement", "@1",
974e64d31b9Smaya  "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement",
975e64d31b9Smaya  "resultBinding", "resultColBinding", "optResultFaceType",
976e64d31b9Smaya  "optResultColorType", "optFaceType", "optColorType",
977e64d31b9Smaya  "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum",
978e64d31b9Smaya  "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum",
979e64d31b9Smaya  "ALIAS_statement", "string", YY_NULLPTR
980e64d31b9Smaya};
98196c5ddc4Srjs
98296c5ddc4Srjsstatic const char *
98396c5ddc4Srjsyysymbol_name (yysymbol_kind_t yysymbol)
98496c5ddc4Srjs{
98596c5ddc4Srjs  return yytname[yysymbol];
98696c5ddc4Srjs}
987e64d31b9Smaya#endif
988e64d31b9Smaya
98996c5ddc4Srjs#ifdef YYPRINT
990e64d31b9Smaya/* YYTOKNUM[NUM] -- (External) token number corresponding to the
991e64d31b9Smaya   (internal) symbol number NUM (which must be that of a token).  */
99296c5ddc4Srjsstatic const yytype_int16 yytoknum[] =
993e64d31b9Smaya{
994e64d31b9Smaya       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
995e64d31b9Smaya     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
996e64d31b9Smaya     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
997e64d31b9Smaya     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
998e64d31b9Smaya     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
999e64d31b9Smaya     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
1000e64d31b9Smaya     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
1001e64d31b9Smaya     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
1002e64d31b9Smaya     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
1003e64d31b9Smaya     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
1004e64d31b9Smaya     355,   356,   357,   358,   359,   360,   361,    59,    44,    91,
1005e64d31b9Smaya      93,    43,    45,    61,   123,   125
1006e64d31b9Smaya};
100796c5ddc4Srjs#endif
1008e64d31b9Smaya
100996c5ddc4Srjs#define YYPACT_NINF (-403)
1010e64d31b9Smaya
101196c5ddc4Srjs#define yypact_value_is_default(Yyn) \
101296c5ddc4Srjs  ((Yyn) == YYPACT_NINF)
1013e64d31b9Smaya
101496c5ddc4Srjs#define YYTABLE_NINF (-63)
1015e64d31b9Smaya
101696c5ddc4Srjs#define yytable_value_is_error(Yyn) \
1017e64d31b9Smaya  0
1018e64d31b9Smaya
1019e64d31b9Smaya  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1020e64d31b9Smaya     STATE-NUM.  */
1021e64d31b9Smayastatic const yytype_int16 yypact[] =
1022e64d31b9Smaya{
102396c5ddc4Srjs     117,  -403,  -403,    35,  -403,  -403,    18,    -9,  -403,   177,
102496c5ddc4Srjs    -403,  -403,   -52,  -403,   -29,   -27,    14,    34,  -403,  -403,
102596c5ddc4Srjs     -32,   -32,   -32,   -32,   -32,   -32,    11,    47,   -32,   -32,
102696c5ddc4Srjs    -403,    31,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,
102796c5ddc4Srjs    -403,  -403,  -403,  -403,    43,  -403,  -403,  -403,  -403,  -403,
102896c5ddc4Srjs    -403,  -403,  -403,  -403,    37,    58,    65,    72,    44,    37,
102996c5ddc4Srjs      86,  -403,   118,    67,  -403,   119,   120,   121,   122,   123,
103096c5ddc4Srjs    -403,   124,    77,  -403,  -403,  -403,   -16,   125,   126,  -403,
103196c5ddc4Srjs    -403,  -403,   127,   137,   -21,   160,   219,   -35,  -403,   127,
103296c5ddc4Srjs     -14,  -403,  -403,  -403,  -403,   134,  -403,    47,  -403,  -403,
103396c5ddc4Srjs    -403,  -403,  -403,    47,    47,    47,    47,    47,    47,  -403,
103496c5ddc4Srjs    -403,  -403,  -403,    -1,    80,    64,     0,   135,    47,    61,
103596c5ddc4Srjs     136,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,
103696c5ddc4Srjs     -16,    47,   148,  -403,  -403,  -403,  -403,   138,  -403,  -403,
103796c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,   153,  -403,  -403,   224,     4,
103896c5ddc4Srjs     226,  -403,   142,   143,   -16,   145,  -403,   146,  -403,  -403,
103996c5ddc4Srjs      38,  -403,  -403,   134,  -403,   147,   149,   150,   188,    12,
104096c5ddc4Srjs     151,    78,   152,    92,   100,     8,   154,   134,  -403,  -403,
104196c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,   189,  -403,
104296c5ddc4Srjs      38,  -403,   155,  -403,  -403,   134,   157,  -403,    26,  -403,
104396c5ddc4Srjs    -403,  -403,  -403,    -3,   159,   163,  -403,   161,  -403,  -403,
104496c5ddc4Srjs     158,  -403,  -403,  -403,  -403,   162,    47,    47,  -403,   170,
104596c5ddc4Srjs     174,    47,  -403,  -403,  -403,  -403,   239,   252,   253,  -403,
104696c5ddc4Srjs    -403,  -403,  -403,   254,  -403,  -403,  -403,  -403,   211,   254,
104796c5ddc4Srjs      33,   171,   172,  -403,   173,  -403,   134,     6,  -403,  -403,
104896c5ddc4Srjs    -403,   256,   255,     9,   176,  -403,   260,  -403,   263,    47,
104996c5ddc4Srjs    -403,  -403,   178,  -403,  -403,   184,    47,    47,   175,  -403,
105096c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,   181,   183,   185,  -403,
105196c5ddc4Srjs     182,  -403,   186,  -403,   187,  -403,   190,  -403,   192,  -403,
105296c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,   271,   272,  -403,   275,
105396c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,  -403,   193,  -403,  -403,
105496c5ddc4Srjs    -403,  -403,   144,   276,  -403,   194,  -403,   195,    28,  -403,
105596c5ddc4Srjs    -403,   106,  -403,   199,   -12,   200,   -30,   278,  -403,   116,
105696c5ddc4Srjs      47,  -403,  -403,   257,   102,    92,  -403,   201,  -403,   202,
105796c5ddc4Srjs    -403,   203,  -403,  -403,  -403,  -403,  -403,  -403,  -403,   205,
105896c5ddc4Srjs    -403,  -403,    47,  -403,   286,   287,  -403,    47,  -403,  -403,
105996c5ddc4Srjs    -403,    47,    91,    64,    39,  -403,  -403,  -403,  -403,  -403,
106096c5ddc4Srjs    -403,  -403,  -403,   206,  -403,  -403,  -403,  -403,  -403,  -403,
106196c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,
106296c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,   285,  -403,  -403,    20,  -403,
106396c5ddc4Srjs    -403,  -403,  -403,    41,  -403,  -403,  -403,  -403,   210,   212,
106496c5ddc4Srjs     213,   214,  -403,   258,   -30,  -403,  -403,  -403,  -403,  -403,
106596c5ddc4Srjs    -403,    47,  -403,    47,   174,   239,   252,   216,  -403,  -403,
106696c5ddc4Srjs     204,   218,   222,   221,   227,   223,   230,   276,  -403,    47,
106796c5ddc4Srjs     116,  -403,   239,  -403,   252,   -49,  -403,  -403,  -403,  -403,
106896c5ddc4Srjs     276,   228,  -403
1069e64d31b9Smaya};
1070e64d31b9Smaya
1071e64d31b9Smaya  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1072e64d31b9Smaya     Performed when YYTABLE does not specify something else to do.  Zero
1073e64d31b9Smaya     means the default is an error.  */
107496c5ddc4Srjsstatic const yytype_int16 yydefact[] =
1075e64d31b9Smaya{
1076e64d31b9Smaya       0,     3,     4,     0,     6,     1,     9,     0,     5,     0,
107796c5ddc4Srjs     269,   270,     0,   234,     0,     0,     0,     0,   232,     2,
107896c5ddc4Srjs       0,     0,     0,     0,     0,     0,     0,   231,     0,     0,
1079e64d31b9Smaya       8,     0,    12,    13,    14,    15,    16,    17,    18,    19,
1080e64d31b9Smaya      21,    22,    23,    20,     0,    85,    86,   107,   108,    87,
1081e64d31b9Smaya      88,    89,    90,     7,     0,     0,     0,     0,     0,     0,
1082e64d31b9Smaya       0,    61,     0,    84,    60,     0,     0,     0,     0,     0,
108396c5ddc4Srjs      72,     0,     0,   229,   230,    31,     0,     0,     0,    10,
108496c5ddc4Srjs      11,   237,   235,     0,     0,     0,   111,   231,   109,   233,
108596c5ddc4Srjs     246,   244,   240,   242,   239,   259,   241,   231,    80,    81,
108696c5ddc4Srjs      82,    83,    50,   231,   231,   231,   231,   231,   231,    74,
108796c5ddc4Srjs      51,   222,   221,     0,     0,     0,     0,    56,   231,    79,
108896c5ddc4Srjs       0,    57,    59,   120,   121,   202,   203,   122,   218,   219,
108996c5ddc4Srjs       0,   231,     0,   268,    91,   238,   112,     0,   113,   117,
109096c5ddc4Srjs     118,   119,   216,   217,   220,     0,   249,   248,     0,   250,
109196c5ddc4Srjs       0,   243,     0,     0,     0,     0,    26,     0,    25,    24,
109296c5ddc4Srjs     256,   105,   103,   259,    93,     0,     0,     0,     0,     0,
109396c5ddc4Srjs       0,   253,     0,   253,     0,     0,   263,   259,   128,   129,
1094e64d31b9Smaya     130,   131,   133,   132,   134,   135,   136,   137,     0,   138,
109596c5ddc4Srjs     256,    97,     0,    95,    94,   259,     0,    92,     0,    77,
109696c5ddc4Srjs      76,    78,    49,     0,     0,     0,   236,     0,   228,   227,
109796c5ddc4Srjs       0,   251,   252,   245,   265,     0,   231,   231,    47,     0,
109896c5ddc4Srjs       0,   231,   257,   258,   104,   106,     0,     0,     0,   201,
109996c5ddc4Srjs     172,   173,   171,     0,   151,   255,   254,   150,     0,     0,
110096c5ddc4Srjs       0,     0,   196,   192,     0,   191,   259,   184,   178,   177,
110196c5ddc4Srjs     176,     0,     0,     0,     0,    96,     0,    98,     0,   231,
110296c5ddc4Srjs     223,    65,     0,    63,    64,     0,   231,   231,     0,   110,
110396c5ddc4Srjs     247,   260,    28,    27,    75,    48,   261,     0,     0,   214,
110496c5ddc4Srjs       0,   215,     0,   175,     0,   163,     0,   152,     0,   157,
110596c5ddc4Srjs     158,   141,   142,   159,   139,   140,     0,     0,   190,     0,
110696c5ddc4Srjs     193,   186,   188,   187,   183,   185,   267,     0,   156,   155,
110796c5ddc4Srjs     165,   166,     0,     0,   102,     0,   101,     0,     0,    58,
110896c5ddc4Srjs      73,    67,    46,     0,     0,     0,   231,     0,    33,     0,
110996c5ddc4Srjs     231,   209,   213,     0,     0,   253,   200,     0,   198,     0,
111096c5ddc4Srjs     199,     0,   264,   170,   169,   167,   168,   164,   189,     0,
111196c5ddc4Srjs      99,   100,   231,   224,     0,     0,    66,   231,    54,    53,
111296c5ddc4Srjs      55,   231,     0,     0,     0,   115,   123,   126,   124,   204,
111396c5ddc4Srjs     205,   125,   266,     0,    34,    35,    36,    37,    38,    39,
111496c5ddc4Srjs      40,    41,    42,    43,    44,    45,    30,    29,   174,   160,
111596c5ddc4Srjs     146,   161,   148,   145,   162,     0,   143,   144,     0,   195,
111696c5ddc4Srjs     197,   194,   179,     0,    70,    68,    71,    69,     0,     0,
111796c5ddc4Srjs       0,     0,   127,   181,   231,   114,   262,   149,   147,   153,
111896c5ddc4Srjs     154,   231,   225,   231,     0,     0,     0,     0,   180,   116,
111996c5ddc4Srjs       0,     0,     0,     0,   207,     0,   211,     0,   226,   231,
112096c5ddc4Srjs       0,   206,     0,   210,     0,     0,    52,    32,   208,   212,
112196c5ddc4Srjs       0,     0,   182
1122e64d31b9Smaya};
1123e64d31b9Smaya
1124e64d31b9Smaya  /* YYPGOTO[NTERM-NUM].  */
1125e64d31b9Smayastatic const yytype_int16 yypgoto[] =
1126e64d31b9Smaya{
112796c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,
112896c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -103,
112996c5ddc4Srjs    -101,  -403,   -99,  -403,   -92,   191,  -403,  -403,  -338,  -403,
113096c5ddc4Srjs    -100,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,   139,
113196c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,  -403,   259,  -403,  -403,
113296c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,
113396c5ddc4Srjs    -403,   -77,  -403,   -86,  -403,  -403,  -403,  -403,  -403,  -403,
113496c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,   -58,  -403,   105,  -403,  -403,
113596c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -403,
113696c5ddc4Srjs     -22,  -403,  -403,  -388,  -403,  -403,  -403,  -403,  -403,  -403,
113796c5ddc4Srjs     261,  -403,  -403,  -403,  -403,  -403,  -403,  -403,  -402,  -374,
113896c5ddc4Srjs     262,  -403,  -403,  -403,   -85,  -115,   -87,  -403,  -403,  -403,
113996c5ddc4Srjs    -403,   288,  -403,   265,  -403,  -403,  -403,  -169,   156,  -153,
114096c5ddc4Srjs    -403,  -403,  -403,  -403,  -403,  -403,    21
1141e64d31b9Smaya};
1142e64d31b9Smaya
1143e64d31b9Smaya  /* YYDEFGOTO[NTERM-NUM].  */
1144e64d31b9Smayastatic const yytype_int16 yydefgoto[] =
1145e64d31b9Smaya{
1146e64d31b9Smaya      -1,     3,     4,     6,     8,     9,    30,    31,    32,    33,
1147e64d31b9Smaya      34,    35,    36,    37,    38,    39,    40,    41,    42,   277,
1148e64d31b9Smaya     386,    43,   153,   218,    75,    62,    71,   322,   323,   359,
114996c5ddc4Srjs     119,    63,   120,   262,   263,   264,   356,   405,   407,    72,
1150e64d31b9Smaya     321,   110,   275,   202,   102,    44,    45,   121,   197,   317,
1151e64d31b9Smaya     315,   164,    46,    47,    48,   137,    88,   269,   364,   138,
115296c5ddc4Srjs     122,   365,   366,   123,   178,   294,   179,   396,   418,   180,
115396c5ddc4Srjs     237,   181,   419,   182,   309,   295,   397,   286,   183,   312,
115496c5ddc4Srjs     347,   184,   232,   185,   284,   186,   250,   187,   412,   428,
115596c5ddc4Srjs     188,   304,   305,   349,   247,   298,   339,   341,   337,   189,
115696c5ddc4Srjs     124,   368,   369,   433,   125,   370,   435,   126,   280,   282,
115796c5ddc4Srjs     371,   127,   142,   128,   129,   144,    76,    49,    59,    50,
115896c5ddc4Srjs      54,    82,    51,    64,    96,   149,   213,   238,   224,   151,
115996c5ddc4Srjs     328,   252,   215,   373,   307,    52,    12
1160e64d31b9Smaya};
1161e64d31b9Smaya
1162e64d31b9Smaya  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
1163e64d31b9Smaya     positive, shift that token.  If negative, reduce the rule whose
1164e64d31b9Smaya     number is the opposite.  If YYTABLE_NINF, syntax error.  */
1165e64d31b9Smayastatic const yytype_int16 yytable[] =
1166e64d31b9Smaya{
1167e64d31b9Smaya     145,   139,   143,   198,   240,   152,   156,   111,   112,   159,
116896c5ddc4Srjs     225,   358,   155,   146,   157,   158,   154,   113,   154,   408,
116996c5ddc4Srjs     261,   154,   113,   434,   253,   147,     7,   114,   160,   190,
117096c5ddc4Srjs     204,   145,   362,    60,   248,     5,   161,   191,   115,   205,
117196c5ddc4Srjs     448,   230,   257,   363,   310,   289,   114,   301,   302,   445,
117296c5ddc4Srjs     192,   290,   436,   193,   219,    53,   450,   115,   289,   162,
117396c5ddc4Srjs     194,   402,   451,   311,   290,   211,   291,    61,   231,    55,
117496c5ddc4Srjs     449,    56,   212,   163,   195,   116,    73,    74,   249,   118,
117596c5ddc4Srjs     116,    73,    74,   117,   118,   431,    10,    11,   303,    10,
117696c5ddc4Srjs      11,   293,   167,   300,   168,   148,    70,   196,   118,   222,
117796c5ddc4Srjs     169,   446,   292,   234,   293,   235,   223,   170,   171,   172,
117896c5ddc4Srjs      70,   173,    57,   174,   165,    90,    91,   236,   273,   235,
117996c5ddc4Srjs       1,     2,   175,    92,   272,   410,   166,   389,   390,   278,
118096c5ddc4Srjs     154,   236,    58,   391,   259,    81,   352,   411,    79,   176,
118196c5ddc4Srjs     177,   260,   392,   353,   318,    93,    94,   414,   241,   421,
118296c5ddc4Srjs      80,   242,   243,    86,   415,   244,   422,    87,    73,    74,
118396c5ddc4Srjs      95,   199,   393,   245,   200,   201,   398,    98,    99,   100,
118496c5ddc4Srjs     101,    83,   145,   394,   395,   325,   208,   209,    84,   324,
118596c5ddc4Srjs     109,   246,    13,    14,    15,    85,    16,    17,    18,    19,
1186e64d31b9Smaya      20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
1187e64d31b9Smaya     374,   375,   376,   377,   378,   379,   380,   381,   382,   383,
118896c5ddc4Srjs     384,   385,    65,    66,    67,    68,    69,   354,   355,    77,
118996c5ddc4Srjs      78,   343,   344,   345,   346,    60,    97,   103,   104,   105,
119096c5ddc4Srjs     106,   107,   108,   130,   131,   132,   133,   403,   387,   145,
119196c5ddc4Srjs     367,   143,   136,   150,   -62,   203,   206,   210,   207,   214,
119296c5ddc4Srjs     216,   217,   229,   220,   221,   254,   226,   276,   227,   228,
119396c5ddc4Srjs     233,   239,   279,   251,   256,   145,   258,   266,   270,   409,
119496c5ddc4Srjs     324,   267,   271,   274,   268,   281,   283,   285,   287,   306,
119596c5ddc4Srjs     296,   297,   299,   314,   308,   313,   316,   320,   319,   326,
119696c5ddc4Srjs     327,   329,   331,   330,   336,   338,   332,   333,   340,   348,
119796c5ddc4Srjs     334,   372,   335,   342,   350,   351,   430,   357,   361,   404,
119896c5ddc4Srjs     406,   399,   400,   401,   388,   402,   416,   417,   423,   438,
119996c5ddc4Srjs     424,   432,   425,   426,   427,   437,   439,   145,   367,   143,
120096c5ddc4Srjs     440,   441,   442,   443,   145,   444,   324,   429,   452,   447,
120196c5ddc4Srjs     420,   413,   265,   134,   288,   360,   255,    89,   140,   141,
120296c5ddc4Srjs     135,     0,   324
1203e64d31b9Smaya};
1204e64d31b9Smaya
1205e64d31b9Smayastatic const yytype_int16 yycheck[] =
1206e64d31b9Smaya{
1207e64d31b9Smaya      87,    87,    87,   118,   173,    97,   105,    23,    24,   108,
120896c5ddc4Srjs     163,    23,   104,    27,   106,   107,   103,    38,   105,   357,
120996c5ddc4Srjs      23,   108,    38,   425,   177,    39,     8,    62,    29,    29,
121096c5ddc4Srjs     130,   118,    62,    65,    26,     0,    37,    37,    73,   131,
121196c5ddc4Srjs     442,    29,   195,    73,    35,    25,    62,    41,    42,   437,
121296c5ddc4Srjs      50,    31,   426,    53,   154,   107,   105,    73,    25,    60,
121396c5ddc4Srjs      60,   110,   450,    54,    31,    61,    33,    99,    56,    98,
121496c5ddc4Srjs     444,    98,    68,    74,    74,    96,   111,   112,    70,   114,
121596c5ddc4Srjs      96,   111,   112,    99,   114,   423,    98,    99,    82,    98,
121696c5ddc4Srjs      99,    71,    28,   246,    30,   109,    99,    97,   114,    61,
121796c5ddc4Srjs      36,   439,    69,    25,    71,    27,    68,    43,    44,    45,
121896c5ddc4Srjs      99,    47,    98,    49,    34,    29,    30,    39,   217,    27,
1219e64d31b9Smaya       3,     4,    58,    37,   216,    34,    46,    25,    26,   221,
122096c5ddc4Srjs     217,    39,    98,    31,   108,    98,   108,    46,   107,    75,
122196c5ddc4Srjs      76,   115,    40,   115,   259,    59,    60,   108,    48,   108,
122296c5ddc4Srjs     107,    51,    52,   109,   115,    55,   115,   113,   111,   112,
122396c5ddc4Srjs      74,   100,    60,    63,   103,   104,   335,   100,   101,   102,
122496c5ddc4Srjs     103,   113,   259,    71,    72,   267,    23,    24,   113,   266,
122596c5ddc4Srjs     103,    81,     5,     6,     7,   113,     9,    10,    11,    12,
1226e64d31b9Smaya      13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
1227e64d31b9Smaya      84,    85,    86,    87,    88,    89,    90,    91,    92,    93,
1228e64d31b9Smaya      94,    95,    21,    22,    23,    24,    25,   111,   112,    28,
122996c5ddc4Srjs      29,    77,    78,    79,    80,    65,   108,   108,   108,   108,
123096c5ddc4Srjs     108,   108,   108,   108,   108,   108,    99,   352,   330,   326,
123196c5ddc4Srjs     326,   326,    23,   109,   109,   109,    98,    23,   110,    23,
123296c5ddc4Srjs     108,   108,    64,   108,   108,    66,   109,    83,   109,   109,
123396c5ddc4Srjs     109,   109,    23,   109,   109,   352,   109,   108,   110,   361,
123496c5ddc4Srjs     357,   108,   110,   103,   113,    23,    23,    23,    67,    23,
123596c5ddc4Srjs     109,   109,   109,    23,    29,   109,    23,   103,   110,   114,
123696c5ddc4Srjs     109,   108,   110,   108,    23,    23,   110,   110,    23,    23,
123796c5ddc4Srjs     110,    23,   110,   110,   110,   110,   421,   108,   108,    23,
123896c5ddc4Srjs      23,   110,   110,   110,    57,   110,   110,    32,   108,   115,
123996c5ddc4Srjs     108,   424,   109,   109,    66,   109,   108,   414,   414,   414,
124096c5ddc4Srjs     108,   110,   105,   110,   421,   105,   423,   414,   110,   440,
124196c5ddc4Srjs     398,   363,   203,    84,   239,   324,   190,    59,    87,    87,
124296c5ddc4Srjs      85,    -1,   439
1243e64d31b9Smaya};
1244e64d31b9Smaya
1245e64d31b9Smaya  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1246e64d31b9Smaya     symbol of state STATE-NUM.  */
1247e64d31b9Smayastatic const yytype_uint8 yystos[] =
1248e64d31b9Smaya{
1249e64d31b9Smaya       0,     3,     4,   117,   118,     0,   119,     8,   120,   121,
125096c5ddc4Srjs      98,    99,   252,     5,     6,     7,     9,    10,    11,    12,
1251e64d31b9Smaya      13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
1252e64d31b9Smaya     122,   123,   124,   125,   126,   127,   128,   129,   130,   131,
125396c5ddc4Srjs     132,   133,   134,   137,   161,   162,   168,   169,   170,   233,
125496c5ddc4Srjs     235,   238,   251,   107,   236,    98,    98,    98,    98,   234,
125596c5ddc4Srjs      65,    99,   141,   147,   239,   141,   141,   141,   141,   141,
125696c5ddc4Srjs      99,   142,   155,   111,   112,   140,   232,   141,   141,   107,
125796c5ddc4Srjs     107,    98,   237,   113,   113,   113,   109,   113,   172,   237,
125896c5ddc4Srjs      29,    30,    37,    59,    60,    74,   240,   108,   100,   101,
1259e64d31b9Smaya     102,   103,   160,   108,   108,   108,   108,   108,   108,   103,
1260e64d31b9Smaya     157,    23,    24,    38,    62,    73,    96,    99,   114,   146,
126196c5ddc4Srjs     148,   163,   176,   179,   216,   220,   223,   227,   229,   230,
126296c5ddc4Srjs     108,   108,   108,    99,   163,   239,    23,   171,   175,   179,
126396c5ddc4Srjs     216,   226,   228,   230,   231,   232,    27,    39,   109,   241,
126496c5ddc4Srjs     109,   245,   140,   138,   232,   140,   138,   140,   140,   138,
1265e64d31b9Smaya      29,    37,    60,    74,   167,    34,    46,    28,    30,    36,
1266e64d31b9Smaya      43,    44,    45,    47,    49,    58,    75,    76,   180,   182,
126796c5ddc4Srjs     185,   187,   189,   194,   197,   199,   201,   203,   206,   215,
126896c5ddc4Srjs      29,    37,    50,    53,    60,    74,    97,   164,   231,   100,
1269e64d31b9Smaya     103,   104,   159,   109,   146,   140,    98,   110,    23,    24,
127096c5ddc4Srjs      23,    61,    68,   242,    23,   248,   108,   108,   139,   146,
127196c5ddc4Srjs     108,   108,    61,    68,   244,   245,   109,   109,   109,    64,
127296c5ddc4Srjs      29,    56,   198,   109,    25,    27,    39,   186,   243,   109,
127396c5ddc4Srjs     243,    48,    51,    52,    55,    63,    81,   210,    26,    70,
127496c5ddc4Srjs     202,   109,   247,   245,    66,   244,   109,   245,   109,   108,
1275e64d31b9Smaya     115,    23,   149,   150,   151,   155,   108,   108,   113,   173,
1276e64d31b9Smaya     110,   110,   140,   138,   103,   158,    83,   135,   140,    23,
127796c5ddc4Srjs     224,    23,   225,    23,   200,    23,   193,    67,   193,    25,
127896c5ddc4Srjs      31,    33,    69,    71,   181,   191,   109,   109,   211,   109,
127996c5ddc4Srjs     245,    41,    42,    82,   207,   208,    23,   250,    29,   190,
128096c5ddc4Srjs      35,    54,   195,   109,    23,   166,    23,   165,   231,   110,
128196c5ddc4Srjs     103,   156,   143,   144,   232,   140,   114,   109,   246,   108,
128296c5ddc4Srjs     108,   110,   110,   110,   110,   110,    23,   214,    23,   212,
128396c5ddc4Srjs      23,   213,   110,    77,    78,    79,    80,   196,    23,   209,
1284e64d31b9Smaya     110,   110,   108,   115,   111,   112,   152,   108,    23,   145,
128596c5ddc4Srjs     252,   108,    62,    73,   174,   177,   178,   179,   217,   218,
128696c5ddc4Srjs     221,   226,    23,   249,    84,    85,    86,    87,    88,    89,
128796c5ddc4Srjs      90,    91,    92,    93,    94,    95,   136,   140,    57,    25,
128896c5ddc4Srjs      26,    31,    40,    60,    71,    72,   183,   192,   243,   110,
128996c5ddc4Srjs     110,   110,   110,   231,    23,   153,    23,   154,   144,   140,
129096c5ddc4Srjs      34,    46,   204,   206,   108,   115,   110,    32,   184,   188,
129196c5ddc4Srjs     191,   108,   115,   108,   108,   109,   109,    66,   205,   177,
129296c5ddc4Srjs     231,   144,   135,   219,   224,   222,   225,   109,   115,   108,
129396c5ddc4Srjs     108,   110,   105,   110,   105,   209,   144,   136,   224,   225,
129496c5ddc4Srjs     105,   209,   110
1295e64d31b9Smaya};
1296e64d31b9Smaya
1297e64d31b9Smaya  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1298e64d31b9Smayastatic const yytype_uint8 yyr1[] =
1299e64d31b9Smaya{
1300e64d31b9Smaya       0,   116,   117,   118,   118,   119,   119,   120,   121,   121,
1301e64d31b9Smaya     122,   122,   123,   123,   124,   124,   124,   124,   124,   124,
1302e64d31b9Smaya     124,   125,   125,   125,   126,   127,   128,   129,   130,   131,
1303e64d31b9Smaya     132,   133,   134,   135,   136,   136,   136,   136,   136,   136,
1304e64d31b9Smaya     136,   136,   136,   136,   136,   136,   137,   138,   139,   140,
1305e64d31b9Smaya     141,   142,   143,   144,   145,   145,   146,   146,   146,   146,
1306e64d31b9Smaya     147,   147,   148,   149,   149,   150,   151,   152,   152,   152,
1307e64d31b9Smaya     153,   154,   155,   156,   157,   158,   159,   159,   159,   159,
1308e64d31b9Smaya     160,   160,   160,   160,   160,   161,   161,   161,   161,   161,
1309e64d31b9Smaya     161,   162,   163,   163,   164,   164,   164,   164,   164,   164,
1310e64d31b9Smaya     164,   165,   166,   167,   167,   167,   167,   168,   168,   169,
1311e64d31b9Smaya     170,   171,   171,   172,   173,   174,   174,   175,   175,   175,
1312e64d31b9Smaya     176,   176,   176,   177,   177,   177,   178,   178,   179,   179,
1313e64d31b9Smaya     179,   179,   179,   179,   179,   179,   179,   179,   179,   180,
1314e64d31b9Smaya     181,   181,   181,   182,   183,   183,   183,   183,   183,   184,
1315e64d31b9Smaya     185,   186,   186,   187,   188,   189,   190,   191,   191,   191,
131696c5ddc4Srjs     192,   192,   192,   193,   194,   195,   195,   196,   196,   196,
131796c5ddc4Srjs     196,   197,   198,   198,   199,   200,   201,   202,   202,   203,
131896c5ddc4Srjs     204,   205,   205,   206,   207,   207,   208,   208,   208,   209,
131996c5ddc4Srjs     210,   210,   210,   210,   210,   210,   211,   211,   212,   213,
132096c5ddc4Srjs     214,   215,   216,   216,   217,   217,   218,   219,   219,   220,
132196c5ddc4Srjs     221,   222,   222,   223,   224,   225,   226,   226,   227,   227,
132296c5ddc4Srjs     228,   229,   229,   230,   230,   230,   230,   231,   231,   232,
132396c5ddc4Srjs     232,   232,   234,   233,   236,   235,   237,   237,   238,   239,
132496c5ddc4Srjs     239,   239,   239,   239,   239,   240,   241,   241,   241,   241,
132596c5ddc4Srjs     242,   242,   242,   243,   243,   243,   244,   244,   244,   245,
132696c5ddc4Srjs     245,   246,   246,   247,   247,   248,   249,   250,   251,   252,
132796c5ddc4Srjs     252
1328e64d31b9Smaya};
1329e64d31b9Smaya
1330e64d31b9Smaya  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
133196c5ddc4Srjsstatic const yytype_int8 yyr2[] =
1332e64d31b9Smaya{
1333e64d31b9Smaya       0,     2,     4,     1,     1,     2,     0,     3,     2,     0,
1334e64d31b9Smaya       2,     2,     1,     1,     1,     1,     1,     1,     1,     1,
1335e64d31b9Smaya       1,     1,     1,     1,     4,     4,     4,     6,     6,     8,
1336e64d31b9Smaya       8,     2,    12,     2,     1,     1,     1,     1,     1,     1,
1337e64d31b9Smaya       1,     1,     1,     1,     1,     1,     6,     2,     2,     3,
1338e64d31b9Smaya       2,     2,     7,     2,     1,     1,     1,     1,     4,     1,
1339e64d31b9Smaya       1,     1,     1,     1,     1,     1,     3,     0,     2,     2,
1340e64d31b9Smaya       1,     1,     1,     1,     1,     1,     1,     1,     1,     0,
1341e64d31b9Smaya       1,     1,     1,     1,     0,     1,     1,     1,     1,     1,
1342e64d31b9Smaya       1,     4,     2,     2,     1,     1,     2,     1,     2,     4,
1343e64d31b9Smaya       4,     1,     1,     1,     2,     1,     2,     1,     1,     3,
1344e64d31b9Smaya       6,     0,     1,     2,     4,     1,     3,     1,     1,     1,
1345e64d31b9Smaya       1,     1,     1,     1,     1,     1,     1,     2,     2,     2,
1346e64d31b9Smaya       2,     2,     2,     2,     2,     2,     2,     2,     2,     3,
1347e64d31b9Smaya       1,     1,     1,     5,     1,     1,     1,     2,     1,     1,
1348e64d31b9Smaya       2,     1,     2,     6,     1,     3,     1,     1,     1,     1,
134996c5ddc4Srjs       1,     1,     1,     1,     4,     1,     1,     1,     1,     1,
135096c5ddc4Srjs       1,     2,     1,     1,     5,     1,     2,     1,     1,     5,
135196c5ddc4Srjs       2,     0,     6,     3,     0,     1,     1,     1,     1,     1,
135296c5ddc4Srjs       2,     1,     1,     2,     4,     4,     0,     3,     1,     1,
135396c5ddc4Srjs       1,     2,     1,     1,     1,     1,     5,     1,     3,     5,
135496c5ddc4Srjs       5,     1,     3,     5,     1,     1,     1,     1,     1,     1,
135596c5ddc4Srjs       1,     1,     1,     3,     5,     7,     9,     2,     2,     1,
135696c5ddc4Srjs       1,     0,     0,     3,     0,     3,     3,     1,     4,     2,
135796c5ddc4Srjs       2,     2,     2,     3,     2,     3,     0,     3,     1,     1,
135896c5ddc4Srjs       0,     1,     1,     0,     1,     1,     0,     1,     1,     0,
135996c5ddc4Srjs       3,     0,     3,     0,     3,     1,     1,     1,     4,     1,
136096c5ddc4Srjs       1
1361e64d31b9Smaya};
1362e64d31b9Smaya
1363e64d31b9Smaya
136496c5ddc4Srjsenum { YYENOMEM = -2 };
136596c5ddc4Srjs
1366e64d31b9Smaya#define yyerrok         (yyerrstatus = 0)
1367e64d31b9Smaya#define yyclearin       (yychar = YYEMPTY)
1368e64d31b9Smaya
1369e64d31b9Smaya#define YYACCEPT        goto yyacceptlab
1370e64d31b9Smaya#define YYABORT         goto yyabortlab
1371e64d31b9Smaya#define YYERROR         goto yyerrorlab
1372e64d31b9Smaya
1373e64d31b9Smaya
1374e64d31b9Smaya#define YYRECOVERING()  (!!yyerrstatus)
1375e64d31b9Smaya
137696c5ddc4Srjs#define YYBACKUP(Token, Value)                                    \
137796c5ddc4Srjs  do                                                              \
137896c5ddc4Srjs    if (yychar == YYEMPTY)                                        \
137996c5ddc4Srjs      {                                                           \
138096c5ddc4Srjs        yychar = (Token);                                         \
138196c5ddc4Srjs        yylval = (Value);                                         \
138296c5ddc4Srjs        YYPOPSTACK (yylen);                                       \
138396c5ddc4Srjs        yystate = *yyssp;                                         \
138496c5ddc4Srjs        goto yybackup;                                            \
138596c5ddc4Srjs      }                                                           \
138696c5ddc4Srjs    else                                                          \
138796c5ddc4Srjs      {                                                           \
138896c5ddc4Srjs        yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
138996c5ddc4Srjs        YYERROR;                                                  \
139096c5ddc4Srjs      }                                                           \
139196c5ddc4Srjs  while (0)
139296c5ddc4Srjs
139396c5ddc4Srjs/* Backward compatibility with an undocumented macro.
139496c5ddc4Srjs   Use YYerror or YYUNDEF. */
139596c5ddc4Srjs#define YYERRCODE YYUNDEF
1396e64d31b9Smaya
1397e64d31b9Smaya/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1398e64d31b9Smaya   If N is 0, then set CURRENT to the empty location which ends
1399e64d31b9Smaya   the previous symbol: RHS[0] (always defined).  */
1400e64d31b9Smaya
1401e64d31b9Smaya#ifndef YYLLOC_DEFAULT
1402e64d31b9Smaya# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
1403e64d31b9Smaya    do                                                                  \
1404e64d31b9Smaya      if (N)                                                            \
1405e64d31b9Smaya        {                                                               \
1406e64d31b9Smaya          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
1407e64d31b9Smaya          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
1408e64d31b9Smaya          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
1409e64d31b9Smaya          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
1410e64d31b9Smaya        }                                                               \
1411e64d31b9Smaya      else                                                              \
1412e64d31b9Smaya        {                                                               \
1413e64d31b9Smaya          (Current).first_line   = (Current).last_line   =              \
1414e64d31b9Smaya            YYRHSLOC (Rhs, 0).last_line;                                \
1415e64d31b9Smaya          (Current).first_column = (Current).last_column =              \
1416e64d31b9Smaya            YYRHSLOC (Rhs, 0).last_column;                              \
1417e64d31b9Smaya        }                                                               \
1418e64d31b9Smaya    while (0)
1419e64d31b9Smaya#endif
1420e64d31b9Smaya
1421e64d31b9Smaya#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1422e64d31b9Smaya
1423e64d31b9Smaya
1424e64d31b9Smaya/* Enable debugging if requested.  */
1425e64d31b9Smaya#if YYDEBUG
1426e64d31b9Smaya
1427e64d31b9Smaya# ifndef YYFPRINTF
1428e64d31b9Smaya#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1429e64d31b9Smaya#  define YYFPRINTF fprintf
1430e64d31b9Smaya# endif
1431e64d31b9Smaya
1432e64d31b9Smaya# define YYDPRINTF(Args)                        \
1433e64d31b9Smayado {                                            \
1434e64d31b9Smaya  if (yydebug)                                  \
1435e64d31b9Smaya    YYFPRINTF Args;                             \
1436e64d31b9Smaya} while (0)
1437e64d31b9Smaya
1438e64d31b9Smaya
1439e64d31b9Smaya/* YY_LOCATION_PRINT -- Print the location on the stream.
1440e64d31b9Smaya   This macro was not mandated originally: define only if we know
1441e64d31b9Smaya   we won't break user code: when these are the locations we know.  */
1442e64d31b9Smaya
144396c5ddc4Srjs# ifndef YY_LOCATION_PRINT
144496c5ddc4Srjs#  if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1445e64d31b9Smaya
1446e64d31b9Smaya/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
1447e64d31b9Smaya
1448e64d31b9SmayaYY_ATTRIBUTE_UNUSED
1449e64d31b9Smayastatic int
1450e64d31b9Smayayy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
1451e64d31b9Smaya{
1452e64d31b9Smaya  int res = 0;
1453e64d31b9Smaya  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
1454e64d31b9Smaya  if (0 <= yylocp->first_line)
1455e64d31b9Smaya    {
1456e64d31b9Smaya      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
1457e64d31b9Smaya      if (0 <= yylocp->first_column)
1458e64d31b9Smaya        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
1459e64d31b9Smaya    }
1460e64d31b9Smaya  if (0 <= yylocp->last_line)
1461e64d31b9Smaya    {
1462e64d31b9Smaya      if (yylocp->first_line < yylocp->last_line)
1463e64d31b9Smaya        {
1464e64d31b9Smaya          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
1465e64d31b9Smaya          if (0 <= end_col)
1466e64d31b9Smaya            res += YYFPRINTF (yyo, ".%d", end_col);
1467e64d31b9Smaya        }
1468e64d31b9Smaya      else if (0 <= end_col && yylocp->first_column < end_col)
1469e64d31b9Smaya        res += YYFPRINTF (yyo, "-%d", end_col);
1470e64d31b9Smaya    }
1471e64d31b9Smaya  return res;
1472e64d31b9Smaya }
1473e64d31b9Smaya
147496c5ddc4Srjs#   define YY_LOCATION_PRINT(File, Loc)          \
1475e64d31b9Smaya  yy_location_print_ (File, &(Loc))
1476e64d31b9Smaya
147796c5ddc4Srjs#  else
147896c5ddc4Srjs#   define YY_LOCATION_PRINT(File, Loc) ((void) 0)
147996c5ddc4Srjs#  endif
148096c5ddc4Srjs# endif /* !defined YY_LOCATION_PRINT */
1481e64d31b9Smaya
1482e64d31b9Smaya
148396c5ddc4Srjs# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
1484e64d31b9Smayado {                                                                      \
1485e64d31b9Smaya  if (yydebug)                                                            \
1486e64d31b9Smaya    {                                                                     \
1487e64d31b9Smaya      YYFPRINTF (stderr, "%s ", Title);                                   \
1488e64d31b9Smaya      yy_symbol_print (stderr,                                            \
148996c5ddc4Srjs                  Kind, Value, Location, state); \
1490e64d31b9Smaya      YYFPRINTF (stderr, "\n");                                           \
1491e64d31b9Smaya    }                                                                     \
1492e64d31b9Smaya} while (0)
1493e64d31b9Smaya
1494e64d31b9Smaya
1495e64d31b9Smaya/*-----------------------------------.
1496e64d31b9Smaya| Print this symbol's value on YYO.  |
1497e64d31b9Smaya`-----------------------------------*/
1498e64d31b9Smaya
1499e64d31b9Smayastatic void
150096c5ddc4Srjsyy_symbol_value_print (FILE *yyo,
150196c5ddc4Srjs                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct asm_parser_state *state)
1502e64d31b9Smaya{
1503e64d31b9Smaya  FILE *yyoutput = yyo;
1504e64d31b9Smaya  YYUSE (yyoutput);
1505e64d31b9Smaya  YYUSE (yylocationp);
1506e64d31b9Smaya  YYUSE (state);
1507e64d31b9Smaya  if (!yyvaluep)
1508e64d31b9Smaya    return;
1509e64d31b9Smaya# ifdef YYPRINT
151096c5ddc4Srjs  if (yykind < YYNTOKENS)
151196c5ddc4Srjs    YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
1512e64d31b9Smaya# endif
151396c5ddc4Srjs  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
151496c5ddc4Srjs  YYUSE (yykind);
151596c5ddc4Srjs  YY_IGNORE_MAYBE_UNINITIALIZED_END
1516e64d31b9Smaya}
1517e64d31b9Smaya
1518e64d31b9Smaya
1519e64d31b9Smaya/*---------------------------.
1520e64d31b9Smaya| Print this symbol on YYO.  |
1521e64d31b9Smaya`---------------------------*/
1522e64d31b9Smaya
1523e64d31b9Smayastatic void
152496c5ddc4Srjsyy_symbol_print (FILE *yyo,
152596c5ddc4Srjs                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct asm_parser_state *state)
1526e64d31b9Smaya{
1527e64d31b9Smaya  YYFPRINTF (yyo, "%s %s (",
152896c5ddc4Srjs             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1529e64d31b9Smaya
1530e64d31b9Smaya  YY_LOCATION_PRINT (yyo, *yylocationp);
1531e64d31b9Smaya  YYFPRINTF (yyo, ": ");
153296c5ddc4Srjs  yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, state);
1533e64d31b9Smaya  YYFPRINTF (yyo, ")");
1534e64d31b9Smaya}
1535e64d31b9Smaya
1536e64d31b9Smaya/*------------------------------------------------------------------.
1537e64d31b9Smaya| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1538e64d31b9Smaya| TOP (included).                                                   |
1539e64d31b9Smaya`------------------------------------------------------------------*/
1540e64d31b9Smaya
1541e64d31b9Smayastatic void
154296c5ddc4Srjsyy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1543e64d31b9Smaya{
1544e64d31b9Smaya  YYFPRINTF (stderr, "Stack now");
1545e64d31b9Smaya  for (; yybottom <= yytop; yybottom++)
1546e64d31b9Smaya    {
1547e64d31b9Smaya      int yybot = *yybottom;
1548e64d31b9Smaya      YYFPRINTF (stderr, " %d", yybot);
1549e64d31b9Smaya    }
1550e64d31b9Smaya  YYFPRINTF (stderr, "\n");
1551e64d31b9Smaya}
1552e64d31b9Smaya
1553e64d31b9Smaya# define YY_STACK_PRINT(Bottom, Top)                            \
1554e64d31b9Smayado {                                                            \
1555e64d31b9Smaya  if (yydebug)                                                  \
1556e64d31b9Smaya    yy_stack_print ((Bottom), (Top));                           \
1557e64d31b9Smaya} while (0)
1558e64d31b9Smaya
1559e64d31b9Smaya
1560e64d31b9Smaya/*------------------------------------------------.
1561e64d31b9Smaya| Report that the YYRULE is going to be reduced.  |
1562e64d31b9Smaya`------------------------------------------------*/
1563e64d31b9Smaya
1564e64d31b9Smayastatic void
156596c5ddc4Srjsyy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
156696c5ddc4Srjs                 int yyrule, struct asm_parser_state *state)
1567e64d31b9Smaya{
156896c5ddc4Srjs  int yylno = yyrline[yyrule];
1569e64d31b9Smaya  int yynrhs = yyr2[yyrule];
1570e64d31b9Smaya  int yyi;
157196c5ddc4Srjs  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1572e64d31b9Smaya             yyrule - 1, yylno);
1573e64d31b9Smaya  /* The symbols being reduced.  */
1574e64d31b9Smaya  for (yyi = 0; yyi < yynrhs; yyi++)
1575e64d31b9Smaya    {
1576e64d31b9Smaya      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1577e64d31b9Smaya      yy_symbol_print (stderr,
157896c5ddc4Srjs                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
157996c5ddc4Srjs                       &yyvsp[(yyi + 1) - (yynrhs)],
158096c5ddc4Srjs                       &(yylsp[(yyi + 1) - (yynrhs)]), state);
1581e64d31b9Smaya      YYFPRINTF (stderr, "\n");
1582e64d31b9Smaya    }
1583e64d31b9Smaya}
1584e64d31b9Smaya
1585e64d31b9Smaya# define YY_REDUCE_PRINT(Rule)          \
1586e64d31b9Smayado {                                    \
1587e64d31b9Smaya  if (yydebug)                          \
1588e64d31b9Smaya    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, state); \
1589e64d31b9Smaya} while (0)
1590e64d31b9Smaya
1591e64d31b9Smaya/* Nonzero means print parse trace.  It is left uninitialized so that
1592e64d31b9Smaya   multiple parsers can coexist.  */
1593e64d31b9Smayaint yydebug;
1594e64d31b9Smaya#else /* !YYDEBUG */
159596c5ddc4Srjs# define YYDPRINTF(Args) ((void) 0)
159696c5ddc4Srjs# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1597e64d31b9Smaya# define YY_STACK_PRINT(Bottom, Top)
1598e64d31b9Smaya# define YY_REDUCE_PRINT(Rule)
1599e64d31b9Smaya#endif /* !YYDEBUG */
1600e64d31b9Smaya
1601e64d31b9Smaya
1602e64d31b9Smaya/* YYINITDEPTH -- initial size of the parser's stacks.  */
1603e64d31b9Smaya#ifndef YYINITDEPTH
1604e64d31b9Smaya# define YYINITDEPTH 200
1605e64d31b9Smaya#endif
1606e64d31b9Smaya
1607e64d31b9Smaya/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1608e64d31b9Smaya   if the built-in stack extension method is used).
1609e64d31b9Smaya
1610e64d31b9Smaya   Do not make this value too large; the results are undefined if
1611e64d31b9Smaya   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1612e64d31b9Smaya   evaluated with infinite-precision integer arithmetic.  */
1613e64d31b9Smaya
1614e64d31b9Smaya#ifndef YYMAXDEPTH
1615e64d31b9Smaya# define YYMAXDEPTH 10000
1616e64d31b9Smaya#endif
1617e64d31b9Smaya
1618e64d31b9Smaya
161996c5ddc4Srjs/* Context of a parse error.  */
162096c5ddc4Srjstypedef struct
162196c5ddc4Srjs{
162296c5ddc4Srjs  yy_state_t *yyssp;
162396c5ddc4Srjs  yysymbol_kind_t yytoken;
162496c5ddc4Srjs  YYLTYPE *yylloc;
162596c5ddc4Srjs} yypcontext_t;
162696c5ddc4Srjs
162796c5ddc4Srjs/* Put in YYARG at most YYARGN of the expected tokens given the
162896c5ddc4Srjs   current YYCTX, and return the number of tokens stored in YYARG.  If
162996c5ddc4Srjs   YYARG is null, return the number of expected tokens (guaranteed to
163096c5ddc4Srjs   be less than YYNTOKENS).  Return YYENOMEM on memory exhaustion.
163196c5ddc4Srjs   Return 0 if there are more than YYARGN expected tokens, yet fill
163296c5ddc4Srjs   YYARG up to YYARGN. */
163396c5ddc4Srjsstatic int
163496c5ddc4Srjsyypcontext_expected_tokens (const yypcontext_t *yyctx,
163596c5ddc4Srjs                            yysymbol_kind_t yyarg[], int yyargn)
163696c5ddc4Srjs{
163796c5ddc4Srjs  /* Actual size of YYARG. */
163896c5ddc4Srjs  int yycount = 0;
163996c5ddc4Srjs  int yyn = yypact[+*yyctx->yyssp];
164096c5ddc4Srjs  if (!yypact_value_is_default (yyn))
164196c5ddc4Srjs    {
164296c5ddc4Srjs      /* Start YYX at -YYN if negative to avoid negative indexes in
164396c5ddc4Srjs         YYCHECK.  In other words, skip the first -YYN actions for
164496c5ddc4Srjs         this state because they are default actions.  */
164596c5ddc4Srjs      int yyxbegin = yyn < 0 ? -yyn : 0;
164696c5ddc4Srjs      /* Stay within bounds of both yycheck and yytname.  */
164796c5ddc4Srjs      int yychecklim = YYLAST - yyn + 1;
164896c5ddc4Srjs      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
164996c5ddc4Srjs      int yyx;
165096c5ddc4Srjs      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
165196c5ddc4Srjs        if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
165296c5ddc4Srjs            && !yytable_value_is_error (yytable[yyx + yyn]))
165396c5ddc4Srjs          {
165496c5ddc4Srjs            if (!yyarg)
165596c5ddc4Srjs              ++yycount;
165696c5ddc4Srjs            else if (yycount == yyargn)
165796c5ddc4Srjs              return 0;
165896c5ddc4Srjs            else
165996c5ddc4Srjs              yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
166096c5ddc4Srjs          }
166196c5ddc4Srjs    }
166296c5ddc4Srjs  if (yyarg && yycount == 0 && 0 < yyargn)
166396c5ddc4Srjs    yyarg[0] = YYSYMBOL_YYEMPTY;
166496c5ddc4Srjs  return yycount;
166596c5ddc4Srjs}
166696c5ddc4Srjs
166796c5ddc4Srjs
1668e64d31b9Smaya
166996c5ddc4Srjs
167096c5ddc4Srjs#ifndef yystrlen
167196c5ddc4Srjs# if defined __GLIBC__ && defined _STRING_H
167296c5ddc4Srjs#  define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
167396c5ddc4Srjs# else
1674e64d31b9Smaya/* Return the length of YYSTR.  */
167596c5ddc4Srjsstatic YYPTRDIFF_T
1676e64d31b9Smayayystrlen (const char *yystr)
1677e64d31b9Smaya{
167896c5ddc4Srjs  YYPTRDIFF_T yylen;
1679e64d31b9Smaya  for (yylen = 0; yystr[yylen]; yylen++)
1680e64d31b9Smaya    continue;
1681e64d31b9Smaya  return yylen;
1682e64d31b9Smaya}
1683e64d31b9Smaya# endif
168496c5ddc4Srjs#endif
1685e64d31b9Smaya
168696c5ddc4Srjs#ifndef yystpcpy
168796c5ddc4Srjs# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
168896c5ddc4Srjs#  define yystpcpy stpcpy
168996c5ddc4Srjs# else
1690e64d31b9Smaya/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1691e64d31b9Smaya   YYDEST.  */
1692e64d31b9Smayastatic char *
1693e64d31b9Smayayystpcpy (char *yydest, const char *yysrc)
1694e64d31b9Smaya{
1695e64d31b9Smaya  char *yyd = yydest;
1696e64d31b9Smaya  const char *yys = yysrc;
1697e64d31b9Smaya
1698e64d31b9Smaya  while ((*yyd++ = *yys++) != '\0')
1699e64d31b9Smaya    continue;
1700e64d31b9Smaya
1701e64d31b9Smaya  return yyd - 1;
1702e64d31b9Smaya}
1703e64d31b9Smaya# endif
170496c5ddc4Srjs#endif
1705e64d31b9Smaya
170696c5ddc4Srjs#ifndef yytnamerr
1707e64d31b9Smaya/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1708e64d31b9Smaya   quotes and backslashes, so that it's suitable for yyerror.  The
1709e64d31b9Smaya   heuristic is that double-quoting is unnecessary unless the string
1710e64d31b9Smaya   contains an apostrophe, a comma, or backslash (other than
1711e64d31b9Smaya   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1712e64d31b9Smaya   null, do not copy; instead, return the length of what the result
1713e64d31b9Smaya   would have been.  */
171496c5ddc4Srjsstatic YYPTRDIFF_T
1715e64d31b9Smayayytnamerr (char *yyres, const char *yystr)
1716e64d31b9Smaya{
1717e64d31b9Smaya  if (*yystr == '"')
1718e64d31b9Smaya    {
171996c5ddc4Srjs      YYPTRDIFF_T yyn = 0;
1720e64d31b9Smaya      char const *yyp = yystr;
1721e64d31b9Smaya      for (;;)
1722e64d31b9Smaya        switch (*++yyp)
1723e64d31b9Smaya          {
1724e64d31b9Smaya          case '\'':
1725e64d31b9Smaya          case ',':
1726e64d31b9Smaya            goto do_not_strip_quotes;
1727e64d31b9Smaya
1728e64d31b9Smaya          case '\\':
1729e64d31b9Smaya            if (*++yyp != '\\')
1730e64d31b9Smaya              goto do_not_strip_quotes;
173196c5ddc4Srjs            else
173296c5ddc4Srjs              goto append;
173396c5ddc4Srjs
173496c5ddc4Srjs          append:
1735e64d31b9Smaya          default:
1736e64d31b9Smaya            if (yyres)
1737e64d31b9Smaya              yyres[yyn] = *yyp;
1738e64d31b9Smaya            yyn++;
1739e64d31b9Smaya            break;
1740e64d31b9Smaya
1741e64d31b9Smaya          case '"':
1742e64d31b9Smaya            if (yyres)
1743e64d31b9Smaya              yyres[yyn] = '\0';
1744e64d31b9Smaya            return yyn;
1745e64d31b9Smaya          }
1746e64d31b9Smaya    do_not_strip_quotes: ;
1747e64d31b9Smaya    }
1748e64d31b9Smaya
174996c5ddc4Srjs  if (yyres)
175096c5ddc4Srjs    return yystpcpy (yyres, yystr) - yyres;
175196c5ddc4Srjs  else
1752e64d31b9Smaya    return yystrlen (yystr);
1753e64d31b9Smaya}
175496c5ddc4Srjs#endif
1755e64d31b9Smaya
1756e64d31b9Smaya
1757e64d31b9Smayastatic int
175896c5ddc4Srjsyy_syntax_error_arguments (const yypcontext_t *yyctx,
175996c5ddc4Srjs                           yysymbol_kind_t yyarg[], int yyargn)
1760e64d31b9Smaya{
176196c5ddc4Srjs  /* Actual size of YYARG. */
1762e64d31b9Smaya  int yycount = 0;
1763e64d31b9Smaya  /* There are many possibilities here to consider:
1764e64d31b9Smaya     - If this state is a consistent state with a default action, then
1765e64d31b9Smaya       the only way this function was invoked is if the default action
1766e64d31b9Smaya       is an error action.  In that case, don't check for expected
1767e64d31b9Smaya       tokens because there are none.
1768e64d31b9Smaya     - The only way there can be no lookahead present (in yychar) is if
1769e64d31b9Smaya       this state is a consistent state with a default action.  Thus,
1770e64d31b9Smaya       detecting the absence of a lookahead is sufficient to determine
1771e64d31b9Smaya       that there is no unexpected or expected token to report.  In that
1772e64d31b9Smaya       case, just report a simple "syntax error".
1773e64d31b9Smaya     - Don't assume there isn't a lookahead just because this state is a
1774e64d31b9Smaya       consistent state with a default action.  There might have been a
1775e64d31b9Smaya       previous inconsistent state, consistent state with a non-default
1776e64d31b9Smaya       action, or user semantic action that manipulated yychar.
1777e64d31b9Smaya     - Of course, the expected token list depends on states to have
1778e64d31b9Smaya       correct lookahead information, and it depends on the parser not
1779e64d31b9Smaya       to perform extra reductions after fetching a lookahead from the
1780e64d31b9Smaya       scanner and before detecting a syntax error.  Thus, state merging
1781e64d31b9Smaya       (from LALR or IELR) and default reductions corrupt the expected
1782e64d31b9Smaya       token list.  However, the list is correct for canonical LR with
1783e64d31b9Smaya       one exception: it will still contain any token that will not be
1784e64d31b9Smaya       accepted due to an error action in a later state.
1785e64d31b9Smaya  */
178696c5ddc4Srjs  if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
178796c5ddc4Srjs    {
178896c5ddc4Srjs      int yyn;
178996c5ddc4Srjs      if (yyarg)
179096c5ddc4Srjs        yyarg[yycount] = yyctx->yytoken;
179196c5ddc4Srjs      ++yycount;
179296c5ddc4Srjs      yyn = yypcontext_expected_tokens (yyctx,
179396c5ddc4Srjs                                        yyarg ? yyarg + 1 : yyarg, yyargn - 1);
179496c5ddc4Srjs      if (yyn == YYENOMEM)
179596c5ddc4Srjs        return YYENOMEM;
179696c5ddc4Srjs      else
179796c5ddc4Srjs        yycount += yyn;
1798e64d31b9Smaya    }
179996c5ddc4Srjs  return yycount;
180096c5ddc4Srjs}
180196c5ddc4Srjs
180296c5ddc4Srjs/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
180396c5ddc4Srjs   about the unexpected token YYTOKEN for the state stack whose top is
180496c5ddc4Srjs   YYSSP.
180596c5ddc4Srjs
180696c5ddc4Srjs   Return 0 if *YYMSG was successfully written.  Return -1 if *YYMSG is
180796c5ddc4Srjs   not large enough to hold the message.  In that case, also set
180896c5ddc4Srjs   *YYMSG_ALLOC to the required number of bytes.  Return YYENOMEM if the
180996c5ddc4Srjs   required number of bytes is too large to store.  */
181096c5ddc4Srjsstatic int
181196c5ddc4Srjsyysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
181296c5ddc4Srjs                const yypcontext_t *yyctx)
181396c5ddc4Srjs{
181496c5ddc4Srjs  enum { YYARGS_MAX = 5 };
181596c5ddc4Srjs  /* Internationalized format string. */
181696c5ddc4Srjs  const char *yyformat = YY_NULLPTR;
181796c5ddc4Srjs  /* Arguments of yyformat: reported tokens (one for the "unexpected",
181896c5ddc4Srjs     one per "expected"). */
181996c5ddc4Srjs  yysymbol_kind_t yyarg[YYARGS_MAX];
182096c5ddc4Srjs  /* Cumulated lengths of YYARG.  */
182196c5ddc4Srjs  YYPTRDIFF_T yysize = 0;
182296c5ddc4Srjs
182396c5ddc4Srjs  /* Actual size of YYARG. */
182496c5ddc4Srjs  int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
182596c5ddc4Srjs  if (yycount == YYENOMEM)
182696c5ddc4Srjs    return YYENOMEM;
1827e64d31b9Smaya
1828e64d31b9Smaya  switch (yycount)
1829e64d31b9Smaya    {
183096c5ddc4Srjs#define YYCASE_(N, S)                       \
1831e64d31b9Smaya      case N:                               \
1832e64d31b9Smaya        yyformat = S;                       \
183396c5ddc4Srjs        break
1834e64d31b9Smaya    default: /* Avoid compiler warnings. */
1835e64d31b9Smaya      YYCASE_(0, YY_("syntax error"));
1836e64d31b9Smaya      YYCASE_(1, YY_("syntax error, unexpected %s"));
1837e64d31b9Smaya      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1838e64d31b9Smaya      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1839e64d31b9Smaya      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1840e64d31b9Smaya      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
184196c5ddc4Srjs#undef YYCASE_
1842e64d31b9Smaya    }
1843e64d31b9Smaya
184496c5ddc4Srjs  /* Compute error message size.  Don't count the "%s"s, but reserve
184596c5ddc4Srjs     room for the terminator.  */
184696c5ddc4Srjs  yysize = yystrlen (yyformat) - 2 * yycount + 1;
1847e64d31b9Smaya  {
184896c5ddc4Srjs    int yyi;
184996c5ddc4Srjs    for (yyi = 0; yyi < yycount; ++yyi)
185096c5ddc4Srjs      {
185196c5ddc4Srjs        YYPTRDIFF_T yysize1
185296c5ddc4Srjs          = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
185396c5ddc4Srjs        if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
185496c5ddc4Srjs          yysize = yysize1;
185596c5ddc4Srjs        else
185696c5ddc4Srjs          return YYENOMEM;
185796c5ddc4Srjs      }
1858e64d31b9Smaya  }
1859e64d31b9Smaya
1860e64d31b9Smaya  if (*yymsg_alloc < yysize)
1861e64d31b9Smaya    {
1862e64d31b9Smaya      *yymsg_alloc = 2 * yysize;
1863e64d31b9Smaya      if (! (yysize <= *yymsg_alloc
1864e64d31b9Smaya             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1865e64d31b9Smaya        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
186696c5ddc4Srjs      return -1;
1867e64d31b9Smaya    }
1868e64d31b9Smaya
1869e64d31b9Smaya  /* Avoid sprintf, as that infringes on the user's name space.
1870e64d31b9Smaya     Don't have undefined behavior even if the translation
1871e64d31b9Smaya     produced a string with the wrong number of "%s"s.  */
1872e64d31b9Smaya  {
1873e64d31b9Smaya    char *yyp = *yymsg;
1874e64d31b9Smaya    int yyi = 0;
1875e64d31b9Smaya    while ((*yyp = *yyformat) != '\0')
1876e64d31b9Smaya      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1877e64d31b9Smaya        {
187896c5ddc4Srjs          yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1879e64d31b9Smaya          yyformat += 2;
1880e64d31b9Smaya        }
1881e64d31b9Smaya      else
1882e64d31b9Smaya        {
188396c5ddc4Srjs          ++yyp;
188496c5ddc4Srjs          ++yyformat;
1885e64d31b9Smaya        }
1886e64d31b9Smaya  }
1887e64d31b9Smaya  return 0;
1888e64d31b9Smaya}
188996c5ddc4Srjs
1890e64d31b9Smaya
1891e64d31b9Smaya/*-----------------------------------------------.
1892e64d31b9Smaya| Release the memory associated to this symbol.  |
1893e64d31b9Smaya`-----------------------------------------------*/
1894e64d31b9Smaya
1895e64d31b9Smayastatic void
189696c5ddc4Srjsyydestruct (const char *yymsg,
189796c5ddc4Srjs            yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct asm_parser_state *state)
1898e64d31b9Smaya{
1899e64d31b9Smaya  YYUSE (yyvaluep);
1900e64d31b9Smaya  YYUSE (yylocationp);
1901e64d31b9Smaya  YYUSE (state);
1902e64d31b9Smaya  if (!yymsg)
1903e64d31b9Smaya    yymsg = "Deleting";
190496c5ddc4Srjs  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1905e64d31b9Smaya
1906e64d31b9Smaya  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
190796c5ddc4Srjs  YYUSE (yykind);
1908e64d31b9Smaya  YY_IGNORE_MAYBE_UNINITIALIZED_END
1909e64d31b9Smaya}
1910e64d31b9Smaya
1911e64d31b9Smaya
1912e64d31b9Smaya
1913e64d31b9Smaya
191496c5ddc4Srjs
191596c5ddc4Srjs
1916e64d31b9Smaya/*----------.
1917e64d31b9Smaya| yyparse.  |
1918e64d31b9Smaya`----------*/
1919e64d31b9Smaya
1920e64d31b9Smayaint
1921e64d31b9Smayayyparse (struct asm_parser_state *state)
1922e64d31b9Smaya{
192396c5ddc4Srjs/* Lookahead token kind.  */
1924e64d31b9Smayaint yychar;
1925e64d31b9Smaya
1926e64d31b9Smaya
1927e64d31b9Smaya/* The semantic value of the lookahead symbol.  */
1928e64d31b9Smaya/* Default value used for initialization, for pacifying older GCCs
1929e64d31b9Smaya   or non-GCC compilers.  */
1930e64d31b9SmayaYY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1931e64d31b9SmayaYYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1932e64d31b9Smaya
1933e64d31b9Smaya/* Location data for the lookahead symbol.  */
1934e64d31b9Smayastatic YYLTYPE yyloc_default
1935e64d31b9Smaya# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1936e64d31b9Smaya  = { 1, 1, 1, 1 }
1937e64d31b9Smaya# endif
1938e64d31b9Smaya;
1939e64d31b9SmayaYYLTYPE yylloc = yyloc_default;
1940e64d31b9Smaya
1941e64d31b9Smaya    /* Number of syntax errors so far.  */
194296c5ddc4Srjs    int yynerrs = 0;
1943e64d31b9Smaya
194496c5ddc4Srjs    yy_state_fast_t yystate = 0;
1945e64d31b9Smaya    /* Number of tokens to shift before error messages enabled.  */
194696c5ddc4Srjs    int yyerrstatus = 0;
1947e64d31b9Smaya
194896c5ddc4Srjs    /* Refer to the stacks through separate pointers, to allow yyoverflow
1949e64d31b9Smaya       to reallocate them elsewhere.  */
1950e64d31b9Smaya
195196c5ddc4Srjs    /* Their size.  */
195296c5ddc4Srjs    YYPTRDIFF_T yystacksize = YYINITDEPTH;
1953e64d31b9Smaya
195496c5ddc4Srjs    /* The state stack: array, bottom, top.  */
195596c5ddc4Srjs    yy_state_t yyssa[YYINITDEPTH];
195696c5ddc4Srjs    yy_state_t *yyss = yyssa;
195796c5ddc4Srjs    yy_state_t *yyssp = yyss;
195896c5ddc4Srjs
195996c5ddc4Srjs    /* The semantic value stack: array, bottom, top.  */
1960e64d31b9Smaya    YYSTYPE yyvsa[YYINITDEPTH];
196196c5ddc4Srjs    YYSTYPE *yyvs = yyvsa;
196296c5ddc4Srjs    YYSTYPE *yyvsp = yyvs;
1963e64d31b9Smaya
196496c5ddc4Srjs    /* The location stack: array, bottom, top.  */
1965e64d31b9Smaya    YYLTYPE yylsa[YYINITDEPTH];
196696c5ddc4Srjs    YYLTYPE *yyls = yylsa;
196796c5ddc4Srjs    YYLTYPE *yylsp = yyls;
1968e64d31b9Smaya
1969e64d31b9Smaya  int yyn;
197096c5ddc4Srjs  /* The return value of yyparse.  */
1971e64d31b9Smaya  int yyresult;
197296c5ddc4Srjs  /* Lookahead symbol kind.  */
197396c5ddc4Srjs  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1974e64d31b9Smaya  /* The variables used to return semantic value and location from the
1975e64d31b9Smaya     action routines.  */
1976e64d31b9Smaya  YYSTYPE yyval;
1977e64d31b9Smaya  YYLTYPE yyloc;
1978e64d31b9Smaya
197996c5ddc4Srjs  /* The locations where the error started and ended.  */
198096c5ddc4Srjs  YYLTYPE yyerror_range[3];
198196c5ddc4Srjs
1982e64d31b9Smaya  /* Buffer for error messages, and its allocated size.  */
1983e64d31b9Smaya  char yymsgbuf[128];
1984e64d31b9Smaya  char *yymsg = yymsgbuf;
198596c5ddc4Srjs  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1986e64d31b9Smaya
1987e64d31b9Smaya#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1988e64d31b9Smaya
1989e64d31b9Smaya  /* The number of symbols on the RHS of the reduced rule.
1990e64d31b9Smaya     Keep to zero when no symbol should be popped.  */
1991e64d31b9Smaya  int yylen = 0;
1992e64d31b9Smaya
1993e64d31b9Smaya  YYDPRINTF ((stderr, "Starting parse\n"));
1994e64d31b9Smaya
1995e64d31b9Smaya  yychar = YYEMPTY; /* Cause a token to be read.  */
1996e64d31b9Smaya  yylsp[0] = yylloc;
1997e64d31b9Smaya  goto yysetstate;
1998e64d31b9Smaya
199996c5ddc4Srjs
2000e64d31b9Smaya/*------------------------------------------------------------.
200196c5ddc4Srjs| yynewstate -- push a new state, which is found in yystate.  |
2002e64d31b9Smaya`------------------------------------------------------------*/
200396c5ddc4Srjsyynewstate:
2004e64d31b9Smaya  /* In all cases, when you get here, the value and location stacks
2005e64d31b9Smaya     have just been pushed.  So pushing a state here evens the stacks.  */
2006e64d31b9Smaya  yyssp++;
2007e64d31b9Smaya
200896c5ddc4Srjs
200996c5ddc4Srjs/*--------------------------------------------------------------------.
201096c5ddc4Srjs| yysetstate -- set current state (the top of the stack) to yystate.  |
201196c5ddc4Srjs`--------------------------------------------------------------------*/
201296c5ddc4Srjsyysetstate:
201396c5ddc4Srjs  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
201496c5ddc4Srjs  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
201596c5ddc4Srjs  YY_IGNORE_USELESS_CAST_BEGIN
201696c5ddc4Srjs  *yyssp = YY_CAST (yy_state_t, yystate);
201796c5ddc4Srjs  YY_IGNORE_USELESS_CAST_END
201896c5ddc4Srjs  YY_STACK_PRINT (yyss, yyssp);
2019e64d31b9Smaya
2020e64d31b9Smaya  if (yyss + yystacksize - 1 <= yyssp)
202196c5ddc4Srjs#if !defined yyoverflow && !defined YYSTACK_RELOCATE
202296c5ddc4Srjs    goto yyexhaustedlab;
202396c5ddc4Srjs#else
2024e64d31b9Smaya    {
2025e64d31b9Smaya      /* Get the current used size of the three stacks, in elements.  */
202696c5ddc4Srjs      YYPTRDIFF_T yysize = yyssp - yyss + 1;
2027e64d31b9Smaya
202896c5ddc4Srjs# if defined yyoverflow
2029e64d31b9Smaya      {
2030e64d31b9Smaya        /* Give user a chance to reallocate the stack.  Use copies of
2031e64d31b9Smaya           these so that the &'s don't force the real ones into
2032e64d31b9Smaya           memory.  */
203396c5ddc4Srjs        yy_state_t *yyss1 = yyss;
2034e64d31b9Smaya        YYSTYPE *yyvs1 = yyvs;
2035e64d31b9Smaya        YYLTYPE *yyls1 = yyls;
2036e64d31b9Smaya
2037e64d31b9Smaya        /* Each stack pointer address is followed by the size of the
2038e64d31b9Smaya           data in use in that stack, in bytes.  This used to be a
2039e64d31b9Smaya           conditional around just the two extra args, but that might
2040e64d31b9Smaya           be undefined if yyoverflow is a macro.  */
2041e64d31b9Smaya        yyoverflow (YY_("memory exhausted"),
204296c5ddc4Srjs                    &yyss1, yysize * YYSIZEOF (*yyssp),
204396c5ddc4Srjs                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
204496c5ddc4Srjs                    &yyls1, yysize * YYSIZEOF (*yylsp),
2045e64d31b9Smaya                    &yystacksize);
2046e64d31b9Smaya        yyss = yyss1;
2047e64d31b9Smaya        yyvs = yyvs1;
2048e64d31b9Smaya        yyls = yyls1;
2049e64d31b9Smaya      }
205096c5ddc4Srjs# else /* defined YYSTACK_RELOCATE */
2051e64d31b9Smaya      /* Extend the stack our own way.  */
2052e64d31b9Smaya      if (YYMAXDEPTH <= yystacksize)
2053e64d31b9Smaya        goto yyexhaustedlab;
2054e64d31b9Smaya      yystacksize *= 2;
2055e64d31b9Smaya      if (YYMAXDEPTH < yystacksize)
2056e64d31b9Smaya        yystacksize = YYMAXDEPTH;
2057e64d31b9Smaya
2058e64d31b9Smaya      {
205996c5ddc4Srjs        yy_state_t *yyss1 = yyss;
2060e64d31b9Smaya        union yyalloc *yyptr =
206196c5ddc4Srjs          YY_CAST (union yyalloc *,
206296c5ddc4Srjs                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
2063e64d31b9Smaya        if (! yyptr)
2064e64d31b9Smaya          goto yyexhaustedlab;
2065e64d31b9Smaya        YYSTACK_RELOCATE (yyss_alloc, yyss);
2066e64d31b9Smaya        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2067e64d31b9Smaya        YYSTACK_RELOCATE (yyls_alloc, yyls);
2068e64d31b9Smaya#  undef YYSTACK_RELOCATE
2069e64d31b9Smaya        if (yyss1 != yyssa)
2070e64d31b9Smaya          YYSTACK_FREE (yyss1);
2071e64d31b9Smaya      }
2072e64d31b9Smaya# endif
2073e64d31b9Smaya
2074e64d31b9Smaya      yyssp = yyss + yysize - 1;
2075e64d31b9Smaya      yyvsp = yyvs + yysize - 1;
2076e64d31b9Smaya      yylsp = yyls + yysize - 1;
2077e64d31b9Smaya
207896c5ddc4Srjs      YY_IGNORE_USELESS_CAST_BEGIN
207996c5ddc4Srjs      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
208096c5ddc4Srjs                  YY_CAST (long, yystacksize)));
208196c5ddc4Srjs      YY_IGNORE_USELESS_CAST_END
2082e64d31b9Smaya
2083e64d31b9Smaya      if (yyss + yystacksize - 1 <= yyssp)
2084e64d31b9Smaya        YYABORT;
2085e64d31b9Smaya    }
208696c5ddc4Srjs#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
2087e64d31b9Smaya
2088e64d31b9Smaya  if (yystate == YYFINAL)
2089e64d31b9Smaya    YYACCEPT;
2090e64d31b9Smaya
2091e64d31b9Smaya  goto yybackup;
2092e64d31b9Smaya
209396c5ddc4Srjs
2094e64d31b9Smaya/*-----------.
2095e64d31b9Smaya| yybackup.  |
2096e64d31b9Smaya`-----------*/
2097e64d31b9Smayayybackup:
2098e64d31b9Smaya  /* Do appropriate processing given the current state.  Read a
2099e64d31b9Smaya     lookahead token if we need one and don't already have one.  */
2100e64d31b9Smaya
2101e64d31b9Smaya  /* First try to decide what to do without reference to lookahead token.  */
2102e64d31b9Smaya  yyn = yypact[yystate];
2103e64d31b9Smaya  if (yypact_value_is_default (yyn))
2104e64d31b9Smaya    goto yydefault;
2105e64d31b9Smaya
2106e64d31b9Smaya  /* Not known => get a lookahead token if don't already have one.  */
2107e64d31b9Smaya
210896c5ddc4Srjs  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
2109e64d31b9Smaya  if (yychar == YYEMPTY)
2110e64d31b9Smaya    {
211196c5ddc4Srjs      YYDPRINTF ((stderr, "Reading a token\n"));
2112e64d31b9Smaya      yychar = yylex (&yylval, &yylloc, state);
2113e64d31b9Smaya    }
2114e64d31b9Smaya
2115e64d31b9Smaya  if (yychar <= YYEOF)
2116e64d31b9Smaya    {
211796c5ddc4Srjs      yychar = YYEOF;
211896c5ddc4Srjs      yytoken = YYSYMBOL_YYEOF;
2119e64d31b9Smaya      YYDPRINTF ((stderr, "Now at end of input.\n"));
2120e64d31b9Smaya    }
212196c5ddc4Srjs  else if (yychar == YYerror)
212296c5ddc4Srjs    {
212396c5ddc4Srjs      /* The scanner already issued an error message, process directly
212496c5ddc4Srjs         to error recovery.  But do not keep the error token as
212596c5ddc4Srjs         lookahead, it is too special and may lead us to an endless
212696c5ddc4Srjs         loop in error recovery. */
212796c5ddc4Srjs      yychar = YYUNDEF;
212896c5ddc4Srjs      yytoken = YYSYMBOL_YYerror;
212996c5ddc4Srjs      yyerror_range[1] = yylloc;
213096c5ddc4Srjs      goto yyerrlab1;
213196c5ddc4Srjs    }
2132e64d31b9Smaya  else
2133e64d31b9Smaya    {
2134e64d31b9Smaya      yytoken = YYTRANSLATE (yychar);
2135e64d31b9Smaya      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2136e64d31b9Smaya    }
2137e64d31b9Smaya
2138e64d31b9Smaya  /* If the proper action on seeing token YYTOKEN is to reduce or to
2139e64d31b9Smaya     detect an error, take that action.  */
2140e64d31b9Smaya  yyn += yytoken;
2141e64d31b9Smaya  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2142e64d31b9Smaya    goto yydefault;
2143e64d31b9Smaya  yyn = yytable[yyn];
2144e64d31b9Smaya  if (yyn <= 0)
2145e64d31b9Smaya    {
2146e64d31b9Smaya      if (yytable_value_is_error (yyn))
2147e64d31b9Smaya        goto yyerrlab;
2148e64d31b9Smaya      yyn = -yyn;
2149e64d31b9Smaya      goto yyreduce;
2150e64d31b9Smaya    }
2151e64d31b9Smaya
2152e64d31b9Smaya  /* Count tokens shifted since error; after three, turn off error
2153e64d31b9Smaya     status.  */
2154e64d31b9Smaya  if (yyerrstatus)
2155e64d31b9Smaya    yyerrstatus--;
2156e64d31b9Smaya
2157e64d31b9Smaya  /* Shift the lookahead token.  */
2158e64d31b9Smaya  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2159e64d31b9Smaya  yystate = yyn;
2160e64d31b9Smaya  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2161e64d31b9Smaya  *++yyvsp = yylval;
2162e64d31b9Smaya  YY_IGNORE_MAYBE_UNINITIALIZED_END
2163e64d31b9Smaya  *++yylsp = yylloc;
216496c5ddc4Srjs
216596c5ddc4Srjs  /* Discard the shifted token.  */
216696c5ddc4Srjs  yychar = YYEMPTY;
2167e64d31b9Smaya  goto yynewstate;
2168e64d31b9Smaya
2169e64d31b9Smaya
2170e64d31b9Smaya/*-----------------------------------------------------------.
2171e64d31b9Smaya| yydefault -- do the default action for the current state.  |
2172e64d31b9Smaya`-----------------------------------------------------------*/
2173e64d31b9Smayayydefault:
2174e64d31b9Smaya  yyn = yydefact[yystate];
2175e64d31b9Smaya  if (yyn == 0)
2176e64d31b9Smaya    goto yyerrlab;
2177e64d31b9Smaya  goto yyreduce;
2178e64d31b9Smaya
2179e64d31b9Smaya
2180e64d31b9Smaya/*-----------------------------.
218196c5ddc4Srjs| yyreduce -- do a reduction.  |
2182e64d31b9Smaya`-----------------------------*/
2183e64d31b9Smayayyreduce:
2184e64d31b9Smaya  /* yyn is the number of a rule to reduce with.  */
2185e64d31b9Smaya  yylen = yyr2[yyn];
2186e64d31b9Smaya
2187e64d31b9Smaya  /* If YYLEN is nonzero, implement the default value of the action:
2188e64d31b9Smaya     '$$ = $1'.
2189e64d31b9Smaya
2190e64d31b9Smaya     Otherwise, the following line sets YYVAL to garbage.
2191e64d31b9Smaya     This behavior is undocumented and Bison
2192e64d31b9Smaya     users should not rely upon it.  Assigning to YYVAL
2193e64d31b9Smaya     unconditionally makes the parser a bit smaller, and it avoids a
2194e64d31b9Smaya     GCC warning that YYVAL may be used uninitialized.  */
2195e64d31b9Smaya  yyval = yyvsp[1-yylen];
2196e64d31b9Smaya
2197e64d31b9Smaya  /* Default location. */
2198e64d31b9Smaya  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
2199e64d31b9Smaya  yyerror_range[1] = yyloc;
2200e64d31b9Smaya  YY_REDUCE_PRINT (yyn);
2201e64d31b9Smaya  switch (yyn)
2202e64d31b9Smaya    {
220396c5ddc4Srjs  case 3: /* language: ARBvp_10  */
220496c5ddc4Srjs#line 299 "../src/mesa/program/program_parse.y"
220596c5ddc4Srjs        {
2206e64d31b9Smaya	   if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) {
2207e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid fragment program header");
2208e64d31b9Smaya
2209e64d31b9Smaya	   }
2210e64d31b9Smaya	   state->mode = ARB_vertex;
2211e64d31b9Smaya	}
221296c5ddc4Srjs#line 2213 "src/mesa/program/program_parse.tab.c"
2213e64d31b9Smaya    break;
2214e64d31b9Smaya
221596c5ddc4Srjs  case 4: /* language: ARBfp_10  */
221696c5ddc4Srjs#line 307 "../src/mesa/program/program_parse.y"
221796c5ddc4Srjs        {
2218e64d31b9Smaya	   if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) {
2219e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid vertex program header");
2220e64d31b9Smaya	   }
2221e64d31b9Smaya	   state->mode = ARB_fragment;
2222e64d31b9Smaya
2223e64d31b9Smaya	   state->option.TexRect =
2224e64d31b9Smaya	      (state->ctx->Extensions.NV_texture_rectangle != GL_FALSE);
2225e64d31b9Smaya	}
222696c5ddc4Srjs#line 2227 "src/mesa/program/program_parse.tab.c"
2227e64d31b9Smaya    break;
2228e64d31b9Smaya
222996c5ddc4Srjs  case 7: /* option: OPTION string ';'  */
223096c5ddc4Srjs#line 323 "../src/mesa/program/program_parse.y"
223196c5ddc4Srjs        {
2232e64d31b9Smaya	   int valid = 0;
2233e64d31b9Smaya
2234e64d31b9Smaya	   if (state->mode == ARB_vertex) {
2235e64d31b9Smaya	      valid = _mesa_ARBvp_parse_option(state, (yyvsp[-1].string));
2236e64d31b9Smaya	   } else if (state->mode == ARB_fragment) {
2237e64d31b9Smaya	      valid = _mesa_ARBfp_parse_option(state, (yyvsp[-1].string));
2238e64d31b9Smaya	   }
2239e64d31b9Smaya
2240e64d31b9Smaya
2241e64d31b9Smaya	   free((yyvsp[-1].string));
2242e64d31b9Smaya
2243e64d31b9Smaya	   if (!valid) {
2244e64d31b9Smaya	      const char *const err_str = (state->mode == ARB_vertex)
2245e64d31b9Smaya		 ? "invalid ARB vertex program option"
2246e64d31b9Smaya		 : "invalid ARB fragment program option";
2247e64d31b9Smaya
2248e64d31b9Smaya	      yyerror(& (yylsp[-1]), state, err_str);
2249e64d31b9Smaya	      YYERROR;
2250e64d31b9Smaya	   }
2251e64d31b9Smaya	}
225296c5ddc4Srjs#line 2253 "src/mesa/program/program_parse.tab.c"
2253e64d31b9Smaya    break;
2254e64d31b9Smaya
225596c5ddc4Srjs  case 10: /* statement: instruction ';'  */
225696c5ddc4Srjs#line 351 "../src/mesa/program/program_parse.y"
225796c5ddc4Srjs        {
2258e64d31b9Smaya	   if ((yyvsp[-1].inst) != NULL) {
2259e64d31b9Smaya	      if (state->inst_tail == NULL) {
2260e64d31b9Smaya		 state->inst_head = (yyvsp[-1].inst);
2261e64d31b9Smaya	      } else {
2262e64d31b9Smaya		 state->inst_tail->next = (yyvsp[-1].inst);
2263e64d31b9Smaya	      }
2264e64d31b9Smaya
2265e64d31b9Smaya	      state->inst_tail = (yyvsp[-1].inst);
2266e64d31b9Smaya	      (yyvsp[-1].inst)->next = NULL;
2267e64d31b9Smaya
2268e64d31b9Smaya              state->prog->arb.NumInstructions++;
2269e64d31b9Smaya	   }
2270e64d31b9Smaya	}
227196c5ddc4Srjs#line 2272 "src/mesa/program/program_parse.tab.c"
2272e64d31b9Smaya    break;
2273e64d31b9Smaya
227496c5ddc4Srjs  case 12: /* instruction: ALU_instruction  */
227596c5ddc4Srjs#line 369 "../src/mesa/program/program_parse.y"
227696c5ddc4Srjs        {
2277e64d31b9Smaya	   (yyval.inst) = (yyvsp[0].inst);
2278e64d31b9Smaya           state->prog->arb.NumAluInstructions++;
2279e64d31b9Smaya	}
228096c5ddc4Srjs#line 2281 "src/mesa/program/program_parse.tab.c"
2281e64d31b9Smaya    break;
2282e64d31b9Smaya
228396c5ddc4Srjs  case 13: /* instruction: TexInstruction  */
228496c5ddc4Srjs#line 374 "../src/mesa/program/program_parse.y"
228596c5ddc4Srjs        {
2286e64d31b9Smaya	   (yyval.inst) = (yyvsp[0].inst);
2287e64d31b9Smaya           state->prog->arb.NumTexInstructions++;
2288e64d31b9Smaya	}
228996c5ddc4Srjs#line 2290 "src/mesa/program/program_parse.tab.c"
2290e64d31b9Smaya    break;
2291e64d31b9Smaya
229296c5ddc4Srjs  case 24: /* ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg  */
229396c5ddc4Srjs#line 395 "../src/mesa/program/program_parse.y"
229496c5ddc4Srjs        {
2295e64d31b9Smaya	   (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[-2].dst_reg), & (yyvsp[0].src_reg), NULL, NULL);
2296e64d31b9Smaya	}
229796c5ddc4Srjs#line 2298 "src/mesa/program/program_parse.tab.c"
2298e64d31b9Smaya    break;
2299e64d31b9Smaya
230096c5ddc4Srjs  case 25: /* VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg  */
230196c5ddc4Srjs#line 401 "../src/mesa/program/program_parse.y"
230296c5ddc4Srjs        {
2303e64d31b9Smaya	   (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-3].temp_inst), & (yyvsp[-2].dst_reg), & (yyvsp[0].src_reg), NULL, NULL);
2304e64d31b9Smaya	}
230596c5ddc4Srjs#line 2306 "src/mesa/program/program_parse.tab.c"
2306e64d31b9Smaya    break;
2307e64d31b9Smaya
230896c5ddc4Srjs  case 26: /* SCALARop_instruction: SCALAR_OP maskedDstReg ',' scalarSrcReg  */
230996c5ddc4Srjs#line 407 "../src/mesa/program/program_parse.y"
231096c5ddc4Srjs        {
2311e64d31b9Smaya	   (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-3].temp_inst), & (yyvsp[-2].dst_reg), & (yyvsp[0].src_reg), NULL, NULL);
2312e64d31b9Smaya	}
231396c5ddc4Srjs#line 2314 "src/mesa/program/program_parse.tab.c"
2314e64d31b9Smaya    break;
2315e64d31b9Smaya
231696c5ddc4Srjs  case 27: /* BINSCop_instruction: BINSC_OP maskedDstReg ',' scalarSrcReg ',' scalarSrcReg  */
231796c5ddc4Srjs#line 413 "../src/mesa/program/program_parse.y"
231896c5ddc4Srjs        {
2319e64d31b9Smaya	   (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-5].temp_inst), & (yyvsp[-4].dst_reg), & (yyvsp[-2].src_reg), & (yyvsp[0].src_reg), NULL);
2320e64d31b9Smaya	}
232196c5ddc4Srjs#line 2322 "src/mesa/program/program_parse.tab.c"
2322e64d31b9Smaya    break;
2323e64d31b9Smaya
232496c5ddc4Srjs  case 28: /* BINop_instruction: BIN_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg  */
232596c5ddc4Srjs#line 420 "../src/mesa/program/program_parse.y"
232696c5ddc4Srjs        {
2327e64d31b9Smaya	   (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-5].temp_inst), & (yyvsp[-4].dst_reg), & (yyvsp[-2].src_reg), & (yyvsp[0].src_reg), NULL);
2328e64d31b9Smaya	}
232996c5ddc4Srjs#line 2330 "src/mesa/program/program_parse.tab.c"
2330e64d31b9Smaya    break;
2331e64d31b9Smaya
233296c5ddc4Srjs  case 29: /* TRIop_instruction: TRI_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg  */
233396c5ddc4Srjs#line 427 "../src/mesa/program/program_parse.y"
233496c5ddc4Srjs        {
2335e64d31b9Smaya	   (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));
2336e64d31b9Smaya	}
233796c5ddc4Srjs#line 2338 "src/mesa/program/program_parse.tab.c"
2338e64d31b9Smaya    break;
2339e64d31b9Smaya
234096c5ddc4Srjs  case 30: /* SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget  */
234196c5ddc4Srjs#line 433 "../src/mesa/program/program_parse.y"
234296c5ddc4Srjs        {
2343e64d31b9Smaya	   (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-7].temp_inst), & (yyvsp[-6].dst_reg), & (yyvsp[-4].src_reg), NULL, NULL);
2344e64d31b9Smaya	   if ((yyval.inst) != NULL) {
2345e64d31b9Smaya	      const GLbitfield tex_mask = (1U << (yyvsp[-2].integer));
2346e64d31b9Smaya	      GLbitfield shadow_tex = 0;
2347e64d31b9Smaya	      GLbitfield target_mask = 0;
2348e64d31b9Smaya
2349e64d31b9Smaya
2350e64d31b9Smaya	      (yyval.inst)->Base.TexSrcUnit = (yyvsp[-2].integer);
2351e64d31b9Smaya
2352e64d31b9Smaya	      if ((yyvsp[0].integer) < 0) {
2353e64d31b9Smaya		 shadow_tex = tex_mask;
2354e64d31b9Smaya
2355e64d31b9Smaya		 (yyval.inst)->Base.TexSrcTarget = -(yyvsp[0].integer);
2356e64d31b9Smaya		 (yyval.inst)->Base.TexShadow = 1;
2357e64d31b9Smaya	      } else {
2358e64d31b9Smaya		 (yyval.inst)->Base.TexSrcTarget = (yyvsp[0].integer);
2359e64d31b9Smaya	      }
2360e64d31b9Smaya
2361e64d31b9Smaya	      target_mask = (1U << (yyval.inst)->Base.TexSrcTarget);
2362e64d31b9Smaya
2363e64d31b9Smaya	      /* If this texture unit was previously accessed and that access
2364e64d31b9Smaya	       * had a different texture target, generate an error.
2365e64d31b9Smaya	       *
2366e64d31b9Smaya	       * If this texture unit was previously accessed and that access
2367e64d31b9Smaya	       * had a different shadow mode, generate an error.
2368e64d31b9Smaya	       */
2369e64d31b9Smaya	      if ((state->prog->TexturesUsed[(yyvsp[-2].integer)] != 0)
2370e64d31b9Smaya		  && ((state->prog->TexturesUsed[(yyvsp[-2].integer)] != target_mask)
2371e64d31b9Smaya		      || ((state->prog->ShadowSamplers & tex_mask)
2372e64d31b9Smaya			  != shadow_tex))) {
2373e64d31b9Smaya		 yyerror(& (yylsp[0]), state,
2374e64d31b9Smaya			 "multiple targets used on one texture image unit");
2375e64d31b9Smaya		 YYERROR;
2376e64d31b9Smaya	      }
2377e64d31b9Smaya
2378e64d31b9Smaya
2379e64d31b9Smaya	      state->prog->TexturesUsed[(yyvsp[-2].integer)] |= target_mask;
2380e64d31b9Smaya	      state->prog->ShadowSamplers |= shadow_tex;
2381e64d31b9Smaya	   }
2382e64d31b9Smaya	}
238396c5ddc4Srjs#line 2384 "src/mesa/program/program_parse.tab.c"
2384e64d31b9Smaya    break;
2385e64d31b9Smaya
238696c5ddc4Srjs  case 31: /* KIL_instruction: KIL swizzleSrcReg  */
238796c5ddc4Srjs#line 477 "../src/mesa/program/program_parse.y"
238896c5ddc4Srjs        {
2389e64d31b9Smaya	   (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[0].src_reg), NULL, NULL);
2390e64d31b9Smaya	   state->fragment.UsesKill = 1;
2391e64d31b9Smaya	}
239296c5ddc4Srjs#line 2393 "src/mesa/program/program_parse.tab.c"
2393e64d31b9Smaya    break;
2394e64d31b9Smaya
239596c5ddc4Srjs  case 32: /* TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget  */
239696c5ddc4Srjs#line 484 "../src/mesa/program/program_parse.y"
239796c5ddc4Srjs        {
2398e64d31b9Smaya	   (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));
2399e64d31b9Smaya	   if ((yyval.inst) != NULL) {
2400e64d31b9Smaya	      const GLbitfield tex_mask = (1U << (yyvsp[-2].integer));
2401e64d31b9Smaya	      GLbitfield shadow_tex = 0;
2402e64d31b9Smaya	      GLbitfield target_mask = 0;
2403e64d31b9Smaya
2404e64d31b9Smaya
2405e64d31b9Smaya	      (yyval.inst)->Base.TexSrcUnit = (yyvsp[-2].integer);
2406e64d31b9Smaya
2407e64d31b9Smaya	      if ((yyvsp[0].integer) < 0) {
2408e64d31b9Smaya		 shadow_tex = tex_mask;
2409e64d31b9Smaya
2410e64d31b9Smaya		 (yyval.inst)->Base.TexSrcTarget = -(yyvsp[0].integer);
2411e64d31b9Smaya		 (yyval.inst)->Base.TexShadow = 1;
2412e64d31b9Smaya	      } else {
2413e64d31b9Smaya		 (yyval.inst)->Base.TexSrcTarget = (yyvsp[0].integer);
2414e64d31b9Smaya	      }
2415e64d31b9Smaya
2416e64d31b9Smaya	      target_mask = (1U << (yyval.inst)->Base.TexSrcTarget);
2417e64d31b9Smaya
2418e64d31b9Smaya	      /* If this texture unit was previously accessed and that access
2419e64d31b9Smaya	       * had a different texture target, generate an error.
2420e64d31b9Smaya	       *
2421e64d31b9Smaya	       * If this texture unit was previously accessed and that access
2422e64d31b9Smaya	       * had a different shadow mode, generate an error.
2423e64d31b9Smaya	       */
2424e64d31b9Smaya	      if ((state->prog->TexturesUsed[(yyvsp[-2].integer)] != 0)
2425e64d31b9Smaya		  && ((state->prog->TexturesUsed[(yyvsp[-2].integer)] != target_mask)
2426e64d31b9Smaya		      || ((state->prog->ShadowSamplers & tex_mask)
2427e64d31b9Smaya			  != shadow_tex))) {
2428e64d31b9Smaya		 yyerror(& (yylsp[0]), state,
2429e64d31b9Smaya			 "multiple targets used on one texture image unit");
2430e64d31b9Smaya		 YYERROR;
2431e64d31b9Smaya	      }
2432e64d31b9Smaya
2433e64d31b9Smaya
2434e64d31b9Smaya	      state->prog->TexturesUsed[(yyvsp[-2].integer)] |= target_mask;
2435e64d31b9Smaya	      state->prog->ShadowSamplers |= shadow_tex;
2436e64d31b9Smaya	   }
2437e64d31b9Smaya	}
243896c5ddc4Srjs#line 2439 "src/mesa/program/program_parse.tab.c"
2439e64d31b9Smaya    break;
2440e64d31b9Smaya
244196c5ddc4Srjs  case 33: /* texImageUnit: TEXTURE_UNIT optTexImageUnitNum  */
244296c5ddc4Srjs#line 528 "../src/mesa/program/program_parse.y"
244396c5ddc4Srjs        {
2444e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
2445e64d31b9Smaya	}
244696c5ddc4Srjs#line 2447 "src/mesa/program/program_parse.tab.c"
2447e64d31b9Smaya    break;
2448e64d31b9Smaya
244996c5ddc4Srjs  case 34: /* texTarget: TEX_1D  */
245096c5ddc4Srjs#line 533 "../src/mesa/program/program_parse.y"
245196c5ddc4Srjs                   { (yyval.integer) = TEXTURE_1D_INDEX; }
245296c5ddc4Srjs#line 2453 "src/mesa/program/program_parse.tab.c"
2453e64d31b9Smaya    break;
2454e64d31b9Smaya
245596c5ddc4Srjs  case 35: /* texTarget: TEX_2D  */
245696c5ddc4Srjs#line 534 "../src/mesa/program/program_parse.y"
245796c5ddc4Srjs                   { (yyval.integer) = TEXTURE_2D_INDEX; }
245896c5ddc4Srjs#line 2459 "src/mesa/program/program_parse.tab.c"
2459e64d31b9Smaya    break;
2460e64d31b9Smaya
246196c5ddc4Srjs  case 36: /* texTarget: TEX_3D  */
246296c5ddc4Srjs#line 535 "../src/mesa/program/program_parse.y"
246396c5ddc4Srjs                   { (yyval.integer) = TEXTURE_3D_INDEX; }
246496c5ddc4Srjs#line 2465 "src/mesa/program/program_parse.tab.c"
2465e64d31b9Smaya    break;
2466e64d31b9Smaya
246796c5ddc4Srjs  case 37: /* texTarget: TEX_CUBE  */
246896c5ddc4Srjs#line 536 "../src/mesa/program/program_parse.y"
246996c5ddc4Srjs                   { (yyval.integer) = TEXTURE_CUBE_INDEX; }
247096c5ddc4Srjs#line 2471 "src/mesa/program/program_parse.tab.c"
2471e64d31b9Smaya    break;
2472e64d31b9Smaya
247396c5ddc4Srjs  case 38: /* texTarget: TEX_RECT  */
247496c5ddc4Srjs#line 537 "../src/mesa/program/program_parse.y"
247596c5ddc4Srjs                   { (yyval.integer) = TEXTURE_RECT_INDEX; }
247696c5ddc4Srjs#line 2477 "src/mesa/program/program_parse.tab.c"
2477e64d31b9Smaya    break;
2478e64d31b9Smaya
247996c5ddc4Srjs  case 39: /* texTarget: TEX_SHADOW1D  */
248096c5ddc4Srjs#line 538 "../src/mesa/program/program_parse.y"
248196c5ddc4Srjs                         { (yyval.integer) = -TEXTURE_1D_INDEX; }
248296c5ddc4Srjs#line 2483 "src/mesa/program/program_parse.tab.c"
2483e64d31b9Smaya    break;
2484e64d31b9Smaya
248596c5ddc4Srjs  case 40: /* texTarget: TEX_SHADOW2D  */
248696c5ddc4Srjs#line 539 "../src/mesa/program/program_parse.y"
248796c5ddc4Srjs                         { (yyval.integer) = -TEXTURE_2D_INDEX; }
248896c5ddc4Srjs#line 2489 "src/mesa/program/program_parse.tab.c"
2489e64d31b9Smaya    break;
2490e64d31b9Smaya
249196c5ddc4Srjs  case 41: /* texTarget: TEX_SHADOWRECT  */
249296c5ddc4Srjs#line 540 "../src/mesa/program/program_parse.y"
249396c5ddc4Srjs                         { (yyval.integer) = -TEXTURE_RECT_INDEX; }
249496c5ddc4Srjs#line 2495 "src/mesa/program/program_parse.tab.c"
2495e64d31b9Smaya    break;
2496e64d31b9Smaya
249796c5ddc4Srjs  case 42: /* texTarget: TEX_ARRAY1D  */
249896c5ddc4Srjs#line 541 "../src/mesa/program/program_parse.y"
249996c5ddc4Srjs                              { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; }
250096c5ddc4Srjs#line 2501 "src/mesa/program/program_parse.tab.c"
2501e64d31b9Smaya    break;
2502e64d31b9Smaya
250396c5ddc4Srjs  case 43: /* texTarget: TEX_ARRAY2D  */
250496c5ddc4Srjs#line 542 "../src/mesa/program/program_parse.y"
250596c5ddc4Srjs                              { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; }
250696c5ddc4Srjs#line 2507 "src/mesa/program/program_parse.tab.c"
2507e64d31b9Smaya    break;
2508e64d31b9Smaya
250996c5ddc4Srjs  case 44: /* texTarget: TEX_ARRAYSHADOW1D  */
251096c5ddc4Srjs#line 543 "../src/mesa/program/program_parse.y"
251196c5ddc4Srjs                              { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; }
251296c5ddc4Srjs#line 2513 "src/mesa/program/program_parse.tab.c"
2513e64d31b9Smaya    break;
2514e64d31b9Smaya
251596c5ddc4Srjs  case 45: /* texTarget: TEX_ARRAYSHADOW2D  */
251696c5ddc4Srjs#line 544 "../src/mesa/program/program_parse.y"
251796c5ddc4Srjs                              { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; }
251896c5ddc4Srjs#line 2519 "src/mesa/program/program_parse.tab.c"
2519e64d31b9Smaya    break;
2520e64d31b9Smaya
252196c5ddc4Srjs  case 46: /* SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle  */
252296c5ddc4Srjs#line 548 "../src/mesa/program/program_parse.y"
252396c5ddc4Srjs        {
2524e64d31b9Smaya	   /* FIXME: Is this correct?  Should the extenedSwizzle be applied
2525e64d31b9Smaya	    * FIXME: to the existing swizzle?
2526e64d31b9Smaya	    */
2527e64d31b9Smaya	   (yyvsp[-2].src_reg).Base.Swizzle = (yyvsp[0].swiz_mask).swizzle;
2528e64d31b9Smaya	   (yyvsp[-2].src_reg).Base.Negate = (yyvsp[0].swiz_mask).mask;
2529e64d31b9Smaya
2530e64d31b9Smaya	   (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[-5].temp_inst), & (yyvsp[-4].dst_reg), & (yyvsp[-2].src_reg), NULL, NULL);
2531e64d31b9Smaya	}
253296c5ddc4Srjs#line 2533 "src/mesa/program/program_parse.tab.c"
2533e64d31b9Smaya    break;
2534e64d31b9Smaya
253596c5ddc4Srjs  case 47: /* scalarSrcReg: optionalSign scalarUse  */
253696c5ddc4Srjs#line 560 "../src/mesa/program/program_parse.y"
253796c5ddc4Srjs        {
2538e64d31b9Smaya	   (yyval.src_reg) = (yyvsp[0].src_reg);
2539e64d31b9Smaya
2540e64d31b9Smaya	   if ((yyvsp[-1].negate)) {
2541e64d31b9Smaya	      (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate;
2542e64d31b9Smaya	   }
2543e64d31b9Smaya	}
254496c5ddc4Srjs#line 2545 "src/mesa/program/program_parse.tab.c"
2545e64d31b9Smaya    break;
2546e64d31b9Smaya
254796c5ddc4Srjs  case 48: /* scalarUse: srcReg scalarSuffix  */
254896c5ddc4Srjs#line 570 "../src/mesa/program/program_parse.y"
254996c5ddc4Srjs        {
2550e64d31b9Smaya	   (yyval.src_reg) = (yyvsp[-1].src_reg);
2551e64d31b9Smaya
2552e64d31b9Smaya	   (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle,
2553e64d31b9Smaya						    (yyvsp[0].swiz_mask).swizzle);
2554e64d31b9Smaya	}
255596c5ddc4Srjs#line 2556 "src/mesa/program/program_parse.tab.c"
2556e64d31b9Smaya    break;
2557e64d31b9Smaya
255896c5ddc4Srjs  case 49: /* swizzleSrcReg: optionalSign srcReg swizzleSuffix  */
255996c5ddc4Srjs#line 579 "../src/mesa/program/program_parse.y"
256096c5ddc4Srjs        {
2561e64d31b9Smaya	   (yyval.src_reg) = (yyvsp[-1].src_reg);
2562e64d31b9Smaya
2563e64d31b9Smaya	   if ((yyvsp[-2].negate)) {
2564e64d31b9Smaya	      (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate;
2565e64d31b9Smaya	   }
2566e64d31b9Smaya
2567e64d31b9Smaya	   (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle,
2568e64d31b9Smaya						    (yyvsp[0].swiz_mask).swizzle);
2569e64d31b9Smaya	}
257096c5ddc4Srjs#line 2571 "src/mesa/program/program_parse.tab.c"
2571e64d31b9Smaya    break;
2572e64d31b9Smaya
257396c5ddc4Srjs  case 50: /* maskedDstReg: dstReg optionalMask  */
257496c5ddc4Srjs#line 592 "../src/mesa/program/program_parse.y"
257596c5ddc4Srjs        {
2576e64d31b9Smaya	   (yyval.dst_reg) = (yyvsp[-1].dst_reg);
2577e64d31b9Smaya	   (yyval.dst_reg).WriteMask = (yyvsp[0].swiz_mask).mask;
2578e64d31b9Smaya
2579e64d31b9Smaya	   if ((yyval.dst_reg).File == PROGRAM_OUTPUT) {
2580e64d31b9Smaya	      /* Technically speaking, this should check that it is in
2581e64d31b9Smaya	       * vertex program mode.  However, PositionInvariant can never be
2582e64d31b9Smaya	       * set in fragment program mode, so it is somewhat irrelevant.
2583e64d31b9Smaya	       */
2584e64d31b9Smaya	      if (state->option.PositionInvariant
2585e64d31b9Smaya	       && ((yyval.dst_reg).Index == VARYING_SLOT_POS)) {
2586e64d31b9Smaya		 yyerror(& (yylsp[-1]), state, "position-invariant programs cannot "
2587e64d31b9Smaya			 "write position");
2588e64d31b9Smaya		 YYERROR;
2589e64d31b9Smaya	      }
2590e64d31b9Smaya
2591e64d31b9Smaya              state->prog->info.outputs_written |= BITFIELD64_BIT((yyval.dst_reg).Index);
2592e64d31b9Smaya	   }
2593e64d31b9Smaya	}
259496c5ddc4Srjs#line 2595 "src/mesa/program/program_parse.tab.c"
2595e64d31b9Smaya    break;
2596e64d31b9Smaya
259796c5ddc4Srjs  case 51: /* maskedAddrReg: addrReg addrWriteMask  */
259896c5ddc4Srjs#line 614 "../src/mesa/program/program_parse.y"
259996c5ddc4Srjs        {
2600e64d31b9Smaya	   set_dst_reg(& (yyval.dst_reg), PROGRAM_ADDRESS, 0);
2601e64d31b9Smaya	   (yyval.dst_reg).WriteMask = (yyvsp[0].swiz_mask).mask;
2602e64d31b9Smaya	}
260396c5ddc4Srjs#line 2604 "src/mesa/program/program_parse.tab.c"
2604e64d31b9Smaya    break;
2605e64d31b9Smaya
260696c5ddc4Srjs  case 52: /* extendedSwizzle: extSwizComp ',' extSwizComp ',' extSwizComp ',' extSwizComp  */
260796c5ddc4Srjs#line 621 "../src/mesa/program/program_parse.y"
260896c5ddc4Srjs        {
2609e64d31b9Smaya	   const unsigned xyzw_valid =
2610e64d31b9Smaya	      ((yyvsp[-6].ext_swizzle).xyzw_valid << 0)
2611e64d31b9Smaya	      | ((yyvsp[-4].ext_swizzle).xyzw_valid << 1)
2612e64d31b9Smaya	      | ((yyvsp[-2].ext_swizzle).xyzw_valid << 2)
2613e64d31b9Smaya	      | ((yyvsp[0].ext_swizzle).xyzw_valid << 3);
2614e64d31b9Smaya	   const unsigned rgba_valid =
2615e64d31b9Smaya	      ((yyvsp[-6].ext_swizzle).rgba_valid << 0)
2616e64d31b9Smaya	      | ((yyvsp[-4].ext_swizzle).rgba_valid << 1)
2617e64d31b9Smaya	      | ((yyvsp[-2].ext_swizzle).rgba_valid << 2)
2618e64d31b9Smaya	      | ((yyvsp[0].ext_swizzle).rgba_valid << 3);
2619e64d31b9Smaya
2620e64d31b9Smaya	   /* All of the swizzle components have to be valid in either RGBA
2621e64d31b9Smaya	    * or XYZW.  Note that 0 and 1 are valid in both, so both masks
2622e64d31b9Smaya	    * can have some bits set.
2623e64d31b9Smaya	    *
2624e64d31b9Smaya	    * We somewhat deviate from the spec here.  It would be really hard
2625e64d31b9Smaya	    * to figure out which component is the error, and there probably
2626e64d31b9Smaya	    * isn't a lot of benefit.
2627e64d31b9Smaya	    */
2628e64d31b9Smaya	   if ((rgba_valid != 0x0f) && (xyzw_valid != 0x0f)) {
2629e64d31b9Smaya	      yyerror(& (yylsp[-6]), state, "cannot combine RGBA and XYZW swizzle "
2630e64d31b9Smaya		      "components");
2631e64d31b9Smaya	      YYERROR;
2632e64d31b9Smaya	   }
2633e64d31b9Smaya
2634e64d31b9Smaya	   (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);
2635e64d31b9Smaya	   (yyval.swiz_mask).mask = ((yyvsp[-6].ext_swizzle).negate) | ((yyvsp[-4].ext_swizzle).negate << 1) | ((yyvsp[-2].ext_swizzle).negate << 2)
2636e64d31b9Smaya	      | ((yyvsp[0].ext_swizzle).negate << 3);
2637e64d31b9Smaya	}
263896c5ddc4Srjs#line 2639 "src/mesa/program/program_parse.tab.c"
2639e64d31b9Smaya    break;
2640e64d31b9Smaya
264196c5ddc4Srjs  case 53: /* extSwizComp: optionalSign extSwizSel  */
264296c5ddc4Srjs#line 654 "../src/mesa/program/program_parse.y"
264396c5ddc4Srjs        {
2644e64d31b9Smaya	   (yyval.ext_swizzle) = (yyvsp[0].ext_swizzle);
2645e64d31b9Smaya	   (yyval.ext_swizzle).negate = ((yyvsp[-1].negate)) ? 1 : 0;
2646e64d31b9Smaya	}
264796c5ddc4Srjs#line 2648 "src/mesa/program/program_parse.tab.c"
2648e64d31b9Smaya    break;
2649e64d31b9Smaya
265096c5ddc4Srjs  case 54: /* extSwizSel: INTEGER  */
265196c5ddc4Srjs#line 661 "../src/mesa/program/program_parse.y"
265296c5ddc4Srjs        {
2653e64d31b9Smaya	   if (((yyvsp[0].integer) != 0) && ((yyvsp[0].integer) != 1)) {
2654e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid extended swizzle selector");
2655e64d31b9Smaya	      YYERROR;
2656e64d31b9Smaya	   }
2657e64d31b9Smaya
2658e64d31b9Smaya	   (yyval.ext_swizzle).swz = ((yyvsp[0].integer) == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE;
2659e64d31b9Smaya           (yyval.ext_swizzle).negate = 0;
2660e64d31b9Smaya
2661e64d31b9Smaya	   /* 0 and 1 are valid for both RGBA swizzle names and XYZW
2662e64d31b9Smaya	    * swizzle names.
2663e64d31b9Smaya	    */
2664e64d31b9Smaya	   (yyval.ext_swizzle).xyzw_valid = 1;
2665e64d31b9Smaya	   (yyval.ext_swizzle).rgba_valid = 1;
2666e64d31b9Smaya	}
266796c5ddc4Srjs#line 2668 "src/mesa/program/program_parse.tab.c"
2668e64d31b9Smaya    break;
2669e64d31b9Smaya
267096c5ddc4Srjs  case 55: /* extSwizSel: string  */
267196c5ddc4Srjs#line 677 "../src/mesa/program/program_parse.y"
267296c5ddc4Srjs        {
2673e64d31b9Smaya	   char s;
2674e64d31b9Smaya
2675e64d31b9Smaya	   if (strlen((yyvsp[0].string)) > 1) {
2676e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid extended swizzle selector");
2677e64d31b9Smaya	      YYERROR;
2678e64d31b9Smaya	   }
2679e64d31b9Smaya
2680e64d31b9Smaya	   s = (yyvsp[0].string)[0];
2681e64d31b9Smaya	   free((yyvsp[0].string));
2682e64d31b9Smaya
2683e64d31b9Smaya           (yyval.ext_swizzle).rgba_valid = 0;
2684e64d31b9Smaya           (yyval.ext_swizzle).xyzw_valid = 0;
2685e64d31b9Smaya           (yyval.ext_swizzle).negate = 0;
2686e64d31b9Smaya
2687e64d31b9Smaya	   switch (s) {
2688e64d31b9Smaya	   case 'x':
2689e64d31b9Smaya	      (yyval.ext_swizzle).swz = SWIZZLE_X;
2690e64d31b9Smaya	      (yyval.ext_swizzle).xyzw_valid = 1;
2691e64d31b9Smaya	      break;
2692e64d31b9Smaya	   case 'y':
2693e64d31b9Smaya	      (yyval.ext_swizzle).swz = SWIZZLE_Y;
2694e64d31b9Smaya	      (yyval.ext_swizzle).xyzw_valid = 1;
2695e64d31b9Smaya	      break;
2696e64d31b9Smaya	   case 'z':
2697e64d31b9Smaya	      (yyval.ext_swizzle).swz = SWIZZLE_Z;
2698e64d31b9Smaya	      (yyval.ext_swizzle).xyzw_valid = 1;
2699e64d31b9Smaya	      break;
2700e64d31b9Smaya	   case 'w':
2701e64d31b9Smaya	      (yyval.ext_swizzle).swz = SWIZZLE_W;
2702e64d31b9Smaya	      (yyval.ext_swizzle).xyzw_valid = 1;
2703e64d31b9Smaya	      break;
2704e64d31b9Smaya
2705e64d31b9Smaya	   case 'r':
2706e64d31b9Smaya	      (yyval.ext_swizzle).swz = SWIZZLE_X;
2707e64d31b9Smaya	      (yyval.ext_swizzle).rgba_valid = 1;
2708e64d31b9Smaya	      break;
2709e64d31b9Smaya	   case 'g':
2710e64d31b9Smaya	      (yyval.ext_swizzle).swz = SWIZZLE_Y;
2711e64d31b9Smaya	      (yyval.ext_swizzle).rgba_valid = 1;
2712e64d31b9Smaya	      break;
2713e64d31b9Smaya	   case 'b':
2714e64d31b9Smaya	      (yyval.ext_swizzle).swz = SWIZZLE_Z;
2715e64d31b9Smaya	      (yyval.ext_swizzle).rgba_valid = 1;
2716e64d31b9Smaya	      break;
2717e64d31b9Smaya	   case 'a':
2718e64d31b9Smaya	      (yyval.ext_swizzle).swz = SWIZZLE_W;
2719e64d31b9Smaya	      (yyval.ext_swizzle).rgba_valid = 1;
2720e64d31b9Smaya	      break;
2721e64d31b9Smaya
2722e64d31b9Smaya	   default:
2723e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid extended swizzle selector");
2724e64d31b9Smaya	      YYERROR;
2725e64d31b9Smaya	      break;
2726e64d31b9Smaya	   }
2727e64d31b9Smaya	}
272896c5ddc4Srjs#line 2729 "src/mesa/program/program_parse.tab.c"
2729e64d31b9Smaya    break;
2730e64d31b9Smaya
273196c5ddc4Srjs  case 56: /* srcReg: USED_IDENTIFIER  */
273296c5ddc4Srjs#line 736 "../src/mesa/program/program_parse.y"
273396c5ddc4Srjs        {
2734e64d31b9Smaya	   struct asm_symbol *const s = (struct asm_symbol *)
2735e64d31b9Smaya              _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string));
2736e64d31b9Smaya
2737e64d31b9Smaya	   free((yyvsp[0].string));
2738e64d31b9Smaya
2739e64d31b9Smaya	   if (s == NULL) {
2740e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid operand variable");
2741e64d31b9Smaya	      YYERROR;
2742e64d31b9Smaya	   } else if ((s->type != at_param) && (s->type != at_temp)
2743e64d31b9Smaya		      && (s->type != at_attrib)) {
2744e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid operand variable");
2745e64d31b9Smaya	      YYERROR;
2746e64d31b9Smaya	   } else if ((s->type == at_param) && s->param_is_array) {
2747e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "non-array access to array PARAM");
2748e64d31b9Smaya	      YYERROR;
2749e64d31b9Smaya	   }
2750e64d31b9Smaya
2751e64d31b9Smaya	   init_src_reg(& (yyval.src_reg));
2752e64d31b9Smaya	   switch (s->type) {
2753e64d31b9Smaya	   case at_temp:
2754e64d31b9Smaya	      set_src_reg(& (yyval.src_reg), PROGRAM_TEMPORARY, s->temp_binding);
2755e64d31b9Smaya	      break;
2756e64d31b9Smaya	   case at_param:
2757e64d31b9Smaya              set_src_reg_swz(& (yyval.src_reg), s->param_binding_type,
2758e64d31b9Smaya                              s->param_binding_begin,
2759e64d31b9Smaya                              s->param_binding_swizzle);
2760e64d31b9Smaya	      break;
2761e64d31b9Smaya	   case at_attrib:
2762e64d31b9Smaya	      set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, s->attrib_binding);
2763e64d31b9Smaya              state->prog->info.inputs_read |= BITFIELD64_BIT((yyval.src_reg).Base.Index);
2764e64d31b9Smaya
2765e64d31b9Smaya	      if (!validate_inputs(& (yylsp[0]), state)) {
2766e64d31b9Smaya		 YYERROR;
2767e64d31b9Smaya	      }
2768e64d31b9Smaya	      break;
2769e64d31b9Smaya
2770e64d31b9Smaya	   default:
2771e64d31b9Smaya	      YYERROR;
2772e64d31b9Smaya	      break;
2773e64d31b9Smaya	   }
2774e64d31b9Smaya	}
277596c5ddc4Srjs#line 2776 "src/mesa/program/program_parse.tab.c"
2776e64d31b9Smaya    break;
2777e64d31b9Smaya
277896c5ddc4Srjs  case 57: /* srcReg: attribBinding  */
277996c5ddc4Srjs#line 779 "../src/mesa/program/program_parse.y"
278096c5ddc4Srjs        {
2781e64d31b9Smaya	   set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, (yyvsp[0].attrib));
2782e64d31b9Smaya           state->prog->info.inputs_read |= BITFIELD64_BIT((yyval.src_reg).Base.Index);
2783e64d31b9Smaya
2784e64d31b9Smaya	   if (!validate_inputs(& (yylsp[0]), state)) {
2785e64d31b9Smaya	      YYERROR;
2786e64d31b9Smaya	   }
2787e64d31b9Smaya	}
278896c5ddc4Srjs#line 2789 "src/mesa/program/program_parse.tab.c"
2789e64d31b9Smaya    break;
2790e64d31b9Smaya
279196c5ddc4Srjs  case 58: /* srcReg: progParamArray '[' progParamArrayMem ']'  */
279296c5ddc4Srjs#line 788 "../src/mesa/program/program_parse.y"
279396c5ddc4Srjs        {
2794e64d31b9Smaya	   if (! (yyvsp[-1].src_reg).Base.RelAddr
2795e64d31b9Smaya	       && ((unsigned) (yyvsp[-1].src_reg).Base.Index >= (yyvsp[-3].sym)->param_binding_length)) {
2796e64d31b9Smaya	      yyerror(& (yylsp[-1]), state, "out of bounds array access");
2797e64d31b9Smaya	      YYERROR;
2798e64d31b9Smaya	   }
2799e64d31b9Smaya
2800e64d31b9Smaya	   init_src_reg(& (yyval.src_reg));
2801e64d31b9Smaya	   (yyval.src_reg).Base.File = (yyvsp[-3].sym)->param_binding_type;
2802e64d31b9Smaya
2803e64d31b9Smaya	   if ((yyvsp[-1].src_reg).Base.RelAddr) {
2804e64d31b9Smaya              state->prog->arb.IndirectRegisterFiles |= (1 << (yyval.src_reg).Base.File);
2805e64d31b9Smaya	      (yyvsp[-3].sym)->param_accessed_indirectly = 1;
2806e64d31b9Smaya
2807e64d31b9Smaya	      (yyval.src_reg).Base.RelAddr = 1;
2808e64d31b9Smaya	      (yyval.src_reg).Base.Index = (yyvsp[-1].src_reg).Base.Index;
2809e64d31b9Smaya	      (yyval.src_reg).Symbol = (yyvsp[-3].sym);
2810e64d31b9Smaya	   } else {
2811e64d31b9Smaya	      (yyval.src_reg).Base.Index = (yyvsp[-3].sym)->param_binding_begin + (yyvsp[-1].src_reg).Base.Index;
2812e64d31b9Smaya	   }
2813e64d31b9Smaya	}
281496c5ddc4Srjs#line 2815 "src/mesa/program/program_parse.tab.c"
2815e64d31b9Smaya    break;
2816e64d31b9Smaya
281796c5ddc4Srjs  case 59: /* srcReg: paramSingleItemUse  */
281896c5ddc4Srjs#line 810 "../src/mesa/program/program_parse.y"
281996c5ddc4Srjs        {
282096c5ddc4Srjs           gl_register_file file = ((yyvsp[0].temp_sym).name != NULL)
2821e64d31b9Smaya	      ? (yyvsp[0].temp_sym).param_binding_type
2822e64d31b9Smaya	      : PROGRAM_CONSTANT;
2823e64d31b9Smaya           set_src_reg_swz(& (yyval.src_reg), file, (yyvsp[0].temp_sym).param_binding_begin,
2824e64d31b9Smaya                           (yyvsp[0].temp_sym).param_binding_swizzle);
2825e64d31b9Smaya	}
282696c5ddc4Srjs#line 2827 "src/mesa/program/program_parse.tab.c"
2827e64d31b9Smaya    break;
2828e64d31b9Smaya
282996c5ddc4Srjs  case 60: /* dstReg: resultBinding  */
283096c5ddc4Srjs#line 820 "../src/mesa/program/program_parse.y"
283196c5ddc4Srjs        {
2832e64d31b9Smaya	   set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, (yyvsp[0].result));
2833e64d31b9Smaya	}
283496c5ddc4Srjs#line 2835 "src/mesa/program/program_parse.tab.c"
2835e64d31b9Smaya    break;
2836e64d31b9Smaya
283796c5ddc4Srjs  case 61: /* dstReg: USED_IDENTIFIER  */
283896c5ddc4Srjs#line 824 "../src/mesa/program/program_parse.y"
283996c5ddc4Srjs        {
2840e64d31b9Smaya	   struct asm_symbol *const s = (struct asm_symbol *)
2841e64d31b9Smaya              _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string));
2842e64d31b9Smaya
2843e64d31b9Smaya	   free((yyvsp[0].string));
2844e64d31b9Smaya
2845e64d31b9Smaya	   if (s == NULL) {
2846e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid operand variable");
2847e64d31b9Smaya	      YYERROR;
2848e64d31b9Smaya	   } else if ((s->type != at_output) && (s->type != at_temp)) {
2849e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid operand variable");
2850e64d31b9Smaya	      YYERROR;
2851e64d31b9Smaya	   }
2852e64d31b9Smaya
2853e64d31b9Smaya	   switch (s->type) {
2854e64d31b9Smaya	   case at_temp:
2855e64d31b9Smaya	      set_dst_reg(& (yyval.dst_reg), PROGRAM_TEMPORARY, s->temp_binding);
2856e64d31b9Smaya	      break;
2857e64d31b9Smaya	   case at_output:
2858e64d31b9Smaya	      set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, s->output_binding);
2859e64d31b9Smaya	      break;
2860e64d31b9Smaya	   default:
2861e64d31b9Smaya	      set_dst_reg(& (yyval.dst_reg), s->param_binding_type, s->param_binding_begin);
2862e64d31b9Smaya	      break;
2863e64d31b9Smaya	   }
2864e64d31b9Smaya	}
286596c5ddc4Srjs#line 2866 "src/mesa/program/program_parse.tab.c"
2866e64d31b9Smaya    break;
2867e64d31b9Smaya
286896c5ddc4Srjs  case 62: /* progParamArray: USED_IDENTIFIER  */
286996c5ddc4Srjs#line 853 "../src/mesa/program/program_parse.y"
287096c5ddc4Srjs        {
2871e64d31b9Smaya	   struct asm_symbol *const s = (struct asm_symbol *)
2872e64d31b9Smaya              _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string));
2873e64d31b9Smaya
2874e64d31b9Smaya	   free((yyvsp[0].string));
2875e64d31b9Smaya
2876e64d31b9Smaya	   if (s == NULL) {
2877e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid operand variable");
2878e64d31b9Smaya	      YYERROR;
2879e64d31b9Smaya	   } else if ((s->type != at_param) || !s->param_is_array) {
2880e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "array access to non-PARAM variable");
2881e64d31b9Smaya	      YYERROR;
2882e64d31b9Smaya	   } else {
2883e64d31b9Smaya	      (yyval.sym) = s;
2884e64d31b9Smaya	   }
2885e64d31b9Smaya	}
288696c5ddc4Srjs#line 2887 "src/mesa/program/program_parse.tab.c"
2887e64d31b9Smaya    break;
2888e64d31b9Smaya
288996c5ddc4Srjs  case 65: /* progParamArrayAbs: INTEGER  */
289096c5ddc4Srjs#line 874 "../src/mesa/program/program_parse.y"
289196c5ddc4Srjs        {
2892e64d31b9Smaya	   init_src_reg(& (yyval.src_reg));
2893e64d31b9Smaya	   (yyval.src_reg).Base.Index = (yyvsp[0].integer);
2894e64d31b9Smaya	}
289596c5ddc4Srjs#line 2896 "src/mesa/program/program_parse.tab.c"
2896e64d31b9Smaya    break;
2897e64d31b9Smaya
289896c5ddc4Srjs  case 66: /* progParamArrayRel: addrReg addrComponent addrRegRelOffset  */
289996c5ddc4Srjs#line 881 "../src/mesa/program/program_parse.y"
290096c5ddc4Srjs        {
2901e64d31b9Smaya	   /* FINISHME: Add support for multiple address registers.
2902e64d31b9Smaya	    */
2903e64d31b9Smaya	   /* FINISHME: Add support for 4-component address registers.
2904e64d31b9Smaya	    */
2905e64d31b9Smaya	   init_src_reg(& (yyval.src_reg));
2906e64d31b9Smaya	   (yyval.src_reg).Base.RelAddr = 1;
2907e64d31b9Smaya	   (yyval.src_reg).Base.Index = (yyvsp[0].integer);
2908e64d31b9Smaya	}
290996c5ddc4Srjs#line 2910 "src/mesa/program/program_parse.tab.c"
2910e64d31b9Smaya    break;
2911e64d31b9Smaya
291296c5ddc4Srjs  case 67: /* addrRegRelOffset: %empty  */
291396c5ddc4Srjs#line 892 "../src/mesa/program/program_parse.y"
291496c5ddc4Srjs                               { (yyval.integer) = 0; }
291596c5ddc4Srjs#line 2916 "src/mesa/program/program_parse.tab.c"
2916e64d31b9Smaya    break;
2917e64d31b9Smaya
291896c5ddc4Srjs  case 68: /* addrRegRelOffset: '+' addrRegPosOffset  */
291996c5ddc4Srjs#line 893 "../src/mesa/program/program_parse.y"
292096c5ddc4Srjs                               { (yyval.integer) = (yyvsp[0].integer); }
292196c5ddc4Srjs#line 2922 "src/mesa/program/program_parse.tab.c"
2922e64d31b9Smaya    break;
2923e64d31b9Smaya
292496c5ddc4Srjs  case 69: /* addrRegRelOffset: '-' addrRegNegOffset  */
292596c5ddc4Srjs#line 894 "../src/mesa/program/program_parse.y"
292696c5ddc4Srjs                               { (yyval.integer) = -(yyvsp[0].integer); }
292796c5ddc4Srjs#line 2928 "src/mesa/program/program_parse.tab.c"
2928e64d31b9Smaya    break;
2929e64d31b9Smaya
293096c5ddc4Srjs  case 70: /* addrRegPosOffset: INTEGER  */
293196c5ddc4Srjs#line 898 "../src/mesa/program/program_parse.y"
293296c5ddc4Srjs        {
2933e64d31b9Smaya	   if (((yyvsp[0].integer) < 0) || ((yyvsp[0].integer) > (state->limits->MaxAddressOffset - 1))) {
2934e64d31b9Smaya              char s[100];
293596c5ddc4Srjs              snprintf(s, sizeof(s),
2936e64d31b9Smaya                             "relative address offset too large (%d)", (yyvsp[0].integer));
2937e64d31b9Smaya	      yyerror(& (yylsp[0]), state, s);
2938e64d31b9Smaya	      YYERROR;
2939e64d31b9Smaya	   } else {
2940e64d31b9Smaya	      (yyval.integer) = (yyvsp[0].integer);
2941e64d31b9Smaya	   }
2942e64d31b9Smaya	}
294396c5ddc4Srjs#line 2944 "src/mesa/program/program_parse.tab.c"
2944e64d31b9Smaya    break;
2945e64d31b9Smaya
294696c5ddc4Srjs  case 71: /* addrRegNegOffset: INTEGER  */
294796c5ddc4Srjs#line 912 "../src/mesa/program/program_parse.y"
294896c5ddc4Srjs        {
2949e64d31b9Smaya	   if (((yyvsp[0].integer) < 0) || ((yyvsp[0].integer) > state->limits->MaxAddressOffset)) {
2950e64d31b9Smaya              char s[100];
295196c5ddc4Srjs              snprintf(s, sizeof(s),
2952e64d31b9Smaya                             "relative address offset too large (%d)", (yyvsp[0].integer));
2953e64d31b9Smaya	      yyerror(& (yylsp[0]), state, s);
2954e64d31b9Smaya	      YYERROR;
2955e64d31b9Smaya	   } else {
2956e64d31b9Smaya	      (yyval.integer) = (yyvsp[0].integer);
2957e64d31b9Smaya	   }
2958e64d31b9Smaya	}
295996c5ddc4Srjs#line 2960 "src/mesa/program/program_parse.tab.c"
2960e64d31b9Smaya    break;
2961e64d31b9Smaya
296296c5ddc4Srjs  case 72: /* addrReg: USED_IDENTIFIER  */
296396c5ddc4Srjs#line 926 "../src/mesa/program/program_parse.y"
296496c5ddc4Srjs        {
2965e64d31b9Smaya	   struct asm_symbol *const s = (struct asm_symbol *)
2966e64d31b9Smaya              _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string));
2967e64d31b9Smaya
2968e64d31b9Smaya	   free((yyvsp[0].string));
2969e64d31b9Smaya
2970e64d31b9Smaya	   if (s == NULL) {
2971e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid array member");
2972e64d31b9Smaya	      YYERROR;
2973e64d31b9Smaya	   } else if (s->type != at_address) {
2974e64d31b9Smaya	      yyerror(& (yylsp[0]), state,
2975e64d31b9Smaya		      "invalid variable for indexed array access");
2976e64d31b9Smaya	      YYERROR;
2977e64d31b9Smaya	   } else {
2978e64d31b9Smaya	      (yyval.sym) = s;
2979e64d31b9Smaya	   }
2980e64d31b9Smaya	}
298196c5ddc4Srjs#line 2982 "src/mesa/program/program_parse.tab.c"
2982e64d31b9Smaya    break;
2983e64d31b9Smaya
298496c5ddc4Srjs  case 73: /* addrComponent: MASK1  */
298596c5ddc4Srjs#line 946 "../src/mesa/program/program_parse.y"
298696c5ddc4Srjs        {
2987e64d31b9Smaya	   if ((yyvsp[0].swiz_mask).mask != WRITEMASK_X) {
2988e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid address component selector");
2989e64d31b9Smaya	      YYERROR;
2990e64d31b9Smaya	   } else {
2991e64d31b9Smaya	      (yyval.swiz_mask) = (yyvsp[0].swiz_mask);
2992e64d31b9Smaya	   }
2993e64d31b9Smaya	}
299496c5ddc4Srjs#line 2995 "src/mesa/program/program_parse.tab.c"
2995e64d31b9Smaya    break;
2996e64d31b9Smaya
299796c5ddc4Srjs  case 74: /* addrWriteMask: MASK1  */
299896c5ddc4Srjs#line 957 "../src/mesa/program/program_parse.y"
299996c5ddc4Srjs        {
3000e64d31b9Smaya	   if ((yyvsp[0].swiz_mask).mask != WRITEMASK_X) {
3001e64d31b9Smaya	      yyerror(& (yylsp[0]), state,
3002e64d31b9Smaya		      "address register write mask must be \".x\"");
3003e64d31b9Smaya	      YYERROR;
3004e64d31b9Smaya	   } else {
3005e64d31b9Smaya	      (yyval.swiz_mask) = (yyvsp[0].swiz_mask);
3006e64d31b9Smaya	   }
3007e64d31b9Smaya	}
300896c5ddc4Srjs#line 3009 "src/mesa/program/program_parse.tab.c"
3009e64d31b9Smaya    break;
3010e64d31b9Smaya
301196c5ddc4Srjs  case 79: /* swizzleSuffix: %empty  */
301296c5ddc4Srjs#line 973 "../src/mesa/program/program_parse.y"
301396c5ddc4Srjs                       { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; }
301496c5ddc4Srjs#line 3015 "src/mesa/program/program_parse.tab.c"
3015e64d31b9Smaya    break;
3016e64d31b9Smaya
301796c5ddc4Srjs  case 84: /* optionalMask: %empty  */
301896c5ddc4Srjs#line 977 "../src/mesa/program/program_parse.y"
301996c5ddc4Srjs                       { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; }
302096c5ddc4Srjs#line 3021 "src/mesa/program/program_parse.tab.c"
3021e64d31b9Smaya    break;
3022e64d31b9Smaya
302396c5ddc4Srjs  case 91: /* ATTRIB_statement: ATTRIB IDENTIFIER '=' attribBinding  */
302496c5ddc4Srjs#line 989 "../src/mesa/program/program_parse.y"
302596c5ddc4Srjs        {
3026e64d31b9Smaya	   struct asm_symbol *const s =
3027e64d31b9Smaya	      declare_variable(state, (yyvsp[-2].string), at_attrib, & (yylsp[-2]));
3028e64d31b9Smaya
3029e64d31b9Smaya	   if (s == NULL) {
3030e64d31b9Smaya	      free((yyvsp[-2].string));
3031e64d31b9Smaya	      YYERROR;
3032e64d31b9Smaya	   } else {
3033e64d31b9Smaya	      s->attrib_binding = (yyvsp[0].attrib);
3034e64d31b9Smaya	      state->InputsBound |= BITFIELD64_BIT(s->attrib_binding);
3035e64d31b9Smaya
3036e64d31b9Smaya	      if (!validate_inputs(& (yylsp[0]), state)) {
3037e64d31b9Smaya		 YYERROR;
3038e64d31b9Smaya	      }
3039e64d31b9Smaya	   }
3040e64d31b9Smaya	}
304196c5ddc4Srjs#line 3042 "src/mesa/program/program_parse.tab.c"
3042e64d31b9Smaya    break;
3043e64d31b9Smaya
304496c5ddc4Srjs  case 92: /* attribBinding: VERTEX vtxAttribItem  */
304596c5ddc4Srjs#line 1008 "../src/mesa/program/program_parse.y"
304696c5ddc4Srjs        {
3047e64d31b9Smaya	   (yyval.attrib) = (yyvsp[0].attrib);
3048e64d31b9Smaya	}
304996c5ddc4Srjs#line 3050 "src/mesa/program/program_parse.tab.c"
3050e64d31b9Smaya    break;
3051e64d31b9Smaya
305296c5ddc4Srjs  case 93: /* attribBinding: FRAGMENT fragAttribItem  */
305396c5ddc4Srjs#line 1012 "../src/mesa/program/program_parse.y"
305496c5ddc4Srjs        {
3055e64d31b9Smaya	   (yyval.attrib) = (yyvsp[0].attrib);
3056e64d31b9Smaya	}
305796c5ddc4Srjs#line 3058 "src/mesa/program/program_parse.tab.c"
3058e64d31b9Smaya    break;
3059e64d31b9Smaya
306096c5ddc4Srjs  case 94: /* vtxAttribItem: POSITION  */
306196c5ddc4Srjs#line 1018 "../src/mesa/program/program_parse.y"
306296c5ddc4Srjs        {
3063e64d31b9Smaya	   (yyval.attrib) = VERT_ATTRIB_POS;
3064e64d31b9Smaya	}
306596c5ddc4Srjs#line 3066 "src/mesa/program/program_parse.tab.c"
3066e64d31b9Smaya    break;
3067e64d31b9Smaya
306896c5ddc4Srjs  case 95: /* vtxAttribItem: NORMAL  */
306996c5ddc4Srjs#line 1022 "../src/mesa/program/program_parse.y"
307096c5ddc4Srjs        {
3071e64d31b9Smaya	   (yyval.attrib) = VERT_ATTRIB_NORMAL;
3072e64d31b9Smaya	}
307396c5ddc4Srjs#line 3074 "src/mesa/program/program_parse.tab.c"
3074e64d31b9Smaya    break;
3075e64d31b9Smaya
307696c5ddc4Srjs  case 96: /* vtxAttribItem: COLOR optColorType  */
307796c5ddc4Srjs#line 1026 "../src/mesa/program/program_parse.y"
307896c5ddc4Srjs        {
3079e64d31b9Smaya	   (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[0].integer);
3080e64d31b9Smaya	}
308196c5ddc4Srjs#line 3082 "src/mesa/program/program_parse.tab.c"
3082e64d31b9Smaya    break;
3083e64d31b9Smaya
308496c5ddc4Srjs  case 97: /* vtxAttribItem: FOGCOORD  */
308596c5ddc4Srjs#line 1030 "../src/mesa/program/program_parse.y"
308696c5ddc4Srjs        {
3087e64d31b9Smaya	   (yyval.attrib) = VERT_ATTRIB_FOG;
3088e64d31b9Smaya	}
308996c5ddc4Srjs#line 3090 "src/mesa/program/program_parse.tab.c"
3090e64d31b9Smaya    break;
3091e64d31b9Smaya
309296c5ddc4Srjs  case 98: /* vtxAttribItem: TEXCOORD optTexCoordUnitNum  */
309396c5ddc4Srjs#line 1034 "../src/mesa/program/program_parse.y"
309496c5ddc4Srjs        {
3095e64d31b9Smaya	   (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[0].integer);
3096e64d31b9Smaya	}
309796c5ddc4Srjs#line 3098 "src/mesa/program/program_parse.tab.c"
3098e64d31b9Smaya    break;
3099e64d31b9Smaya
310096c5ddc4Srjs  case 99: /* vtxAttribItem: MATRIXINDEX '[' vtxWeightNum ']'  */
310196c5ddc4Srjs#line 1038 "../src/mesa/program/program_parse.y"
310296c5ddc4Srjs        {
3103e64d31b9Smaya	   yyerror(& (yylsp[-3]), state, "GL_ARB_matrix_palette not supported");
3104e64d31b9Smaya	   YYERROR;
3105e64d31b9Smaya	}
310696c5ddc4Srjs#line 3107 "src/mesa/program/program_parse.tab.c"
3107e64d31b9Smaya    break;
3108e64d31b9Smaya
310996c5ddc4Srjs  case 100: /* vtxAttribItem: VTXATTRIB '[' vtxAttribNum ']'  */
311096c5ddc4Srjs#line 1043 "../src/mesa/program/program_parse.y"
311196c5ddc4Srjs        {
3112e64d31b9Smaya	   (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[-1].integer);
3113e64d31b9Smaya	}
311496c5ddc4Srjs#line 3115 "src/mesa/program/program_parse.tab.c"
3115e64d31b9Smaya    break;
3116e64d31b9Smaya
311796c5ddc4Srjs  case 101: /* vtxAttribNum: INTEGER  */
311896c5ddc4Srjs#line 1049 "../src/mesa/program/program_parse.y"
311996c5ddc4Srjs        {
3120e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->limits->MaxAttribs) {
3121e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid vertex attribute reference");
3122e64d31b9Smaya	      YYERROR;
3123e64d31b9Smaya	   }
3124e64d31b9Smaya
3125e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3126e64d31b9Smaya	}
312796c5ddc4Srjs#line 3128 "src/mesa/program/program_parse.tab.c"
3128e64d31b9Smaya    break;
3129e64d31b9Smaya
313096c5ddc4Srjs  case 103: /* fragAttribItem: POSITION  */
313196c5ddc4Srjs#line 1062 "../src/mesa/program/program_parse.y"
313296c5ddc4Srjs        {
3133e64d31b9Smaya	   (yyval.attrib) = VARYING_SLOT_POS;
3134e64d31b9Smaya	}
313596c5ddc4Srjs#line 3136 "src/mesa/program/program_parse.tab.c"
3136e64d31b9Smaya    break;
3137e64d31b9Smaya
313896c5ddc4Srjs  case 104: /* fragAttribItem: COLOR optColorType  */
313996c5ddc4Srjs#line 1066 "../src/mesa/program/program_parse.y"
314096c5ddc4Srjs        {
3141e64d31b9Smaya	   (yyval.attrib) = VARYING_SLOT_COL0 + (yyvsp[0].integer);
3142e64d31b9Smaya	}
314396c5ddc4Srjs#line 3144 "src/mesa/program/program_parse.tab.c"
3144e64d31b9Smaya    break;
3145e64d31b9Smaya
314696c5ddc4Srjs  case 105: /* fragAttribItem: FOGCOORD  */
314796c5ddc4Srjs#line 1070 "../src/mesa/program/program_parse.y"
314896c5ddc4Srjs        {
3149e64d31b9Smaya	   (yyval.attrib) = VARYING_SLOT_FOGC;
3150e64d31b9Smaya	}
315196c5ddc4Srjs#line 3152 "src/mesa/program/program_parse.tab.c"
3152e64d31b9Smaya    break;
3153e64d31b9Smaya
315496c5ddc4Srjs  case 106: /* fragAttribItem: TEXCOORD optTexCoordUnitNum  */
315596c5ddc4Srjs#line 1074 "../src/mesa/program/program_parse.y"
315696c5ddc4Srjs        {
3157e64d31b9Smaya	   (yyval.attrib) = VARYING_SLOT_TEX0 + (yyvsp[0].integer);
3158e64d31b9Smaya	}
315996c5ddc4Srjs#line 3160 "src/mesa/program/program_parse.tab.c"
3160e64d31b9Smaya    break;
3161e64d31b9Smaya
316296c5ddc4Srjs  case 109: /* PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit  */
316396c5ddc4Srjs#line 1082 "../src/mesa/program/program_parse.y"
316496c5ddc4Srjs        {
3165e64d31b9Smaya	   struct asm_symbol *const s =
3166e64d31b9Smaya	      declare_variable(state, (yyvsp[-1].string), at_param, & (yylsp[-1]));
3167e64d31b9Smaya
3168e64d31b9Smaya	   if (s == NULL) {
3169e64d31b9Smaya	      free((yyvsp[-1].string));
3170e64d31b9Smaya	      YYERROR;
3171e64d31b9Smaya	   } else {
3172e64d31b9Smaya	      s->param_binding_type = (yyvsp[0].temp_sym).param_binding_type;
3173e64d31b9Smaya	      s->param_binding_begin = (yyvsp[0].temp_sym).param_binding_begin;
3174e64d31b9Smaya	      s->param_binding_length = (yyvsp[0].temp_sym).param_binding_length;
3175e64d31b9Smaya              s->param_binding_swizzle = (yyvsp[0].temp_sym).param_binding_swizzle;
3176e64d31b9Smaya	      s->param_is_array = 0;
3177e64d31b9Smaya	   }
3178e64d31b9Smaya	}
317996c5ddc4Srjs#line 3180 "src/mesa/program/program_parse.tab.c"
3180e64d31b9Smaya    break;
3181e64d31b9Smaya
318296c5ddc4Srjs  case 110: /* PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit  */
318396c5ddc4Srjs#line 1100 "../src/mesa/program/program_parse.y"
318496c5ddc4Srjs        {
3185e64d31b9Smaya	   if (((yyvsp[-2].integer) != 0) && ((unsigned) (yyvsp[-2].integer) != (yyvsp[0].temp_sym).param_binding_length)) {
3186e64d31b9Smaya	      free((yyvsp[-4].string));
318796c5ddc4Srjs	      yyerror(& (yylsp[-2]), state,
3188e64d31b9Smaya		      "parameter array size and number of bindings must match");
3189e64d31b9Smaya	      YYERROR;
3190e64d31b9Smaya	   } else {
3191e64d31b9Smaya	      struct asm_symbol *const s =
3192e64d31b9Smaya		 declare_variable(state, (yyvsp[-4].string), (yyvsp[0].temp_sym).type, & (yylsp[-4]));
3193e64d31b9Smaya
3194e64d31b9Smaya	      if (s == NULL) {
3195e64d31b9Smaya		 free((yyvsp[-4].string));
3196e64d31b9Smaya		 YYERROR;
3197e64d31b9Smaya	      } else {
3198e64d31b9Smaya		 s->param_binding_type = (yyvsp[0].temp_sym).param_binding_type;
3199e64d31b9Smaya		 s->param_binding_begin = (yyvsp[0].temp_sym).param_binding_begin;
3200e64d31b9Smaya		 s->param_binding_length = (yyvsp[0].temp_sym).param_binding_length;
3201e64d31b9Smaya                 s->param_binding_swizzle = SWIZZLE_XYZW;
3202e64d31b9Smaya		 s->param_is_array = 1;
3203e64d31b9Smaya	      }
3204e64d31b9Smaya	   }
3205e64d31b9Smaya	}
320696c5ddc4Srjs#line 3207 "src/mesa/program/program_parse.tab.c"
3207e64d31b9Smaya    break;
3208e64d31b9Smaya
320996c5ddc4Srjs  case 111: /* optArraySize: %empty  */
321096c5ddc4Srjs#line 1125 "../src/mesa/program/program_parse.y"
321196c5ddc4Srjs        {
3212e64d31b9Smaya	   (yyval.integer) = 0;
3213e64d31b9Smaya	}
321496c5ddc4Srjs#line 3215 "src/mesa/program/program_parse.tab.c"
3215e64d31b9Smaya    break;
3216e64d31b9Smaya
321796c5ddc4Srjs  case 112: /* optArraySize: INTEGER  */
321896c5ddc4Srjs#line 1129 "../src/mesa/program/program_parse.y"
321996c5ddc4Srjs        {
3220e64d31b9Smaya	   if (((yyvsp[0].integer) < 1) || ((unsigned) (yyvsp[0].integer) > state->limits->MaxParameters)) {
3221e64d31b9Smaya              char msg[100];
322296c5ddc4Srjs              snprintf(msg, sizeof(msg),
3223e64d31b9Smaya                             "invalid parameter array size (size=%d max=%u)",
3224e64d31b9Smaya                             (yyvsp[0].integer), state->limits->MaxParameters);
3225e64d31b9Smaya	      yyerror(& (yylsp[0]), state, msg);
3226e64d31b9Smaya	      YYERROR;
3227e64d31b9Smaya	   } else {
3228e64d31b9Smaya	      (yyval.integer) = (yyvsp[0].integer);
3229e64d31b9Smaya	   }
3230e64d31b9Smaya	}
323196c5ddc4Srjs#line 3232 "src/mesa/program/program_parse.tab.c"
3232e64d31b9Smaya    break;
3233e64d31b9Smaya
323496c5ddc4Srjs  case 113: /* paramSingleInit: '=' paramSingleItemDecl  */
323596c5ddc4Srjs#line 1144 "../src/mesa/program/program_parse.y"
323696c5ddc4Srjs        {
3237e64d31b9Smaya	   (yyval.temp_sym) = (yyvsp[0].temp_sym);
3238e64d31b9Smaya	}
323996c5ddc4Srjs#line 3240 "src/mesa/program/program_parse.tab.c"
3240e64d31b9Smaya    break;
3241e64d31b9Smaya
324296c5ddc4Srjs  case 114: /* paramMultipleInit: '=' '{' paramMultInitList '}'  */
324396c5ddc4Srjs#line 1150 "../src/mesa/program/program_parse.y"
324496c5ddc4Srjs        {
3245e64d31b9Smaya	   (yyval.temp_sym) = (yyvsp[-1].temp_sym);
3246e64d31b9Smaya	}
324796c5ddc4Srjs#line 3248 "src/mesa/program/program_parse.tab.c"
3248e64d31b9Smaya    break;
3249e64d31b9Smaya
325096c5ddc4Srjs  case 116: /* paramMultInitList: paramMultInitList ',' paramMultipleItem  */
325196c5ddc4Srjs#line 1157 "../src/mesa/program/program_parse.y"
325296c5ddc4Srjs        {
3253e64d31b9Smaya	   (yyvsp[-2].temp_sym).param_binding_length += (yyvsp[0].temp_sym).param_binding_length;
3254e64d31b9Smaya	   (yyval.temp_sym) = (yyvsp[-2].temp_sym);
3255e64d31b9Smaya	}
325696c5ddc4Srjs#line 3257 "src/mesa/program/program_parse.tab.c"
3257e64d31b9Smaya    break;
3258e64d31b9Smaya
325996c5ddc4Srjs  case 117: /* paramSingleItemDecl: stateSingleItem  */
326096c5ddc4Srjs#line 1164 "../src/mesa/program/program_parse.y"
326196c5ddc4Srjs        {
3262e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3263e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3264e64d31b9Smaya	   initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[0].state));
3265e64d31b9Smaya	}
326696c5ddc4Srjs#line 3267 "src/mesa/program/program_parse.tab.c"
3267e64d31b9Smaya    break;
3268e64d31b9Smaya
326996c5ddc4Srjs  case 118: /* paramSingleItemDecl: programSingleItem  */
327096c5ddc4Srjs#line 1170 "../src/mesa/program/program_parse.y"
327196c5ddc4Srjs        {
3272e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3273e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3274e64d31b9Smaya	   initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[0].state));
3275e64d31b9Smaya	}
327696c5ddc4Srjs#line 3277 "src/mesa/program/program_parse.tab.c"
3277e64d31b9Smaya    break;
3278e64d31b9Smaya
327996c5ddc4Srjs  case 119: /* paramSingleItemDecl: paramConstDecl  */
328096c5ddc4Srjs#line 1176 "../src/mesa/program/program_parse.y"
328196c5ddc4Srjs        {
3282e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3283e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3284e64d31b9Smaya	   initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[0].vector), GL_TRUE);
3285e64d31b9Smaya	}
328696c5ddc4Srjs#line 3287 "src/mesa/program/program_parse.tab.c"
3287e64d31b9Smaya    break;
3288e64d31b9Smaya
328996c5ddc4Srjs  case 120: /* paramSingleItemUse: stateSingleItem  */
329096c5ddc4Srjs#line 1184 "../src/mesa/program/program_parse.y"
329196c5ddc4Srjs        {
3292e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3293e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3294e64d31b9Smaya	   initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[0].state));
3295e64d31b9Smaya	}
329696c5ddc4Srjs#line 3297 "src/mesa/program/program_parse.tab.c"
3297e64d31b9Smaya    break;
3298e64d31b9Smaya
329996c5ddc4Srjs  case 121: /* paramSingleItemUse: programSingleItem  */
330096c5ddc4Srjs#line 1190 "../src/mesa/program/program_parse.y"
330196c5ddc4Srjs        {
3302e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3303e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3304e64d31b9Smaya	   initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[0].state));
3305e64d31b9Smaya	}
330696c5ddc4Srjs#line 3307 "src/mesa/program/program_parse.tab.c"
3307e64d31b9Smaya    break;
3308e64d31b9Smaya
330996c5ddc4Srjs  case 122: /* paramSingleItemUse: paramConstUse  */
331096c5ddc4Srjs#line 1196 "../src/mesa/program/program_parse.y"
331196c5ddc4Srjs        {
3312e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3313e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3314e64d31b9Smaya	   initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[0].vector), GL_TRUE);
3315e64d31b9Smaya	}
331696c5ddc4Srjs#line 3317 "src/mesa/program/program_parse.tab.c"
3317e64d31b9Smaya    break;
3318e64d31b9Smaya
331996c5ddc4Srjs  case 123: /* paramMultipleItem: stateMultipleItem  */
332096c5ddc4Srjs#line 1204 "../src/mesa/program/program_parse.y"
332196c5ddc4Srjs        {
3322e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3323e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3324e64d31b9Smaya	   initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[0].state));
3325e64d31b9Smaya	}
332696c5ddc4Srjs#line 3327 "src/mesa/program/program_parse.tab.c"
3327e64d31b9Smaya    break;
3328e64d31b9Smaya
332996c5ddc4Srjs  case 124: /* paramMultipleItem: programMultipleItem  */
333096c5ddc4Srjs#line 1210 "../src/mesa/program/program_parse.y"
333196c5ddc4Srjs        {
3332e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3333e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3334e64d31b9Smaya	   initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[0].state));
3335e64d31b9Smaya	}
333696c5ddc4Srjs#line 3337 "src/mesa/program/program_parse.tab.c"
3337e64d31b9Smaya    break;
3338e64d31b9Smaya
333996c5ddc4Srjs  case 125: /* paramMultipleItem: paramConstDecl  */
334096c5ddc4Srjs#line 1216 "../src/mesa/program/program_parse.y"
334196c5ddc4Srjs        {
3342e64d31b9Smaya	   memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym)));
3343e64d31b9Smaya	   (yyval.temp_sym).param_binding_begin = ~0;
3344e64d31b9Smaya	   initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[0].vector), GL_FALSE);
3345e64d31b9Smaya	}
334696c5ddc4Srjs#line 3347 "src/mesa/program/program_parse.tab.c"
3347e64d31b9Smaya    break;
3348e64d31b9Smaya
334996c5ddc4Srjs  case 126: /* stateMultipleItem: stateSingleItem  */
335096c5ddc4Srjs#line 1223 "../src/mesa/program/program_parse.y"
335196c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
335296c5ddc4Srjs#line 3353 "src/mesa/program/program_parse.tab.c"
3353e64d31b9Smaya    break;
3354e64d31b9Smaya
335596c5ddc4Srjs  case 127: /* stateMultipleItem: STATE stateMatrixRows  */
335696c5ddc4Srjs#line 1224 "../src/mesa/program/program_parse.y"
335796c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
335896c5ddc4Srjs#line 3359 "src/mesa/program/program_parse.tab.c"
3359e64d31b9Smaya    break;
3360e64d31b9Smaya
336196c5ddc4Srjs  case 128: /* stateSingleItem: STATE stateMaterialItem  */
336296c5ddc4Srjs#line 1227 "../src/mesa/program/program_parse.y"
336396c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
336496c5ddc4Srjs#line 3365 "src/mesa/program/program_parse.tab.c"
3365e64d31b9Smaya    break;
3366e64d31b9Smaya
336796c5ddc4Srjs  case 129: /* stateSingleItem: STATE stateLightItem  */
336896c5ddc4Srjs#line 1228 "../src/mesa/program/program_parse.y"
336996c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
337096c5ddc4Srjs#line 3371 "src/mesa/program/program_parse.tab.c"
3371e64d31b9Smaya    break;
3372e64d31b9Smaya
337396c5ddc4Srjs  case 130: /* stateSingleItem: STATE stateLightModelItem  */
337496c5ddc4Srjs#line 1229 "../src/mesa/program/program_parse.y"
337596c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
337696c5ddc4Srjs#line 3377 "src/mesa/program/program_parse.tab.c"
3377e64d31b9Smaya    break;
3378e64d31b9Smaya
337996c5ddc4Srjs  case 131: /* stateSingleItem: STATE stateLightProdItem  */
338096c5ddc4Srjs#line 1230 "../src/mesa/program/program_parse.y"
338196c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
338296c5ddc4Srjs#line 3383 "src/mesa/program/program_parse.tab.c"
3383e64d31b9Smaya    break;
3384e64d31b9Smaya
338596c5ddc4Srjs  case 132: /* stateSingleItem: STATE stateTexGenItem  */
338696c5ddc4Srjs#line 1231 "../src/mesa/program/program_parse.y"
338796c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
338896c5ddc4Srjs#line 3389 "src/mesa/program/program_parse.tab.c"
3389e64d31b9Smaya    break;
3390e64d31b9Smaya
339196c5ddc4Srjs  case 133: /* stateSingleItem: STATE stateTexEnvItem  */
339296c5ddc4Srjs#line 1232 "../src/mesa/program/program_parse.y"
339396c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
339496c5ddc4Srjs#line 3395 "src/mesa/program/program_parse.tab.c"
3395e64d31b9Smaya    break;
3396e64d31b9Smaya
339796c5ddc4Srjs  case 134: /* stateSingleItem: STATE stateFogItem  */
339896c5ddc4Srjs#line 1233 "../src/mesa/program/program_parse.y"
339996c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
340096c5ddc4Srjs#line 3401 "src/mesa/program/program_parse.tab.c"
3401e64d31b9Smaya    break;
3402e64d31b9Smaya
340396c5ddc4Srjs  case 135: /* stateSingleItem: STATE stateClipPlaneItem  */
340496c5ddc4Srjs#line 1234 "../src/mesa/program/program_parse.y"
340596c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
340696c5ddc4Srjs#line 3407 "src/mesa/program/program_parse.tab.c"
3407e64d31b9Smaya    break;
3408e64d31b9Smaya
340996c5ddc4Srjs  case 136: /* stateSingleItem: STATE statePointItem  */
341096c5ddc4Srjs#line 1235 "../src/mesa/program/program_parse.y"
341196c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
341296c5ddc4Srjs#line 3413 "src/mesa/program/program_parse.tab.c"
3413e64d31b9Smaya    break;
3414e64d31b9Smaya
341596c5ddc4Srjs  case 137: /* stateSingleItem: STATE stateMatrixRow  */
341696c5ddc4Srjs#line 1236 "../src/mesa/program/program_parse.y"
341796c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
341896c5ddc4Srjs#line 3419 "src/mesa/program/program_parse.tab.c"
3419e64d31b9Smaya    break;
3420e64d31b9Smaya
342196c5ddc4Srjs  case 138: /* stateSingleItem: STATE stateDepthItem  */
342296c5ddc4Srjs#line 1237 "../src/mesa/program/program_parse.y"
342396c5ddc4Srjs                                          { memcpy((yyval.state), (yyvsp[0].state), sizeof((yyval.state))); }
342496c5ddc4Srjs#line 3425 "src/mesa/program/program_parse.tab.c"
3425e64d31b9Smaya    break;
3426e64d31b9Smaya
342796c5ddc4Srjs  case 139: /* stateMaterialItem: MATERIAL optFaceType stateMatProperty  */
342896c5ddc4Srjs#line 1241 "../src/mesa/program/program_parse.y"
342996c5ddc4Srjs        {
3430e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3431e64d31b9Smaya	   (yyval.state)[0] = STATE_MATERIAL;
343296c5ddc4Srjs	   (yyval.state)[1] = (yyvsp[0].integer) + (yyvsp[-1].integer);
343396c5ddc4Srjs	   (yyval.state)[2] = 0;
3434e64d31b9Smaya	}
343596c5ddc4Srjs#line 3436 "src/mesa/program/program_parse.tab.c"
3436e64d31b9Smaya    break;
3437e64d31b9Smaya
343896c5ddc4Srjs  case 140: /* stateMatProperty: ambDiffSpecPropertyMaterial  */
343996c5ddc4Srjs#line 1250 "../src/mesa/program/program_parse.y"
344096c5ddc4Srjs        {
3441e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3442e64d31b9Smaya	}
344396c5ddc4Srjs#line 3444 "src/mesa/program/program_parse.tab.c"
3444e64d31b9Smaya    break;
3445e64d31b9Smaya
344696c5ddc4Srjs  case 141: /* stateMatProperty: EMISSION  */
344796c5ddc4Srjs#line 1254 "../src/mesa/program/program_parse.y"
344896c5ddc4Srjs        {
344996c5ddc4Srjs	   (yyval.integer) = MAT_ATTRIB_FRONT_EMISSION;
3450e64d31b9Smaya	}
345196c5ddc4Srjs#line 3452 "src/mesa/program/program_parse.tab.c"
3452e64d31b9Smaya    break;
3453e64d31b9Smaya
345496c5ddc4Srjs  case 142: /* stateMatProperty: SHININESS  */
345596c5ddc4Srjs#line 1258 "../src/mesa/program/program_parse.y"
345696c5ddc4Srjs        {
345796c5ddc4Srjs	   (yyval.integer) = MAT_ATTRIB_FRONT_SHININESS;
3458e64d31b9Smaya	}
345996c5ddc4Srjs#line 3460 "src/mesa/program/program_parse.tab.c"
3460e64d31b9Smaya    break;
3461e64d31b9Smaya
346296c5ddc4Srjs  case 143: /* stateLightItem: LIGHT '[' stateLightNumber ']' stateLightProperty  */
346396c5ddc4Srjs#line 1264 "../src/mesa/program/program_parse.y"
346496c5ddc4Srjs        {
3465e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3466e64d31b9Smaya	   (yyval.state)[0] = STATE_LIGHT;
3467e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-2].integer);
3468e64d31b9Smaya	   (yyval.state)[2] = (yyvsp[0].integer);
3469e64d31b9Smaya	}
347096c5ddc4Srjs#line 3471 "src/mesa/program/program_parse.tab.c"
3471e64d31b9Smaya    break;
3472e64d31b9Smaya
347396c5ddc4Srjs  case 144: /* stateLightProperty: ambDiffSpecPropertyLight  */
347496c5ddc4Srjs#line 1273 "../src/mesa/program/program_parse.y"
347596c5ddc4Srjs        {
3476e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3477e64d31b9Smaya	}
347896c5ddc4Srjs#line 3479 "src/mesa/program/program_parse.tab.c"
3479e64d31b9Smaya    break;
3480e64d31b9Smaya
348196c5ddc4Srjs  case 145: /* stateLightProperty: POSITION  */
348296c5ddc4Srjs#line 1277 "../src/mesa/program/program_parse.y"
348396c5ddc4Srjs        {
3484e64d31b9Smaya	   (yyval.integer) = STATE_POSITION;
3485e64d31b9Smaya	}
348696c5ddc4Srjs#line 3487 "src/mesa/program/program_parse.tab.c"
3487e64d31b9Smaya    break;
3488e64d31b9Smaya
348996c5ddc4Srjs  case 146: /* stateLightProperty: ATTENUATION  */
349096c5ddc4Srjs#line 1281 "../src/mesa/program/program_parse.y"
349196c5ddc4Srjs        {
3492e64d31b9Smaya	   if (!state->ctx->Extensions.EXT_point_parameters) {
3493e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "GL_ARB_point_parameters not supported");
3494e64d31b9Smaya	      YYERROR;
3495e64d31b9Smaya	   }
3496e64d31b9Smaya
3497e64d31b9Smaya	   (yyval.integer) = STATE_ATTENUATION;
3498e64d31b9Smaya	}
349996c5ddc4Srjs#line 3500 "src/mesa/program/program_parse.tab.c"
3500e64d31b9Smaya    break;
3501e64d31b9Smaya
350296c5ddc4Srjs  case 147: /* stateLightProperty: SPOT stateSpotProperty  */
350396c5ddc4Srjs#line 1290 "../src/mesa/program/program_parse.y"
350496c5ddc4Srjs        {
3505e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3506e64d31b9Smaya	}
350796c5ddc4Srjs#line 3508 "src/mesa/program/program_parse.tab.c"
3508e64d31b9Smaya    break;
3509e64d31b9Smaya
351096c5ddc4Srjs  case 148: /* stateLightProperty: HALF  */
351196c5ddc4Srjs#line 1294 "../src/mesa/program/program_parse.y"
351296c5ddc4Srjs        {
3513e64d31b9Smaya	   (yyval.integer) = STATE_HALF_VECTOR;
3514e64d31b9Smaya	}
351596c5ddc4Srjs#line 3516 "src/mesa/program/program_parse.tab.c"
3516e64d31b9Smaya    break;
3517e64d31b9Smaya
351896c5ddc4Srjs  case 149: /* stateSpotProperty: DIRECTION  */
351996c5ddc4Srjs#line 1300 "../src/mesa/program/program_parse.y"
352096c5ddc4Srjs        {
3521e64d31b9Smaya	   (yyval.integer) = STATE_SPOT_DIRECTION;
3522e64d31b9Smaya	}
352396c5ddc4Srjs#line 3524 "src/mesa/program/program_parse.tab.c"
3524e64d31b9Smaya    break;
3525e64d31b9Smaya
352696c5ddc4Srjs  case 150: /* stateLightModelItem: LIGHTMODEL stateLModProperty  */
352796c5ddc4Srjs#line 1306 "../src/mesa/program/program_parse.y"
352896c5ddc4Srjs        {
3529e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[0].state)[0];
3530e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[0].state)[1];
3531e64d31b9Smaya	}
353296c5ddc4Srjs#line 3533 "src/mesa/program/program_parse.tab.c"
3533e64d31b9Smaya    break;
3534e64d31b9Smaya
353596c5ddc4Srjs  case 151: /* stateLModProperty: AMBIENT  */
353696c5ddc4Srjs#line 1313 "../src/mesa/program/program_parse.y"
353796c5ddc4Srjs        {
3538e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3539e64d31b9Smaya	   (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT;
3540e64d31b9Smaya	}
354196c5ddc4Srjs#line 3542 "src/mesa/program/program_parse.tab.c"
3542e64d31b9Smaya    break;
3543e64d31b9Smaya
354496c5ddc4Srjs  case 152: /* stateLModProperty: optFaceType SCENECOLOR  */
354596c5ddc4Srjs#line 1318 "../src/mesa/program/program_parse.y"
354696c5ddc4Srjs        {
3547e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3548e64d31b9Smaya	   (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR;
3549e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-1].integer);
3550e64d31b9Smaya	}
355196c5ddc4Srjs#line 3552 "src/mesa/program/program_parse.tab.c"
3552e64d31b9Smaya    break;
3553e64d31b9Smaya
355496c5ddc4Srjs  case 153: /* stateLightProdItem: LIGHTPROD '[' stateLightNumber ']' optFaceType stateLProdProperty  */
355596c5ddc4Srjs#line 1326 "../src/mesa/program/program_parse.y"
355696c5ddc4Srjs        {
3557e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3558e64d31b9Smaya	   (yyval.state)[0] = STATE_LIGHTPROD;
3559e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-3].integer);
356096c5ddc4Srjs	   (yyval.state)[2] = (yyvsp[0].integer) + (yyvsp[-1].integer);
356196c5ddc4Srjs	   (yyval.state)[3] = 0;
3562e64d31b9Smaya	}
356396c5ddc4Srjs#line 3564 "src/mesa/program/program_parse.tab.c"
3564e64d31b9Smaya    break;
3565e64d31b9Smaya
356696c5ddc4Srjs  case 155: /* stateTexEnvItem: TEXENV optLegacyTexUnitNum stateTexEnvProperty  */
356796c5ddc4Srjs#line 1338 "../src/mesa/program/program_parse.y"
356896c5ddc4Srjs        {
3569e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3570e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[0].integer);
3571e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-1].integer);
3572e64d31b9Smaya	}
357396c5ddc4Srjs#line 3574 "src/mesa/program/program_parse.tab.c"
3574e64d31b9Smaya    break;
3575e64d31b9Smaya
357696c5ddc4Srjs  case 156: /* stateTexEnvProperty: COLOR  */
357796c5ddc4Srjs#line 1346 "../src/mesa/program/program_parse.y"
357896c5ddc4Srjs        {
3579e64d31b9Smaya	   (yyval.integer) = STATE_TEXENV_COLOR;
3580e64d31b9Smaya	}
358196c5ddc4Srjs#line 3582 "src/mesa/program/program_parse.tab.c"
3582e64d31b9Smaya    break;
3583e64d31b9Smaya
358496c5ddc4Srjs  case 157: /* ambDiffSpecPropertyMaterial: AMBIENT  */
358596c5ddc4Srjs#line 1352 "../src/mesa/program/program_parse.y"
358696c5ddc4Srjs        {
358796c5ddc4Srjs	   (yyval.integer) = MAT_ATTRIB_FRONT_AMBIENT;
3588e64d31b9Smaya	}
358996c5ddc4Srjs#line 3590 "src/mesa/program/program_parse.tab.c"
3590e64d31b9Smaya    break;
3591e64d31b9Smaya
359296c5ddc4Srjs  case 158: /* ambDiffSpecPropertyMaterial: DIFFUSE  */
359396c5ddc4Srjs#line 1356 "../src/mesa/program/program_parse.y"
359496c5ddc4Srjs        {
359596c5ddc4Srjs	   (yyval.integer) = MAT_ATTRIB_FRONT_DIFFUSE;
3596e64d31b9Smaya	}
359796c5ddc4Srjs#line 3598 "src/mesa/program/program_parse.tab.c"
3598e64d31b9Smaya    break;
3599e64d31b9Smaya
360096c5ddc4Srjs  case 159: /* ambDiffSpecPropertyMaterial: SPECULAR  */
360196c5ddc4Srjs#line 1360 "../src/mesa/program/program_parse.y"
360296c5ddc4Srjs        {
360396c5ddc4Srjs	   (yyval.integer) = MAT_ATTRIB_FRONT_SPECULAR;
3604e64d31b9Smaya	}
360596c5ddc4Srjs#line 3606 "src/mesa/program/program_parse.tab.c"
3606e64d31b9Smaya    break;
3607e64d31b9Smaya
360896c5ddc4Srjs  case 160: /* ambDiffSpecPropertyLight: AMBIENT  */
360996c5ddc4Srjs#line 1366 "../src/mesa/program/program_parse.y"
361096c5ddc4Srjs        {
361196c5ddc4Srjs           (yyval.integer) = STATE_AMBIENT;
361296c5ddc4Srjs        }
361396c5ddc4Srjs#line 3614 "src/mesa/program/program_parse.tab.c"
361496c5ddc4Srjs    break;
361596c5ddc4Srjs
361696c5ddc4Srjs  case 161: /* ambDiffSpecPropertyLight: DIFFUSE  */
361796c5ddc4Srjs#line 1370 "../src/mesa/program/program_parse.y"
361896c5ddc4Srjs        {
361996c5ddc4Srjs           (yyval.integer) = STATE_DIFFUSE;
362096c5ddc4Srjs        }
362196c5ddc4Srjs#line 3622 "src/mesa/program/program_parse.tab.c"
362296c5ddc4Srjs    break;
362396c5ddc4Srjs
362496c5ddc4Srjs  case 162: /* ambDiffSpecPropertyLight: SPECULAR  */
362596c5ddc4Srjs#line 1374 "../src/mesa/program/program_parse.y"
362696c5ddc4Srjs        {
362796c5ddc4Srjs           (yyval.integer) = STATE_SPECULAR;
362896c5ddc4Srjs        }
362996c5ddc4Srjs#line 3630 "src/mesa/program/program_parse.tab.c"
363096c5ddc4Srjs    break;
363196c5ddc4Srjs
363296c5ddc4Srjs  case 163: /* stateLightNumber: INTEGER  */
363396c5ddc4Srjs#line 1380 "../src/mesa/program/program_parse.y"
363496c5ddc4Srjs        {
3635e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->MaxLights) {
3636e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid light selector");
3637e64d31b9Smaya	      YYERROR;
3638e64d31b9Smaya	   }
3639e64d31b9Smaya
3640e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3641e64d31b9Smaya	}
364296c5ddc4Srjs#line 3643 "src/mesa/program/program_parse.tab.c"
3643e64d31b9Smaya    break;
3644e64d31b9Smaya
364596c5ddc4Srjs  case 164: /* stateTexGenItem: TEXGEN optTexCoordUnitNum stateTexGenType stateTexGenCoord  */
364696c5ddc4Srjs#line 1391 "../src/mesa/program/program_parse.y"
364796c5ddc4Srjs        {
3648e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3649e64d31b9Smaya	   (yyval.state)[0] = STATE_TEXGEN;
3650e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-2].integer);
3651e64d31b9Smaya	   (yyval.state)[2] = (yyvsp[-1].integer) + (yyvsp[0].integer);
3652e64d31b9Smaya	}
365396c5ddc4Srjs#line 3654 "src/mesa/program/program_parse.tab.c"
3654e64d31b9Smaya    break;
3655e64d31b9Smaya
365696c5ddc4Srjs  case 165: /* stateTexGenType: EYE  */
365796c5ddc4Srjs#line 1400 "../src/mesa/program/program_parse.y"
365896c5ddc4Srjs        {
3659e64d31b9Smaya	   (yyval.integer) = STATE_TEXGEN_EYE_S;
3660e64d31b9Smaya	}
366196c5ddc4Srjs#line 3662 "src/mesa/program/program_parse.tab.c"
3662e64d31b9Smaya    break;
3663e64d31b9Smaya
366496c5ddc4Srjs  case 166: /* stateTexGenType: OBJECT  */
366596c5ddc4Srjs#line 1404 "../src/mesa/program/program_parse.y"
366696c5ddc4Srjs        {
3667e64d31b9Smaya	   (yyval.integer) = STATE_TEXGEN_OBJECT_S;
3668e64d31b9Smaya	}
366996c5ddc4Srjs#line 3670 "src/mesa/program/program_parse.tab.c"
3670e64d31b9Smaya    break;
3671e64d31b9Smaya
367296c5ddc4Srjs  case 167: /* stateTexGenCoord: TEXGEN_S  */
367396c5ddc4Srjs#line 1409 "../src/mesa/program/program_parse.y"
367496c5ddc4Srjs        {
3675e64d31b9Smaya	   (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S;
3676e64d31b9Smaya	}
367796c5ddc4Srjs#line 3678 "src/mesa/program/program_parse.tab.c"
3678e64d31b9Smaya    break;
3679e64d31b9Smaya
368096c5ddc4Srjs  case 168: /* stateTexGenCoord: TEXGEN_T  */
368196c5ddc4Srjs#line 1413 "../src/mesa/program/program_parse.y"
368296c5ddc4Srjs        {
3683e64d31b9Smaya	   (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S;
3684e64d31b9Smaya	}
368596c5ddc4Srjs#line 3686 "src/mesa/program/program_parse.tab.c"
3686e64d31b9Smaya    break;
3687e64d31b9Smaya
368896c5ddc4Srjs  case 169: /* stateTexGenCoord: TEXGEN_R  */
368996c5ddc4Srjs#line 1417 "../src/mesa/program/program_parse.y"
369096c5ddc4Srjs        {
3691e64d31b9Smaya	   (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S;
3692e64d31b9Smaya	}
369396c5ddc4Srjs#line 3694 "src/mesa/program/program_parse.tab.c"
3694e64d31b9Smaya    break;
3695e64d31b9Smaya
369696c5ddc4Srjs  case 170: /* stateTexGenCoord: TEXGEN_Q  */
369796c5ddc4Srjs#line 1421 "../src/mesa/program/program_parse.y"
369896c5ddc4Srjs        {
3699e64d31b9Smaya	   (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S;
3700e64d31b9Smaya	}
370196c5ddc4Srjs#line 3702 "src/mesa/program/program_parse.tab.c"
3702e64d31b9Smaya    break;
3703e64d31b9Smaya
370496c5ddc4Srjs  case 171: /* stateFogItem: FOG stateFogProperty  */
370596c5ddc4Srjs#line 1427 "../src/mesa/program/program_parse.y"
370696c5ddc4Srjs        {
3707e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3708e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[0].integer);
3709e64d31b9Smaya	}
371096c5ddc4Srjs#line 3711 "src/mesa/program/program_parse.tab.c"
3711e64d31b9Smaya    break;
3712e64d31b9Smaya
371396c5ddc4Srjs  case 172: /* stateFogProperty: COLOR  */
371496c5ddc4Srjs#line 1434 "../src/mesa/program/program_parse.y"
371596c5ddc4Srjs        {
3716e64d31b9Smaya	   (yyval.integer) = STATE_FOG_COLOR;
3717e64d31b9Smaya	}
371896c5ddc4Srjs#line 3719 "src/mesa/program/program_parse.tab.c"
3719e64d31b9Smaya    break;
3720e64d31b9Smaya
372196c5ddc4Srjs  case 173: /* stateFogProperty: PARAMS  */
372296c5ddc4Srjs#line 1438 "../src/mesa/program/program_parse.y"
372396c5ddc4Srjs        {
3724e64d31b9Smaya	   (yyval.integer) = STATE_FOG_PARAMS;
3725e64d31b9Smaya	}
372696c5ddc4Srjs#line 3727 "src/mesa/program/program_parse.tab.c"
3727e64d31b9Smaya    break;
3728e64d31b9Smaya
372996c5ddc4Srjs  case 174: /* stateClipPlaneItem: CLIP '[' stateClipPlaneNum ']' PLANE  */
373096c5ddc4Srjs#line 1444 "../src/mesa/program/program_parse.y"
373196c5ddc4Srjs        {
3732e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3733e64d31b9Smaya	   (yyval.state)[0] = STATE_CLIPPLANE;
3734e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-2].integer);
3735e64d31b9Smaya	}
373696c5ddc4Srjs#line 3737 "src/mesa/program/program_parse.tab.c"
3737e64d31b9Smaya    break;
3738e64d31b9Smaya
373996c5ddc4Srjs  case 175: /* stateClipPlaneNum: INTEGER  */
374096c5ddc4Srjs#line 1452 "../src/mesa/program/program_parse.y"
374196c5ddc4Srjs        {
3742e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->MaxClipPlanes) {
3743e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid clip plane selector");
3744e64d31b9Smaya	      YYERROR;
3745e64d31b9Smaya	   }
3746e64d31b9Smaya
3747e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3748e64d31b9Smaya	}
374996c5ddc4Srjs#line 3750 "src/mesa/program/program_parse.tab.c"
3750e64d31b9Smaya    break;
3751e64d31b9Smaya
375296c5ddc4Srjs  case 176: /* statePointItem: POINT_TOK statePointProperty  */
375396c5ddc4Srjs#line 1463 "../src/mesa/program/program_parse.y"
375496c5ddc4Srjs        {
3755e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
3756e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[0].integer);
3757e64d31b9Smaya	}
375896c5ddc4Srjs#line 3759 "src/mesa/program/program_parse.tab.c"
3759e64d31b9Smaya    break;
3760e64d31b9Smaya
376196c5ddc4Srjs  case 177: /* statePointProperty: SIZE_TOK  */
376296c5ddc4Srjs#line 1470 "../src/mesa/program/program_parse.y"
376396c5ddc4Srjs        {
3764e64d31b9Smaya	   (yyval.integer) = STATE_POINT_SIZE;
3765e64d31b9Smaya	}
376696c5ddc4Srjs#line 3767 "src/mesa/program/program_parse.tab.c"
3767e64d31b9Smaya    break;
3768e64d31b9Smaya
376996c5ddc4Srjs  case 178: /* statePointProperty: ATTENUATION  */
377096c5ddc4Srjs#line 1474 "../src/mesa/program/program_parse.y"
377196c5ddc4Srjs        {
3772e64d31b9Smaya	   (yyval.integer) = STATE_POINT_ATTENUATION;
3773e64d31b9Smaya	}
377496c5ddc4Srjs#line 3775 "src/mesa/program/program_parse.tab.c"
3775e64d31b9Smaya    break;
3776e64d31b9Smaya
377796c5ddc4Srjs  case 179: /* stateMatrixRow: stateMatrixItem ROW '[' stateMatrixRowNum ']'  */
377896c5ddc4Srjs#line 1480 "../src/mesa/program/program_parse.y"
377996c5ddc4Srjs        {
378096c5ddc4Srjs	   (yyval.state)[0] = (yyvsp[-4].state)[0] + (yyvsp[-4].state)[2];
3781e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-4].state)[1];
3782e64d31b9Smaya	   (yyval.state)[2] = (yyvsp[-1].integer);
3783e64d31b9Smaya	   (yyval.state)[3] = (yyvsp[-1].integer);
3784e64d31b9Smaya	}
378596c5ddc4Srjs#line 3786 "src/mesa/program/program_parse.tab.c"
3786e64d31b9Smaya    break;
3787e64d31b9Smaya
378896c5ddc4Srjs  case 180: /* stateMatrixRows: stateMatrixItem optMatrixRows  */
378996c5ddc4Srjs#line 1489 "../src/mesa/program/program_parse.y"
379096c5ddc4Srjs        {
379196c5ddc4Srjs	   (yyval.state)[0] = (yyvsp[-1].state)[0] + (yyvsp[-1].state)[2];
3792e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-1].state)[1];
3793e64d31b9Smaya	   (yyval.state)[2] = (yyvsp[0].state)[2];
3794e64d31b9Smaya	   (yyval.state)[3] = (yyvsp[0].state)[3];
3795e64d31b9Smaya	}
379696c5ddc4Srjs#line 3797 "src/mesa/program/program_parse.tab.c"
3797e64d31b9Smaya    break;
3798e64d31b9Smaya
379996c5ddc4Srjs  case 181: /* optMatrixRows: %empty  */
380096c5ddc4Srjs#line 1498 "../src/mesa/program/program_parse.y"
380196c5ddc4Srjs        {
3802e64d31b9Smaya	   (yyval.state)[2] = 0;
3803e64d31b9Smaya	   (yyval.state)[3] = 3;
3804e64d31b9Smaya	}
380596c5ddc4Srjs#line 3806 "src/mesa/program/program_parse.tab.c"
3806e64d31b9Smaya    break;
3807e64d31b9Smaya
380896c5ddc4Srjs  case 182: /* optMatrixRows: ROW '[' stateMatrixRowNum DOT_DOT stateMatrixRowNum ']'  */
380996c5ddc4Srjs#line 1503 "../src/mesa/program/program_parse.y"
381096c5ddc4Srjs        {
3811e64d31b9Smaya	   /* It seems logical that the matrix row range specifier would have
3812e64d31b9Smaya	    * to specify a range or more than one row (i.e., $5 > $3).
3813e64d31b9Smaya	    * However, the ARB_vertex_program spec says "a program will fail
3814e64d31b9Smaya	    * to load if <a> is greater than <b>."  This means that $3 == $5
3815e64d31b9Smaya	    * is valid.
3816e64d31b9Smaya	    */
3817e64d31b9Smaya	   if ((yyvsp[-3].integer) > (yyvsp[-1].integer)) {
3818e64d31b9Smaya	      yyerror(& (yylsp[-3]), state, "invalid matrix row range");
3819e64d31b9Smaya	      YYERROR;
3820e64d31b9Smaya	   }
3821e64d31b9Smaya
3822e64d31b9Smaya	   (yyval.state)[2] = (yyvsp[-3].integer);
3823e64d31b9Smaya	   (yyval.state)[3] = (yyvsp[-1].integer);
3824e64d31b9Smaya	}
382596c5ddc4Srjs#line 3826 "src/mesa/program/program_parse.tab.c"
3826e64d31b9Smaya    break;
3827e64d31b9Smaya
382896c5ddc4Srjs  case 183: /* stateMatrixItem: MATRIX stateMatrixName stateOptMatModifier  */
382996c5ddc4Srjs#line 1521 "../src/mesa/program/program_parse.y"
383096c5ddc4Srjs        {
3831e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[-1].state)[0];
3832e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-1].state)[1];
3833e64d31b9Smaya	   (yyval.state)[2] = (yyvsp[0].integer);
3834e64d31b9Smaya	}
383596c5ddc4Srjs#line 3836 "src/mesa/program/program_parse.tab.c"
3836e64d31b9Smaya    break;
3837e64d31b9Smaya
383896c5ddc4Srjs  case 184: /* stateOptMatModifier: %empty  */
383996c5ddc4Srjs#line 1529 "../src/mesa/program/program_parse.y"
384096c5ddc4Srjs        {
384196c5ddc4Srjs	   (yyval.integer) = STATE_MATRIX_NO_MODIFIER;
3842e64d31b9Smaya	}
384396c5ddc4Srjs#line 3844 "src/mesa/program/program_parse.tab.c"
3844e64d31b9Smaya    break;
3845e64d31b9Smaya
384696c5ddc4Srjs  case 185: /* stateOptMatModifier: stateMatModifier  */
384796c5ddc4Srjs#line 1533 "../src/mesa/program/program_parse.y"
384896c5ddc4Srjs        {
3849e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3850e64d31b9Smaya	}
385196c5ddc4Srjs#line 3852 "src/mesa/program/program_parse.tab.c"
3852e64d31b9Smaya    break;
3853e64d31b9Smaya
385496c5ddc4Srjs  case 186: /* stateMatModifier: INVERSE  */
385596c5ddc4Srjs#line 1539 "../src/mesa/program/program_parse.y"
385696c5ddc4Srjs        {
3857e64d31b9Smaya	   (yyval.integer) = STATE_MATRIX_INVERSE;
3858e64d31b9Smaya	}
385996c5ddc4Srjs#line 3860 "src/mesa/program/program_parse.tab.c"
3860e64d31b9Smaya    break;
3861e64d31b9Smaya
386296c5ddc4Srjs  case 187: /* stateMatModifier: TRANSPOSE  */
386396c5ddc4Srjs#line 1543 "../src/mesa/program/program_parse.y"
386496c5ddc4Srjs        {
3865e64d31b9Smaya	   (yyval.integer) = STATE_MATRIX_TRANSPOSE;
3866e64d31b9Smaya	}
386796c5ddc4Srjs#line 3868 "src/mesa/program/program_parse.tab.c"
3868e64d31b9Smaya    break;
3869e64d31b9Smaya
387096c5ddc4Srjs  case 188: /* stateMatModifier: INVTRANS  */
387196c5ddc4Srjs#line 1547 "../src/mesa/program/program_parse.y"
387296c5ddc4Srjs        {
3873e64d31b9Smaya	   (yyval.integer) = STATE_MATRIX_INVTRANS;
3874e64d31b9Smaya	}
387596c5ddc4Srjs#line 3876 "src/mesa/program/program_parse.tab.c"
3876e64d31b9Smaya    break;
3877e64d31b9Smaya
387896c5ddc4Srjs  case 189: /* stateMatrixRowNum: INTEGER  */
387996c5ddc4Srjs#line 1553 "../src/mesa/program/program_parse.y"
388096c5ddc4Srjs        {
3881e64d31b9Smaya	   if ((yyvsp[0].integer) > 3) {
3882e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid matrix row reference");
3883e64d31b9Smaya	      YYERROR;
3884e64d31b9Smaya	   }
3885e64d31b9Smaya
3886e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3887e64d31b9Smaya	}
388896c5ddc4Srjs#line 3889 "src/mesa/program/program_parse.tab.c"
3889e64d31b9Smaya    break;
3890e64d31b9Smaya
389196c5ddc4Srjs  case 190: /* stateMatrixName: MODELVIEW stateOptModMatNum  */
389296c5ddc4Srjs#line 1564 "../src/mesa/program/program_parse.y"
389396c5ddc4Srjs        {
3894e64d31b9Smaya	   (yyval.state)[0] = STATE_MODELVIEW_MATRIX;
3895e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[0].integer);
3896e64d31b9Smaya	}
389796c5ddc4Srjs#line 3898 "src/mesa/program/program_parse.tab.c"
3898e64d31b9Smaya    break;
3899e64d31b9Smaya
390096c5ddc4Srjs  case 191: /* stateMatrixName: PROJECTION  */
390196c5ddc4Srjs#line 1569 "../src/mesa/program/program_parse.y"
390296c5ddc4Srjs        {
3903e64d31b9Smaya	   (yyval.state)[0] = STATE_PROJECTION_MATRIX;
3904e64d31b9Smaya	   (yyval.state)[1] = 0;
3905e64d31b9Smaya	}
390696c5ddc4Srjs#line 3907 "src/mesa/program/program_parse.tab.c"
3907e64d31b9Smaya    break;
3908e64d31b9Smaya
390996c5ddc4Srjs  case 192: /* stateMatrixName: MVP  */
391096c5ddc4Srjs#line 1574 "../src/mesa/program/program_parse.y"
391196c5ddc4Srjs        {
3912e64d31b9Smaya	   (yyval.state)[0] = STATE_MVP_MATRIX;
3913e64d31b9Smaya	   (yyval.state)[1] = 0;
3914e64d31b9Smaya	}
391596c5ddc4Srjs#line 3916 "src/mesa/program/program_parse.tab.c"
3916e64d31b9Smaya    break;
3917e64d31b9Smaya
391896c5ddc4Srjs  case 193: /* stateMatrixName: TEXTURE optTexCoordUnitNum  */
391996c5ddc4Srjs#line 1579 "../src/mesa/program/program_parse.y"
392096c5ddc4Srjs        {
3921e64d31b9Smaya	   (yyval.state)[0] = STATE_TEXTURE_MATRIX;
3922e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[0].integer);
3923e64d31b9Smaya	}
392496c5ddc4Srjs#line 3925 "src/mesa/program/program_parse.tab.c"
3925e64d31b9Smaya    break;
3926e64d31b9Smaya
392796c5ddc4Srjs  case 194: /* stateMatrixName: PALETTE '[' statePaletteMatNum ']'  */
392896c5ddc4Srjs#line 1584 "../src/mesa/program/program_parse.y"
392996c5ddc4Srjs        {
3930e64d31b9Smaya	   yyerror(& (yylsp[-3]), state, "GL_ARB_matrix_palette not supported");
3931e64d31b9Smaya	   YYERROR;
3932e64d31b9Smaya	}
393396c5ddc4Srjs#line 3934 "src/mesa/program/program_parse.tab.c"
3934e64d31b9Smaya    break;
3935e64d31b9Smaya
393696c5ddc4Srjs  case 195: /* stateMatrixName: MAT_PROGRAM '[' stateProgramMatNum ']'  */
393796c5ddc4Srjs#line 1589 "../src/mesa/program/program_parse.y"
393896c5ddc4Srjs        {
3939e64d31b9Smaya	   (yyval.state)[0] = STATE_PROGRAM_MATRIX;
3940e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[-1].integer);
3941e64d31b9Smaya	}
394296c5ddc4Srjs#line 3943 "src/mesa/program/program_parse.tab.c"
3943e64d31b9Smaya    break;
3944e64d31b9Smaya
394596c5ddc4Srjs  case 196: /* stateOptModMatNum: %empty  */
394696c5ddc4Srjs#line 1596 "../src/mesa/program/program_parse.y"
394796c5ddc4Srjs        {
3948e64d31b9Smaya	   (yyval.integer) = 0;
3949e64d31b9Smaya	}
395096c5ddc4Srjs#line 3951 "src/mesa/program/program_parse.tab.c"
3951e64d31b9Smaya    break;
3952e64d31b9Smaya
395396c5ddc4Srjs  case 197: /* stateOptModMatNum: '[' stateModMatNum ']'  */
395496c5ddc4Srjs#line 1600 "../src/mesa/program/program_parse.y"
395596c5ddc4Srjs        {
3956e64d31b9Smaya	   (yyval.integer) = (yyvsp[-1].integer);
3957e64d31b9Smaya	}
395896c5ddc4Srjs#line 3959 "src/mesa/program/program_parse.tab.c"
3959e64d31b9Smaya    break;
3960e64d31b9Smaya
396196c5ddc4Srjs  case 198: /* stateModMatNum: INTEGER  */
396296c5ddc4Srjs#line 1605 "../src/mesa/program/program_parse.y"
396396c5ddc4Srjs        {
3964e64d31b9Smaya	   /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
3965e64d31b9Smaya	    * zero is valid.
3966e64d31b9Smaya	    */
3967e64d31b9Smaya	   if ((yyvsp[0].integer) != 0) {
3968e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid modelview matrix index");
3969e64d31b9Smaya	      YYERROR;
3970e64d31b9Smaya	   }
3971e64d31b9Smaya
3972e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3973e64d31b9Smaya	}
397496c5ddc4Srjs#line 3975 "src/mesa/program/program_parse.tab.c"
3975e64d31b9Smaya    break;
3976e64d31b9Smaya
397796c5ddc4Srjs  case 199: /* statePaletteMatNum: INTEGER  */
397896c5ddc4Srjs#line 1618 "../src/mesa/program/program_parse.y"
397996c5ddc4Srjs        {
3980e64d31b9Smaya	   /* Since GL_ARB_matrix_palette isn't supported, just let any value
3981e64d31b9Smaya	    * through here.  The error will be generated later.
3982e64d31b9Smaya	    */
3983e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3984e64d31b9Smaya	}
398596c5ddc4Srjs#line 3986 "src/mesa/program/program_parse.tab.c"
3986e64d31b9Smaya    break;
3987e64d31b9Smaya
398896c5ddc4Srjs  case 200: /* stateProgramMatNum: INTEGER  */
398996c5ddc4Srjs#line 1626 "../src/mesa/program/program_parse.y"
399096c5ddc4Srjs        {
3991e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->MaxProgramMatrices) {
3992e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program matrix selector");
3993e64d31b9Smaya	      YYERROR;
3994e64d31b9Smaya	   }
3995e64d31b9Smaya
3996e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
3997e64d31b9Smaya	}
399896c5ddc4Srjs#line 3999 "src/mesa/program/program_parse.tab.c"
3999e64d31b9Smaya    break;
4000e64d31b9Smaya
400196c5ddc4Srjs  case 201: /* stateDepthItem: DEPTH RANGE  */
400296c5ddc4Srjs#line 1637 "../src/mesa/program/program_parse.y"
400396c5ddc4Srjs        {
4004e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
4005e64d31b9Smaya	   (yyval.state)[0] = STATE_DEPTH_RANGE;
4006e64d31b9Smaya	}
400796c5ddc4Srjs#line 4008 "src/mesa/program/program_parse.tab.c"
4008e64d31b9Smaya    break;
4009e64d31b9Smaya
401096c5ddc4Srjs  case 206: /* progEnvParams: PROGRAM ENV '[' progEnvParamNums ']'  */
401196c5ddc4Srjs#line 1649 "../src/mesa/program/program_parse.y"
401296c5ddc4Srjs        {
4013e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
401496c5ddc4Srjs	   (yyval.state)[0] = state->state_param_enum_env;
401596c5ddc4Srjs	   (yyval.state)[1] = (yyvsp[-1].state)[0];
401696c5ddc4Srjs	   (yyval.state)[2] = (yyvsp[-1].state)[1];
401796c5ddc4Srjs           (yyval.state)[3] = 0;
4018e64d31b9Smaya	}
401996c5ddc4Srjs#line 4020 "src/mesa/program/program_parse.tab.c"
4020e64d31b9Smaya    break;
4021e64d31b9Smaya
402296c5ddc4Srjs  case 207: /* progEnvParamNums: progEnvParamNum  */
402396c5ddc4Srjs#line 1659 "../src/mesa/program/program_parse.y"
402496c5ddc4Srjs        {
4025e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[0].integer);
4026e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[0].integer);
4027e64d31b9Smaya	}
402896c5ddc4Srjs#line 4029 "src/mesa/program/program_parse.tab.c"
4029e64d31b9Smaya    break;
4030e64d31b9Smaya
403196c5ddc4Srjs  case 208: /* progEnvParamNums: progEnvParamNum DOT_DOT progEnvParamNum  */
403296c5ddc4Srjs#line 1664 "../src/mesa/program/program_parse.y"
403396c5ddc4Srjs        {
4034e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[-2].integer);
4035e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[0].integer);
4036e64d31b9Smaya	}
403796c5ddc4Srjs#line 4038 "src/mesa/program/program_parse.tab.c"
4038e64d31b9Smaya    break;
4039e64d31b9Smaya
404096c5ddc4Srjs  case 209: /* progEnvParam: PROGRAM ENV '[' progEnvParamNum ']'  */
404196c5ddc4Srjs#line 1671 "../src/mesa/program/program_parse.y"
404296c5ddc4Srjs        {
4043e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
404496c5ddc4Srjs	   (yyval.state)[0] = state->state_param_enum_env;
404596c5ddc4Srjs	   (yyval.state)[1] = (yyvsp[-1].integer);
4046e64d31b9Smaya	   (yyval.state)[2] = (yyvsp[-1].integer);
404796c5ddc4Srjs           (yyval.state)[3] = 0;
4048e64d31b9Smaya	}
404996c5ddc4Srjs#line 4050 "src/mesa/program/program_parse.tab.c"
4050e64d31b9Smaya    break;
4051e64d31b9Smaya
405296c5ddc4Srjs  case 210: /* progLocalParams: PROGRAM LOCAL '[' progLocalParamNums ']'  */
405396c5ddc4Srjs#line 1681 "../src/mesa/program/program_parse.y"
405496c5ddc4Srjs        {
4055e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
405696c5ddc4Srjs	   (yyval.state)[0] = state->state_param_enum_local;
405796c5ddc4Srjs	   (yyval.state)[1] = (yyvsp[-1].state)[0];
405896c5ddc4Srjs	   (yyval.state)[2] = (yyvsp[-1].state)[1];
405996c5ddc4Srjs           (yyval.state)[3] = 0;
4060e64d31b9Smaya	}
406196c5ddc4Srjs#line 4062 "src/mesa/program/program_parse.tab.c"
4062e64d31b9Smaya    break;
4063e64d31b9Smaya
406496c5ddc4Srjs  case 211: /* progLocalParamNums: progLocalParamNum  */
406596c5ddc4Srjs#line 1690 "../src/mesa/program/program_parse.y"
406696c5ddc4Srjs        {
4067e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[0].integer);
4068e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[0].integer);
4069e64d31b9Smaya	}
407096c5ddc4Srjs#line 4071 "src/mesa/program/program_parse.tab.c"
4071e64d31b9Smaya    break;
4072e64d31b9Smaya
407396c5ddc4Srjs  case 212: /* progLocalParamNums: progLocalParamNum DOT_DOT progLocalParamNum  */
407496c5ddc4Srjs#line 1695 "../src/mesa/program/program_parse.y"
407596c5ddc4Srjs        {
4076e64d31b9Smaya	   (yyval.state)[0] = (yyvsp[-2].integer);
4077e64d31b9Smaya	   (yyval.state)[1] = (yyvsp[0].integer);
4078e64d31b9Smaya	}
407996c5ddc4Srjs#line 4080 "src/mesa/program/program_parse.tab.c"
4080e64d31b9Smaya    break;
4081e64d31b9Smaya
408296c5ddc4Srjs  case 213: /* progLocalParam: PROGRAM LOCAL '[' progLocalParamNum ']'  */
408396c5ddc4Srjs#line 1702 "../src/mesa/program/program_parse.y"
408496c5ddc4Srjs        {
4085e64d31b9Smaya	   memset((yyval.state), 0, sizeof((yyval.state)));
408696c5ddc4Srjs	   (yyval.state)[0] = state->state_param_enum_local;
408796c5ddc4Srjs	   (yyval.state)[1] = (yyvsp[-1].integer);
4088e64d31b9Smaya	   (yyval.state)[2] = (yyvsp[-1].integer);
408996c5ddc4Srjs           (yyval.state)[3] = 0;
4090e64d31b9Smaya	}
409196c5ddc4Srjs#line 4092 "src/mesa/program/program_parse.tab.c"
4092e64d31b9Smaya    break;
4093e64d31b9Smaya
409496c5ddc4Srjs  case 214: /* progEnvParamNum: INTEGER  */
409596c5ddc4Srjs#line 1712 "../src/mesa/program/program_parse.y"
409696c5ddc4Srjs        {
4097e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->limits->MaxEnvParams) {
4098e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid environment parameter reference");
4099e64d31b9Smaya	      YYERROR;
4100e64d31b9Smaya	   }
4101e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
4102e64d31b9Smaya	}
410396c5ddc4Srjs#line 4104 "src/mesa/program/program_parse.tab.c"
4104e64d31b9Smaya    break;
4105e64d31b9Smaya
410696c5ddc4Srjs  case 215: /* progLocalParamNum: INTEGER  */
410796c5ddc4Srjs#line 1722 "../src/mesa/program/program_parse.y"
410896c5ddc4Srjs        {
4109e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->limits->MaxLocalParams) {
4110e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid local parameter reference");
4111e64d31b9Smaya	      YYERROR;
4112e64d31b9Smaya	   }
4113e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
4114e64d31b9Smaya	}
411596c5ddc4Srjs#line 4116 "src/mesa/program/program_parse.tab.c"
4116e64d31b9Smaya    break;
4117e64d31b9Smaya
411896c5ddc4Srjs  case 220: /* paramConstScalarDecl: signedFloatConstant  */
411996c5ddc4Srjs#line 1737 "../src/mesa/program/program_parse.y"
412096c5ddc4Srjs        {
4121e64d31b9Smaya	   (yyval.vector).count = 4;
4122e64d31b9Smaya	   (yyval.vector).data[0].f = (yyvsp[0].real);
4123e64d31b9Smaya	   (yyval.vector).data[1].f = (yyvsp[0].real);
4124e64d31b9Smaya	   (yyval.vector).data[2].f = (yyvsp[0].real);
4125e64d31b9Smaya	   (yyval.vector).data[3].f = (yyvsp[0].real);
4126e64d31b9Smaya	}
412796c5ddc4Srjs#line 4128 "src/mesa/program/program_parse.tab.c"
4128e64d31b9Smaya    break;
4129e64d31b9Smaya
413096c5ddc4Srjs  case 221: /* paramConstScalarUse: REAL  */
413196c5ddc4Srjs#line 1747 "../src/mesa/program/program_parse.y"
413296c5ddc4Srjs        {
4133e64d31b9Smaya	   (yyval.vector).count = 1;
4134e64d31b9Smaya	   (yyval.vector).data[0].f = (yyvsp[0].real);
4135e64d31b9Smaya	   (yyval.vector).data[1].f = (yyvsp[0].real);
4136e64d31b9Smaya	   (yyval.vector).data[2].f = (yyvsp[0].real);
4137e64d31b9Smaya	   (yyval.vector).data[3].f = (yyvsp[0].real);
4138e64d31b9Smaya	}
413996c5ddc4Srjs#line 4140 "src/mesa/program/program_parse.tab.c"
4140e64d31b9Smaya    break;
4141e64d31b9Smaya
414296c5ddc4Srjs  case 222: /* paramConstScalarUse: INTEGER  */
414396c5ddc4Srjs#line 1755 "../src/mesa/program/program_parse.y"
414496c5ddc4Srjs        {
4145e64d31b9Smaya	   (yyval.vector).count = 1;
4146e64d31b9Smaya	   (yyval.vector).data[0].f = (float) (yyvsp[0].integer);
4147e64d31b9Smaya	   (yyval.vector).data[1].f = (float) (yyvsp[0].integer);
4148e64d31b9Smaya	   (yyval.vector).data[2].f = (float) (yyvsp[0].integer);
4149e64d31b9Smaya	   (yyval.vector).data[3].f = (float) (yyvsp[0].integer);
4150e64d31b9Smaya	}
415196c5ddc4Srjs#line 4152 "src/mesa/program/program_parse.tab.c"
4152e64d31b9Smaya    break;
4153e64d31b9Smaya
415496c5ddc4Srjs  case 223: /* paramConstVector: '{' signedFloatConstant '}'  */
415596c5ddc4Srjs#line 1765 "../src/mesa/program/program_parse.y"
415696c5ddc4Srjs        {
4157e64d31b9Smaya	   (yyval.vector).count = 4;
4158e64d31b9Smaya	   (yyval.vector).data[0].f = (yyvsp[-1].real);
4159e64d31b9Smaya	   (yyval.vector).data[1].f = 0.0f;
4160e64d31b9Smaya	   (yyval.vector).data[2].f = 0.0f;
4161e64d31b9Smaya	   (yyval.vector).data[3].f = 1.0f;
4162e64d31b9Smaya	}
416396c5ddc4Srjs#line 4164 "src/mesa/program/program_parse.tab.c"
4164e64d31b9Smaya    break;
4165e64d31b9Smaya
416696c5ddc4Srjs  case 224: /* paramConstVector: '{' signedFloatConstant ',' signedFloatConstant '}'  */
416796c5ddc4Srjs#line 1773 "../src/mesa/program/program_parse.y"
416896c5ddc4Srjs        {
4169e64d31b9Smaya	   (yyval.vector).count = 4;
4170e64d31b9Smaya	   (yyval.vector).data[0].f = (yyvsp[-3].real);
4171e64d31b9Smaya	   (yyval.vector).data[1].f = (yyvsp[-1].real);
4172e64d31b9Smaya	   (yyval.vector).data[2].f = 0.0f;
4173e64d31b9Smaya	   (yyval.vector).data[3].f = 1.0f;
4174e64d31b9Smaya	}
417596c5ddc4Srjs#line 4176 "src/mesa/program/program_parse.tab.c"
4176e64d31b9Smaya    break;
4177e64d31b9Smaya
417896c5ddc4Srjs  case 225: /* paramConstVector: '{' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant '}'  */
417996c5ddc4Srjs#line 1782 "../src/mesa/program/program_parse.y"
418096c5ddc4Srjs        {
4181e64d31b9Smaya	   (yyval.vector).count = 4;
4182e64d31b9Smaya	   (yyval.vector).data[0].f = (yyvsp[-5].real);
4183e64d31b9Smaya	   (yyval.vector).data[1].f = (yyvsp[-3].real);
4184e64d31b9Smaya	   (yyval.vector).data[2].f = (yyvsp[-1].real);
4185e64d31b9Smaya	   (yyval.vector).data[3].f = 1.0f;
4186e64d31b9Smaya	}
418796c5ddc4Srjs#line 4188 "src/mesa/program/program_parse.tab.c"
4188e64d31b9Smaya    break;
4189e64d31b9Smaya
419096c5ddc4Srjs  case 226: /* paramConstVector: '{' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant '}'  */
419196c5ddc4Srjs#line 1791 "../src/mesa/program/program_parse.y"
419296c5ddc4Srjs        {
4193e64d31b9Smaya	   (yyval.vector).count = 4;
4194e64d31b9Smaya	   (yyval.vector).data[0].f = (yyvsp[-7].real);
4195e64d31b9Smaya	   (yyval.vector).data[1].f = (yyvsp[-5].real);
4196e64d31b9Smaya	   (yyval.vector).data[2].f = (yyvsp[-3].real);
4197e64d31b9Smaya	   (yyval.vector).data[3].f = (yyvsp[-1].real);
4198e64d31b9Smaya	}
419996c5ddc4Srjs#line 4200 "src/mesa/program/program_parse.tab.c"
4200e64d31b9Smaya    break;
4201e64d31b9Smaya
420296c5ddc4Srjs  case 227: /* signedFloatConstant: optionalSign REAL  */
420396c5ddc4Srjs#line 1801 "../src/mesa/program/program_parse.y"
420496c5ddc4Srjs        {
4205e64d31b9Smaya	   (yyval.real) = ((yyvsp[-1].negate)) ? -(yyvsp[0].real) : (yyvsp[0].real);
4206e64d31b9Smaya	}
420796c5ddc4Srjs#line 4208 "src/mesa/program/program_parse.tab.c"
4208e64d31b9Smaya    break;
4209e64d31b9Smaya
421096c5ddc4Srjs  case 228: /* signedFloatConstant: optionalSign INTEGER  */
421196c5ddc4Srjs#line 1805 "../src/mesa/program/program_parse.y"
421296c5ddc4Srjs        {
4213e64d31b9Smaya	   (yyval.real) = (float)(((yyvsp[-1].negate)) ? -(yyvsp[0].integer) : (yyvsp[0].integer));
4214e64d31b9Smaya	}
421596c5ddc4Srjs#line 4216 "src/mesa/program/program_parse.tab.c"
4216e64d31b9Smaya    break;
4217e64d31b9Smaya
421896c5ddc4Srjs  case 229: /* optionalSign: '+'  */
421996c5ddc4Srjs#line 1810 "../src/mesa/program/program_parse.y"
422096c5ddc4Srjs                         { (yyval.negate) = FALSE; }
422196c5ddc4Srjs#line 4222 "src/mesa/program/program_parse.tab.c"
4222e64d31b9Smaya    break;
4223e64d31b9Smaya
422496c5ddc4Srjs  case 230: /* optionalSign: '-'  */
422596c5ddc4Srjs#line 1811 "../src/mesa/program/program_parse.y"
422696c5ddc4Srjs                         { (yyval.negate) = TRUE;  }
422796c5ddc4Srjs#line 4228 "src/mesa/program/program_parse.tab.c"
4228e64d31b9Smaya    break;
4229e64d31b9Smaya
423096c5ddc4Srjs  case 231: /* optionalSign: %empty  */
423196c5ddc4Srjs#line 1812 "../src/mesa/program/program_parse.y"
423296c5ddc4Srjs                         { (yyval.negate) = FALSE; }
423396c5ddc4Srjs#line 4234 "src/mesa/program/program_parse.tab.c"
4234e64d31b9Smaya    break;
4235e64d31b9Smaya
423696c5ddc4Srjs  case 232: /* @1: %empty  */
423796c5ddc4Srjs#line 1815 "../src/mesa/program/program_parse.y"
423896c5ddc4Srjs                     { (yyval.integer) = (yyvsp[0].integer); }
423996c5ddc4Srjs#line 4240 "src/mesa/program/program_parse.tab.c"
4240e64d31b9Smaya    break;
4241e64d31b9Smaya
424296c5ddc4Srjs  case 234: /* @2: %empty  */
424396c5ddc4Srjs#line 1818 "../src/mesa/program/program_parse.y"
424496c5ddc4Srjs                           { (yyval.integer) = (yyvsp[0].integer); }
424596c5ddc4Srjs#line 4246 "src/mesa/program/program_parse.tab.c"
4246e64d31b9Smaya    break;
4247e64d31b9Smaya
424896c5ddc4Srjs  case 236: /* varNameList: varNameList ',' IDENTIFIER  */
424996c5ddc4Srjs#line 1822 "../src/mesa/program/program_parse.y"
425096c5ddc4Srjs        {
4251e64d31b9Smaya	   if (!declare_variable(state, (yyvsp[0].string), (yyvsp[-3].integer), & (yylsp[0]))) {
4252e64d31b9Smaya	      free((yyvsp[0].string));
4253e64d31b9Smaya	      YYERROR;
4254e64d31b9Smaya	   }
4255e64d31b9Smaya	}
425696c5ddc4Srjs#line 4257 "src/mesa/program/program_parse.tab.c"
4257e64d31b9Smaya    break;
4258e64d31b9Smaya
425996c5ddc4Srjs  case 237: /* varNameList: IDENTIFIER  */
426096c5ddc4Srjs#line 1829 "../src/mesa/program/program_parse.y"
426196c5ddc4Srjs        {
4262e64d31b9Smaya	   if (!declare_variable(state, (yyvsp[0].string), (yyvsp[-1].integer), & (yylsp[0]))) {
4263e64d31b9Smaya	      free((yyvsp[0].string));
4264e64d31b9Smaya	      YYERROR;
4265e64d31b9Smaya	   }
4266e64d31b9Smaya	}
426796c5ddc4Srjs#line 4268 "src/mesa/program/program_parse.tab.c"
4268e64d31b9Smaya    break;
4269e64d31b9Smaya
427096c5ddc4Srjs  case 238: /* OUTPUT_statement: OUTPUT IDENTIFIER '=' resultBinding  */
427196c5ddc4Srjs#line 1838 "../src/mesa/program/program_parse.y"
427296c5ddc4Srjs        {
4273e64d31b9Smaya	   struct asm_symbol *const s =
4274e64d31b9Smaya	      declare_variable(state, (yyvsp[-2].string), at_output, & (yylsp[-2]));
4275e64d31b9Smaya
4276e64d31b9Smaya	   if (s == NULL) {
4277e64d31b9Smaya	      free((yyvsp[-2].string));
4278e64d31b9Smaya	      YYERROR;
4279e64d31b9Smaya	   } else {
4280e64d31b9Smaya	      s->output_binding = (yyvsp[0].result);
4281e64d31b9Smaya	   }
4282e64d31b9Smaya	}
428396c5ddc4Srjs#line 4284 "src/mesa/program/program_parse.tab.c"
4284e64d31b9Smaya    break;
4285e64d31b9Smaya
428696c5ddc4Srjs  case 239: /* resultBinding: RESULT POSITION  */
428796c5ddc4Srjs#line 1852 "../src/mesa/program/program_parse.y"
428896c5ddc4Srjs        {
4289e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4290e64d31b9Smaya	      (yyval.result) = VARYING_SLOT_POS;
4291e64d31b9Smaya	   } else {
4292e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program result name");
4293e64d31b9Smaya	      YYERROR;
4294e64d31b9Smaya	   }
4295e64d31b9Smaya	}
429696c5ddc4Srjs#line 4297 "src/mesa/program/program_parse.tab.c"
4297e64d31b9Smaya    break;
4298e64d31b9Smaya
429996c5ddc4Srjs  case 240: /* resultBinding: RESULT FOGCOORD  */
430096c5ddc4Srjs#line 1861 "../src/mesa/program/program_parse.y"
430196c5ddc4Srjs        {
4302e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4303e64d31b9Smaya	      (yyval.result) = VARYING_SLOT_FOGC;
4304e64d31b9Smaya	   } else {
4305e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program result name");
4306e64d31b9Smaya	      YYERROR;
4307e64d31b9Smaya	   }
4308e64d31b9Smaya	}
430996c5ddc4Srjs#line 4310 "src/mesa/program/program_parse.tab.c"
4310e64d31b9Smaya    break;
4311e64d31b9Smaya
431296c5ddc4Srjs  case 241: /* resultBinding: RESULT resultColBinding  */
431396c5ddc4Srjs#line 1870 "../src/mesa/program/program_parse.y"
431496c5ddc4Srjs        {
4315e64d31b9Smaya	   (yyval.result) = (yyvsp[0].result);
4316e64d31b9Smaya	}
431796c5ddc4Srjs#line 4318 "src/mesa/program/program_parse.tab.c"
4318e64d31b9Smaya    break;
4319e64d31b9Smaya
432096c5ddc4Srjs  case 242: /* resultBinding: RESULT POINTSIZE  */
432196c5ddc4Srjs#line 1874 "../src/mesa/program/program_parse.y"
432296c5ddc4Srjs        {
4323e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4324e64d31b9Smaya	      (yyval.result) = VARYING_SLOT_PSIZ;
4325e64d31b9Smaya	   } else {
4326e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program result name");
4327e64d31b9Smaya	      YYERROR;
4328e64d31b9Smaya	   }
4329e64d31b9Smaya	}
433096c5ddc4Srjs#line 4331 "src/mesa/program/program_parse.tab.c"
4331e64d31b9Smaya    break;
4332e64d31b9Smaya
433396c5ddc4Srjs  case 243: /* resultBinding: RESULT TEXCOORD optTexCoordUnitNum  */
433496c5ddc4Srjs#line 1883 "../src/mesa/program/program_parse.y"
433596c5ddc4Srjs        {
4336e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4337e64d31b9Smaya	      (yyval.result) = VARYING_SLOT_TEX0 + (yyvsp[0].integer);
4338e64d31b9Smaya	   } else {
4339e64d31b9Smaya	      yyerror(& (yylsp[-1]), state, "invalid program result name");
4340e64d31b9Smaya	      YYERROR;
4341e64d31b9Smaya	   }
4342e64d31b9Smaya	}
434396c5ddc4Srjs#line 4344 "src/mesa/program/program_parse.tab.c"
4344e64d31b9Smaya    break;
4345e64d31b9Smaya
434696c5ddc4Srjs  case 244: /* resultBinding: RESULT DEPTH  */
434796c5ddc4Srjs#line 1892 "../src/mesa/program/program_parse.y"
434896c5ddc4Srjs        {
4349e64d31b9Smaya	   if (state->mode == ARB_fragment) {
4350e64d31b9Smaya	      (yyval.result) = FRAG_RESULT_DEPTH;
4351e64d31b9Smaya	   } else {
4352e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program result name");
4353e64d31b9Smaya	      YYERROR;
4354e64d31b9Smaya	   }
4355e64d31b9Smaya	}
435696c5ddc4Srjs#line 4357 "src/mesa/program/program_parse.tab.c"
4357e64d31b9Smaya    break;
4358e64d31b9Smaya
435996c5ddc4Srjs  case 245: /* resultColBinding: COLOR optResultFaceType optResultColorType  */
436096c5ddc4Srjs#line 1903 "../src/mesa/program/program_parse.y"
436196c5ddc4Srjs        {
4362e64d31b9Smaya	   (yyval.result) = (yyvsp[-1].integer) + (yyvsp[0].integer);
4363e64d31b9Smaya	}
436496c5ddc4Srjs#line 4365 "src/mesa/program/program_parse.tab.c"
4365e64d31b9Smaya    break;
4366e64d31b9Smaya
436796c5ddc4Srjs  case 246: /* optResultFaceType: %empty  */
436896c5ddc4Srjs#line 1909 "../src/mesa/program/program_parse.y"
436996c5ddc4Srjs        {
4370e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4371e64d31b9Smaya	      (yyval.integer) = VARYING_SLOT_COL0;
4372e64d31b9Smaya	   } else {
4373e64d31b9Smaya	      if (state->option.DrawBuffers)
4374e64d31b9Smaya		 (yyval.integer) = FRAG_RESULT_DATA0;
4375e64d31b9Smaya	      else
4376e64d31b9Smaya		 (yyval.integer) = FRAG_RESULT_COLOR;
4377e64d31b9Smaya	   }
4378e64d31b9Smaya	}
437996c5ddc4Srjs#line 4380 "src/mesa/program/program_parse.tab.c"
4380e64d31b9Smaya    break;
4381e64d31b9Smaya
438296c5ddc4Srjs  case 247: /* optResultFaceType: '[' INTEGER ']'  */
438396c5ddc4Srjs#line 1920 "../src/mesa/program/program_parse.y"
438496c5ddc4Srjs        {
4385e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4386e64d31b9Smaya	      yyerror(& (yylsp[-2]), state, "invalid program result name");
4387e64d31b9Smaya	      YYERROR;
4388e64d31b9Smaya	   } else {
4389e64d31b9Smaya	      if (!state->option.DrawBuffers) {
4390e64d31b9Smaya		 /* From the ARB_draw_buffers spec (same text exists
4391e64d31b9Smaya		  * for ATI_draw_buffers):
4392e64d31b9Smaya		  *
4393e64d31b9Smaya		  *     If this option is not specified, a fragment
4394e64d31b9Smaya		  *     program that attempts to bind
4395e64d31b9Smaya		  *     "result.color[n]" will fail to load, and only
4396e64d31b9Smaya		  *     "result.color" will be allowed.
4397e64d31b9Smaya		  */
4398e64d31b9Smaya		 yyerror(& (yylsp[-2]), state,
4399e64d31b9Smaya			 "result.color[] used without "
4400e64d31b9Smaya			 "`OPTION ARB_draw_buffers' or "
4401e64d31b9Smaya			 "`OPTION ATI_draw_buffers'");
4402e64d31b9Smaya		 YYERROR;
4403e64d31b9Smaya	      } else if ((yyvsp[-1].integer) >= state->MaxDrawBuffers) {
4404e64d31b9Smaya		 yyerror(& (yylsp[-2]), state,
4405e64d31b9Smaya			 "result.color[] exceeds MAX_DRAW_BUFFERS_ARB");
4406e64d31b9Smaya		 YYERROR;
4407e64d31b9Smaya	      }
4408e64d31b9Smaya	      (yyval.integer) = FRAG_RESULT_DATA0 + (yyvsp[-1].integer);
4409e64d31b9Smaya	   }
4410e64d31b9Smaya	}
441196c5ddc4Srjs#line 4412 "src/mesa/program/program_parse.tab.c"
4412e64d31b9Smaya    break;
4413e64d31b9Smaya
441496c5ddc4Srjs  case 248: /* optResultFaceType: FRONT  */
441596c5ddc4Srjs#line 1948 "../src/mesa/program/program_parse.y"
441696c5ddc4Srjs        {
4417e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4418e64d31b9Smaya	      (yyval.integer) = VARYING_SLOT_COL0;
4419e64d31b9Smaya	   } else {
4420e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program result name");
4421e64d31b9Smaya	      YYERROR;
4422e64d31b9Smaya	   }
4423e64d31b9Smaya	}
442496c5ddc4Srjs#line 4425 "src/mesa/program/program_parse.tab.c"
4425e64d31b9Smaya    break;
4426e64d31b9Smaya
442796c5ddc4Srjs  case 249: /* optResultFaceType: BACK  */
442896c5ddc4Srjs#line 1957 "../src/mesa/program/program_parse.y"
442996c5ddc4Srjs        {
4430e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4431e64d31b9Smaya	      (yyval.integer) = VARYING_SLOT_BFC0;
4432e64d31b9Smaya	   } else {
4433e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program result name");
4434e64d31b9Smaya	      YYERROR;
4435e64d31b9Smaya	   }
4436e64d31b9Smaya	}
443796c5ddc4Srjs#line 4438 "src/mesa/program/program_parse.tab.c"
4438e64d31b9Smaya    break;
4439e64d31b9Smaya
444096c5ddc4Srjs  case 250: /* optResultColorType: %empty  */
444196c5ddc4Srjs#line 1968 "../src/mesa/program/program_parse.y"
444296c5ddc4Srjs        {
444396c5ddc4Srjs	   (yyval.integer) = 0;
4444e64d31b9Smaya	}
444596c5ddc4Srjs#line 4446 "src/mesa/program/program_parse.tab.c"
4446e64d31b9Smaya    break;
4447e64d31b9Smaya
444896c5ddc4Srjs  case 251: /* optResultColorType: PRIMARY  */
444996c5ddc4Srjs#line 1972 "../src/mesa/program/program_parse.y"
445096c5ddc4Srjs        {
4451e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4452e64d31b9Smaya	      (yyval.integer) = 0;
4453e64d31b9Smaya	   } else {
4454e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program result name");
4455e64d31b9Smaya	      YYERROR;
4456e64d31b9Smaya	   }
4457e64d31b9Smaya	}
445896c5ddc4Srjs#line 4459 "src/mesa/program/program_parse.tab.c"
4459e64d31b9Smaya    break;
4460e64d31b9Smaya
446196c5ddc4Srjs  case 252: /* optResultColorType: SECONDARY  */
446296c5ddc4Srjs#line 1981 "../src/mesa/program/program_parse.y"
446396c5ddc4Srjs        {
4464e64d31b9Smaya	   if (state->mode == ARB_vertex) {
4465e64d31b9Smaya	      (yyval.integer) = 1;
4466e64d31b9Smaya	   } else {
4467e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid program result name");
4468e64d31b9Smaya	      YYERROR;
4469e64d31b9Smaya	   }
4470e64d31b9Smaya	}
447196c5ddc4Srjs#line 4472 "src/mesa/program/program_parse.tab.c"
4472e64d31b9Smaya    break;
4473e64d31b9Smaya
447496c5ddc4Srjs  case 253: /* optFaceType: %empty  */
447596c5ddc4Srjs#line 1991 "../src/mesa/program/program_parse.y"
447696c5ddc4Srjs                { (yyval.integer) = 0; }
447796c5ddc4Srjs#line 4478 "src/mesa/program/program_parse.tab.c"
4478e64d31b9Smaya    break;
4479e64d31b9Smaya
448096c5ddc4Srjs  case 254: /* optFaceType: FRONT  */
448196c5ddc4Srjs#line 1992 "../src/mesa/program/program_parse.y"
448296c5ddc4Srjs                { (yyval.integer) = 0; }
448396c5ddc4Srjs#line 4484 "src/mesa/program/program_parse.tab.c"
4484e64d31b9Smaya    break;
4485e64d31b9Smaya
448696c5ddc4Srjs  case 255: /* optFaceType: BACK  */
448796c5ddc4Srjs#line 1993 "../src/mesa/program/program_parse.y"
448896c5ddc4Srjs                { (yyval.integer) = 1; }
448996c5ddc4Srjs#line 4490 "src/mesa/program/program_parse.tab.c"
4490e64d31b9Smaya    break;
4491e64d31b9Smaya
449296c5ddc4Srjs  case 256: /* optColorType: %empty  */
449396c5ddc4Srjs#line 1996 "../src/mesa/program/program_parse.y"
449496c5ddc4Srjs                    { (yyval.integer) = 0; }
449596c5ddc4Srjs#line 4496 "src/mesa/program/program_parse.tab.c"
4496e64d31b9Smaya    break;
4497e64d31b9Smaya
449896c5ddc4Srjs  case 257: /* optColorType: PRIMARY  */
449996c5ddc4Srjs#line 1997 "../src/mesa/program/program_parse.y"
450096c5ddc4Srjs                    { (yyval.integer) = 0; }
450196c5ddc4Srjs#line 4502 "src/mesa/program/program_parse.tab.c"
4502e64d31b9Smaya    break;
4503e64d31b9Smaya
450496c5ddc4Srjs  case 258: /* optColorType: SECONDARY  */
450596c5ddc4Srjs#line 1998 "../src/mesa/program/program_parse.y"
450696c5ddc4Srjs                    { (yyval.integer) = 1; }
450796c5ddc4Srjs#line 4508 "src/mesa/program/program_parse.tab.c"
4508e64d31b9Smaya    break;
4509e64d31b9Smaya
451096c5ddc4Srjs  case 259: /* optTexCoordUnitNum: %empty  */
451196c5ddc4Srjs#line 2001 "../src/mesa/program/program_parse.y"
451296c5ddc4Srjs                                   { (yyval.integer) = 0; }
451396c5ddc4Srjs#line 4514 "src/mesa/program/program_parse.tab.c"
4514e64d31b9Smaya    break;
4515e64d31b9Smaya
451696c5ddc4Srjs  case 260: /* optTexCoordUnitNum: '[' texCoordUnitNum ']'  */
451796c5ddc4Srjs#line 2002 "../src/mesa/program/program_parse.y"
451896c5ddc4Srjs                                   { (yyval.integer) = (yyvsp[-1].integer); }
451996c5ddc4Srjs#line 4520 "src/mesa/program/program_parse.tab.c"
4520e64d31b9Smaya    break;
4521e64d31b9Smaya
452296c5ddc4Srjs  case 261: /* optTexImageUnitNum: %empty  */
452396c5ddc4Srjs#line 2005 "../src/mesa/program/program_parse.y"
452496c5ddc4Srjs                                   { (yyval.integer) = 0; }
452596c5ddc4Srjs#line 4526 "src/mesa/program/program_parse.tab.c"
4526e64d31b9Smaya    break;
4527e64d31b9Smaya
452896c5ddc4Srjs  case 262: /* optTexImageUnitNum: '[' texImageUnitNum ']'  */
452996c5ddc4Srjs#line 2006 "../src/mesa/program/program_parse.y"
453096c5ddc4Srjs                                   { (yyval.integer) = (yyvsp[-1].integer); }
453196c5ddc4Srjs#line 4532 "src/mesa/program/program_parse.tab.c"
4532e64d31b9Smaya    break;
4533e64d31b9Smaya
453496c5ddc4Srjs  case 263: /* optLegacyTexUnitNum: %empty  */
453596c5ddc4Srjs#line 2009 "../src/mesa/program/program_parse.y"
453696c5ddc4Srjs                                   { (yyval.integer) = 0; }
453796c5ddc4Srjs#line 4538 "src/mesa/program/program_parse.tab.c"
4538e64d31b9Smaya    break;
4539e64d31b9Smaya
454096c5ddc4Srjs  case 264: /* optLegacyTexUnitNum: '[' legacyTexUnitNum ']'  */
454196c5ddc4Srjs#line 2010 "../src/mesa/program/program_parse.y"
454296c5ddc4Srjs                                   { (yyval.integer) = (yyvsp[-1].integer); }
454396c5ddc4Srjs#line 4544 "src/mesa/program/program_parse.tab.c"
4544e64d31b9Smaya    break;
4545e64d31b9Smaya
454696c5ddc4Srjs  case 265: /* texCoordUnitNum: INTEGER  */
454796c5ddc4Srjs#line 2014 "../src/mesa/program/program_parse.y"
454896c5ddc4Srjs        {
4549e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->MaxTextureCoordUnits) {
4550e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid texture coordinate unit selector");
4551e64d31b9Smaya	      YYERROR;
4552e64d31b9Smaya	   }
4553e64d31b9Smaya
4554e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
4555e64d31b9Smaya	}
455696c5ddc4Srjs#line 4557 "src/mesa/program/program_parse.tab.c"
4557e64d31b9Smaya    break;
4558e64d31b9Smaya
455996c5ddc4Srjs  case 266: /* texImageUnitNum: INTEGER  */
456096c5ddc4Srjs#line 2025 "../src/mesa/program/program_parse.y"
456196c5ddc4Srjs        {
4562e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->MaxTextureImageUnits) {
4563e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid texture image unit selector");
4564e64d31b9Smaya	      YYERROR;
4565e64d31b9Smaya	   }
4566e64d31b9Smaya
4567e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
4568e64d31b9Smaya	}
456996c5ddc4Srjs#line 4570 "src/mesa/program/program_parse.tab.c"
4570e64d31b9Smaya    break;
4571e64d31b9Smaya
457296c5ddc4Srjs  case 267: /* legacyTexUnitNum: INTEGER  */
457396c5ddc4Srjs#line 2036 "../src/mesa/program/program_parse.y"
457496c5ddc4Srjs        {
4575e64d31b9Smaya	   if ((unsigned) (yyvsp[0].integer) >= state->MaxTextureUnits) {
4576e64d31b9Smaya	      yyerror(& (yylsp[0]), state, "invalid texture unit selector");
4577e64d31b9Smaya	      YYERROR;
4578e64d31b9Smaya	   }
4579e64d31b9Smaya
4580e64d31b9Smaya	   (yyval.integer) = (yyvsp[0].integer);
4581e64d31b9Smaya	}
458296c5ddc4Srjs#line 4583 "src/mesa/program/program_parse.tab.c"
4583e64d31b9Smaya    break;
4584e64d31b9Smaya
458596c5ddc4Srjs  case 268: /* ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER  */
458696c5ddc4Srjs#line 2047 "../src/mesa/program/program_parse.y"
458796c5ddc4Srjs        {
4588e64d31b9Smaya	   struct asm_symbol *exist = (struct asm_symbol *)
4589e64d31b9Smaya              _mesa_symbol_table_find_symbol(state->st, (yyvsp[-2].string));
4590e64d31b9Smaya	   struct asm_symbol *target = (struct asm_symbol *)
4591e64d31b9Smaya              _mesa_symbol_table_find_symbol(state->st, (yyvsp[0].string));
4592e64d31b9Smaya
4593e64d31b9Smaya	   free((yyvsp[0].string));
4594e64d31b9Smaya
4595e64d31b9Smaya	   if (exist != NULL) {
4596e64d31b9Smaya	      char m[1000];
459796c5ddc4Srjs	      snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[-2].string));
4598e64d31b9Smaya	      free((yyvsp[-2].string));
4599e64d31b9Smaya	      yyerror(& (yylsp[-2]), state, m);
4600e64d31b9Smaya	      YYERROR;
4601e64d31b9Smaya	   } else if (target == NULL) {
4602e64d31b9Smaya	      free((yyvsp[-2].string));
4603e64d31b9Smaya	      yyerror(& (yylsp[0]), state,
4604e64d31b9Smaya		      "undefined variable binding in ALIAS statement");
4605e64d31b9Smaya	      YYERROR;
4606e64d31b9Smaya	   } else {
4607e64d31b9Smaya              _mesa_symbol_table_add_symbol(state->st, (yyvsp[-2].string), target);
4608e64d31b9Smaya	   }
4609e64d31b9Smaya	}
461096c5ddc4Srjs#line 4611 "src/mesa/program/program_parse.tab.c"
4611e64d31b9Smaya    break;
4612e64d31b9Smaya
4613e64d31b9Smaya
461496c5ddc4Srjs#line 4615 "src/mesa/program/program_parse.tab.c"
461596c5ddc4Srjs
4616e64d31b9Smaya      default: break;
4617e64d31b9Smaya    }
4618e64d31b9Smaya  /* User semantic actions sometimes alter yychar, and that requires
4619e64d31b9Smaya     that yytoken be updated with the new translation.  We take the
4620e64d31b9Smaya     approach of translating immediately before every use of yytoken.
4621e64d31b9Smaya     One alternative is translating here after every semantic action,
4622e64d31b9Smaya     but that translation would be missed if the semantic action invokes
4623e64d31b9Smaya     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4624e64d31b9Smaya     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
4625e64d31b9Smaya     incorrect destructor might then be invoked immediately.  In the
4626e64d31b9Smaya     case of YYERROR or YYBACKUP, subsequent parser actions might lead
4627e64d31b9Smaya     to an incorrect destructor call or verbose syntax error message
4628e64d31b9Smaya     before the lookahead is translated.  */
462996c5ddc4Srjs  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
4630e64d31b9Smaya
4631e64d31b9Smaya  YYPOPSTACK (yylen);
4632e64d31b9Smaya  yylen = 0;
4633e64d31b9Smaya
4634e64d31b9Smaya  *++yyvsp = yyval;
4635e64d31b9Smaya  *++yylsp = yyloc;
4636e64d31b9Smaya
4637e64d31b9Smaya  /* Now 'shift' the result of the reduction.  Determine what state
4638e64d31b9Smaya     that goes to, based on the state we popped back to and the rule
4639e64d31b9Smaya     number reduced by.  */
4640e64d31b9Smaya  {
4641e64d31b9Smaya    const int yylhs = yyr1[yyn] - YYNTOKENS;
4642e64d31b9Smaya    const int yyi = yypgoto[yylhs] + *yyssp;
4643e64d31b9Smaya    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
4644e64d31b9Smaya               ? yytable[yyi]
4645e64d31b9Smaya               : yydefgoto[yylhs]);
4646e64d31b9Smaya  }
4647e64d31b9Smaya
4648e64d31b9Smaya  goto yynewstate;
4649e64d31b9Smaya
4650e64d31b9Smaya
4651e64d31b9Smaya/*--------------------------------------.
4652e64d31b9Smaya| yyerrlab -- here on detecting error.  |
4653e64d31b9Smaya`--------------------------------------*/
4654e64d31b9Smayayyerrlab:
4655e64d31b9Smaya  /* Make sure we have latest lookahead translation.  See comments at
4656e64d31b9Smaya     user semantic actions for why this is necessary.  */
465796c5ddc4Srjs  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
4658e64d31b9Smaya  /* If not already recovering from an error, report this error.  */
4659e64d31b9Smaya  if (!yyerrstatus)
4660e64d31b9Smaya    {
4661e64d31b9Smaya      ++yynerrs;
4662e64d31b9Smaya      {
466396c5ddc4Srjs        yypcontext_t yyctx
466496c5ddc4Srjs          = {yyssp, yytoken, &yylloc};
4665e64d31b9Smaya        char const *yymsgp = YY_("syntax error");
4666e64d31b9Smaya        int yysyntax_error_status;
466796c5ddc4Srjs        yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
4668e64d31b9Smaya        if (yysyntax_error_status == 0)
4669e64d31b9Smaya          yymsgp = yymsg;
467096c5ddc4Srjs        else if (yysyntax_error_status == -1)
4671e64d31b9Smaya          {
4672e64d31b9Smaya            if (yymsg != yymsgbuf)
4673e64d31b9Smaya              YYSTACK_FREE (yymsg);
467496c5ddc4Srjs            yymsg = YY_CAST (char *,
467596c5ddc4Srjs                             YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
467696c5ddc4Srjs            if (yymsg)
4677e64d31b9Smaya              {
467896c5ddc4Srjs                yysyntax_error_status
467996c5ddc4Srjs                  = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
468096c5ddc4Srjs                yymsgp = yymsg;
4681e64d31b9Smaya              }
4682e64d31b9Smaya            else
4683e64d31b9Smaya              {
468496c5ddc4Srjs                yymsg = yymsgbuf;
468596c5ddc4Srjs                yymsg_alloc = sizeof yymsgbuf;
468696c5ddc4Srjs                yysyntax_error_status = YYENOMEM;
4687e64d31b9Smaya              }
4688e64d31b9Smaya          }
4689e64d31b9Smaya        yyerror (&yylloc, state, yymsgp);
469096c5ddc4Srjs        if (yysyntax_error_status == YYENOMEM)
4691e64d31b9Smaya          goto yyexhaustedlab;
4692e64d31b9Smaya      }
4693e64d31b9Smaya    }
4694e64d31b9Smaya
4695e64d31b9Smaya  yyerror_range[1] = yylloc;
4696e64d31b9Smaya  if (yyerrstatus == 3)
4697e64d31b9Smaya    {
4698e64d31b9Smaya      /* If just tried and failed to reuse lookahead token after an
4699e64d31b9Smaya         error, discard it.  */
4700e64d31b9Smaya
4701e64d31b9Smaya      if (yychar <= YYEOF)
4702e64d31b9Smaya        {
4703e64d31b9Smaya          /* Return failure if at end of input.  */
4704e64d31b9Smaya          if (yychar == YYEOF)
4705e64d31b9Smaya            YYABORT;
4706e64d31b9Smaya        }
4707e64d31b9Smaya      else
4708e64d31b9Smaya        {
4709e64d31b9Smaya          yydestruct ("Error: discarding",
4710e64d31b9Smaya                      yytoken, &yylval, &yylloc, state);
4711e64d31b9Smaya          yychar = YYEMPTY;
4712e64d31b9Smaya        }
4713e64d31b9Smaya    }
4714e64d31b9Smaya
4715e64d31b9Smaya  /* Else will try to reuse lookahead token after shifting the error
4716e64d31b9Smaya     token.  */
4717e64d31b9Smaya  goto yyerrlab1;
4718e64d31b9Smaya
4719e64d31b9Smaya
4720e64d31b9Smaya/*---------------------------------------------------.
4721e64d31b9Smaya| yyerrorlab -- error raised explicitly by YYERROR.  |
4722e64d31b9Smaya`---------------------------------------------------*/
4723e64d31b9Smayayyerrorlab:
472496c5ddc4Srjs  /* Pacify compilers when the user code never invokes YYERROR and the
472596c5ddc4Srjs     label yyerrorlab therefore never appears in user code.  */
472696c5ddc4Srjs  if (0)
472796c5ddc4Srjs    YYERROR;
4728e64d31b9Smaya
4729e64d31b9Smaya  /* Do not reclaim the symbols of the rule whose action triggered
4730e64d31b9Smaya     this YYERROR.  */
4731e64d31b9Smaya  YYPOPSTACK (yylen);
4732e64d31b9Smaya  yylen = 0;
4733e64d31b9Smaya  YY_STACK_PRINT (yyss, yyssp);
4734e64d31b9Smaya  yystate = *yyssp;
4735e64d31b9Smaya  goto yyerrlab1;
4736e64d31b9Smaya
4737e64d31b9Smaya
4738e64d31b9Smaya/*-------------------------------------------------------------.
4739e64d31b9Smaya| yyerrlab1 -- common code for both syntax error and YYERROR.  |
4740e64d31b9Smaya`-------------------------------------------------------------*/
4741e64d31b9Smayayyerrlab1:
4742e64d31b9Smaya  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
4743e64d31b9Smaya
474496c5ddc4Srjs  /* Pop stack until we find a state that shifts the error token.  */
4745e64d31b9Smaya  for (;;)
4746e64d31b9Smaya    {
4747e64d31b9Smaya      yyn = yypact[yystate];
4748e64d31b9Smaya      if (!yypact_value_is_default (yyn))
4749e64d31b9Smaya        {
475096c5ddc4Srjs          yyn += YYSYMBOL_YYerror;
475196c5ddc4Srjs          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
4752e64d31b9Smaya            {
4753e64d31b9Smaya              yyn = yytable[yyn];
4754e64d31b9Smaya              if (0 < yyn)
4755e64d31b9Smaya                break;
4756e64d31b9Smaya            }
4757e64d31b9Smaya        }
4758e64d31b9Smaya
4759e64d31b9Smaya      /* Pop the current state because it cannot handle the error token.  */
4760e64d31b9Smaya      if (yyssp == yyss)
4761e64d31b9Smaya        YYABORT;
4762e64d31b9Smaya
4763e64d31b9Smaya      yyerror_range[1] = *yylsp;
4764e64d31b9Smaya      yydestruct ("Error: popping",
476596c5ddc4Srjs                  YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, state);
4766e64d31b9Smaya      YYPOPSTACK (1);
4767e64d31b9Smaya      yystate = *yyssp;
4768e64d31b9Smaya      YY_STACK_PRINT (yyss, yyssp);
4769e64d31b9Smaya    }
4770e64d31b9Smaya
4771e64d31b9Smaya  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
4772e64d31b9Smaya  *++yyvsp = yylval;
4773e64d31b9Smaya  YY_IGNORE_MAYBE_UNINITIALIZED_END
4774e64d31b9Smaya
4775e64d31b9Smaya  yyerror_range[2] = yylloc;
477696c5ddc4Srjs  ++yylsp;
477796c5ddc4Srjs  YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
4778e64d31b9Smaya
4779e64d31b9Smaya  /* Shift the error token.  */
478096c5ddc4Srjs  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
4781e64d31b9Smaya
4782e64d31b9Smaya  yystate = yyn;
4783e64d31b9Smaya  goto yynewstate;
4784e64d31b9Smaya
4785e64d31b9Smaya
4786e64d31b9Smaya/*-------------------------------------.
4787e64d31b9Smaya| yyacceptlab -- YYACCEPT comes here.  |
4788e64d31b9Smaya`-------------------------------------*/
4789e64d31b9Smayayyacceptlab:
4790e64d31b9Smaya  yyresult = 0;
4791e64d31b9Smaya  goto yyreturn;
4792e64d31b9Smaya
479396c5ddc4Srjs
4794e64d31b9Smaya/*-----------------------------------.
4795e64d31b9Smaya| yyabortlab -- YYABORT comes here.  |
4796e64d31b9Smaya`-----------------------------------*/
4797e64d31b9Smayayyabortlab:
4798e64d31b9Smaya  yyresult = 1;
4799e64d31b9Smaya  goto yyreturn;
4800e64d31b9Smaya
480196c5ddc4Srjs
480296c5ddc4Srjs#if 1
4803e64d31b9Smaya/*-------------------------------------------------.
4804e64d31b9Smaya| yyexhaustedlab -- memory exhaustion comes here.  |
4805e64d31b9Smaya`-------------------------------------------------*/
4806e64d31b9Smayayyexhaustedlab:
4807e64d31b9Smaya  yyerror (&yylloc, state, YY_("memory exhausted"));
4808e64d31b9Smaya  yyresult = 2;
480996c5ddc4Srjs  goto yyreturn;
4810e64d31b9Smaya#endif
4811e64d31b9Smaya
481296c5ddc4Srjs
481396c5ddc4Srjs/*-------------------------------------------------------.
481496c5ddc4Srjs| yyreturn -- parsing is finished, clean up and return.  |
481596c5ddc4Srjs`-------------------------------------------------------*/
4816e64d31b9Smayayyreturn:
4817e64d31b9Smaya  if (yychar != YYEMPTY)
4818e64d31b9Smaya    {
4819e64d31b9Smaya      /* Make sure we have latest lookahead translation.  See comments at
4820e64d31b9Smaya         user semantic actions for why this is necessary.  */
4821e64d31b9Smaya      yytoken = YYTRANSLATE (yychar);
4822e64d31b9Smaya      yydestruct ("Cleanup: discarding lookahead",
4823e64d31b9Smaya                  yytoken, &yylval, &yylloc, state);
4824e64d31b9Smaya    }
4825e64d31b9Smaya  /* Do not reclaim the symbols of the rule whose action triggered
4826e64d31b9Smaya     this YYABORT or YYACCEPT.  */
4827e64d31b9Smaya  YYPOPSTACK (yylen);
4828e64d31b9Smaya  YY_STACK_PRINT (yyss, yyssp);
4829e64d31b9Smaya  while (yyssp != yyss)
4830e64d31b9Smaya    {
4831e64d31b9Smaya      yydestruct ("Cleanup: popping",
483296c5ddc4Srjs                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, state);
4833e64d31b9Smaya      YYPOPSTACK (1);
4834e64d31b9Smaya    }
4835e64d31b9Smaya#ifndef yyoverflow
4836e64d31b9Smaya  if (yyss != yyssa)
4837e64d31b9Smaya    YYSTACK_FREE (yyss);
4838e64d31b9Smaya#endif
4839e64d31b9Smaya  if (yymsg != yymsgbuf)
4840e64d31b9Smaya    YYSTACK_FREE (yymsg);
4841e64d31b9Smaya  return yyresult;
4842e64d31b9Smaya}
484396c5ddc4Srjs
484496c5ddc4Srjs#line 2076 "../src/mesa/program/program_parse.y"
4845e64d31b9Smaya
4846e64d31b9Smaya
4847e64d31b9Smayavoid
4848e64d31b9Smayaasm_instruction_set_operands(struct asm_instruction *inst,
4849e64d31b9Smaya			     const struct prog_dst_register *dst,
4850e64d31b9Smaya			     const struct asm_src_register *src0,
4851e64d31b9Smaya			     const struct asm_src_register *src1,
4852e64d31b9Smaya			     const struct asm_src_register *src2)
4853e64d31b9Smaya{
4854e64d31b9Smaya   /* In the core ARB extensions only the KIL instruction doesn't have a
4855e64d31b9Smaya    * destination register.
4856e64d31b9Smaya    */
4857e64d31b9Smaya   if (dst == NULL) {
4858e64d31b9Smaya      init_dst_reg(& inst->Base.DstReg);
4859e64d31b9Smaya   } else {
4860e64d31b9Smaya      inst->Base.DstReg = *dst;
4861e64d31b9Smaya   }
4862e64d31b9Smaya
4863e64d31b9Smaya   if (src0 != NULL) {
4864e64d31b9Smaya      inst->Base.SrcReg[0] = src0->Base;
4865e64d31b9Smaya      inst->SrcReg[0] = *src0;
4866e64d31b9Smaya   } else {
4867e64d31b9Smaya      init_src_reg(& inst->SrcReg[0]);
4868e64d31b9Smaya   }
4869e64d31b9Smaya
4870e64d31b9Smaya   if (src1 != NULL) {
4871e64d31b9Smaya      inst->Base.SrcReg[1] = src1->Base;
4872e64d31b9Smaya      inst->SrcReg[1] = *src1;
4873e64d31b9Smaya   } else {
4874e64d31b9Smaya      init_src_reg(& inst->SrcReg[1]);
4875e64d31b9Smaya   }
4876e64d31b9Smaya
4877e64d31b9Smaya   if (src2 != NULL) {
4878e64d31b9Smaya      inst->Base.SrcReg[2] = src2->Base;
4879e64d31b9Smaya      inst->SrcReg[2] = *src2;
4880e64d31b9Smaya   } else {
4881e64d31b9Smaya      init_src_reg(& inst->SrcReg[2]);
4882e64d31b9Smaya   }
4883e64d31b9Smaya}
4884e64d31b9Smaya
4885e64d31b9Smaya
4886e64d31b9Smayastruct asm_instruction *
4887e64d31b9Smayaasm_instruction_ctor(enum prog_opcode op,
4888e64d31b9Smaya		     const struct prog_dst_register *dst,
4889e64d31b9Smaya		     const struct asm_src_register *src0,
4890e64d31b9Smaya		     const struct asm_src_register *src1,
4891e64d31b9Smaya		     const struct asm_src_register *src2)
4892e64d31b9Smaya{
4893e64d31b9Smaya   struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction);
4894e64d31b9Smaya
4895e64d31b9Smaya   if (inst) {
4896e64d31b9Smaya      _mesa_init_instructions(& inst->Base, 1);
4897e64d31b9Smaya      inst->Base.Opcode = op;
4898e64d31b9Smaya
4899e64d31b9Smaya      asm_instruction_set_operands(inst, dst, src0, src1, src2);
4900e64d31b9Smaya   }
4901e64d31b9Smaya
4902e64d31b9Smaya   return inst;
4903e64d31b9Smaya}
4904e64d31b9Smaya
4905e64d31b9Smaya
4906e64d31b9Smayastruct asm_instruction *
4907e64d31b9Smayaasm_instruction_copy_ctor(const struct prog_instruction *base,
4908e64d31b9Smaya			  const struct prog_dst_register *dst,
4909e64d31b9Smaya			  const struct asm_src_register *src0,
4910e64d31b9Smaya			  const struct asm_src_register *src1,
4911e64d31b9Smaya			  const struct asm_src_register *src2)
4912e64d31b9Smaya{
4913e64d31b9Smaya   struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction);
4914e64d31b9Smaya
4915e64d31b9Smaya   if (inst) {
4916e64d31b9Smaya      _mesa_init_instructions(& inst->Base, 1);
4917e64d31b9Smaya      inst->Base.Opcode = base->Opcode;
4918e64d31b9Smaya      inst->Base.Saturate = base->Saturate;
4919e64d31b9Smaya
4920e64d31b9Smaya      asm_instruction_set_operands(inst, dst, src0, src1, src2);
4921e64d31b9Smaya   }
4922e64d31b9Smaya
4923e64d31b9Smaya   return inst;
4924e64d31b9Smaya}
4925e64d31b9Smaya
4926e64d31b9Smaya
4927e64d31b9Smayavoid
4928e64d31b9Smayainit_dst_reg(struct prog_dst_register *r)
4929e64d31b9Smaya{
4930e64d31b9Smaya   memset(r, 0, sizeof(*r));
4931e64d31b9Smaya   r->File = PROGRAM_UNDEFINED;
4932e64d31b9Smaya   r->WriteMask = WRITEMASK_XYZW;
4933e64d31b9Smaya}
4934e64d31b9Smaya
4935e64d31b9Smaya
4936e64d31b9Smaya/** Like init_dst_reg() but set the File and Index fields. */
4937e64d31b9Smayavoid
4938e64d31b9Smayaset_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index)
4939e64d31b9Smaya{
4940e64d31b9Smaya   const GLint maxIndex = 1 << INST_INDEX_BITS;
4941e64d31b9Smaya   const GLint minIndex = 0;
4942e64d31b9Smaya   assert(index >= minIndex);
4943e64d31b9Smaya   (void) minIndex;
4944e64d31b9Smaya   assert(index <= maxIndex);
4945e64d31b9Smaya   (void) maxIndex;
4946e64d31b9Smaya   assert(file == PROGRAM_TEMPORARY ||
4947e64d31b9Smaya	  file == PROGRAM_ADDRESS ||
4948e64d31b9Smaya	  file == PROGRAM_OUTPUT);
4949e64d31b9Smaya   memset(r, 0, sizeof(*r));
4950e64d31b9Smaya   r->File = file;
4951e64d31b9Smaya   r->Index = index;
4952e64d31b9Smaya   r->WriteMask = WRITEMASK_XYZW;
4953e64d31b9Smaya}
4954e64d31b9Smaya
4955e64d31b9Smaya
4956e64d31b9Smayavoid
4957e64d31b9Smayainit_src_reg(struct asm_src_register *r)
4958e64d31b9Smaya{
4959e64d31b9Smaya   memset(r, 0, sizeof(*r));
4960e64d31b9Smaya   r->Base.File = PROGRAM_UNDEFINED;
4961e64d31b9Smaya   r->Base.Swizzle = SWIZZLE_NOOP;
4962e64d31b9Smaya   r->Symbol = NULL;
4963e64d31b9Smaya}
4964e64d31b9Smaya
4965e64d31b9Smaya
4966e64d31b9Smaya/** Like init_src_reg() but set the File and Index fields.
4967e64d31b9Smaya * \return GL_TRUE if a valid src register, GL_FALSE otherwise
4968e64d31b9Smaya */
4969e64d31b9Smayavoid
4970e64d31b9Smayaset_src_reg(struct asm_src_register *r, gl_register_file file, GLint index)
4971e64d31b9Smaya{
4972e64d31b9Smaya   set_src_reg_swz(r, file, index, SWIZZLE_XYZW);
4973e64d31b9Smaya}
4974e64d31b9Smaya
4975e64d31b9Smaya
4976e64d31b9Smayavoid
4977e64d31b9Smayaset_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index,
4978e64d31b9Smaya                GLuint swizzle)
4979e64d31b9Smaya{
4980e64d31b9Smaya   const GLint maxIndex = (1 << INST_INDEX_BITS) - 1;
4981e64d31b9Smaya   const GLint minIndex = -(1 << INST_INDEX_BITS);
4982e64d31b9Smaya   assert(file < PROGRAM_FILE_MAX);
4983e64d31b9Smaya   assert(index >= minIndex);
4984e64d31b9Smaya   (void) minIndex;
4985e64d31b9Smaya   assert(index <= maxIndex);
4986e64d31b9Smaya   (void) maxIndex;
4987e64d31b9Smaya   memset(r, 0, sizeof(*r));
4988e64d31b9Smaya   r->Base.File = file;
4989e64d31b9Smaya   r->Base.Index = index;
4990e64d31b9Smaya   r->Base.Swizzle = swizzle;
4991e64d31b9Smaya   r->Symbol = NULL;
4992e64d31b9Smaya}
4993e64d31b9Smaya
4994e64d31b9Smaya
4995e64d31b9Smaya/**
4996e64d31b9Smaya * Validate the set of inputs used by a program
4997e64d31b9Smaya *
4998e64d31b9Smaya * Validates that legal sets of inputs are used by the program.  In this case
4999e64d31b9Smaya * "used" included both reading the input or binding the input to a name using
5000e64d31b9Smaya * the \c ATTRIB command.
5001e64d31b9Smaya *
5002e64d31b9Smaya * \return
5003e64d31b9Smaya * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
5004e64d31b9Smaya */
5005e64d31b9Smayaint
5006e64d31b9Smayavalidate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state)
5007e64d31b9Smaya{
5008e64d31b9Smaya   const GLbitfield64 inputs = state->prog->info.inputs_read | state->InputsBound;
5009e64d31b9Smaya   GLbitfield ff_inputs = 0;
5010e64d31b9Smaya
5011e64d31b9Smaya   /* Since Mesa internal attribute indices are different from
5012e64d31b9Smaya    * how NV_vertex_program defines attribute aliasing, we have to construct
5013e64d31b9Smaya    * a separate usage mask based on how the aliasing is defined.
5014e64d31b9Smaya    *
5015e64d31b9Smaya    * Note that attribute aliasing is optional if NV_vertex_program is
5016e64d31b9Smaya    * unsupported.
5017e64d31b9Smaya    */
5018e64d31b9Smaya   if (inputs & VERT_BIT_POS)
5019e64d31b9Smaya      ff_inputs |= 1 << 0;
5020e64d31b9Smaya   if (inputs & VERT_BIT_NORMAL)
5021e64d31b9Smaya      ff_inputs |= 1 << 2;
5022e64d31b9Smaya   if (inputs & VERT_BIT_COLOR0)
5023e64d31b9Smaya      ff_inputs |= 1 << 3;
5024e64d31b9Smaya   if (inputs & VERT_BIT_COLOR1)
5025e64d31b9Smaya      ff_inputs |= 1 << 4;
5026e64d31b9Smaya   if (inputs & VERT_BIT_FOG)
5027e64d31b9Smaya      ff_inputs |= 1 << 5;
5028e64d31b9Smaya
5029e64d31b9Smaya   ff_inputs |= ((inputs & VERT_BIT_TEX_ALL) >> VERT_ATTRIB_TEX0) << 8;
5030e64d31b9Smaya
5031e64d31b9Smaya   if ((ff_inputs & (inputs >> VERT_ATTRIB_GENERIC0)) != 0) {
5032e64d31b9Smaya      yyerror(locp, state, "illegal use of generic attribute and name attribute");
5033e64d31b9Smaya      return 0;
5034e64d31b9Smaya   }
5035e64d31b9Smaya
5036e64d31b9Smaya   return 1;
5037e64d31b9Smaya}
5038e64d31b9Smaya
5039e64d31b9Smaya
5040e64d31b9Smayastruct asm_symbol *
5041e64d31b9Smayadeclare_variable(struct asm_parser_state *state, char *name, enum asm_type t,
5042e64d31b9Smaya		 struct YYLTYPE *locp)
5043e64d31b9Smaya{
5044e64d31b9Smaya   struct asm_symbol *s = NULL;
5045e64d31b9Smaya   struct asm_symbol *exist = (struct asm_symbol *)
5046e64d31b9Smaya      _mesa_symbol_table_find_symbol(state->st, name);
5047e64d31b9Smaya
5048e64d31b9Smaya
5049e64d31b9Smaya   if (exist != NULL) {
5050e64d31b9Smaya      yyerror(locp, state, "redeclared identifier");
5051e64d31b9Smaya   } else {
5052e64d31b9Smaya      s = calloc(1, sizeof(struct asm_symbol));
5053e64d31b9Smaya      s->name = name;
5054e64d31b9Smaya      s->type = t;
5055e64d31b9Smaya
5056e64d31b9Smaya      switch (t) {
5057e64d31b9Smaya      case at_temp:
5058e64d31b9Smaya         if (state->prog->arb.NumTemporaries >= state->limits->MaxTemps) {
5059e64d31b9Smaya	    yyerror(locp, state, "too many temporaries declared");
5060e64d31b9Smaya	    free(s);
5061e64d31b9Smaya	    return NULL;
5062e64d31b9Smaya	 }
5063e64d31b9Smaya
5064e64d31b9Smaya         s->temp_binding = state->prog->arb.NumTemporaries;
5065e64d31b9Smaya         state->prog->arb.NumTemporaries++;
5066e64d31b9Smaya	 break;
5067e64d31b9Smaya
5068e64d31b9Smaya      case at_address:
5069e64d31b9Smaya         if (state->prog->arb.NumAddressRegs >=
5070e64d31b9Smaya             state->limits->MaxAddressRegs) {
5071e64d31b9Smaya	    yyerror(locp, state, "too many address registers declared");
5072e64d31b9Smaya	    free(s);
5073e64d31b9Smaya	    return NULL;
5074e64d31b9Smaya	 }
5075e64d31b9Smaya
5076e64d31b9Smaya	 /* FINISHME: Add support for multiple address registers.
5077e64d31b9Smaya	  */
5078e64d31b9Smaya         state->prog->arb.NumAddressRegs++;
5079e64d31b9Smaya	 break;
5080e64d31b9Smaya
5081e64d31b9Smaya      default:
5082e64d31b9Smaya	 break;
5083e64d31b9Smaya      }
5084e64d31b9Smaya
5085e64d31b9Smaya      _mesa_symbol_table_add_symbol(state->st, s->name, s);
5086e64d31b9Smaya      s->next = state->sym;
5087e64d31b9Smaya      state->sym = s;
5088e64d31b9Smaya   }
5089e64d31b9Smaya
5090e64d31b9Smaya   return s;
5091e64d31b9Smaya}
5092e64d31b9Smaya
5093e64d31b9Smaya
5094e64d31b9Smayaint add_state_reference(struct gl_program_parameter_list *param_list,
5095e64d31b9Smaya			const gl_state_index16 tokens[STATE_LENGTH])
5096e64d31b9Smaya{
5097e64d31b9Smaya   const GLuint size = 4; /* XXX fix */
5098e64d31b9Smaya   char *name;
5099e64d31b9Smaya   GLint index;
5100e64d31b9Smaya
5101e64d31b9Smaya   name = _mesa_program_state_string(tokens);
5102e64d31b9Smaya   index = _mesa_add_parameter(param_list, PROGRAM_STATE_VAR, name,
5103e64d31b9Smaya                               size, GL_NONE, NULL, tokens, true);
5104e64d31b9Smaya   param_list->StateFlags |= _mesa_program_state_flags(tokens);
5105e64d31b9Smaya
5106e64d31b9Smaya   /* free name string here since we duplicated it in add_parameter() */
5107e64d31b9Smaya   free(name);
5108e64d31b9Smaya
5109e64d31b9Smaya   return index;
5110e64d31b9Smaya}
5111e64d31b9Smaya
5112e64d31b9Smaya
5113e64d31b9Smayaint
5114e64d31b9Smayainitialize_symbol_from_state(struct gl_program *prog,
511596c5ddc4Srjs			     struct asm_symbol *param_var,
5116e64d31b9Smaya			     const gl_state_index16 tokens[STATE_LENGTH])
5117e64d31b9Smaya{
5118e64d31b9Smaya   int idx = -1;
5119e64d31b9Smaya   gl_state_index16 state_tokens[STATE_LENGTH];
5120e64d31b9Smaya
5121e64d31b9Smaya
5122e64d31b9Smaya   memcpy(state_tokens, tokens, sizeof(state_tokens));
5123e64d31b9Smaya
5124e64d31b9Smaya   param_var->type = at_param;
5125e64d31b9Smaya   param_var->param_binding_type = PROGRAM_STATE_VAR;
5126e64d31b9Smaya
5127e64d31b9Smaya   /* If we are adding a STATE_MATRIX that has multiple rows, we need to
5128e64d31b9Smaya    * unroll it and call add_state_reference() for each row
5129e64d31b9Smaya    */
513096c5ddc4Srjs   if (state_tokens[0] >= STATE_MODELVIEW_MATRIX &&
513196c5ddc4Srjs       state_tokens[0] <= STATE_PROGRAM_MATRIX_INVTRANS
5132e64d31b9Smaya       && (state_tokens[2] != state_tokens[3])) {
5133e64d31b9Smaya      int row;
5134e64d31b9Smaya      const int first_row = state_tokens[2];
5135e64d31b9Smaya      const int last_row = state_tokens[3];
5136e64d31b9Smaya
5137e64d31b9Smaya      for (row = first_row; row <= last_row; row++) {
5138e64d31b9Smaya	 state_tokens[2] = state_tokens[3] = row;
5139e64d31b9Smaya
5140e64d31b9Smaya	 idx = add_state_reference(prog->Parameters, state_tokens);
5141e64d31b9Smaya	 if (param_var->param_binding_begin == ~0U) {
5142e64d31b9Smaya	    param_var->param_binding_begin = idx;
5143e64d31b9Smaya            param_var->param_binding_swizzle = SWIZZLE_XYZW;
5144e64d31b9Smaya         }
5145e64d31b9Smaya
5146e64d31b9Smaya	 param_var->param_binding_length++;
5147e64d31b9Smaya      }
5148e64d31b9Smaya   }
5149e64d31b9Smaya   else {
5150e64d31b9Smaya      idx = add_state_reference(prog->Parameters, state_tokens);
5151e64d31b9Smaya      if (param_var->param_binding_begin == ~0U) {
5152e64d31b9Smaya	 param_var->param_binding_begin = idx;
5153e64d31b9Smaya         param_var->param_binding_swizzle = SWIZZLE_XYZW;
5154e64d31b9Smaya      }
5155e64d31b9Smaya      param_var->param_binding_length++;
5156e64d31b9Smaya   }
5157e64d31b9Smaya
5158e64d31b9Smaya   return idx;
5159e64d31b9Smaya}
5160e64d31b9Smaya
5161e64d31b9Smaya
5162e64d31b9Smayaint
5163e64d31b9Smayainitialize_symbol_from_param(struct gl_program *prog,
516496c5ddc4Srjs			     struct asm_symbol *param_var,
5165e64d31b9Smaya			     const gl_state_index16 tokens[STATE_LENGTH])
5166e64d31b9Smaya{
5167e64d31b9Smaya   int idx = -1;
5168e64d31b9Smaya   gl_state_index16 state_tokens[STATE_LENGTH];
5169e64d31b9Smaya
5170e64d31b9Smaya
5171e64d31b9Smaya   memcpy(state_tokens, tokens, sizeof(state_tokens));
5172e64d31b9Smaya
517396c5ddc4Srjs   assert(state_tokens[0] == STATE_VERTEX_PROGRAM_ENV ||
517496c5ddc4Srjs          state_tokens[0] == STATE_VERTEX_PROGRAM_LOCAL ||
517596c5ddc4Srjs          state_tokens[0] == STATE_FRAGMENT_PROGRAM_ENV ||
517696c5ddc4Srjs          state_tokens[0] == STATE_FRAGMENT_PROGRAM_LOCAL);
5177e64d31b9Smaya
5178e64d31b9Smaya   /*
5179e64d31b9Smaya    * The param type is STATE_VAR.  The program parameter entry will
5180e64d31b9Smaya    * effectively be a pointer into the LOCAL or ENV parameter array.
5181e64d31b9Smaya    */
5182e64d31b9Smaya   param_var->type = at_param;
5183e64d31b9Smaya   param_var->param_binding_type = PROGRAM_STATE_VAR;
5184e64d31b9Smaya
5185e64d31b9Smaya   /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
5186e64d31b9Smaya    * we need to unroll it and call add_state_reference() for each row
5187e64d31b9Smaya    */
518896c5ddc4Srjs   if (state_tokens[1] != state_tokens[2]) {
5189e64d31b9Smaya      int row;
519096c5ddc4Srjs      const int first_row = state_tokens[1];
519196c5ddc4Srjs      const int last_row = state_tokens[2];
5192e64d31b9Smaya
5193e64d31b9Smaya      for (row = first_row; row <= last_row; row++) {
519496c5ddc4Srjs	 state_tokens[1] = state_tokens[2] = row;
5195e64d31b9Smaya
5196e64d31b9Smaya	 idx = add_state_reference(prog->Parameters, state_tokens);
5197e64d31b9Smaya	 if (param_var->param_binding_begin == ~0U) {
5198e64d31b9Smaya	    param_var->param_binding_begin = idx;
5199e64d31b9Smaya            param_var->param_binding_swizzle = SWIZZLE_XYZW;
5200e64d31b9Smaya         }
5201e64d31b9Smaya	 param_var->param_binding_length++;
5202e64d31b9Smaya      }
5203e64d31b9Smaya   }
5204e64d31b9Smaya   else {
5205e64d31b9Smaya      idx = add_state_reference(prog->Parameters, state_tokens);
5206e64d31b9Smaya      if (param_var->param_binding_begin == ~0U) {
5207e64d31b9Smaya	 param_var->param_binding_begin = idx;
5208e64d31b9Smaya         param_var->param_binding_swizzle = SWIZZLE_XYZW;
5209e64d31b9Smaya      }
5210e64d31b9Smaya      param_var->param_binding_length++;
5211e64d31b9Smaya   }
5212e64d31b9Smaya
5213e64d31b9Smaya   return idx;
5214e64d31b9Smaya}
5215e64d31b9Smaya
5216e64d31b9Smaya
5217e64d31b9Smaya/**
5218e64d31b9Smaya * Put a float/vector constant/literal into the parameter list.
5219e64d31b9Smaya * \param param_var  returns info about the parameter/constant's location,
5220e64d31b9Smaya *                   binding, type, etc.
5221e64d31b9Smaya * \param vec  the vector/constant to add
5222e64d31b9Smaya * \param allowSwizzle  if true, try to consolidate constants which only differ
5223e64d31b9Smaya *                      by a swizzle.  We don't want to do this when building
5224e64d31b9Smaya *                      arrays of constants that may be indexed indirectly.
5225e64d31b9Smaya * \return index of the constant in the parameter list.
5226e64d31b9Smaya */
5227e64d31b9Smayaint
5228e64d31b9Smayainitialize_symbol_from_const(struct gl_program *prog,
522996c5ddc4Srjs			     struct asm_symbol *param_var,
5230e64d31b9Smaya			     const struct asm_vector *vec,
5231e64d31b9Smaya                             GLboolean allowSwizzle)
5232e64d31b9Smaya{
5233e64d31b9Smaya   unsigned swizzle;
5234e64d31b9Smaya   const int idx = _mesa_add_unnamed_constant(prog->Parameters,
5235e64d31b9Smaya                                              vec->data, vec->count,
5236e64d31b9Smaya                                              allowSwizzle ? &swizzle : NULL);
5237e64d31b9Smaya
5238e64d31b9Smaya   param_var->type = at_param;
5239e64d31b9Smaya   param_var->param_binding_type = PROGRAM_CONSTANT;
5240e64d31b9Smaya
5241e64d31b9Smaya   if (param_var->param_binding_begin == ~0U) {
5242e64d31b9Smaya      param_var->param_binding_begin = idx;
5243e64d31b9Smaya      param_var->param_binding_swizzle = allowSwizzle ? swizzle : SWIZZLE_XYZW;
5244e64d31b9Smaya   }
5245e64d31b9Smaya   param_var->param_binding_length++;
5246e64d31b9Smaya
5247e64d31b9Smaya   return idx;
5248e64d31b9Smaya}
5249e64d31b9Smaya
5250e64d31b9Smaya
5251e64d31b9Smayachar *
5252e64d31b9Smayamake_error_string(const char *fmt, ...)
5253e64d31b9Smaya{
5254e64d31b9Smaya   int length;
5255e64d31b9Smaya   char *str;
5256e64d31b9Smaya   va_list args;
5257e64d31b9Smaya
5258e64d31b9Smaya
5259e64d31b9Smaya   /* Call vsnprintf once to determine how large the final string is.  Call it
5260e64d31b9Smaya    * again to do the actual formatting.  from the vsnprintf manual page:
5261e64d31b9Smaya    *
5262e64d31b9Smaya    *    Upon successful return, these functions return the number of
5263e64d31b9Smaya    *    characters printed  (not including the trailing '\0' used to end
5264e64d31b9Smaya    *    output to strings).
5265e64d31b9Smaya    */
5266e64d31b9Smaya   va_start(args, fmt);
5267e64d31b9Smaya   length = 1 + vsnprintf(NULL, 0, fmt, args);
5268e64d31b9Smaya   va_end(args);
5269e64d31b9Smaya
5270e64d31b9Smaya   str = malloc(length);
5271e64d31b9Smaya   if (str) {
5272e64d31b9Smaya      va_start(args, fmt);
5273e64d31b9Smaya      vsnprintf(str, length, fmt, args);
5274e64d31b9Smaya      va_end(args);
5275e64d31b9Smaya   }
5276e64d31b9Smaya
5277e64d31b9Smaya   return str;
5278e64d31b9Smaya}
5279e64d31b9Smaya
5280e64d31b9Smaya
5281e64d31b9Smayavoid
5282e64d31b9Smayayyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s)
5283e64d31b9Smaya{
5284e64d31b9Smaya   char *err_str;
5285e64d31b9Smaya
5286e64d31b9Smaya
5287e64d31b9Smaya   err_str = make_error_string("glProgramStringARB(%s)\n", s);
5288e64d31b9Smaya   if (err_str) {
5289e64d31b9Smaya      _mesa_error(state->ctx, GL_INVALID_OPERATION, "%s", err_str);
5290e64d31b9Smaya      free(err_str);
5291e64d31b9Smaya   }
5292e64d31b9Smaya
5293e64d31b9Smaya   err_str = make_error_string("line %u, char %u: error: %s\n",
5294e64d31b9Smaya			       locp->first_line, locp->first_column, s);
5295e64d31b9Smaya   _mesa_set_program_error(state->ctx, locp->position, err_str);
5296e64d31b9Smaya
5297e64d31b9Smaya   if (err_str) {
5298e64d31b9Smaya      free(err_str);
5299e64d31b9Smaya   }
5300e64d31b9Smaya}
5301e64d31b9Smaya
5302e64d31b9Smaya
5303e64d31b9SmayaGLboolean
5304e64d31b9Smaya_mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *str,
5305e64d31b9Smaya			GLsizei len, struct asm_parser_state *state)
5306e64d31b9Smaya{
5307e64d31b9Smaya   struct asm_instruction *inst;
5308e64d31b9Smaya   unsigned i;
5309e64d31b9Smaya   GLubyte *strz;
5310e64d31b9Smaya   GLboolean result = GL_FALSE;
5311e64d31b9Smaya   void *temp;
5312e64d31b9Smaya   struct asm_symbol *sym;
5313e64d31b9Smaya
5314e64d31b9Smaya   state->ctx = ctx;
5315e64d31b9Smaya   state->prog->Target = target;
5316e64d31b9Smaya   state->prog->Parameters = _mesa_new_parameter_list();
5317e64d31b9Smaya
5318e64d31b9Smaya   /* Make a copy of the program string and force it to be NUL-terminated.
5319e64d31b9Smaya    */
5320e64d31b9Smaya   strz = (GLubyte *) ralloc_size(state->mem_ctx, len + 1);
5321e64d31b9Smaya   if (strz == NULL) {
532296c5ddc4Srjs      if (state->prog->Parameters) {
532396c5ddc4Srjs         _mesa_free_parameter_list(state->prog->Parameters);
532496c5ddc4Srjs         state->prog->Parameters = NULL;
532596c5ddc4Srjs      }
5326e64d31b9Smaya      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
5327e64d31b9Smaya      return GL_FALSE;
5328e64d31b9Smaya   }
5329e64d31b9Smaya   memcpy (strz, str, len);
5330e64d31b9Smaya   strz[len] = '\0';
5331e64d31b9Smaya
5332e64d31b9Smaya   state->prog->String = strz;
5333e64d31b9Smaya
5334e64d31b9Smaya   state->st = _mesa_symbol_table_ctor();
5335e64d31b9Smaya
5336e64d31b9Smaya   state->limits = (target == GL_VERTEX_PROGRAM_ARB)
5337e64d31b9Smaya      ? & ctx->Const.Program[MESA_SHADER_VERTEX]
5338e64d31b9Smaya      : & ctx->Const.Program[MESA_SHADER_FRAGMENT];
5339e64d31b9Smaya
5340e64d31b9Smaya   state->MaxTextureImageUnits = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
5341e64d31b9Smaya   state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits;
5342e64d31b9Smaya   state->MaxTextureUnits = ctx->Const.MaxTextureUnits;
5343e64d31b9Smaya   state->MaxClipPlanes = ctx->Const.MaxClipPlanes;
5344e64d31b9Smaya   state->MaxLights = ctx->Const.MaxLights;
5345e64d31b9Smaya   state->MaxProgramMatrices = ctx->Const.MaxProgramMatrices;
5346e64d31b9Smaya   state->MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
5347e64d31b9Smaya
534896c5ddc4Srjs   state->state_param_enum_env = (target == GL_VERTEX_PROGRAM_ARB)
534996c5ddc4Srjs      ? STATE_VERTEX_PROGRAM_ENV : STATE_FRAGMENT_PROGRAM_ENV;
535096c5ddc4Srjs   state->state_param_enum_local = (target == GL_VERTEX_PROGRAM_ARB)
535196c5ddc4Srjs      ? STATE_VERTEX_PROGRAM_LOCAL : STATE_FRAGMENT_PROGRAM_LOCAL;
5352e64d31b9Smaya
5353e64d31b9Smaya   _mesa_set_program_error(ctx, -1, NULL);
5354e64d31b9Smaya
5355e64d31b9Smaya   _mesa_program_lexer_ctor(& state->scanner, state, (const char *) str, len);
5356e64d31b9Smaya   yyparse(state);
5357e64d31b9Smaya   _mesa_program_lexer_dtor(state->scanner);
5358e64d31b9Smaya
5359e64d31b9Smaya
5360e64d31b9Smaya   if (ctx->Program.ErrorPos != -1) {
5361e64d31b9Smaya      goto error;
5362e64d31b9Smaya   }
5363e64d31b9Smaya
5364e64d31b9Smaya   if (! _mesa_layout_parameters(state)) {
5365e64d31b9Smaya      struct YYLTYPE loc;
5366e64d31b9Smaya
5367e64d31b9Smaya      loc.first_line = 0;
5368e64d31b9Smaya      loc.first_column = 0;
5369e64d31b9Smaya      loc.position = len;
5370e64d31b9Smaya
5371e64d31b9Smaya      yyerror(& loc, state, "invalid PARAM usage");
5372e64d31b9Smaya      goto error;
5373e64d31b9Smaya   }
5374e64d31b9Smaya
5375e64d31b9Smaya
537696c5ddc4Srjs
5377e64d31b9Smaya   /* Add one instruction to store the "END" instruction.
5378e64d31b9Smaya    */
5379e64d31b9Smaya   state->prog->arb.Instructions =
5380e64d31b9Smaya      rzalloc_array(state->mem_ctx, struct prog_instruction,
5381e64d31b9Smaya                    state->prog->arb.NumInstructions + 1);
5382e64d31b9Smaya
5383e64d31b9Smaya   if (state->prog->arb.Instructions == NULL) {
5384e64d31b9Smaya      goto error;
5385e64d31b9Smaya   }
5386e64d31b9Smaya
5387e64d31b9Smaya   inst = state->inst_head;
5388e64d31b9Smaya   for (i = 0; i < state->prog->arb.NumInstructions; i++) {
5389e64d31b9Smaya      struct asm_instruction *const temp = inst->next;
5390e64d31b9Smaya
5391e64d31b9Smaya      state->prog->arb.Instructions[i] = inst->Base;
5392e64d31b9Smaya      inst = temp;
5393e64d31b9Smaya   }
5394e64d31b9Smaya
5395e64d31b9Smaya   /* Finally, tag on an OPCODE_END instruction */
5396e64d31b9Smaya   {
5397e64d31b9Smaya      const GLuint numInst = state->prog->arb.NumInstructions;
5398e64d31b9Smaya      _mesa_init_instructions(state->prog->arb.Instructions + numInst, 1);
5399e64d31b9Smaya      state->prog->arb.Instructions[numInst].Opcode = OPCODE_END;
5400e64d31b9Smaya   }
5401e64d31b9Smaya   state->prog->arb.NumInstructions++;
5402e64d31b9Smaya
5403e64d31b9Smaya   state->prog->arb.NumParameters = state->prog->Parameters->NumParameters;
5404e64d31b9Smaya   state->prog->arb.NumAttributes =
5405e64d31b9Smaya      util_bitcount64(state->prog->info.inputs_read);
5406e64d31b9Smaya
5407e64d31b9Smaya   /*
5408e64d31b9Smaya    * Initialize native counts to logical counts.  The device driver may
5409e64d31b9Smaya    * change them if program is translated into a hardware program.
5410e64d31b9Smaya    */
5411e64d31b9Smaya   state->prog->arb.NumNativeInstructions = state->prog->arb.NumInstructions;
5412e64d31b9Smaya   state->prog->arb.NumNativeTemporaries = state->prog->arb.NumTemporaries;
5413e64d31b9Smaya   state->prog->arb.NumNativeParameters = state->prog->arb.NumParameters;
5414e64d31b9Smaya   state->prog->arb.NumNativeAttributes = state->prog->arb.NumAttributes;
5415e64d31b9Smaya   state->prog->arb.NumNativeAddressRegs = state->prog->arb.NumAddressRegs;
5416e64d31b9Smaya
5417e64d31b9Smaya   result = GL_TRUE;
5418e64d31b9Smaya
5419e64d31b9Smayaerror:
5420e64d31b9Smaya   for (inst = state->inst_head; inst != NULL; inst = temp) {
5421e64d31b9Smaya      temp = inst->next;
5422e64d31b9Smaya      free(inst);
5423e64d31b9Smaya   }
5424e64d31b9Smaya
5425e64d31b9Smaya   state->inst_head = NULL;
5426e64d31b9Smaya   state->inst_tail = NULL;
5427e64d31b9Smaya
5428e64d31b9Smaya   for (sym = state->sym; sym != NULL; sym = temp) {
5429e64d31b9Smaya      temp = sym->next;
5430e64d31b9Smaya
5431e64d31b9Smaya      free((void *) sym->name);
5432e64d31b9Smaya      free(sym);
5433e64d31b9Smaya   }
5434e64d31b9Smaya   state->sym = NULL;
5435e64d31b9Smaya
5436e64d31b9Smaya   _mesa_symbol_table_dtor(state->st);
5437e64d31b9Smaya   state->st = NULL;
5438e64d31b9Smaya
543996c5ddc4Srjs   if (result != GL_TRUE) {
544096c5ddc4Srjs      if (state->prog->Parameters) {
544196c5ddc4Srjs         _mesa_free_parameter_list(state->prog->Parameters);
544296c5ddc4Srjs         state->prog->Parameters = NULL;
544396c5ddc4Srjs      }
544496c5ddc4Srjs      ralloc_free(state->prog->String);
544596c5ddc4Srjs      state->prog->String = NULL;
544696c5ddc4Srjs   }
544796c5ddc4Srjs
5448e64d31b9Smaya   return result;
5449e64d31b9Smaya}
5450