glsl: Refactor variable declaration handling.
[mesa.git] / src / glsl / glsl_parser.h
1 /* A Bison parser, made by GNU Bison 2.4.3. */
2
3 /* Skeleton interface for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2009, 2010 Free Software Foundation, Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34
35 /* Tokens. */
36 #ifndef YYTOKENTYPE
37 # define YYTOKENTYPE
38 /* Put the tokens into the symbol table, so that GDB and other debuggers
39 know about them. */
40 enum yytokentype {
41 ATTRIBUTE = 258,
42 CONST_TOK = 259,
43 BOOL_TOK = 260,
44 FLOAT_TOK = 261,
45 INT_TOK = 262,
46 UINT_TOK = 263,
47 BREAK = 264,
48 CONTINUE = 265,
49 DO = 266,
50 ELSE = 267,
51 FOR = 268,
52 IF = 269,
53 DISCARD = 270,
54 RETURN = 271,
55 SWITCH = 272,
56 CASE = 273,
57 DEFAULT = 274,
58 BVEC2 = 275,
59 BVEC3 = 276,
60 BVEC4 = 277,
61 IVEC2 = 278,
62 IVEC3 = 279,
63 IVEC4 = 280,
64 UVEC2 = 281,
65 UVEC3 = 282,
66 UVEC4 = 283,
67 VEC2 = 284,
68 VEC3 = 285,
69 VEC4 = 286,
70 CENTROID = 287,
71 IN_TOK = 288,
72 OUT_TOK = 289,
73 INOUT_TOK = 290,
74 UNIFORM = 291,
75 VARYING = 292,
76 NOPERSPECTIVE = 293,
77 FLAT = 294,
78 SMOOTH = 295,
79 MAT2X2 = 296,
80 MAT2X3 = 297,
81 MAT2X4 = 298,
82 MAT3X2 = 299,
83 MAT3X3 = 300,
84 MAT3X4 = 301,
85 MAT4X2 = 302,
86 MAT4X3 = 303,
87 MAT4X4 = 304,
88 SAMPLER1D = 305,
89 SAMPLER2D = 306,
90 SAMPLER3D = 307,
91 SAMPLERCUBE = 308,
92 SAMPLER1DSHADOW = 309,
93 SAMPLER2DSHADOW = 310,
94 SAMPLERCUBESHADOW = 311,
95 SAMPLER1DARRAY = 312,
96 SAMPLER2DARRAY = 313,
97 SAMPLER1DARRAYSHADOW = 314,
98 SAMPLER2DARRAYSHADOW = 315,
99 ISAMPLER1D = 316,
100 ISAMPLER2D = 317,
101 ISAMPLER3D = 318,
102 ISAMPLERCUBE = 319,
103 ISAMPLER1DARRAY = 320,
104 ISAMPLER2DARRAY = 321,
105 USAMPLER1D = 322,
106 USAMPLER2D = 323,
107 USAMPLER3D = 324,
108 USAMPLERCUBE = 325,
109 USAMPLER1DARRAY = 326,
110 USAMPLER2DARRAY = 327,
111 STRUCT = 328,
112 VOID_TOK = 329,
113 WHILE = 330,
114 IDENTIFIER = 331,
115 FLOATCONSTANT = 332,
116 INTCONSTANT = 333,
117 UINTCONSTANT = 334,
118 BOOLCONSTANT = 335,
119 FIELD_SELECTION = 336,
120 LEFT_OP = 337,
121 RIGHT_OP = 338,
122 INC_OP = 339,
123 DEC_OP = 340,
124 LE_OP = 341,
125 GE_OP = 342,
126 EQ_OP = 343,
127 NE_OP = 344,
128 AND_OP = 345,
129 OR_OP = 346,
130 XOR_OP = 347,
131 MUL_ASSIGN = 348,
132 DIV_ASSIGN = 349,
133 ADD_ASSIGN = 350,
134 MOD_ASSIGN = 351,
135 LEFT_ASSIGN = 352,
136 RIGHT_ASSIGN = 353,
137 AND_ASSIGN = 354,
138 XOR_ASSIGN = 355,
139 OR_ASSIGN = 356,
140 SUB_ASSIGN = 357,
141 INVARIANT = 358,
142 LOWP = 359,
143 MEDIUMP = 360,
144 HIGHP = 361,
145 SUPERP = 362,
146 PRECISION = 363,
147 VERSION = 364,
148 EXTENSION = 365,
149 LINE = 366,
150 PRAGMA = 367,
151 COLON = 368,
152 EOL = 369,
153 INTERFACE = 370,
154 OUTPUT = 371,
155 LAYOUT_TOK = 372,
156 ASM = 373,
157 CLASS = 374,
158 UNION = 375,
159 ENUM = 376,
160 TYPEDEF = 377,
161 TEMPLATE = 378,
162 THIS = 379,
163 PACKED_TOK = 380,
164 GOTO = 381,
165 INLINE_TOK = 382,
166 NOINLINE = 383,
167 VOLATILE = 384,
168 PUBLIC_TOK = 385,
169 STATIC = 386,
170 EXTERN = 387,
171 EXTERNAL = 388,
172 LONG_TOK = 389,
173 SHORT_TOK = 390,
174 DOUBLE_TOK = 391,
175 HALF = 392,
176 FIXED_TOK = 393,
177 UNSIGNED = 394,
178 INPUT_TOK = 395,
179 OUPTUT = 396,
180 HVEC2 = 397,
181 HVEC3 = 398,
182 HVEC4 = 399,
183 DVEC2 = 400,
184 DVEC3 = 401,
185 DVEC4 = 402,
186 FVEC2 = 403,
187 FVEC3 = 404,
188 FVEC4 = 405,
189 SAMPLER2DRECT = 406,
190 SAMPLER3DRECT = 407,
191 SAMPLER2DRECTSHADOW = 408,
192 SIZEOF = 409,
193 CAST = 410,
194 NAMESPACE = 411,
195 USING = 412,
196 ERROR_TOK = 413,
197 COMMON = 414,
198 PARTITION = 415,
199 ACTIVE = 416,
200 SAMPLERBUFFER = 417,
201 FILTER = 418,
202 IMAGE1D = 419,
203 IMAGE2D = 420,
204 IMAGE3D = 421,
205 IMAGECUBE = 422,
206 IMAGE1DARRAY = 423,
207 IMAGE2DARRAY = 424,
208 IIMAGE1D = 425,
209 IIMAGE2D = 426,
210 IIMAGE3D = 427,
211 IIMAGECUBE = 428,
212 IIMAGE1DARRAY = 429,
213 IIMAGE2DARRAY = 430,
214 UIMAGE1D = 431,
215 UIMAGE2D = 432,
216 UIMAGE3D = 433,
217 UIMAGECUBE = 434,
218 UIMAGE1DARRAY = 435,
219 UIMAGE2DARRAY = 436,
220 IMAGE1DSHADOW = 437,
221 IMAGE2DSHADOW = 438,
222 IMAGEBUFFER = 439,
223 IIMAGEBUFFER = 440,
224 UIMAGEBUFFER = 441,
225 ROW_MAJOR = 442
226 };
227 #endif
228
229
230
231 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
232 typedef union YYSTYPE
233 {
234
235 /* Line 1685 of yacc.c */
236 #line 52 "glsl_parser.ypp"
237
238 int n;
239 float real;
240 char *identifier;
241
242 union {
243 struct ast_type_qualifier q;
244 unsigned i;
245 } type_qualifier;
246
247 ast_node *node;
248 ast_type_specifier *type_specifier;
249 ast_fully_specified_type *fully_specified_type;
250 ast_function *function;
251 ast_parameter_declarator *parameter_declarator;
252 ast_function_definition *function_definition;
253 ast_compound_statement *compound_statement;
254 ast_expression *expression;
255 ast_declarator_list *declarator_list;
256 ast_struct_specifier *struct_specifier;
257 ast_declaration *declaration;
258
259 struct {
260 ast_node *cond;
261 ast_expression *rest;
262 } for_rest_statement;
263
264
265
266 /* Line 1685 of yacc.c */
267 #line 268 "glsl_parser.h"
268 } YYSTYPE;
269 # define YYSTYPE_IS_TRIVIAL 1
270 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
271 # define YYSTYPE_IS_DECLARED 1
272 #endif
273
274
275
276 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
277 typedef struct YYLTYPE
278 {
279 int first_line;
280 int first_column;
281 int last_line;
282 int last_column;
283 } YYLTYPE;
284 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
285 # define YYLTYPE_IS_DECLARED 1
286 # define YYLTYPE_IS_TRIVIAL 1
287 #endif
288
289
290