blob: e3d0a3cfc9dfe191e878d13ec3dcf8b8e7619730 [file] [log] [blame]
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001#line 2 "glsl_lexer.cpp"
2
3#line 4 "glsl_lexer.cpp"
4
5#define YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
8
9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 5
12#define YY_FLEX_SUBMINOR_VERSION 35
13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA
15#endif
16
17/* First, we deal with platform-specific or compiler-specific issues. */
18
19/* begin standard C headers. */
20#include <stdio.h>
21#include <string.h>
22#include <errno.h>
23#include <stdlib.h>
24
25/* end standard C headers. */
26
27/* flex integer type definitions */
28
29#ifndef FLEXINT_H
30#define FLEXINT_H
31
32/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 */
39#ifndef __STDC_LIMIT_MACROS
40#define __STDC_LIMIT_MACROS 1
41#endif
42
43#include <inttypes.h>
44typedef int8_t flex_int8_t;
45typedef uint8_t flex_uint8_t;
46typedef int16_t flex_int16_t;
47typedef uint16_t flex_uint16_t;
48typedef int32_t flex_int32_t;
49typedef uint32_t flex_uint32_t;
50#else
51typedef signed char flex_int8_t;
52typedef short int flex_int16_t;
53typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t;
55typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t;
Kenneth Graunke0d082c02010-11-13 22:02:32 -080057#endif /* ! C99 */
Carl Worthe8a8f0f2010-07-28 12:27:33 -070058
59/* Limits of integral types. */
60#ifndef INT8_MIN
61#define INT8_MIN (-128)
62#endif
63#ifndef INT16_MIN
64#define INT16_MIN (-32767-1)
65#endif
66#ifndef INT32_MIN
67#define INT32_MIN (-2147483647-1)
68#endif
69#ifndef INT8_MAX
70#define INT8_MAX (127)
71#endif
72#ifndef INT16_MAX
73#define INT16_MAX (32767)
74#endif
75#ifndef INT32_MAX
76#define INT32_MAX (2147483647)
77#endif
78#ifndef UINT8_MAX
79#define UINT8_MAX (255U)
80#endif
81#ifndef UINT16_MAX
82#define UINT16_MAX (65535U)
83#endif
84#ifndef UINT32_MAX
85#define UINT32_MAX (4294967295U)
86#endif
87
Carl Worthe8a8f0f2010-07-28 12:27:33 -070088#endif /* ! FLEXINT_H */
89
90#ifdef __cplusplus
91
92/* The "const" storage-class-modifier is valid. */
93#define YY_USE_CONST
94
95#else /* ! __cplusplus */
96
97/* C99 requires __STDC__ to be defined as 1. */
98#if defined (__STDC__)
99
100#define YY_USE_CONST
101
102#endif /* defined (__STDC__) */
103#endif /* ! __cplusplus */
104
105#ifdef YY_USE_CONST
106#define yyconst const
107#else
108#define yyconst
109#endif
110
111/* Returned upon end-of-file. */
112#define YY_NULL 0
113
114/* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
117 * double cast.
118 */
119#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
121/* An opaque pointer. */
122#ifndef YY_TYPEDEF_YY_SCANNER_T
123#define YY_TYPEDEF_YY_SCANNER_T
124typedef void* yyscan_t;
125#endif
126
127/* For convenience, these vars (plus the bison vars far below)
128 are macros in the reentrant scanner. */
129#define yyin yyg->yyin_r
130#define yyout yyg->yyout_r
131#define yyextra yyg->yyextra_r
132#define yyleng yyg->yyleng_r
133#define yytext yyg->yytext_r
134#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136#define yy_flex_debug yyg->yy_flex_debug_r
137
138/* Enter a start condition. This macro really ought to take a parameter,
139 * but we do it the disgusting crufty way forced on us by the ()-less
140 * definition of BEGIN.
141 */
142#define BEGIN yyg->yy_start = 1 + 2 *
143
144/* Translate the current start state into a value that can be later handed
145 * to BEGIN to return to the state. The YYSTATE alias is for lex
146 * compatibility.
147 */
148#define YY_START ((yyg->yy_start - 1) / 2)
149#define YYSTATE YY_START
150
151/* Action number for EOF rule of a given start state. */
152#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153
154/* Special action meaning "start processing a new file". */
155#define YY_NEW_FILE _mesa_glsl_restart(yyin ,yyscanner )
156
157#define YY_END_OF_BUFFER_CHAR 0
158
159/* Size of default input buffer. */
160#ifndef YY_BUF_SIZE
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700161#define YY_BUF_SIZE 16384
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700162#endif
163
164/* The state buf must be large enough to hold one state per character in the main buffer.
165 */
166#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
167
168#ifndef YY_TYPEDEF_YY_BUFFER_STATE
169#define YY_TYPEDEF_YY_BUFFER_STATE
170typedef struct yy_buffer_state *YY_BUFFER_STATE;
171#endif
172
173#define EOB_ACT_CONTINUE_SCAN 0
174#define EOB_ACT_END_OF_FILE 1
175#define EOB_ACT_LAST_MATCH 2
176
177 #define YY_LESS_LINENO(n)
178
179/* Return all but the first "n" matched characters back to the input stream. */
180#define yyless(n) \
181 do \
182 { \
183 /* Undo effects of setting up yytext. */ \
184 int yyless_macro_arg = (n); \
185 YY_LESS_LINENO(yyless_macro_arg);\
186 *yy_cp = yyg->yy_hold_char; \
187 YY_RESTORE_YY_MORE_OFFSET \
188 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
189 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
190 } \
191 while ( 0 )
192
193#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
194
195#ifndef YY_TYPEDEF_YY_SIZE_T
196#define YY_TYPEDEF_YY_SIZE_T
197typedef size_t yy_size_t;
198#endif
199
200#ifndef YY_STRUCT_YY_BUFFER_STATE
201#define YY_STRUCT_YY_BUFFER_STATE
202struct yy_buffer_state
203 {
204 FILE *yy_input_file;
205
206 char *yy_ch_buf; /* input buffer */
207 char *yy_buf_pos; /* current position in input buffer */
208
209 /* Size of input buffer in bytes, not including room for EOB
210 * characters.
211 */
212 yy_size_t yy_buf_size;
213
214 /* Number of characters read into yy_ch_buf, not including EOB
215 * characters.
216 */
217 int yy_n_chars;
218
219 /* Whether we "own" the buffer - i.e., we know we created it,
220 * and can realloc() it to grow it, and should free() it to
221 * delete it.
222 */
223 int yy_is_our_buffer;
224
225 /* Whether this is an "interactive" input source; if so, and
226 * if we're using stdio for input, then we want to use getc()
227 * instead of fread(), to make sure we stop fetching input after
228 * each newline.
229 */
230 int yy_is_interactive;
231
232 /* Whether we're considered to be at the beginning of a line.
233 * If so, '^' rules will be active on the next match, otherwise
234 * not.
235 */
236 int yy_at_bol;
237
238 int yy_bs_lineno; /**< The line count. */
239 int yy_bs_column; /**< The column count. */
240
241 /* Whether to try to fill the input buffer when we reach the
242 * end of it.
243 */
244 int yy_fill_buffer;
245
246 int yy_buffer_status;
247
248#define YY_BUFFER_NEW 0
249#define YY_BUFFER_NORMAL 1
250 /* When an EOF's been seen but there's still some text to process
251 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
252 * shouldn't try reading from the input source any more. We might
253 * still have a bunch of tokens to match, though, because of
254 * possible backing-up.
255 *
256 * When we actually see the EOF, we change the status to "new"
257 * (via _mesa_glsl_restart()), so that the user can continue scanning by
258 * just pointing yyin at a new input file.
259 */
260#define YY_BUFFER_EOF_PENDING 2
261
262 };
263#endif /* !YY_STRUCT_YY_BUFFER_STATE */
264
265/* We provide macros for accessing buffer states in case in the
266 * future we want to put the buffer states in a more general
267 * "scanner state".
268 *
269 * Returns the top of the stack, or NULL.
270 */
271#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
272 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
273 : NULL)
274
275/* Same as previous macro, but useful when we know that the buffer stack is not
276 * NULL or when we need an lvalue. For internal use only.
277 */
278#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
279
280void _mesa_glsl_restart (FILE *input_file ,yyscan_t yyscanner );
281void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
282YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
283void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
284void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
285void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
286void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner );
287
288static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner );
289static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner );
290static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
291
292#define YY_FLUSH_BUFFER _mesa_glsl__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
293
294YY_BUFFER_STATE _mesa_glsl__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
295YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
296YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
297
298void *_mesa_glsl_alloc (yy_size_t ,yyscan_t yyscanner );
299void *_mesa_glsl_realloc (void *,yy_size_t ,yyscan_t yyscanner );
300void _mesa_glsl_free (void * ,yyscan_t yyscanner );
301
302#define yy_new_buffer _mesa_glsl__create_buffer
303
304#define yy_set_interactive(is_interactive) \
305 { \
306 if ( ! YY_CURRENT_BUFFER ){ \
307 _mesa_glsl_ensure_buffer_stack (yyscanner); \
308 YY_CURRENT_BUFFER_LVALUE = \
309 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
310 } \
311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
312 }
313
314#define yy_set_bol(at_bol) \
315 { \
316 if ( ! YY_CURRENT_BUFFER ){\
317 _mesa_glsl_ensure_buffer_stack (yyscanner); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
320 } \
321 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
322 }
323
324#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
325
326/* Begin user sect3 */
327
328#define _mesa_glsl_wrap(n) 1
329#define YY_SKIP_YYWRAP
330
331typedef unsigned char YY_CHAR;
332
333typedef int yy_state_type;
334
335#define yytext_ptr yytext_r
336
337static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
338static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
339static int yy_get_next_buffer (yyscan_t yyscanner );
340static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
341
342/* Done after the current pattern has been matched and before the
343 * corresponding action - sets up yytext.
344 */
345#define YY_DO_BEFORE_ACTION \
346 yyg->yytext_ptr = yy_bp; \
347 yyleng = (size_t) (yy_cp - yy_bp); \
348 yyg->yy_hold_char = *yy_cp; \
349 *yy_cp = '\0'; \
350 yyg->yy_c_buf_p = yy_cp;
351
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800352#define YY_NUM_RULES 209
353#define YY_END_OF_BUFFER 210
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700354/* This struct is not used in this scanner,
355 but its presence is necessary. */
356struct yy_trans_info
357 {
358 flex_int32_t yy_verify;
359 flex_int32_t yy_nxt;
360 };
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800361static yyconst flex_int16_t yy_accept[813] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700362 { 0,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800363 0, 0, 15, 15, 0, 0, 210, 208, 1, 20,
364 208, 208, 208, 208, 208, 208, 208, 208, 119, 117,
365 208, 208, 208, 207, 208, 207, 207, 207, 207, 207,
366 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
367 207, 207, 207, 207, 207, 208, 1, 208, 209, 15,
368 19, 209, 18, 16, 17, 13, 12, 1, 101, 110,
369 102, 113, 107, 96, 109, 97, 116, 121, 108, 122,
370 119, 0, 0, 124, 119, 0, 117, 117, 105, 98,
371 100, 99, 106, 207, 114, 104, 207, 207, 207, 207,
372 207, 207, 207, 207, 207, 207, 207, 207, 29, 207,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700373
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800374 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
375 207, 207, 33, 207, 207, 60, 207, 207, 207, 207,
376 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
377 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
378 207, 207, 207, 207, 207, 207, 207, 207, 207, 115,
379 103, 1, 0, 0, 2, 0, 0, 0, 0, 15,
380 14, 18, 17, 0, 121, 120, 0, 122, 0, 123,
381 118, 111, 112, 207, 127, 207, 207, 207, 207, 207,
382 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
383 207, 207, 207, 207, 207, 207, 32, 207, 207, 207,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700384
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800385 207, 207, 207, 207, 207, 207, 207, 25, 207, 207,
386 207, 207, 207, 207, 207, 207, 207, 207, 207, 61,
387 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
388 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
389 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
390 0, 0, 0, 0, 14, 0, 121, 0, 120, 0,
391 122, 123, 118, 207, 207, 23, 207, 207, 174, 167,
392 207, 207, 207, 207, 207, 207, 207, 207, 207, 31,
393 130, 207, 207, 207, 207, 67, 207, 207, 135, 149,
394 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700395
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800396 207, 207, 146, 170, 48, 49, 50, 207, 207, 207,
397 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
398 207, 207, 207, 207, 207, 207, 207, 133, 125, 207,
399 207, 26, 207, 207, 207, 207, 207, 207, 207, 45,
400 46, 47, 94, 207, 207, 0, 0, 0, 0, 0,
401 120, 207, 207, 27, 36, 37, 38, 207, 128, 207,
402 22, 207, 207, 207, 207, 157, 158, 159, 207, 126,
403 207, 150, 24, 160, 161, 162, 172, 154, 155, 156,
404 207, 207, 207, 62, 152, 207, 207, 207, 39, 40,
405 41, 207, 207, 207, 207, 207, 207, 207, 207, 207,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700406
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800407 207, 207, 207, 207, 207, 207, 207, 147, 207, 207,
408 207, 207, 207, 207, 207, 207, 207, 207, 129, 207,
409 207, 169, 42, 43, 44, 207, 207, 30, 0, 0,
410 0, 0, 177, 207, 207, 175, 207, 207, 207, 148,
411 143, 180, 207, 207, 207, 207, 207, 207, 138, 207,
412 207, 207, 95, 51, 52, 53, 54, 55, 56, 57,
413 58, 59, 207, 207, 207, 207, 153, 134, 207, 207,
414 141, 35, 207, 207, 166, 68, 142, 93, 178, 136,
415 207, 207, 207, 207, 207, 207, 207, 207, 0, 0,
416 0, 0, 207, 207, 207, 137, 34, 207, 207, 207,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700417
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800418 207, 207, 207, 181, 182, 183, 207, 207, 207, 207,
419 207, 171, 207, 207, 207, 207, 207, 207, 207, 207,
420 131, 207, 207, 207, 207, 207, 63, 207, 207, 64,
421 207, 0, 0, 0, 0, 0, 207, 65, 28, 144,
422 185, 186, 187, 207, 207, 207, 207, 207, 207, 207,
423 207, 207, 207, 207, 207, 139, 207, 207, 207, 207,
424 207, 207, 207, 207, 207, 132, 189, 190, 191, 207,
425 207, 151, 207, 140, 0, 0, 6, 0, 0, 0,
426 11, 3, 21, 207, 207, 207, 207, 207, 207, 207,
427 207, 207, 184, 145, 66, 207, 207, 207, 207, 168,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700428
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800429 207, 176, 173, 206, 70, 71, 72, 207, 207, 207,
430 207, 207, 207, 207, 207, 207, 207, 0, 0, 0,
431 0, 0, 0, 207, 207, 207, 188, 207, 207, 207,
432 207, 207, 81, 82, 83, 207, 207, 207, 207, 207,
433 207, 207, 207, 207, 207, 207, 207, 207, 192, 87,
434 88, 89, 207, 4, 0, 5, 0, 0, 0, 0,
435 0, 207, 207, 207, 207, 207, 207, 207, 203, 207,
436 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
437 73, 207, 207, 207, 207, 207, 207, 0, 0, 0,
438 207, 207, 204, 193, 207, 194, 207, 207, 207, 84,
Ian Romanick33fe3642010-08-30 11:59:48 -0700439
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800440 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
441 207, 205, 207, 207, 90, 0, 0, 195, 196, 207,
442 199, 207, 200, 207, 207, 69, 207, 207, 207, 163,
443 207, 164, 179, 207, 197, 198, 207, 207, 0, 0,
444 207, 207, 207, 207, 74, 207, 75, 207, 207, 207,
445 207, 207, 0, 0, 0, 207, 207, 85, 86, 207,
446 76, 207, 207, 77, 207, 91, 92, 0, 0, 0,
447 207, 207, 207, 207, 207, 207, 0, 0, 0, 207,
448 207, 207, 207, 207, 78, 0, 0, 7, 0, 0,
449 201, 202, 207, 207, 207, 0, 8, 0, 0, 207,
450
451 207, 165, 0, 0, 79, 80, 0, 0, 9, 0,
452 10, 0
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700453 } ;
454
455static yyconst flex_int32_t yy_ec[256] =
456 { 0,
457 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
458 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700460 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
461 10, 11, 12, 1, 13, 14, 15, 16, 17, 18,
462 19, 20, 21, 21, 21, 22, 22, 23, 1, 24,
463 25, 26, 1, 1, 27, 28, 29, 30, 31, 32,
464 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800465 33, 34, 35, 33, 36, 33, 33, 37, 33, 33,
466 1, 1, 1, 38, 39, 1, 40, 41, 42, 43,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700467
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800468 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
469 54, 55, 33, 56, 57, 58, 59, 60, 61, 62,
470 63, 64, 1, 65, 1, 1, 1, 1, 1, 1,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 1, 1, 1, 1, 1
485 } ;
486
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800487static yyconst flex_int32_t yy_meta[66] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700488 { 0,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700489 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700490 1, 1, 1, 1, 1, 4, 4, 4, 4, 4,
491 4, 5, 1, 1, 1, 1, 6, 6, 6, 6,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800492 5, 5, 7, 7, 7, 7, 8, 1, 7, 6,
493 6, 6, 6, 5, 5, 7, 7, 7, 7, 7,
Ian Romanick33fe3642010-08-30 11:59:48 -0700494 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800495 7, 8, 7, 7, 1
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700496 } ;
497
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800498static yyconst flex_int16_t yy_base[824] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700499 { 0,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800500 0, 64, 70, 0, 1185, 1184, 1186, 1189, 65, 1189,
501 1160, 1159, 128, 1158, 125, 126, 124, 1157, 140, 189,
502 123, 1156, 138, 0, 127, 124, 113, 135, 144, 161,
503 176, 1126, 130, 187, 140, 143, 161, 1120, 182, 174,
504 202, 199, 211, 212, 1131, 130, 263, 255, 1189, 189,
505 1189, 1162, 256, 1189, 0, 1189, 1189, 215, 1189, 1189,
506 1189, 1189, 1189, 1189, 1189, 1189, 1189, 248, 1189, 250,
507 112, 302, 319, 1189, 1189, 0, 0, 1189, 1151, 1189,
508 1189, 1189, 1150, 0, 1189, 1189, 1116, 1121, 1114, 1117,
509 1126, 1125, 1111, 1114, 1126, 144, 1120, 1107, 1104, 1118,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700510
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800511 1104, 1101, 1101, 1107, 175, 191, 1101, 1112, 1097, 1103,
512 1107, 1108, 0, 1099, 1110, 247, 1109, 1104, 1084, 230,
513 1088, 1102, 1092, 241, 1085, 228, 1098, 1100, 1082, 1078,
514 1086, 1083, 1072, 1081, 173, 1079, 1085, 1080, 1083, 1071,
515 1074, 233, 240, 260, 1084, 1071, 1084, 239, 1077, 1189,
516 1189, 307, 301, 323, 1189, 1062, 1075, 1066, 1077, 249,
517 0, 368, 0, 379, 1189, 298, 390, 1189, 397, 404,
518 291, 1189, 1189, 1072, 0, 1063, 1067, 1077, 1074, 270,
519 1057, 1057, 1061, 291, 1072, 1069, 1069, 1067, 1064, 1055,
520 1062, 1048, 1046, 1059, 1044, 1061, 0, 1058, 1045, 1053,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700521
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800522 1050, 1054, 1055, 1048, 1045, 1033, 1032, 1046, 1049, 1036,
523 1045, 1032, 1039, 1029, 335, 1035, 1038, 1028, 1036, 1024,
524 1028, 1019, 1034, 1024, 1015, 1034, 1017, 1015, 1026, 1015,
525 1010, 1008, 1022, 1007, 1009, 1006, 1018, 1017, 1020, 1001,
526 306, 1010, 1005, 1003, 1013, 991, 339, 1010, 1012, 1000,
527 992, 996, 1008, 991, 0, 411, 421, 438, 1189, 451,
528 458, 1189, 1189, 986, 997, 0, 994, 344, 0, 0,
529 987, 985, 987, 982, 991, 979, 997, 985, 350, 0,
530 0, 979, 990, 989, 989, 0, 973, 353, 0, 0,
531 975, 357, 983, 984, 974, 968, 967, 968, 967, 967,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700532
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800533 361, 962, 0, 0, 958, 957, 956, 958, 959, 964,
534 958, 954, 968, 963, 962, 961, 952, 955, 955, 947,
535 950, 945, 954, 959, 944, 957, 947, 0, 0, 954,
536 950, 0, 941, 941, 947, 937, 945, 426, 942, 0,
537 0, 0, 0, 931, 944, 943, 942, 939, 927, 465,
538 475, 939, 941, 0, 0, 0, 0, 927, 0, 927,
539 0, 926, 927, 921, 932, 0, 0, 0, 922, 0,
540 918, 0, 0, 0, 0, 0, 0, 0, 0, 0,
541 929, 481, 928, 0, 0, 926, 922, 918, 0, 0,
542 0, 910, 443, 486, 493, 915, 911, 917, 907, 905,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700543
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800544 919, 903, 903, 917, 905, 917, 912, 0, 910, 907,
545 911, 894, 896, 903, 909, 904, 903, 890, 0, 892,
546 893, 0, 0, 0, 0, 890, 894, 0, 888, 938,
547 887, 890, 0, 878, 888, 0, 876, 876, 890, 0,
548 892, 0, 497, 901, 900, 899, 869, 868, 0, 886,
549 885, 880, 0, 0, 0, 0, 0, 0, 0, 0,
550 0, 0, 868, 882, 868, 865, 0, 0, 871, 870,
551 0, 0, 868, 860, 0, 0, 0, 0, 0, 0,
552 857, 869, 500, 861, 868, 867, 864, 858, 851, 519,
553 867, 852, 847, 861, 859, 0, 0, 851, 871, 870,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700554
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800555 869, 839, 838, 495, 496, 0, 851, 854, 852, 840,
556 836, 0, 849, 846, 845, 834, 833, 832, 515, 841,
557 0, 854, 853, 852, 822, 821, 0, 836, 822, 0,
558 833, 828, 543, 545, 873, 821, 829, 0, 0, 0,
559 845, 844, 0, 825, 828, 812, 820, 810, 818, 819,
560 819, 818, 803, 539, 816, 0, 817, 805, 804, 800,
561 825, 824, 823, 793, 792, 0, 823, 822, 0, 803,
562 806, 0, 552, 0, 792, 557, 1189, 580, 0, 590,
563 499, 1189, 0, 789, 788, 798, 798, 785, 800, 783,
564 798, 793, 0, 0, 0, 806, 805, 804, 774, 0,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700565
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800566 774, 0, 0, 0, 559, 568, 797, 785, 788, 772,
567 771, 781, 781, 794, 793, 792, 762, 767, 552, 613,
568 363, 775, 763, 761, 760, 771, 0, 774, 770, 772,
569 768, 754, 782, 781, 0, 766, 758, 749, 757, 747,
570 758, 754, 756, 754, 754, 741, 740, 751, 0, 767,
571 766, 0, 751, 1189, 391, 1189, 620, 0, 640, 750,
572 732, 749, 748, 731, 723, 731, 721, 729, 0, 726,
573 725, 736, 719, 722, 737, 720, 733, 734, 731, 728,
574 736, 730, 729, 712, 711, 710, 721, 402, 705, 715,
575 699, 698, 0, 725, 698, 723, 696, 700, 699, 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700576
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800577 710, 713, 709, 711, 688, 702, 686, 680, 688, 671,
578 662, 0, 640, 639, 0, 648, 641, 0, 0, 645,
579 0, 644, 0, 650, 649, 0, 625, 633, 623, 650,
580 630, 0, 0, 643, 0, 0, 642, 641, 582, 632,
581 639, 638, 614, 613, 635, 608, 633, 607, 590, 607,
582 586, 585, 611, 380, 526, 545, 544, 0, 0, 538,
583 0, 504, 510, 0, 495, 0, 0, 550, 572, 483,
584 470, 454, 462, 449, 445, 404, 419, 616, 619, 391,
585 387, 404, 392, 290, 0, 617, 642, 1189, 644, 570,
586 0, 0, 263, 258, 139, 645, 1189, 643, 618, 107,
587
588 77, 0, 23, 662, 0, 0, 663, 664, 1189, 665,
589 1189, 1189, 697, 702, 707, 712, 714, 716, 722, 729,
590 734, 739, 744
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700591 } ;
592
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800593static yyconst flex_int16_t yy_def[824] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700594 { 0,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800595 812, 1, 812, 3, 813, 813, 812, 812, 812, 812,
596 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
597 812, 812, 812, 814, 812, 814, 814, 814, 814, 814,
598 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
599 814, 814, 814, 814, 814, 812, 812, 812, 812, 812,
600 812, 812, 812, 812, 815, 812, 812, 812, 812, 812,
601 812, 812, 812, 812, 812, 812, 812, 816, 812, 817,
602 19, 812, 812, 812, 812, 818, 20, 812, 812, 812,
603 812, 812, 812, 814, 812, 812, 814, 814, 814, 814,
604 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700605
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800606 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
607 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
608 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
609 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
610 814, 814, 814, 814, 814, 814, 814, 814, 814, 812,
611 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
612 819, 812, 815, 812, 812, 817, 812, 812, 812, 812,
613 818, 812, 812, 814, 814, 814, 814, 814, 814, 814,
614 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
615 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700616
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800617 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
618 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
619 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
620 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
621 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
622 812, 812, 812, 812, 819, 812, 812, 812, 812, 812,
623 812, 812, 812, 814, 814, 814, 814, 814, 814, 814,
624 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
625 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
626 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700627
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800628 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
629 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
630 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
631 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
632 814, 814, 814, 814, 814, 812, 812, 812, 812, 812,
633 812, 814, 814, 814, 814, 814, 814, 814, 814, 814,
634 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
635 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
636 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
637 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700638
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800639 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
640 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
641 814, 814, 814, 814, 814, 814, 814, 814, 812, 812,
642 812, 812, 814, 814, 814, 814, 814, 814, 814, 814,
643 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
644 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
645 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
646 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
647 814, 814, 814, 814, 814, 814, 814, 814, 812, 812,
648 812, 812, 814, 814, 814, 814, 814, 814, 814, 814,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700649
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800650 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
651 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
652 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
653 814, 812, 820, 812, 812, 812, 814, 814, 814, 814,
654 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
655 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
656 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
657 814, 814, 814, 814, 812, 812, 812, 812, 821, 812,
658 812, 812, 814, 814, 814, 814, 814, 814, 814, 814,
659 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700660
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800661 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
662 814, 814, 814, 814, 814, 814, 814, 812, 822, 812,
663 821, 812, 812, 814, 814, 814, 814, 814, 814, 814,
664 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
665 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
666 814, 814, 814, 812, 812, 812, 812, 823, 812, 812,
667 812, 814, 814, 814, 814, 814, 814, 814, 814, 814,
668 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
669 814, 814, 814, 814, 814, 814, 814, 823, 812, 812,
670 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
Ian Romanick33fe3642010-08-30 11:59:48 -0700671
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800672 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
673 814, 814, 814, 814, 814, 812, 812, 814, 814, 814,
674 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
675 814, 814, 814, 814, 814, 814, 814, 814, 812, 812,
676 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
677 814, 814, 812, 812, 812, 814, 814, 814, 814, 814,
678 814, 814, 814, 814, 814, 814, 814, 812, 812, 812,
679 814, 814, 814, 814, 814, 814, 812, 812, 812, 814,
680 814, 814, 814, 814, 814, 812, 812, 812, 812, 812,
681 814, 814, 814, 814, 814, 812, 812, 812, 812, 814,
682
683 814, 814, 812, 812, 814, 814, 812, 812, 812, 812,
684 812, 0, 812, 812, 812, 812, 812, 812, 812, 812,
685 812, 812, 812
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700686 } ;
687
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800688static yyconst flex_int16_t yy_nxt[1255] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700689 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700690 8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
691 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
692 20, 20, 8, 21, 22, 23, 24, 24, 24, 24,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800693 24, 24, 24, 24, 24, 24, 24, 25, 24, 26,
694 27, 28, 29, 30, 31, 32, 33, 34, 24, 24,
695 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
696 45, 24, 24, 24, 46, 47, 58, 807, 58, 48,
697 49, 50, 51, 50, 49, 49, 49, 49, 49, 49,
698 49, 49, 49, 49, 52, 49, 53, 53, 53, 53,
699 53, 53, 54, 49, 49, 49, 55, 55, 55, 55,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700700
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800701 55, 55, 55, 55, 55, 55, 55, 49, 55, 55,
Chad Versace974fb462010-10-15 14:46:00 -0700702 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
703 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800704 55, 55, 55, 55, 49, 61, 64, 806, 66, 68,
705 68, 68, 68, 68, 68, 68, 79, 80, 812, 65,
706 67, 85, 62, 70, 150, 71, 71, 71, 71, 71,
707 71, 72, 82, 83, 86, 87, 90, 805, 91, 110,
708 73, 74, 92, 812, 93, 75, 76, 111, 94, 119,
709 88, 89, 121, 73, 74, 95, 122, 97, 96, 112,
710 160, 98, 160, 120, 151, 183, 184, 99, 75, 802,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700711
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800712 123, 76, 70, 100, 77, 77, 77, 77, 77, 77,
713 77, 101, 231, 102, 124, 104, 58, 129, 58, 73,
714 74, 126, 103, 105, 78, 193, 106, 130, 232, 107,
715 195, 113, 73, 74, 114, 108, 194, 127, 115, 116,
716 128, 131, 138, 117, 196, 139, 118, 78, 132, 133,
717 160, 146, 160, 134, 140, 147, 154, 155, 142, 135,
718 136, 141, 137, 143, 152, 148, 58, 144, 153, 221,
719 145, 162, 162, 162, 162, 162, 162, 162, 164, 165,
720 167, 168, 213, 222, 239, 240, 248, 241, 218, 249,
721 214, 164, 165, 167, 168, 219, 242, 205, 156, 243,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700722
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800723 206, 207, 154, 155, 208, 157, 209, 244, 152, 158,
724 58, 801, 153, 269, 159, 70, 800, 72, 72, 72,
725 72, 72, 72, 72, 154, 155, 263, 270, 258, 259,
726 169, 169, 73, 74, 170, 170, 170, 170, 170, 170,
727 170, 258, 259, 795, 156, 73, 74, 274, 275, 263,
728 333, 157, 305, 306, 307, 158, 340, 341, 342, 334,
729 159, 355, 356, 357, 576, 577, 156, 366, 367, 368,
730 374, 375, 376, 157, 378, 379, 380, 158, 389, 390,
731 391, 768, 159, 162, 162, 162, 162, 162, 162, 162,
732 256, 256, 655, 656, 257, 257, 257, 257, 257, 257,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700733
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800734 257, 260, 260, 655, 656, 261, 261, 261, 261, 261,
735 261, 261, 170, 170, 170, 170, 170, 170, 170, 170,
736 170, 170, 170, 170, 170, 170, 257, 257, 257, 257,
737 257, 257, 257, 769, 794, 262, 257, 257, 257, 257,
738 257, 257, 257, 423, 424, 425, 793, 792, 262, 350,
739 350, 791, 165, 351, 351, 351, 351, 351, 351, 351,
740 454, 455, 456, 786, 785, 165, 261, 261, 261, 261,
741 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
742 351, 351, 351, 351, 351, 351, 351, 784, 783, 168,
743 351, 351, 351, 351, 351, 351, 351, 444, 445, 446,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700744
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800745 581, 782, 168, 457, 458, 459, 259, 781, 447, 448,
746 460, 461, 462, 499, 500, 501, 522, 523, 524, 259,
747 490, 546, 548, 780, 502, 503, 779, 525, 526, 547,
748 549, 561, 562, 563, 533, 534, 534, 534, 534, 534,
749 534, 622, 564, 565, 576, 577, 576, 577, 776, 775,
750 774, 768, 623, 655, 656, 596, 597, 598, 576, 577,
751 580, 580, 580, 580, 580, 580, 580, 599, 614, 615,
752 616, 798, 619, 620, 620, 620, 620, 620, 620, 579,
753 617, 576, 577, 753, 773, 638, 772, 771, 658, 770,
754 754, 576, 577, 639, 640, 578, 578, 578, 578, 578,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700755
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800756 578, 641, 642, 769, 579, 580, 580, 580, 580, 580,
757 580, 580, 753, 658, 655, 656, 777, 787, 796, 754,
758 789, 655, 656, 799, 778, 788, 797, 790, 659, 659,
759 659, 659, 659, 659, 659, 657, 657, 657, 657, 657,
760 657, 655, 656, 787, 798, 789, 796, 767, 766, 765,
761 764, 788, 790, 763, 797, 659, 659, 659, 659, 659,
762 659, 659, 803, 808, 810, 808, 810, 762, 761, 760,
763 804, 809, 811, 809, 811, 759, 758, 757, 756, 755,
764 752, 751, 750, 749, 748, 747, 746, 745, 744, 743,
765 742, 741, 740, 739, 738, 737, 799, 56, 56, 56,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700766
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800767 56, 56, 56, 56, 56, 84, 84, 84, 84, 84,
768 163, 163, 163, 163, 163, 68, 68, 166, 166, 171,
769 171, 171, 255, 255, 736, 255, 255, 255, 255, 255,
770 578, 578, 578, 735, 734, 733, 578, 621, 621, 621,
771 657, 657, 657, 732, 731, 730, 657, 688, 688, 688,
772 729, 728, 727, 726, 725, 724, 723, 722, 721, 720,
773 719, 718, 717, 716, 715, 714, 713, 712, 711, 710,
774 709, 708, 707, 706, 705, 704, 703, 702, 701, 700,
775 699, 698, 697, 696, 695, 694, 693, 692, 691, 690,
776 689, 687, 686, 685, 684, 683, 682, 681, 680, 679,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700777
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800778 678, 677, 676, 675, 674, 673, 672, 671, 670, 669,
779 668, 667, 666, 665, 664, 663, 662, 661, 660, 654,
780 653, 652, 651, 650, 649, 648, 647, 646, 645, 644,
781 643, 637, 636, 635, 634, 633, 632, 631, 630, 629,
782 628, 627, 626, 625, 624, 618, 613, 612, 611, 610,
783 609, 608, 607, 606, 605, 604, 603, 602, 601, 600,
784 595, 594, 593, 592, 591, 590, 589, 588, 587, 586,
785 585, 584, 583, 582, 581, 575, 574, 573, 572, 571,
786 570, 569, 568, 567, 566, 560, 559, 558, 557, 556,
787 555, 554, 553, 552, 551, 550, 545, 544, 543, 542,
788
789 541, 540, 539, 538, 537, 536, 535, 532, 531, 530,
790 529, 528, 527, 521, 520, 519, 518, 517, 516, 515,
791 514, 513, 512, 511, 510, 509, 508, 507, 506, 505,
792 504, 498, 497, 496, 495, 494, 493, 492, 491, 490,
793 489, 488, 487, 486, 485, 484, 483, 482, 481, 480,
Chad Versace974fb462010-10-15 14:46:00 -0700794 479, 478, 477, 476, 475, 474, 473, 472, 471, 470,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800795 469, 468, 467, 466, 465, 464, 463, 453, 452, 451,
796 450, 449, 443, 442, 441, 440, 439, 438, 437, 436,
797 435, 434, 433, 432, 431, 430, 429, 428, 427, 426,
798 422, 421, 420, 419, 418, 417, 416, 415, 414, 413,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700799
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800800 412, 411, 410, 409, 408, 407, 406, 405, 404, 403,
Chad Versace974fb462010-10-15 14:46:00 -0700801 402, 401, 400, 399, 398, 397, 396, 395, 394, 393,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800802 392, 388, 387, 386, 385, 384, 383, 382, 381, 377,
803 373, 372, 371, 370, 369, 365, 364, 363, 362, 361,
804 360, 359, 358, 354, 353, 352, 349, 348, 347, 346,
805 345, 344, 343, 339, 338, 337, 336, 335, 332, 331,
806 330, 329, 328, 327, 326, 325, 324, 323, 322, 321,
Chad Versace974fb462010-10-15 14:46:00 -0700807 320, 319, 318, 317, 316, 315, 314, 313, 312, 311,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800808 310, 309, 308, 304, 303, 302, 301, 300, 299, 298,
809 297, 296, 295, 294, 293, 292, 291, 290, 289, 288,
810
Chad Versace974fb462010-10-15 14:46:00 -0700811 287, 286, 285, 284, 283, 282, 281, 280, 279, 278,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800812 277, 276, 273, 272, 271, 268, 267, 266, 265, 264,
813 254, 253, 252, 251, 250, 247, 246, 245, 238, 237,
814 236, 235, 234, 233, 230, 229, 228, 227, 226, 225,
815 224, 223, 220, 217, 216, 215, 212, 211, 210, 204,
816 203, 202, 201, 200, 199, 198, 197, 192, 191, 190,
817 189, 188, 187, 186, 185, 182, 181, 180, 179, 178,
818 177, 176, 175, 174, 173, 172, 161, 149, 125, 109,
819 81, 69, 63, 60, 59, 812, 57, 57, 7, 812,
820 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700821
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800822 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
823 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
824 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
825 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
826 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
827 812, 812, 812, 812
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700828 } ;
829
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800830static yyconst flex_int16_t yy_chk[1255] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700831 { 0,
832 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
833 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
834 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
835 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
836 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700837 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800838 1, 1, 1, 1, 1, 2, 9, 803, 9, 2,
Chad Versace974fb462010-10-15 14:46:00 -0700839 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
840 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700841 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
842
843 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
844 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
845 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800846 3, 3, 3, 3, 3, 13, 15, 801, 16, 17,
847 17, 17, 17, 17, 17, 17, 21, 21, 71, 15,
848 16, 25, 13, 19, 46, 19, 19, 19, 19, 19,
849 19, 19, 23, 23, 25, 26, 27, 800, 27, 33,
850 19, 19, 27, 71, 28, 19, 19, 33, 28, 35,
851 26, 26, 36, 19, 19, 28, 36, 29, 28, 33,
852 50, 29, 50, 35, 46, 96, 96, 29, 19, 795,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700853
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800854 37, 19, 20, 29, 20, 20, 20, 20, 20, 20,
855 20, 30, 135, 30, 37, 31, 58, 40, 58, 20,
856 20, 39, 30, 31, 20, 105, 31, 40, 135, 31,
857 106, 34, 20, 20, 34, 31, 105, 39, 34, 34,
858 39, 41, 42, 34, 106, 42, 34, 20, 41, 41,
859 160, 44, 160, 41, 42, 44, 48, 48, 43, 41,
860 41, 42, 41, 43, 47, 44, 47, 43, 47, 126,
861 43, 53, 53, 53, 53, 53, 53, 53, 68, 68,
862 70, 70, 120, 126, 142, 142, 148, 143, 124, 148,
863 120, 68, 68, 70, 70, 124, 143, 116, 48, 144,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700864
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800865 116, 116, 153, 153, 116, 48, 116, 144, 152, 48,
866 152, 794, 152, 180, 48, 72, 793, 72, 72, 72,
867 72, 72, 72, 72, 154, 154, 171, 180, 166, 166,
868 73, 73, 72, 72, 73, 73, 73, 73, 73, 73,
869 73, 166, 166, 784, 153, 72, 72, 184, 184, 171,
870 241, 153, 215, 215, 215, 153, 247, 247, 247, 241,
871 153, 268, 268, 268, 621, 621, 154, 279, 279, 279,
872 288, 288, 288, 154, 292, 292, 292, 154, 301, 301,
873 301, 754, 154, 162, 162, 162, 162, 162, 162, 162,
874 164, 164, 655, 655, 164, 164, 164, 164, 164, 164,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700875
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800876 164, 167, 167, 688, 688, 167, 167, 167, 167, 167,
877 167, 167, 169, 169, 169, 169, 169, 169, 169, 170,
878 170, 170, 170, 170, 170, 170, 256, 256, 256, 256,
879 256, 256, 256, 754, 783, 170, 257, 257, 257, 257,
880 257, 257, 257, 338, 338, 338, 782, 781, 170, 258,
881 258, 780, 257, 258, 258, 258, 258, 258, 258, 258,
882 393, 393, 393, 777, 776, 257, 260, 260, 260, 260,
883 260, 260, 260, 261, 261, 261, 261, 261, 261, 261,
884 350, 350, 350, 350, 350, 350, 350, 775, 774, 261,
885 351, 351, 351, 351, 351, 351, 351, 382, 382, 382,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700886
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800887 581, 773, 261, 394, 394, 394, 351, 772, 382, 382,
888 395, 395, 395, 443, 443, 443, 483, 483, 483, 351,
889 490, 504, 505, 771, 443, 443, 770, 483, 483, 504,
890 505, 519, 519, 519, 490, 490, 490, 490, 490, 490,
891 490, 581, 519, 519, 533, 533, 534, 534, 765, 763,
892 762, 768, 581, 619, 619, 554, 554, 554, 576, 576,
893 534, 534, 534, 534, 534, 534, 534, 554, 573, 573,
894 573, 790, 576, 576, 576, 576, 576, 576, 576, 533,
895 573, 578, 578, 739, 760, 605, 757, 756, 619, 755,
896 739, 580, 580, 605, 606, 578, 578, 578, 578, 578,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700897
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800898 578, 606, 606, 768, 533, 580, 580, 580, 580, 580,
899 580, 580, 753, 619, 620, 620, 769, 778, 786, 753,
900 779, 657, 657, 790, 769, 778, 786, 779, 620, 620,
901 620, 620, 620, 620, 620, 657, 657, 657, 657, 657,
902 657, 659, 659, 787, 798, 789, 796, 752, 751, 750,
903 749, 787, 789, 748, 796, 659, 659, 659, 659, 659,
904 659, 659, 799, 804, 807, 808, 810, 747, 746, 745,
905 799, 804, 807, 808, 810, 744, 743, 742, 741, 740,
906 738, 737, 734, 731, 730, 729, 728, 727, 725, 724,
907 722, 720, 717, 716, 714, 713, 798, 813, 813, 813,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700908
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800909 813, 813, 813, 813, 813, 814, 814, 814, 814, 814,
910 815, 815, 815, 815, 815, 816, 816, 817, 817, 818,
911 818, 818, 819, 819, 711, 819, 819, 819, 819, 819,
912 820, 820, 820, 710, 709, 708, 820, 821, 821, 821,
913 822, 822, 822, 707, 706, 705, 822, 823, 823, 823,
914 704, 703, 702, 701, 699, 698, 697, 696, 695, 694,
915 692, 691, 690, 689, 687, 686, 685, 684, 683, 682,
916 681, 680, 679, 678, 677, 676, 675, 674, 673, 672,
917 671, 670, 668, 667, 666, 665, 664, 663, 662, 661,
918 660, 653, 651, 650, 648, 647, 646, 645, 644, 643,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700919
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800920 642, 641, 640, 639, 638, 637, 636, 634, 633, 632,
921 631, 630, 629, 628, 626, 625, 624, 623, 622, 618,
922 617, 616, 615, 614, 613, 612, 611, 610, 609, 608,
923 607, 601, 599, 598, 597, 596, 592, 591, 590, 589,
924 588, 587, 586, 585, 584, 575, 571, 570, 568, 567,
925 565, 564, 563, 562, 561, 560, 559, 558, 557, 555,
926 553, 552, 551, 550, 549, 548, 547, 546, 545, 544,
927 542, 541, 537, 536, 535, 532, 531, 529, 528, 526,
928 525, 524, 523, 522, 520, 518, 517, 516, 515, 514,
929 513, 511, 510, 509, 508, 507, 503, 502, 501, 500,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700930
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800931 499, 498, 495, 494, 493, 492, 491, 489, 488, 487,
932 486, 485, 484, 482, 481, 474, 473, 470, 469, 466,
933 465, 464, 463, 452, 451, 450, 448, 447, 446, 445,
934 444, 441, 439, 438, 437, 435, 434, 432, 431, 430,
935 429, 427, 426, 421, 420, 418, 417, 416, 415, 414,
936 413, 412, 411, 410, 409, 407, 406, 405, 404, 403,
937 402, 401, 400, 399, 398, 397, 396, 392, 388, 387,
938 386, 383, 381, 371, 369, 365, 364, 363, 362, 360,
939 358, 353, 352, 349, 348, 347, 346, 345, 344, 339,
940 337, 336, 335, 334, 333, 331, 330, 327, 326, 325,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700941
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800942 324, 323, 322, 321, 320, 319, 318, 317, 316, 315,
943 314, 313, 312, 311, 310, 309, 308, 307, 306, 305,
944 302, 300, 299, 298, 297, 296, 295, 294, 293, 291,
945 287, 285, 284, 283, 282, 278, 277, 276, 275, 274,
946 273, 272, 271, 267, 265, 264, 254, 253, 252, 251,
947 250, 249, 248, 246, 245, 244, 243, 242, 240, 239,
948 238, 237, 236, 235, 234, 233, 232, 231, 230, 229,
949 228, 227, 226, 225, 224, 223, 222, 221, 220, 219,
950 218, 217, 216, 214, 213, 212, 211, 210, 209, 208,
951 207, 206, 205, 204, 203, 202, 201, 200, 199, 198,
Ian Romanick33fe3642010-08-30 11:59:48 -0700952
Kenneth Graunke0d082c02010-11-13 22:02:32 -0800953 196, 195, 194, 193, 192, 191, 190, 189, 188, 187,
954 186, 185, 183, 182, 181, 179, 178, 177, 176, 174,
955 159, 158, 157, 156, 149, 147, 146, 145, 141, 140,
956 139, 138, 137, 136, 134, 133, 132, 131, 130, 129,
957 128, 127, 125, 123, 122, 121, 119, 118, 117, 115,
958 114, 112, 111, 110, 109, 108, 107, 104, 103, 102,
959 101, 100, 99, 98, 97, 95, 94, 93, 92, 91,
960 90, 89, 88, 87, 83, 79, 52, 45, 38, 32,
961 22, 18, 14, 12, 11, 7, 6, 5, 812, 812,
962 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
963
964 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
965 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
966 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
967 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
968 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
969 812, 812, 812, 812
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700970 } ;
971
972/* The intent behind this definition is that it'll catch
973 * any uses of REJECT which flex missed.
974 */
975#define REJECT reject_used_but_not_detected
976#define yymore() yymore_used_but_not_detected
977#define YY_MORE_ADJ 0
978#define YY_RESTORE_YY_MORE_OFFSET
979#line 1 "glsl_lexer.lpp"
980#line 2 "glsl_lexer.lpp"
981/*
982 * Copyright © 2008, 2009 Intel Corporation
983 *
984 * Permission is hereby granted, free of charge, to any person obtaining a
985 * copy of this software and associated documentation files (the "Software"),
986 * to deal in the Software without restriction, including without limitation
987 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
988 * and/or sell copies of the Software, and to permit persons to whom the
989 * Software is furnished to do so, subject to the following conditions:
990 *
991 * The above copyright notice and this permission notice (including the next
992 * paragraph) shall be included in all copies or substantial portions of the
993 * Software.
994 *
995 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
996 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
997 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
998 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
999 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1000 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1001 * DEALINGS IN THE SOFTWARE.
1002 */
1003#include <ctype.h>
1004#include "ast.h"
1005#include "glsl_parser_extras.h"
1006#include "glsl_parser.h"
1007
1008#define YY_USER_ACTION \
1009 do { \
1010 yylloc->source = 0; \
1011 yylloc->first_column = yycolumn + 1; \
1012 yylloc->first_line = yylineno + 1; \
1013 yycolumn += yyleng; \
1014 } while(0);
1015
1016#define YY_USER_INIT yylineno = 0; yycolumn = 0;
1017
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001018#define IS_UINT (yytext[yyleng - 1] == 'u' || yytext[yyleng - 1] == 'U')
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001019
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001020/* A macro for handling reserved words and keywords across language versions.
1021 *
1022 * Certain words start out as identifiers, become reserved words in
1023 * later language revisions, and finally become language keywords.
1024 *
1025 * For example, consider the following lexer rule:
1026 * samplerBuffer KEYWORD(130, 140, SAMPLERBUFFER)
1027 *
1028 * This means that "samplerBuffer" will be treated as:
1029 * - a keyword (SAMPLERBUFFER token) ...in GLSL >= 1.40
1030 * - a reserved word - error ...in GLSL >= 1.30
1031 * - an identifier ...in GLSL < 1.30
1032 */
1033#define KEYWORD(reserved_version, allowed_version, token) \
Ian Romanickdb36e882010-08-11 17:03:37 -07001034 do { \
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001035 if (yyextra->language_version >= allowed_version) { \
Ian Romanickdb36e882010-08-11 17:03:37 -07001036 return token; \
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001037 } else if (yyextra->language_version >= reserved_version) { \
Ian Romanickdb36e882010-08-11 17:03:37 -07001038 _mesa_glsl_error(yylloc, yyextra, \
1039 "Illegal use of reserved word `%s'", yytext); \
1040 return ERROR_TOK; \
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001041 } else { \
1042 yylval->identifier = strdup(yytext); \
1043 return IDENTIFIER; \
Ian Romanickdb36e882010-08-11 17:03:37 -07001044 } \
1045 } while (0)
Eric Anholt6a416262010-08-01 18:44:21 -07001046
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001047/* The ES macro can be used in KEYWORD checks:
1048 *
1049 * word KEYWORD(110 || ES, 400, TOKEN)
1050 * ...means the word is reserved in GLSL ES 1.00, while
1051 *
1052 * word KEYWORD(110, 130 || ES, TOKEN)
1053 * ...means the word is a legal keyword in GLSL ES 1.00.
1054 */
1055#define ES yyextra->es_shader
1056
1057#line 1058 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001058
1059#define INITIAL 0
1060#define PP 1
Ian Romanick33fe3642010-08-30 11:59:48 -07001061#define PRAGMA 2
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001062
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001063#define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
1064
1065/* Holds the entire state of the reentrant scanner. */
1066struct yyguts_t
1067 {
1068
1069 /* User-defined. Not touched by flex. */
1070 YY_EXTRA_TYPE yyextra_r;
1071
1072 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1073 FILE *yyin_r, *yyout_r;
1074 size_t yy_buffer_stack_top; /**< index of top of stack. */
1075 size_t yy_buffer_stack_max; /**< capacity of stack. */
1076 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1077 char yy_hold_char;
1078 int yy_n_chars;
1079 int yyleng_r;
1080 char *yy_c_buf_p;
1081 int yy_init;
1082 int yy_start;
1083 int yy_did_buffer_switch_on_eof;
1084 int yy_start_stack_ptr;
1085 int yy_start_stack_depth;
1086 int *yy_start_stack;
1087 yy_state_type yy_last_accepting_state;
1088 char* yy_last_accepting_cpos;
1089
1090 int yylineno_r;
1091 int yy_flex_debug_r;
1092
1093 char *yytext_r;
1094 int yy_more_flag;
1095 int yy_more_len;
1096
1097 YYSTYPE * yylval_r;
1098
1099 YYLTYPE * yylloc_r;
1100
1101 }; /* end struct yyguts_t */
1102
1103static int yy_init_globals (yyscan_t yyscanner );
1104
1105 /* This must go here because YYSTYPE and YYLTYPE are included
1106 * from bison output in section 1.*/
1107 # define yylval yyg->yylval_r
1108
1109 # define yylloc yyg->yylloc_r
1110
1111int _mesa_glsl_lex_init (yyscan_t* scanner);
1112
1113int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1114
1115/* Accessor methods to globals.
1116 These are made visible to non-reentrant scanners for convenience. */
1117
1118int _mesa_glsl_lex_destroy (yyscan_t yyscanner );
1119
1120int _mesa_glsl_get_debug (yyscan_t yyscanner );
1121
1122void _mesa_glsl_set_debug (int debug_flag ,yyscan_t yyscanner );
1123
1124YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner );
1125
1126void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1127
1128FILE *_mesa_glsl_get_in (yyscan_t yyscanner );
1129
1130void _mesa_glsl_set_in (FILE * in_str ,yyscan_t yyscanner );
1131
1132FILE *_mesa_glsl_get_out (yyscan_t yyscanner );
1133
1134void _mesa_glsl_set_out (FILE * out_str ,yyscan_t yyscanner );
1135
1136int _mesa_glsl_get_leng (yyscan_t yyscanner );
1137
1138char *_mesa_glsl_get_text (yyscan_t yyscanner );
1139
1140int _mesa_glsl_get_lineno (yyscan_t yyscanner );
1141
1142void _mesa_glsl_set_lineno (int line_number ,yyscan_t yyscanner );
1143
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001144int _mesa_glsl_get_column (yyscan_t yyscanner );
1145
1146void _mesa_glsl_set_column (int column_no ,yyscan_t yyscanner );
1147
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001148YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner );
1149
1150void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1151
1152 YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner );
1153
1154 void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
1155
1156/* Macros after this point can all be overridden by user definitions in
1157 * section 1.
1158 */
1159
1160#ifndef YY_SKIP_YYWRAP
1161#ifdef __cplusplus
1162extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner );
1163#else
1164extern int _mesa_glsl_wrap (yyscan_t yyscanner );
1165#endif
1166#endif
1167
1168#ifndef yytext_ptr
1169static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1170#endif
1171
1172#ifdef YY_NEED_STRLEN
1173static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1174#endif
1175
1176#ifndef YY_NO_INPUT
1177
1178#ifdef __cplusplus
1179static int yyinput (yyscan_t yyscanner );
1180#else
1181static int input (yyscan_t yyscanner );
1182#endif
1183
1184#endif
1185
1186/* Amount of stuff to slurp up with each read. */
1187#ifndef YY_READ_BUF_SIZE
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001188#define YY_READ_BUF_SIZE 8192
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001189#endif
1190
1191/* Copy whatever the last rule matched to the standard output. */
1192#ifndef ECHO
1193/* This used to be an fputs(), but since the string might contain NUL's,
1194 * we now use fwrite().
1195 */
Ian Romanick5ed66102010-10-05 16:40:00 -07001196#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001197#endif
1198
1199/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1200 * is returned in "result".
1201 */
1202#ifndef YY_INPUT
1203#define YY_INPUT(buf,result,max_size) \
1204 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1205 { \
1206 int c = '*'; \
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001207 unsigned n; \
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001208 for ( n = 0; n < max_size && \
1209 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1210 buf[n] = (char) c; \
1211 if ( c == '\n' ) \
1212 buf[n++] = (char) c; \
1213 if ( c == EOF && ferror( yyin ) ) \
1214 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1215 result = n; \
1216 } \
1217 else \
1218 { \
1219 errno=0; \
1220 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1221 { \
1222 if( errno != EINTR) \
1223 { \
1224 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1225 break; \
1226 } \
1227 errno=0; \
1228 clearerr(yyin); \
1229 } \
1230 }\
1231\
1232
1233#endif
1234
1235/* No semi-colon after return; correct usage is to write "yyterminate();" -
1236 * we don't want an extra ';' after the "return" because that will cause
1237 * some compilers to complain about unreachable statements.
1238 */
1239#ifndef yyterminate
1240#define yyterminate() return YY_NULL
1241#endif
1242
1243/* Number of entries by which start-condition stack grows. */
1244#ifndef YY_START_STACK_INCR
1245#define YY_START_STACK_INCR 25
1246#endif
1247
1248/* Report a fatal error. */
1249#ifndef YY_FATAL_ERROR
1250#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1251#endif
1252
1253/* end tables serialization structures and prototypes */
1254
1255/* Default declaration of generated scanner - a define so the user can
1256 * easily add parameters.
1257 */
1258#ifndef YY_DECL
1259#define YY_DECL_IS_OURS 1
1260
1261extern int _mesa_glsl_lex \
1262 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1263
1264#define YY_DECL int _mesa_glsl_lex \
1265 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1266#endif /* !YY_DECL */
1267
1268/* Code executed at the beginning of each rule, after yytext and yyleng
1269 * have been set up.
1270 */
1271#ifndef YY_USER_ACTION
1272#define YY_USER_ACTION
1273#endif
1274
1275/* Code executed at the end of each rule. */
1276#ifndef YY_BREAK
1277#define YY_BREAK break;
1278#endif
1279
1280#define YY_RULE_SETUP \
1281 if ( yyleng > 0 ) \
1282 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1283 (yytext[yyleng - 1] == '\n'); \
1284 YY_USER_ACTION
1285
1286/** The main scanner function which does all the work.
1287 */
1288YY_DECL
1289{
1290 register yy_state_type yy_current_state;
1291 register char *yy_cp, *yy_bp;
1292 register int yy_act;
1293 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1294
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001295#line 94 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001296
1297
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001298#line 1299 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001299
1300 yylval = yylval_param;
1301
1302 yylloc = yylloc_param;
1303
1304 if ( !yyg->yy_init )
1305 {
1306 yyg->yy_init = 1;
1307
1308#ifdef YY_USER_INIT
1309 YY_USER_INIT;
1310#endif
1311
1312 if ( ! yyg->yy_start )
1313 yyg->yy_start = 1; /* first start state */
1314
1315 if ( ! yyin )
1316 yyin = stdin;
1317
1318 if ( ! yyout )
1319 yyout = stdout;
1320
1321 if ( ! YY_CURRENT_BUFFER ) {
1322 _mesa_glsl_ensure_buffer_stack (yyscanner);
1323 YY_CURRENT_BUFFER_LVALUE =
1324 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1325 }
1326
1327 _mesa_glsl__load_buffer_state(yyscanner );
1328 }
1329
1330 while ( 1 ) /* loops until end-of-file is reached */
1331 {
1332 yy_cp = yyg->yy_c_buf_p;
1333
1334 /* Support of yytext. */
1335 *yy_cp = yyg->yy_hold_char;
1336
1337 /* yy_bp points to the position in yy_ch_buf of the start of
1338 * the current run.
1339 */
1340 yy_bp = yy_cp;
1341
1342 yy_current_state = yyg->yy_start;
1343 yy_current_state += YY_AT_BOL();
1344yy_match:
1345 do
1346 {
1347 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1348 if ( yy_accept[yy_current_state] )
1349 {
1350 yyg->yy_last_accepting_state = yy_current_state;
1351 yyg->yy_last_accepting_cpos = yy_cp;
1352 }
1353 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1354 {
1355 yy_current_state = (int) yy_def[yy_current_state];
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001356 if ( yy_current_state >= 813 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001357 yy_c = yy_meta[(unsigned int) yy_c];
1358 }
1359 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1360 ++yy_cp;
1361 }
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001362 while ( yy_current_state != 812 );
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001363 yy_cp = yyg->yy_last_accepting_cpos;
1364 yy_current_state = yyg->yy_last_accepting_state;
1365
1366yy_find_action:
1367 yy_act = yy_accept[yy_current_state];
1368
1369 YY_DO_BEFORE_ACTION;
1370
1371do_action: /* This label is used only to access EOF actions. */
1372
1373 switch ( yy_act )
1374 { /* beginning of action switch */
1375 case 0: /* must back up */
1376 /* undo the effects of YY_DO_BEFORE_ACTION */
1377 *yy_cp = yyg->yy_hold_char;
1378 yy_cp = yyg->yy_last_accepting_cpos;
1379 yy_current_state = yyg->yy_last_accepting_state;
1380 goto yy_find_action;
1381
1382case 1:
1383YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001384#line 96 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001385;
1386 YY_BREAK
1387/* Preprocessor tokens. */
1388case 2:
1389*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1390yyg->yy_c_buf_p = yy_cp -= 1;
1391YY_DO_BEFORE_ACTION; /* set up yytext again */
1392YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001393#line 99 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001394;
1395 YY_BREAK
1396case 3:
1397YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001398#line 100 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001399{ BEGIN PP; return VERSION; }
1400 YY_BREAK
1401case 4:
1402YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001403#line 101 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001404{ BEGIN PP; return EXTENSION; }
1405 YY_BREAK
1406case 5:
1407*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1408yyg->yy_c_buf_p = yy_cp -= 1;
1409YY_DO_BEFORE_ACTION; /* set up yytext again */
1410YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001411#line 102 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001412{
1413 /* Eat characters until the first digit is
1414 * encountered
1415 */
1416 char *ptr = yytext;
1417 while (!isdigit(*ptr))
1418 ptr++;
1419
1420 /* Subtract one from the line number because
1421 * yylineno is zero-based instead of
1422 * one-based.
1423 */
1424 yylineno = strtol(ptr, &ptr, 0) - 1;
1425 yylloc->source = strtol(ptr, NULL, 0);
1426 }
1427 YY_BREAK
1428case 6:
1429*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1430yyg->yy_c_buf_p = yy_cp -= 1;
1431YY_DO_BEFORE_ACTION; /* set up yytext again */
1432YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001433#line 117 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001434{
1435 /* Eat characters until the first digit is
1436 * encountered
1437 */
1438 char *ptr = yytext;
1439 while (!isdigit(*ptr))
1440 ptr++;
1441
1442 /* Subtract one from the line number because
1443 * yylineno is zero-based instead of
1444 * one-based.
1445 */
1446 yylineno = strtol(ptr, &ptr, 0) - 1;
1447 }
1448 YY_BREAK
1449case 7:
1450YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001451#line 131 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001452{
1453 BEGIN PP;
1454 return PRAGMA_DEBUG_ON;
1455 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001456 YY_BREAK
1457case 8:
1458YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001459#line 135 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001460{
1461 BEGIN PP;
1462 return PRAGMA_DEBUG_OFF;
1463 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001464 YY_BREAK
1465case 9:
1466YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001467#line 139 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001468{
1469 BEGIN PP;
1470 return PRAGMA_OPTIMIZE_ON;
1471 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001472 YY_BREAK
1473case 10:
1474YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001475#line 143 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001476{
1477 BEGIN PP;
1478 return PRAGMA_OPTIMIZE_OFF;
1479 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001480 YY_BREAK
1481case 11:
1482YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001483#line 147 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001484{ BEGIN PRAGMA; }
1485 YY_BREAK
1486case 12:
1487/* rule 12 can match eol */
1488YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001489#line 149 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001490{ BEGIN 0; yylineno++; yycolumn = 0; }
1491 YY_BREAK
1492case 13:
1493YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001494#line 150 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001495{ }
1496 YY_BREAK
1497case 14:
1498YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001499#line 152 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001500{ }
1501 YY_BREAK
1502case 15:
1503YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001504#line 153 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001505{ }
1506 YY_BREAK
1507case 16:
1508YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001509#line 154 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001510return COLON;
1511 YY_BREAK
1512case 17:
1513YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001514#line 155 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001515{
1516 yylval->identifier = strdup(yytext);
1517 return IDENTIFIER;
1518 }
1519 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001520case 18:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001521YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001522#line 159 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001523{
1524 yylval->n = strtol(yytext, NULL, 10);
1525 return INTCONSTANT;
1526 }
1527 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001528case 19:
1529/* rule 19 can match eol */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001530YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001531#line 163 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001532{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
1533 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001534case 20:
Ian Romanick33fe3642010-08-30 11:59:48 -07001535/* rule 20 can match eol */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001536YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001537#line 165 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001538{ yylineno++; yycolumn = 0; }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001539 YY_BREAK
1540case 21:
1541YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001542#line 167 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001543return ATTRIBUTE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001544 YY_BREAK
1545case 22:
1546YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001547#line 168 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001548return CONST_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001549 YY_BREAK
1550case 23:
1551YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001552#line 169 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001553return BOOL_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001554 YY_BREAK
1555case 24:
1556YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001557#line 170 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001558return FLOAT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001559 YY_BREAK
1560case 25:
1561YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001562#line 171 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001563return INT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001564 YY_BREAK
1565case 26:
1566YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001567#line 172 "glsl_lexer.lpp"
1568KEYWORD(130, 130, UINT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001569 YY_BREAK
1570case 27:
1571YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001572#line 174 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001573return BREAK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001574 YY_BREAK
1575case 28:
1576YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001577#line 175 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001578return CONTINUE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001579 YY_BREAK
1580case 29:
1581YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001582#line 176 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001583return DO;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001584 YY_BREAK
1585case 30:
1586YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001587#line 177 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001588return WHILE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001589 YY_BREAK
1590case 31:
1591YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001592#line 178 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001593return ELSE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001594 YY_BREAK
1595case 32:
1596YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001597#line 179 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001598return FOR;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001599 YY_BREAK
1600case 33:
1601YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001602#line 180 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001603return IF;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001604 YY_BREAK
1605case 34:
1606YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001607#line 181 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001608return DISCARD;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001609 YY_BREAK
1610case 35:
1611YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001612#line 182 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001613return RETURN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001614 YY_BREAK
1615case 36:
1616YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001617#line 184 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001618return BVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001619 YY_BREAK
1620case 37:
1621YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001622#line 185 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001623return BVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001624 YY_BREAK
1625case 38:
1626YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001627#line 186 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001628return BVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001629 YY_BREAK
1630case 39:
1631YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001632#line 187 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001633return IVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001634 YY_BREAK
1635case 40:
1636YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001637#line 188 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001638return IVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001639 YY_BREAK
1640case 41:
1641YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001642#line 189 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001643return IVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001644 YY_BREAK
1645case 42:
1646YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001647#line 190 "glsl_lexer.lpp"
1648KEYWORD(130, 130, UVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001649 YY_BREAK
1650case 43:
1651YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001652#line 191 "glsl_lexer.lpp"
1653KEYWORD(130, 130, UVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001654 YY_BREAK
1655case 44:
1656YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001657#line 192 "glsl_lexer.lpp"
1658KEYWORD(130, 130, UVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001659 YY_BREAK
1660case 45:
1661YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001662#line 193 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001663return VEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001664 YY_BREAK
1665case 46:
1666YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001667#line 194 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001668return VEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001669 YY_BREAK
1670case 47:
1671YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001672#line 195 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001673return VEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001674 YY_BREAK
1675case 48:
1676YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001677#line 196 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001678return MAT2X2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001679 YY_BREAK
1680case 49:
1681YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001682#line 197 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001683return MAT3X3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001684 YY_BREAK
1685case 50:
1686YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001687#line 198 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001688return MAT4X4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001689 YY_BREAK
1690case 51:
1691YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001692#line 199 "glsl_lexer.lpp"
1693KEYWORD(120, 120, MAT2X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001694 YY_BREAK
1695case 52:
1696YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001697#line 200 "glsl_lexer.lpp"
1698KEYWORD(120, 120, MAT2X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001699 YY_BREAK
1700case 53:
1701YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001702#line 201 "glsl_lexer.lpp"
1703KEYWORD(120, 120, MAT2X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001704 YY_BREAK
1705case 54:
1706YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001707#line 202 "glsl_lexer.lpp"
1708KEYWORD(120, 120, MAT3X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001709 YY_BREAK
1710case 55:
1711YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001712#line 203 "glsl_lexer.lpp"
1713KEYWORD(120, 120, MAT3X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001714 YY_BREAK
1715case 56:
1716YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001717#line 204 "glsl_lexer.lpp"
1718KEYWORD(120, 120, MAT3X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001719 YY_BREAK
1720case 57:
1721YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001722#line 205 "glsl_lexer.lpp"
1723KEYWORD(120, 120, MAT4X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001724 YY_BREAK
1725case 58:
1726YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001727#line 206 "glsl_lexer.lpp"
1728KEYWORD(120, 120, MAT4X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001729 YY_BREAK
1730case 59:
1731YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001732#line 207 "glsl_lexer.lpp"
1733KEYWORD(120, 120, MAT4X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001734 YY_BREAK
1735case 60:
1736YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001737#line 209 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001738return IN_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001739 YY_BREAK
1740case 61:
1741YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001742#line 210 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001743return OUT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001744 YY_BREAK
1745case 62:
1746YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001747#line 211 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001748return INOUT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001749 YY_BREAK
1750case 63:
1751YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001752#line 212 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001753return UNIFORM;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001754 YY_BREAK
1755case 64:
1756YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001757#line 213 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001758return VARYING;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001759 YY_BREAK
1760case 65:
1761YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001762#line 214 "glsl_lexer.lpp"
1763KEYWORD(120, 120, CENTROID);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001764 YY_BREAK
1765case 66:
1766YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001767#line 215 "glsl_lexer.lpp"
1768KEYWORD(120 || ES, 120 || ES, INVARIANT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001769 YY_BREAK
1770case 67:
1771YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001772#line 216 "glsl_lexer.lpp"
1773KEYWORD(130 || ES, 130, FLAT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001774 YY_BREAK
1775case 68:
1776YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001777#line 217 "glsl_lexer.lpp"
1778KEYWORD(130, 130, SMOOTH);
Ian Romanick33fe3642010-08-30 11:59:48 -07001779 YY_BREAK
1780case 69:
1781YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001782#line 218 "glsl_lexer.lpp"
1783KEYWORD(130, 130, NOPERSPECTIVE);
Ian Romanick33fe3642010-08-30 11:59:48 -07001784 YY_BREAK
1785case 70:
1786YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001787#line 220 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001788return SAMPLER1D;
Ian Romanick33fe3642010-08-30 11:59:48 -07001789 YY_BREAK
1790case 71:
1791YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001792#line 221 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001793return SAMPLER2D;
Ian Romanick33fe3642010-08-30 11:59:48 -07001794 YY_BREAK
1795case 72:
1796YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001797#line 222 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001798return SAMPLER3D;
Ian Romanick33fe3642010-08-30 11:59:48 -07001799 YY_BREAK
1800case 73:
1801YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001802#line 223 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001803return SAMPLERCUBE;
Ian Romanick33fe3642010-08-30 11:59:48 -07001804 YY_BREAK
1805case 74:
1806YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001807#line 224 "glsl_lexer.lpp"
1808KEYWORD(130, 130, SAMPLER1DARRAY);
Chad Versace41c20792010-10-08 12:05:02 -07001809 YY_BREAK
1810case 75:
1811YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001812#line 225 "glsl_lexer.lpp"
1813KEYWORD(130, 130, SAMPLER2DARRAY);
Chad Versace41c20792010-10-08 12:05:02 -07001814 YY_BREAK
1815case 76:
1816YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001817#line 226 "glsl_lexer.lpp"
1818return SAMPLER1DSHADOW;
Chad Versace41c20792010-10-08 12:05:02 -07001819 YY_BREAK
1820case 77:
1821YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001822#line 227 "glsl_lexer.lpp"
1823return SAMPLER2DSHADOW;
Chad Versace41c20792010-10-08 12:05:02 -07001824 YY_BREAK
1825case 78:
1826YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001827#line 228 "glsl_lexer.lpp"
1828KEYWORD(130, 130, SAMPLERCUBESHADOW);
1829 YY_BREAK
1830case 79:
1831YY_RULE_SETUP
1832#line 229 "glsl_lexer.lpp"
1833KEYWORD(130, 130, SAMPLER1DARRAYSHADOW);
1834 YY_BREAK
1835case 80:
1836YY_RULE_SETUP
1837#line 230 "glsl_lexer.lpp"
1838KEYWORD(130, 130, SAMPLER2DARRAYSHADOW);
1839 YY_BREAK
1840case 81:
1841YY_RULE_SETUP
1842#line 231 "glsl_lexer.lpp"
1843KEYWORD(130, 130, ISAMPLER1D);
1844 YY_BREAK
1845case 82:
1846YY_RULE_SETUP
1847#line 232 "glsl_lexer.lpp"
1848KEYWORD(130, 130, ISAMPLER2D);
1849 YY_BREAK
1850case 83:
1851YY_RULE_SETUP
1852#line 233 "glsl_lexer.lpp"
1853KEYWORD(130, 130, ISAMPLER3D);
1854 YY_BREAK
1855case 84:
1856YY_RULE_SETUP
1857#line 234 "glsl_lexer.lpp"
1858KEYWORD(130, 130, ISAMPLERCUBE);
1859 YY_BREAK
1860case 85:
1861YY_RULE_SETUP
1862#line 235 "glsl_lexer.lpp"
1863KEYWORD(130, 130, ISAMPLER1DARRAY);
1864 YY_BREAK
1865case 86:
1866YY_RULE_SETUP
1867#line 236 "glsl_lexer.lpp"
1868KEYWORD(130, 130, ISAMPLER2DARRAY);
1869 YY_BREAK
1870case 87:
1871YY_RULE_SETUP
1872#line 237 "glsl_lexer.lpp"
1873KEYWORD(130, 130, USAMPLER1D);
1874 YY_BREAK
1875case 88:
1876YY_RULE_SETUP
1877#line 238 "glsl_lexer.lpp"
1878KEYWORD(130, 130, USAMPLER2D);
1879 YY_BREAK
1880case 89:
1881YY_RULE_SETUP
1882#line 239 "glsl_lexer.lpp"
1883KEYWORD(130, 130, USAMPLER3D);
1884 YY_BREAK
1885case 90:
1886YY_RULE_SETUP
1887#line 240 "glsl_lexer.lpp"
1888KEYWORD(130, 130, USAMPLERCUBE);
1889 YY_BREAK
1890case 91:
1891YY_RULE_SETUP
1892#line 241 "glsl_lexer.lpp"
1893KEYWORD(130, 130, USAMPLER1DARRAY);
1894 YY_BREAK
1895case 92:
1896YY_RULE_SETUP
1897#line 242 "glsl_lexer.lpp"
1898KEYWORD(130, 130, USAMPLER2DARRAY);
1899 YY_BREAK
1900case 93:
1901YY_RULE_SETUP
1902#line 245 "glsl_lexer.lpp"
1903return STRUCT;
1904 YY_BREAK
1905case 94:
1906YY_RULE_SETUP
1907#line 246 "glsl_lexer.lpp"
1908return VOID_TOK;
1909 YY_BREAK
1910case 95:
1911YY_RULE_SETUP
1912#line 248 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001913{
1914 if ((yyextra->language_version >= 140)
Ian Romanick2b45ba82010-10-05 17:03:25 -07001915 || yyextra->ARB_explicit_attrib_location_enable
Ian Romanickf50f0652010-06-30 17:30:03 -07001916 || (yyextra->ARB_fragment_coord_conventions_enable)){
1917 return LAYOUT_TOK;
1918 } else {
1919 yylval->identifier = strdup(yytext);
1920 return IDENTIFIER;
1921 }
1922 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001923 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001924case 96:
1925YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001926#line 259 "glsl_lexer.lpp"
1927return INC_OP;
Chad Versace41c20792010-10-08 12:05:02 -07001928 YY_BREAK
1929case 97:
1930YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001931#line 260 "glsl_lexer.lpp"
1932return DEC_OP;
Chad Versace41c20792010-10-08 12:05:02 -07001933 YY_BREAK
1934case 98:
1935YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001936#line 261 "glsl_lexer.lpp"
1937return LE_OP;
Chad Versacef88b4ea2010-10-08 16:12:56 -07001938 YY_BREAK
1939case 99:
1940YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001941#line 262 "glsl_lexer.lpp"
1942return GE_OP;
Chad Versacef88b4ea2010-10-08 16:12:56 -07001943 YY_BREAK
1944case 100:
1945YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001946#line 263 "glsl_lexer.lpp"
1947return EQ_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001948 YY_BREAK
Chad Versacef88b4ea2010-10-08 16:12:56 -07001949case 101:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001950YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001951#line 264 "glsl_lexer.lpp"
1952return NE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001953 YY_BREAK
Chad Versacef88b4ea2010-10-08 16:12:56 -07001954case 102:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001955YY_RULE_SETUP
Chad Versacef88b4ea2010-10-08 16:12:56 -07001956#line 265 "glsl_lexer.lpp"
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001957return AND_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001958 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001959case 103:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001960YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001961#line 266 "glsl_lexer.lpp"
1962return OR_OP;
Ian Romanickf50f0652010-06-30 17:30:03 -07001963 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001964case 104:
Ian Romanickf50f0652010-06-30 17:30:03 -07001965YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001966#line 267 "glsl_lexer.lpp"
1967return XOR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001968 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001969case 105:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001970YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001971#line 268 "glsl_lexer.lpp"
1972return LEFT_OP;
Chad Versace41c20792010-10-08 12:05:02 -07001973 YY_BREAK
1974case 106:
1975YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001976#line 269 "glsl_lexer.lpp"
1977return RIGHT_OP;
Chad Versacef88b4ea2010-10-08 16:12:56 -07001978 YY_BREAK
1979case 107:
1980YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08001981#line 271 "glsl_lexer.lpp"
1982return MUL_ASSIGN;
1983 YY_BREAK
1984case 108:
1985YY_RULE_SETUP
1986#line 272 "glsl_lexer.lpp"
1987return DIV_ASSIGN;
1988 YY_BREAK
1989case 109:
1990YY_RULE_SETUP
1991#line 273 "glsl_lexer.lpp"
1992return ADD_ASSIGN;
1993 YY_BREAK
1994case 110:
1995YY_RULE_SETUP
1996#line 274 "glsl_lexer.lpp"
1997return MOD_ASSIGN;
1998 YY_BREAK
1999case 111:
2000YY_RULE_SETUP
2001#line 275 "glsl_lexer.lpp"
2002return LEFT_ASSIGN;
2003 YY_BREAK
2004case 112:
2005YY_RULE_SETUP
2006#line 276 "glsl_lexer.lpp"
2007return RIGHT_ASSIGN;
2008 YY_BREAK
2009case 113:
2010YY_RULE_SETUP
2011#line 277 "glsl_lexer.lpp"
2012return AND_ASSIGN;
2013 YY_BREAK
2014case 114:
2015YY_RULE_SETUP
2016#line 278 "glsl_lexer.lpp"
2017return XOR_ASSIGN;
2018 YY_BREAK
2019case 115:
2020YY_RULE_SETUP
2021#line 279 "glsl_lexer.lpp"
2022return OR_ASSIGN;
2023 YY_BREAK
2024case 116:
2025YY_RULE_SETUP
2026#line 280 "glsl_lexer.lpp"
2027return SUB_ASSIGN;
2028 YY_BREAK
2029case 117:
2030YY_RULE_SETUP
2031#line 282 "glsl_lexer.lpp"
2032{
2033 yylval->n = strtol(yytext, NULL, 10);
2034 return IS_UINT ? UINTCONSTANT : INTCONSTANT;
2035 }
2036 YY_BREAK
2037case 118:
2038YY_RULE_SETUP
Chad Versacef88b4ea2010-10-08 16:12:56 -07002039#line 286 "glsl_lexer.lpp"
2040{
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002041 yylval->n = strtol(yytext + 2, NULL, 16);
2042 return IS_UINT ? UINTCONSTANT : INTCONSTANT;
2043 }
2044 YY_BREAK
2045case 119:
2046YY_RULE_SETUP
2047#line 290 "glsl_lexer.lpp"
2048{
2049 yylval->n = strtol(yytext, NULL, 8);
2050 return IS_UINT ? UINTCONSTANT : INTCONSTANT;
2051 }
2052 YY_BREAK
2053case 120:
2054YY_RULE_SETUP
2055#line 295 "glsl_lexer.lpp"
2056{
Chad Versacef88b4ea2010-10-08 16:12:56 -07002057 yylval->real = strtod(yytext, NULL);
2058 return FLOATCONSTANT;
2059 }
2060 YY_BREAK
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002061case 121:
Chad Versacef88b4ea2010-10-08 16:12:56 -07002062YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002063#line 299 "glsl_lexer.lpp"
2064{
2065 yylval->real = strtod(yytext, NULL);
2066 return FLOATCONSTANT;
2067 }
2068 YY_BREAK
2069case 122:
2070YY_RULE_SETUP
2071#line 303 "glsl_lexer.lpp"
2072{
2073 yylval->real = strtod(yytext, NULL);
2074 return FLOATCONSTANT;
2075 }
2076 YY_BREAK
2077case 123:
2078YY_RULE_SETUP
2079#line 307 "glsl_lexer.lpp"
2080{
2081 yylval->real = strtod(yytext, NULL);
2082 return FLOATCONSTANT;
2083 }
2084 YY_BREAK
2085case 124:
2086YY_RULE_SETUP
2087#line 311 "glsl_lexer.lpp"
2088{
2089 yylval->real = strtod(yytext, NULL);
2090 return FLOATCONSTANT;
2091 }
2092 YY_BREAK
2093case 125:
2094YY_RULE_SETUP
2095#line 316 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002096{
Eric Anholt47f3f222010-08-02 11:26:43 -07002097 yylval->n = 1;
2098 return BOOLCONSTANT;
2099 }
2100 YY_BREAK
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002101case 126:
Eric Anholt47f3f222010-08-02 11:26:43 -07002102YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002103#line 320 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07002104{
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002105 yylval->n = 0;
2106 return BOOLCONSTANT;
2107 }
2108 YY_BREAK
2109/* Reserved words in GLSL 1.10. */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002110case 127:
2111YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002112#line 327 "glsl_lexer.lpp"
2113KEYWORD(110 || ES, 999, ASM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002114 YY_BREAK
2115case 128:
2116YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002117#line 328 "glsl_lexer.lpp"
2118KEYWORD(110 || ES, 999, CLASS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002119 YY_BREAK
2120case 129:
2121YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002122#line 329 "glsl_lexer.lpp"
2123KEYWORD(110 || ES, 999, UNION);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002124 YY_BREAK
2125case 130:
2126YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002127#line 330 "glsl_lexer.lpp"
2128KEYWORD(110 || ES, 999, ENUM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002129 YY_BREAK
2130case 131:
2131YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002132#line 331 "glsl_lexer.lpp"
2133KEYWORD(110 || ES, 999, TYPEDEF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002134 YY_BREAK
2135case 132:
2136YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002137#line 332 "glsl_lexer.lpp"
2138KEYWORD(110 || ES, 999, TEMPLATE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002139 YY_BREAK
2140case 133:
2141YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002142#line 333 "glsl_lexer.lpp"
2143KEYWORD(110 || ES, 999, THIS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002144 YY_BREAK
2145case 134:
2146YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002147#line 334 "glsl_lexer.lpp"
2148KEYWORD(110 || ES, 999, PACKED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002149 YY_BREAK
2150case 135:
2151YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002152#line 335 "glsl_lexer.lpp"
2153KEYWORD(110 || ES, 999, GOTO);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002154 YY_BREAK
2155case 136:
2156YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002157#line 336 "glsl_lexer.lpp"
2158KEYWORD(110 || ES, 130, SWITCH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002159 YY_BREAK
2160case 137:
2161YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002162#line 337 "glsl_lexer.lpp"
2163KEYWORD(110 || ES, 130, DEFAULT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002164 YY_BREAK
2165case 138:
2166YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002167#line 338 "glsl_lexer.lpp"
2168KEYWORD(110 || ES, 999, INLINE_TOK);
Ian Romanickf50f0652010-06-30 17:30:03 -07002169 YY_BREAK
2170case 139:
2171YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002172#line 339 "glsl_lexer.lpp"
2173KEYWORD(110 || ES, 999, NOINLINE);
Eric Anholt47f3f222010-08-02 11:26:43 -07002174 YY_BREAK
2175case 140:
2176YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002177#line 340 "glsl_lexer.lpp"
2178KEYWORD(110 || ES, 999, VOLATILE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002179 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002180case 141:
2181YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002182#line 341 "glsl_lexer.lpp"
2183KEYWORD(110 || ES, 999, PUBLIC_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002184 YY_BREAK
2185case 142:
2186YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002187#line 342 "glsl_lexer.lpp"
2188KEYWORD(110 || ES, 999, STATIC);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002189 YY_BREAK
2190case 143:
2191YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002192#line 343 "glsl_lexer.lpp"
2193KEYWORD(110 || ES, 999, EXTERN);
Ian Romanickf50f0652010-06-30 17:30:03 -07002194 YY_BREAK
2195case 144:
2196YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002197#line 344 "glsl_lexer.lpp"
2198KEYWORD(110 || ES, 999, EXTERNAL);
Eric Anholt47f3f222010-08-02 11:26:43 -07002199 YY_BREAK
2200case 145:
2201YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002202#line 345 "glsl_lexer.lpp"
2203KEYWORD(110 || ES, 999, INTERFACE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002204 YY_BREAK
2205case 146:
2206YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002207#line 346 "glsl_lexer.lpp"
2208KEYWORD(110 || ES, 999, LONG_TOK);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002209 YY_BREAK
2210case 147:
2211YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002212#line 347 "glsl_lexer.lpp"
2213KEYWORD(110 || ES, 999, SHORT_TOK);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002214 YY_BREAK
2215case 148:
2216YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002217#line 348 "glsl_lexer.lpp"
2218KEYWORD(110 || ES, 400, DOUBLE_TOK);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002219 YY_BREAK
2220case 149:
2221YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002222#line 349 "glsl_lexer.lpp"
2223KEYWORD(110 || ES, 999, HALF);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002224 YY_BREAK
2225case 150:
2226YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002227#line 350 "glsl_lexer.lpp"
2228KEYWORD(110 || ES, 999, FIXED_TOK);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002229 YY_BREAK
2230case 151:
2231YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002232#line 351 "glsl_lexer.lpp"
2233KEYWORD(110 || ES, 999, UNSIGNED);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002234 YY_BREAK
2235case 152:
2236YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002237#line 352 "glsl_lexer.lpp"
2238KEYWORD(110 || ES, 999, INPUT_TOK);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002239 YY_BREAK
2240case 153:
2241YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002242#line 353 "glsl_lexer.lpp"
2243KEYWORD(110 || ES, 999, OUTPUT);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002244 YY_BREAK
2245case 154:
2246YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002247#line 354 "glsl_lexer.lpp"
2248KEYWORD(110 || ES, 999, HVEC2);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002249 YY_BREAK
2250case 155:
2251YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002252#line 355 "glsl_lexer.lpp"
2253KEYWORD(110 || ES, 999, HVEC3);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002254 YY_BREAK
2255case 156:
2256YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002257#line 356 "glsl_lexer.lpp"
2258KEYWORD(110 || ES, 999, HVEC4);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002259 YY_BREAK
2260case 157:
2261YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002262#line 357 "glsl_lexer.lpp"
2263KEYWORD(110 || ES, 400, DVEC2);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002264 YY_BREAK
2265case 158:
2266YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002267#line 358 "glsl_lexer.lpp"
2268KEYWORD(110 || ES, 400, DVEC3);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002269 YY_BREAK
2270case 159:
2271YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002272#line 359 "glsl_lexer.lpp"
2273KEYWORD(110 || ES, 400, DVEC4);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002274 YY_BREAK
2275case 160:
2276YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002277#line 360 "glsl_lexer.lpp"
2278KEYWORD(110 || ES, 999, FVEC2);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002279 YY_BREAK
2280case 161:
2281YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002282#line 361 "glsl_lexer.lpp"
2283KEYWORD(110 || ES, 999, FVEC3);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002284 YY_BREAK
2285case 162:
2286YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002287#line 362 "glsl_lexer.lpp"
2288KEYWORD(110 || ES, 999, FVEC4);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002289 YY_BREAK
2290case 163:
2291YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002292#line 363 "glsl_lexer.lpp"
2293return SAMPLER2DRECT;
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002294 YY_BREAK
2295case 164:
2296YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002297#line 364 "glsl_lexer.lpp"
2298KEYWORD(110 || ES, 999, SAMPLER3DRECT);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002299 YY_BREAK
2300case 165:
2301YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002302#line 365 "glsl_lexer.lpp"
2303return SAMPLER2DRECTSHADOW;
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002304 YY_BREAK
2305case 166:
2306YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002307#line 366 "glsl_lexer.lpp"
2308KEYWORD(110 || ES, 999, SIZEOF);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002309 YY_BREAK
2310case 167:
2311YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002312#line 367 "glsl_lexer.lpp"
2313KEYWORD(110 || ES, 999, CAST);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002314 YY_BREAK
2315case 168:
2316YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002317#line 368 "glsl_lexer.lpp"
2318KEYWORD(110 || ES, 999, NAMESPACE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002319 YY_BREAK
2320case 169:
2321YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002322#line 369 "glsl_lexer.lpp"
2323KEYWORD(110 || ES, 999, USING);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002324 YY_BREAK
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002325/* Additional reserved words in GLSL 1.20. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002326case 170:
2327YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002328#line 372 "glsl_lexer.lpp"
2329KEYWORD(120, 130 || ES, LOWP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002330 YY_BREAK
2331case 171:
2332YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002333#line 373 "glsl_lexer.lpp"
2334KEYWORD(120, 130 || ES, MEDIUMP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002335 YY_BREAK
2336case 172:
2337YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002338#line 374 "glsl_lexer.lpp"
2339KEYWORD(120, 130 || ES, HIGHP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002340 YY_BREAK
2341case 173:
2342YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002343#line 375 "glsl_lexer.lpp"
2344KEYWORD(120, 130 || ES, PRECISION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002345 YY_BREAK
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002346/* Additional reserved words in GLSL 1.30. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002347case 174:
2348YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002349#line 378 "glsl_lexer.lpp"
2350KEYWORD(130, 130, CASE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002351 YY_BREAK
2352case 175:
2353YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002354#line 379 "glsl_lexer.lpp"
2355KEYWORD(130, 999, COMMON);
Ian Romanick33fe3642010-08-30 11:59:48 -07002356 YY_BREAK
2357case 176:
2358YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002359#line 380 "glsl_lexer.lpp"
2360KEYWORD(130, 999, PARTITION);
Ian Romanick33fe3642010-08-30 11:59:48 -07002361 YY_BREAK
2362case 177:
2363YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002364#line 381 "glsl_lexer.lpp"
2365KEYWORD(130, 999, ACTIVE);
Ian Romanick33fe3642010-08-30 11:59:48 -07002366 YY_BREAK
2367case 178:
2368YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002369#line 382 "glsl_lexer.lpp"
2370KEYWORD(130 || ES, 999, SUPERP);
Ian Romanick33fe3642010-08-30 11:59:48 -07002371 YY_BREAK
2372case 179:
2373YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002374#line 383 "glsl_lexer.lpp"
2375KEYWORD(130, 140, SAMPLERBUFFER);
Ian Romanick33fe3642010-08-30 11:59:48 -07002376 YY_BREAK
2377case 180:
2378YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002379#line 384 "glsl_lexer.lpp"
2380KEYWORD(130, 999, FILTER);
Ian Romanick33fe3642010-08-30 11:59:48 -07002381 YY_BREAK
2382case 181:
2383YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002384#line 385 "glsl_lexer.lpp"
2385KEYWORD(130, 999, IMAGE1D);
Chad Versace41c20792010-10-08 12:05:02 -07002386 YY_BREAK
2387case 182:
2388YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002389#line 386 "glsl_lexer.lpp"
2390KEYWORD(130, 999, IMAGE2D);
Chad Versace41c20792010-10-08 12:05:02 -07002391 YY_BREAK
2392case 183:
2393YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002394#line 387 "glsl_lexer.lpp"
2395KEYWORD(130, 999, IMAGE3D);
Chad Versace41c20792010-10-08 12:05:02 -07002396 YY_BREAK
2397case 184:
2398YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002399#line 388 "glsl_lexer.lpp"
2400KEYWORD(130, 999, IMAGECUBE);
Chad Versace41c20792010-10-08 12:05:02 -07002401 YY_BREAK
2402case 185:
2403YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002404#line 389 "glsl_lexer.lpp"
2405KEYWORD(130, 999, IIMAGE1D);
Chad Versacef88b4ea2010-10-08 16:12:56 -07002406 YY_BREAK
2407case 186:
2408YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002409#line 390 "glsl_lexer.lpp"
2410KEYWORD(130, 999, IIMAGE2D);
Chad Versacef88b4ea2010-10-08 16:12:56 -07002411 YY_BREAK
2412case 187:
2413YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002414#line 391 "glsl_lexer.lpp"
2415KEYWORD(130, 999, IIMAGE3D);
2416 YY_BREAK
2417case 188:
2418YY_RULE_SETUP
2419#line 392 "glsl_lexer.lpp"
2420KEYWORD(130, 999, IIMAGECUBE);
2421 YY_BREAK
2422case 189:
2423YY_RULE_SETUP
2424#line 393 "glsl_lexer.lpp"
2425KEYWORD(130, 999, UIMAGE1D);
2426 YY_BREAK
2427case 190:
2428YY_RULE_SETUP
2429#line 394 "glsl_lexer.lpp"
2430KEYWORD(130, 999, UIMAGE2D);
2431 YY_BREAK
2432case 191:
2433YY_RULE_SETUP
2434#line 395 "glsl_lexer.lpp"
2435KEYWORD(130, 999, UIMAGE3D);
2436 YY_BREAK
2437case 192:
2438YY_RULE_SETUP
2439#line 396 "glsl_lexer.lpp"
2440KEYWORD(130, 999, UIMAGECUBE);
2441 YY_BREAK
2442case 193:
2443YY_RULE_SETUP
2444#line 397 "glsl_lexer.lpp"
2445KEYWORD(130, 999, IMAGE1DARRAY);
2446 YY_BREAK
2447case 194:
2448YY_RULE_SETUP
2449#line 398 "glsl_lexer.lpp"
2450KEYWORD(130, 999, IMAGE2DARRAY);
2451 YY_BREAK
2452case 195:
2453YY_RULE_SETUP
2454#line 399 "glsl_lexer.lpp"
2455KEYWORD(130, 999, IIMAGE1DARRAY);
2456 YY_BREAK
2457case 196:
2458YY_RULE_SETUP
2459#line 400 "glsl_lexer.lpp"
2460KEYWORD(130, 999, IIMAGE2DARRAY);
2461 YY_BREAK
2462case 197:
2463YY_RULE_SETUP
2464#line 401 "glsl_lexer.lpp"
2465KEYWORD(130, 999, UIMAGE1DARRAY);
2466 YY_BREAK
2467case 198:
2468YY_RULE_SETUP
2469#line 402 "glsl_lexer.lpp"
2470KEYWORD(130, 999, UIMAGE2DARRAY);
2471 YY_BREAK
2472case 199:
2473YY_RULE_SETUP
2474#line 403 "glsl_lexer.lpp"
2475KEYWORD(130, 999, IMAGE1DSHADOW);
2476 YY_BREAK
2477case 200:
2478YY_RULE_SETUP
2479#line 404 "glsl_lexer.lpp"
2480KEYWORD(130, 999, IMAGE2DSHADOW);
2481 YY_BREAK
2482case 201:
2483YY_RULE_SETUP
2484#line 405 "glsl_lexer.lpp"
2485KEYWORD(130, 999, IMAGE1DARRAYSHADOW);
2486 YY_BREAK
2487case 202:
2488YY_RULE_SETUP
2489#line 406 "glsl_lexer.lpp"
2490KEYWORD(130, 999, IMAGE2DARRAYSHADOW);
2491 YY_BREAK
2492case 203:
2493YY_RULE_SETUP
2494#line 407 "glsl_lexer.lpp"
2495KEYWORD(130, 999, IMAGEBUFFER);
2496 YY_BREAK
2497case 204:
2498YY_RULE_SETUP
2499#line 408 "glsl_lexer.lpp"
2500KEYWORD(130, 999, IIMAGEBUFFER);
2501 YY_BREAK
2502case 205:
2503YY_RULE_SETUP
2504#line 409 "glsl_lexer.lpp"
2505KEYWORD(130, 999, UIMAGEBUFFER);
2506 YY_BREAK
2507case 206:
2508YY_RULE_SETUP
2509#line 410 "glsl_lexer.lpp"
2510KEYWORD(130, 999, ROW_MAJOR);
2511 YY_BREAK
2512case 207:
2513YY_RULE_SETUP
2514#line 412 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002515{
2516 struct _mesa_glsl_parse_state *state = yyextra;
2517 void *ctx = state;
2518 yylval->identifier = talloc_strdup(ctx, yytext);
2519 return IDENTIFIER;
2520 }
2521 YY_BREAK
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002522case 208:
Eric Anholt47f3f222010-08-02 11:26:43 -07002523YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002524#line 419 "glsl_lexer.lpp"
Chad Versacef88b4ea2010-10-08 16:12:56 -07002525{ return yytext[0]; }
2526 YY_BREAK
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002527case 209:
Chad Versacef88b4ea2010-10-08 16:12:56 -07002528YY_RULE_SETUP
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002529#line 421 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002530ECHO;
2531 YY_BREAK
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002532#line 2533 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002533case YY_STATE_EOF(INITIAL):
2534case YY_STATE_EOF(PP):
Ian Romanick33fe3642010-08-30 11:59:48 -07002535case YY_STATE_EOF(PRAGMA):
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002536 yyterminate();
2537
2538 case YY_END_OF_BUFFER:
2539 {
2540 /* Amount of text matched not including the EOB char. */
2541 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2542
2543 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2544 *yy_cp = yyg->yy_hold_char;
2545 YY_RESTORE_YY_MORE_OFFSET
2546
2547 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2548 {
2549 /* We're scanning a new file or input source. It's
2550 * possible that this happened because the user
2551 * just pointed yyin at a new source and called
2552 * _mesa_glsl_lex(). If so, then we have to assure
2553 * consistency between YY_CURRENT_BUFFER and our
2554 * globals. Here is the right place to do so, because
2555 * this is the first action (other than possibly a
2556 * back-up) that will match for the new input source.
2557 */
2558 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2559 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2560 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2561 }
2562
2563 /* Note that here we test for yy_c_buf_p "<=" to the position
2564 * of the first EOB in the buffer, since yy_c_buf_p will
2565 * already have been incremented past the NUL character
2566 * (since all states make transitions on EOB to the
2567 * end-of-buffer state). Contrast this with the test
2568 * in input().
2569 */
2570 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2571 { /* This was really a NUL. */
2572 yy_state_type yy_next_state;
2573
2574 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2575
2576 yy_current_state = yy_get_previous_state( yyscanner );
2577
2578 /* Okay, we're now positioned to make the NUL
2579 * transition. We couldn't have
2580 * yy_get_previous_state() go ahead and do it
2581 * for us because it doesn't know how to deal
2582 * with the possibility of jamming (and we don't
2583 * want to build jamming into it because then it
2584 * will run more slowly).
2585 */
2586
2587 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2588
2589 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2590
2591 if ( yy_next_state )
2592 {
2593 /* Consume the NUL. */
2594 yy_cp = ++yyg->yy_c_buf_p;
2595 yy_current_state = yy_next_state;
2596 goto yy_match;
2597 }
2598
2599 else
2600 {
2601 yy_cp = yyg->yy_last_accepting_cpos;
2602 yy_current_state = yyg->yy_last_accepting_state;
2603 goto yy_find_action;
2604 }
2605 }
2606
2607 else switch ( yy_get_next_buffer( yyscanner ) )
2608 {
2609 case EOB_ACT_END_OF_FILE:
2610 {
2611 yyg->yy_did_buffer_switch_on_eof = 0;
2612
2613 if ( _mesa_glsl_wrap(yyscanner ) )
2614 {
2615 /* Note: because we've taken care in
2616 * yy_get_next_buffer() to have set up
2617 * yytext, we can now set up
2618 * yy_c_buf_p so that if some total
2619 * hoser (like flex itself) wants to
2620 * call the scanner after we return the
2621 * YY_NULL, it'll still work - another
2622 * YY_NULL will get returned.
2623 */
2624 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2625
2626 yy_act = YY_STATE_EOF(YY_START);
2627 goto do_action;
2628 }
2629
2630 else
2631 {
2632 if ( ! yyg->yy_did_buffer_switch_on_eof )
2633 YY_NEW_FILE;
2634 }
2635 break;
2636 }
2637
2638 case EOB_ACT_CONTINUE_SCAN:
2639 yyg->yy_c_buf_p =
2640 yyg->yytext_ptr + yy_amount_of_matched_text;
2641
2642 yy_current_state = yy_get_previous_state( yyscanner );
2643
2644 yy_cp = yyg->yy_c_buf_p;
2645 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2646 goto yy_match;
2647
2648 case EOB_ACT_LAST_MATCH:
2649 yyg->yy_c_buf_p =
2650 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2651
2652 yy_current_state = yy_get_previous_state( yyscanner );
2653
2654 yy_cp = yyg->yy_c_buf_p;
2655 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2656 goto yy_find_action;
2657 }
2658 break;
2659 }
2660
2661 default:
2662 YY_FATAL_ERROR(
2663 "fatal flex scanner internal error--no action found" );
2664 } /* end of action switch */
2665 } /* end of scanning one token */
2666} /* end of _mesa_glsl_lex */
2667
2668/* yy_get_next_buffer - try to read in a new buffer
2669 *
2670 * Returns a code representing an action:
2671 * EOB_ACT_LAST_MATCH -
2672 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2673 * EOB_ACT_END_OF_FILE - end of file
2674 */
2675static int yy_get_next_buffer (yyscan_t yyscanner)
2676{
2677 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2678 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2679 register char *source = yyg->yytext_ptr;
2680 register int number_to_move, i;
2681 int ret_val;
2682
2683 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2684 YY_FATAL_ERROR(
2685 "fatal flex scanner internal error--end of buffer missed" );
2686
2687 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2688 { /* Don't try to fill the buffer, so this is an EOF. */
2689 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2690 {
2691 /* We matched a single character, the EOB, so
2692 * treat this as a final EOF.
2693 */
2694 return EOB_ACT_END_OF_FILE;
2695 }
2696
2697 else
2698 {
2699 /* We matched some text prior to the EOB, first
2700 * process it.
2701 */
2702 return EOB_ACT_LAST_MATCH;
2703 }
2704 }
2705
2706 /* Try to read more data. */
2707
2708 /* First move last chars to start of buffer. */
2709 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2710
2711 for ( i = 0; i < number_to_move; ++i )
2712 *(dest++) = *(source++);
2713
2714 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2715 /* don't do the read, it's not guaranteed to return an EOF,
2716 * just force an EOF
2717 */
2718 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2719
2720 else
2721 {
2722 int num_to_read =
2723 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2724
2725 while ( num_to_read <= 0 )
2726 { /* Not enough room in the buffer - grow it. */
2727
2728 /* just a shorter name for the current buffer */
2729 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2730
2731 int yy_c_buf_p_offset =
2732 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2733
2734 if ( b->yy_is_our_buffer )
2735 {
2736 int new_size = b->yy_buf_size * 2;
2737
2738 if ( new_size <= 0 )
2739 b->yy_buf_size += b->yy_buf_size / 8;
2740 else
2741 b->yy_buf_size *= 2;
2742
2743 b->yy_ch_buf = (char *)
2744 /* Include room in for 2 EOB chars. */
2745 _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2746 }
2747 else
2748 /* Can't grow it, we don't own it. */
2749 b->yy_ch_buf = 0;
2750
2751 if ( ! b->yy_ch_buf )
2752 YY_FATAL_ERROR(
2753 "fatal error - scanner input buffer overflow" );
2754
2755 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2756
2757 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2758 number_to_move - 1;
2759
2760 }
2761
2762 if ( num_to_read > YY_READ_BUF_SIZE )
2763 num_to_read = YY_READ_BUF_SIZE;
2764
2765 /* Read in more data. */
2766 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2767 yyg->yy_n_chars, (size_t) num_to_read );
2768
2769 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2770 }
2771
2772 if ( yyg->yy_n_chars == 0 )
2773 {
2774 if ( number_to_move == YY_MORE_ADJ )
2775 {
2776 ret_val = EOB_ACT_END_OF_FILE;
2777 _mesa_glsl_restart(yyin ,yyscanner);
2778 }
2779
2780 else
2781 {
2782 ret_val = EOB_ACT_LAST_MATCH;
2783 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2784 YY_BUFFER_EOF_PENDING;
2785 }
2786 }
2787
2788 else
2789 ret_val = EOB_ACT_CONTINUE_SCAN;
2790
2791 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2792 /* Extend the array by 50%, plus the number we really need. */
2793 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2794 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2795 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2796 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2797 }
2798
2799 yyg->yy_n_chars += number_to_move;
2800 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2801 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2802
2803 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2804
2805 return ret_val;
2806}
2807
2808/* yy_get_previous_state - get the state just before the EOB char was reached */
2809
2810 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2811{
2812 register yy_state_type yy_current_state;
2813 register char *yy_cp;
2814 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2815
2816 yy_current_state = yyg->yy_start;
2817 yy_current_state += YY_AT_BOL();
2818
2819 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2820 {
2821 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2822 if ( yy_accept[yy_current_state] )
2823 {
2824 yyg->yy_last_accepting_state = yy_current_state;
2825 yyg->yy_last_accepting_cpos = yy_cp;
2826 }
2827 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2828 {
2829 yy_current_state = (int) yy_def[yy_current_state];
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002830 if ( yy_current_state >= 813 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002831 yy_c = yy_meta[(unsigned int) yy_c];
2832 }
2833 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2834 }
2835
2836 return yy_current_state;
2837}
2838
2839/* yy_try_NUL_trans - try to make a transition on the NUL character
2840 *
2841 * synopsis
2842 * next_state = yy_try_NUL_trans( current_state );
2843 */
2844 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2845{
2846 register int yy_is_jam;
2847 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2848 register char *yy_cp = yyg->yy_c_buf_p;
2849
2850 register YY_CHAR yy_c = 1;
2851 if ( yy_accept[yy_current_state] )
2852 {
2853 yyg->yy_last_accepting_state = yy_current_state;
2854 yyg->yy_last_accepting_cpos = yy_cp;
2855 }
2856 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2857 {
2858 yy_current_state = (int) yy_def[yy_current_state];
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002859 if ( yy_current_state >= 813 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002860 yy_c = yy_meta[(unsigned int) yy_c];
2861 }
2862 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Kenneth Graunke0d082c02010-11-13 22:02:32 -08002863 yy_is_jam = (yy_current_state == 812);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002864
2865 return yy_is_jam ? 0 : yy_current_state;
2866}
2867
2868#ifndef YY_NO_INPUT
2869#ifdef __cplusplus
2870 static int yyinput (yyscan_t yyscanner)
2871#else
2872 static int input (yyscan_t yyscanner)
2873#endif
2874
2875{
2876 int c;
2877 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2878
2879 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2880
2881 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2882 {
2883 /* yy_c_buf_p now points to the character we want to return.
2884 * If this occurs *before* the EOB characters, then it's a
2885 * valid NUL; if not, then we've hit the end of the buffer.
2886 */
2887 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2888 /* This was really a NUL. */
2889 *yyg->yy_c_buf_p = '\0';
2890
2891 else
2892 { /* need more input */
2893 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2894 ++yyg->yy_c_buf_p;
2895
2896 switch ( yy_get_next_buffer( yyscanner ) )
2897 {
2898 case EOB_ACT_LAST_MATCH:
2899 /* This happens because yy_g_n_b()
2900 * sees that we've accumulated a
2901 * token and flags that we need to
2902 * try matching the token before
2903 * proceeding. But for input(),
2904 * there's no matching to consider.
2905 * So convert the EOB_ACT_LAST_MATCH
2906 * to EOB_ACT_END_OF_FILE.
2907 */
2908
2909 /* Reset buffer status. */
2910 _mesa_glsl_restart(yyin ,yyscanner);
2911
2912 /*FALLTHROUGH*/
2913
2914 case EOB_ACT_END_OF_FILE:
2915 {
2916 if ( _mesa_glsl_wrap(yyscanner ) )
2917 return EOF;
2918
2919 if ( ! yyg->yy_did_buffer_switch_on_eof )
2920 YY_NEW_FILE;
2921#ifdef __cplusplus
2922 return yyinput(yyscanner);
2923#else
2924 return input(yyscanner);
2925#endif
2926 }
2927
2928 case EOB_ACT_CONTINUE_SCAN:
2929 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2930 break;
2931 }
2932 }
2933 }
2934
2935 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2936 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2937 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2938
2939 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2940
2941 return c;
2942}
2943#endif /* ifndef YY_NO_INPUT */
2944
2945/** Immediately switch to a different input stream.
2946 * @param input_file A readable stream.
2947 * @param yyscanner The scanner object.
2948 * @note This function does not reset the start condition to @c INITIAL .
2949 */
2950 void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner)
2951{
2952 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2953
2954 if ( ! YY_CURRENT_BUFFER ){
2955 _mesa_glsl_ensure_buffer_stack (yyscanner);
2956 YY_CURRENT_BUFFER_LVALUE =
2957 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2958 }
2959
2960 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2961 _mesa_glsl__load_buffer_state(yyscanner );
2962}
2963
2964/** Switch to a different input buffer.
2965 * @param new_buffer The new input buffer.
2966 * @param yyscanner The scanner object.
2967 */
2968 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2969{
2970 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2971
2972 /* TODO. We should be able to replace this entire function body
2973 * with
2974 * _mesa_glsl_pop_buffer_state();
2975 * _mesa_glsl_push_buffer_state(new_buffer);
2976 */
2977 _mesa_glsl_ensure_buffer_stack (yyscanner);
2978 if ( YY_CURRENT_BUFFER == new_buffer )
2979 return;
2980
2981 if ( YY_CURRENT_BUFFER )
2982 {
2983 /* Flush out information for old buffer. */
2984 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2985 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2986 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2987 }
2988
2989 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2990 _mesa_glsl__load_buffer_state(yyscanner );
2991
2992 /* We don't actually know whether we did this switch during
2993 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2994 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2995 * to go ahead and always set it.
2996 */
2997 yyg->yy_did_buffer_switch_on_eof = 1;
2998}
2999
3000static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner)
3001{
3002 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3003 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3004 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
3005 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
3006 yyg->yy_hold_char = *yyg->yy_c_buf_p;
3007}
3008
3009/** Allocate and initialize an input buffer state.
3010 * @param file A readable stream.
3011 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3012 * @param yyscanner The scanner object.
3013 * @return the allocated buffer state.
3014 */
3015 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner)
3016{
3017 YY_BUFFER_STATE b;
3018
3019 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3020 if ( ! b )
3021 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
3022
3023 b->yy_buf_size = size;
3024
3025 /* yy_ch_buf has to be 2 characters longer than the size given because
3026 * we need to put in 2 end-of-buffer characters.
3027 */
3028 b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner );
3029 if ( ! b->yy_ch_buf )
3030 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
3031
3032 b->yy_is_our_buffer = 1;
3033
3034 _mesa_glsl__init_buffer(b,file ,yyscanner);
3035
3036 return b;
3037}
3038
3039/** Destroy the buffer.
3040 * @param b a buffer created with _mesa_glsl__create_buffer()
3041 * @param yyscanner The scanner object.
3042 */
3043 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
3044{
3045 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3046
3047 if ( ! b )
3048 return;
3049
3050 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3051 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3052
3053 if ( b->yy_is_our_buffer )
3054 _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner );
3055
3056 _mesa_glsl_free((void *) b ,yyscanner );
3057}
3058
3059/* Initializes or reinitializes a buffer.
3060 * This function is sometimes called more than once on the same buffer,
3061 * such as during a _mesa_glsl_restart() or at EOF.
3062 */
3063 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
3064
3065{
3066 int oerrno = errno;
3067 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3068
3069 _mesa_glsl__flush_buffer(b ,yyscanner);
3070
3071 b->yy_input_file = file;
3072 b->yy_fill_buffer = 1;
3073
3074 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
3075 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
3076 * In that case, we don't want to reset the lineno or column.
3077 */
3078 if (b != YY_CURRENT_BUFFER){
3079 b->yy_bs_lineno = 1;
3080 b->yy_bs_column = 0;
3081 }
3082
3083 b->yy_is_interactive = 0;
3084
3085 errno = oerrno;
3086}
3087
3088/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3089 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3090 * @param yyscanner The scanner object.
3091 */
3092 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
3093{
3094 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3095 if ( ! b )
3096 return;
3097
3098 b->yy_n_chars = 0;
3099
3100 /* We always need two end-of-buffer characters. The first causes
3101 * a transition to the end-of-buffer state. The second causes
3102 * a jam in that state.
3103 */
3104 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3105 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3106
3107 b->yy_buf_pos = &b->yy_ch_buf[0];
3108
3109 b->yy_at_bol = 1;
3110 b->yy_buffer_status = YY_BUFFER_NEW;
3111
3112 if ( b == YY_CURRENT_BUFFER )
3113 _mesa_glsl__load_buffer_state(yyscanner );
3114}
3115
3116/** Pushes the new state onto the stack. The new state becomes
3117 * the current state. This function will allocate the stack
3118 * if necessary.
3119 * @param new_buffer The new state.
3120 * @param yyscanner The scanner object.
3121 */
3122void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
3123{
3124 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3125 if (new_buffer == NULL)
3126 return;
3127
3128 _mesa_glsl_ensure_buffer_stack(yyscanner);
3129
3130 /* This block is copied from _mesa_glsl__switch_to_buffer. */
3131 if ( YY_CURRENT_BUFFER )
3132 {
3133 /* Flush out information for old buffer. */
3134 *yyg->yy_c_buf_p = yyg->yy_hold_char;
3135 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
3136 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
3137 }
3138
3139 /* Only push if top exists. Otherwise, replace top. */
3140 if (YY_CURRENT_BUFFER)
3141 yyg->yy_buffer_stack_top++;
3142 YY_CURRENT_BUFFER_LVALUE = new_buffer;
3143
3144 /* copied from _mesa_glsl__switch_to_buffer. */
3145 _mesa_glsl__load_buffer_state(yyscanner );
3146 yyg->yy_did_buffer_switch_on_eof = 1;
3147}
3148
3149/** Removes and deletes the top of the stack, if present.
3150 * The next element becomes the new top.
3151 * @param yyscanner The scanner object.
3152 */
3153void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner)
3154{
3155 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3156 if (!YY_CURRENT_BUFFER)
3157 return;
3158
3159 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
3160 YY_CURRENT_BUFFER_LVALUE = NULL;
3161 if (yyg->yy_buffer_stack_top > 0)
3162 --yyg->yy_buffer_stack_top;
3163
3164 if (YY_CURRENT_BUFFER) {
3165 _mesa_glsl__load_buffer_state(yyscanner );
3166 yyg->yy_did_buffer_switch_on_eof = 1;
3167 }
3168}
3169
3170/* Allocates the stack if it does not exist.
3171 * Guarantees space for at least one push.
3172 */
3173static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner)
3174{
3175 int num_to_alloc;
3176 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3177
3178 if (!yyg->yy_buffer_stack) {
3179
3180 /* First allocation is just for 2 elements, since we don't know if this
3181 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3182 * immediate realloc on the next call.
3183 */
3184 num_to_alloc = 1;
3185 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc
3186 (num_to_alloc * sizeof(struct yy_buffer_state*)
3187 , yyscanner);
3188 if ( ! yyg->yy_buffer_stack )
3189 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3190
3191 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3192
3193 yyg->yy_buffer_stack_max = num_to_alloc;
3194 yyg->yy_buffer_stack_top = 0;
3195 return;
3196 }
3197
3198 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3199
3200 /* Increase the buffer to prepare for a possible push. */
3201 int grow_size = 8 /* arbitrary grow size */;
3202
3203 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3204 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc
3205 (yyg->yy_buffer_stack,
3206 num_to_alloc * sizeof(struct yy_buffer_state*)
3207 , yyscanner);
3208 if ( ! yyg->yy_buffer_stack )
3209 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3210
3211 /* zero only the new slots.*/
3212 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3213 yyg->yy_buffer_stack_max = num_to_alloc;
3214 }
3215}
3216
3217/** Setup the input buffer state to scan directly from a user-specified character buffer.
3218 * @param base the character buffer
3219 * @param size the size in bytes of the character buffer
3220 * @param yyscanner The scanner object.
3221 * @return the newly allocated buffer state object.
3222 */
3223YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3224{
3225 YY_BUFFER_STATE b;
3226
3227 if ( size < 2 ||
3228 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3229 base[size-1] != YY_END_OF_BUFFER_CHAR )
3230 /* They forgot to leave room for the EOB's. */
3231 return 0;
3232
3233 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3234 if ( ! b )
3235 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3236
3237 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3238 b->yy_buf_pos = b->yy_ch_buf = base;
3239 b->yy_is_our_buffer = 0;
3240 b->yy_input_file = 0;
3241 b->yy_n_chars = b->yy_buf_size;
3242 b->yy_is_interactive = 0;
3243 b->yy_at_bol = 1;
3244 b->yy_fill_buffer = 0;
3245 b->yy_buffer_status = YY_BUFFER_NEW;
3246
3247 _mesa_glsl__switch_to_buffer(b ,yyscanner );
3248
3249 return b;
3250}
3251
3252/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3253 * scan from a @e copy of @a str.
3254 * @param yystr a NUL-terminated string to scan
3255 * @param yyscanner The scanner object.
3256 * @return the newly allocated buffer state object.
3257 * @note If you want to scan bytes that may contain NUL values, then use
3258 * _mesa_glsl__scan_bytes() instead.
3259 */
3260YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner)
3261{
3262
3263 return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner);
3264}
3265
3266/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3267 * scan from a @e copy of @a bytes.
Kenneth Graunke0d082c02010-11-13 22:02:32 -08003268 * @param bytes the byte buffer to scan
3269 * @param len the number of bytes in the buffer pointed to by @a bytes.
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003270 * @param yyscanner The scanner object.
3271 * @return the newly allocated buffer state object.
3272 */
3273YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3274{
3275 YY_BUFFER_STATE b;
3276 char *buf;
3277 yy_size_t n;
3278 int i;
3279
3280 /* Get memory for full buffer, including space for trailing EOB's. */
3281 n = _yybytes_len + 2;
3282 buf = (char *) _mesa_glsl_alloc(n ,yyscanner );
3283 if ( ! buf )
3284 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3285
3286 for ( i = 0; i < _yybytes_len; ++i )
3287 buf[i] = yybytes[i];
3288
3289 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3290
3291 b = _mesa_glsl__scan_buffer(buf,n ,yyscanner);
3292 if ( ! b )
3293 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3294
3295 /* It's okay to grow etc. this buffer, and we should throw it
3296 * away when we're done.
3297 */
3298 b->yy_is_our_buffer = 1;
3299
3300 return b;
3301}
3302
3303#ifndef YY_EXIT_FAILURE
3304#define YY_EXIT_FAILURE 2
3305#endif
3306
3307static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3308{
3309 (void) fprintf( stderr, "%s\n", msg );
3310 exit( YY_EXIT_FAILURE );
3311}
3312
3313/* Redefine yyless() so it works in section 3 code. */
3314
3315#undef yyless
3316#define yyless(n) \
3317 do \
3318 { \
3319 /* Undo effects of setting up yytext. */ \
3320 int yyless_macro_arg = (n); \
3321 YY_LESS_LINENO(yyless_macro_arg);\
3322 yytext[yyleng] = yyg->yy_hold_char; \
3323 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3324 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3325 *yyg->yy_c_buf_p = '\0'; \
3326 yyleng = yyless_macro_arg; \
3327 } \
3328 while ( 0 )
3329
3330/* Accessor methods (get/set functions) to struct members. */
3331
3332/** Get the user-defined data for this scanner.
3333 * @param yyscanner The scanner object.
3334 */
3335YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner)
3336{
3337 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3338 return yyextra;
3339}
3340
3341/** Get the current line number.
3342 * @param yyscanner The scanner object.
3343 */
3344int _mesa_glsl_get_lineno (yyscan_t yyscanner)
3345{
3346 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3347
3348 if (! YY_CURRENT_BUFFER)
3349 return 0;
3350
3351 return yylineno;
3352}
3353
3354/** Get the current column number.
3355 * @param yyscanner The scanner object.
3356 */
3357int _mesa_glsl_get_column (yyscan_t yyscanner)
3358{
3359 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3360
3361 if (! YY_CURRENT_BUFFER)
3362 return 0;
3363
3364 return yycolumn;
3365}
3366
3367/** Get the input stream.
3368 * @param yyscanner The scanner object.
3369 */
3370FILE *_mesa_glsl_get_in (yyscan_t yyscanner)
3371{
3372 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3373 return yyin;
3374}
3375
3376/** Get the output stream.
3377 * @param yyscanner The scanner object.
3378 */
3379FILE *_mesa_glsl_get_out (yyscan_t yyscanner)
3380{
3381 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3382 return yyout;
3383}
3384
3385/** Get the length of the current token.
3386 * @param yyscanner The scanner object.
3387 */
3388int _mesa_glsl_get_leng (yyscan_t yyscanner)
3389{
3390 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3391 return yyleng;
3392}
3393
3394/** Get the current token.
3395 * @param yyscanner The scanner object.
3396 */
3397
3398char *_mesa_glsl_get_text (yyscan_t yyscanner)
3399{
3400 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3401 return yytext;
3402}
3403
3404/** Set the user-defined data. This data is never touched by the scanner.
3405 * @param user_defined The data to be associated with this scanner.
3406 * @param yyscanner The scanner object.
3407 */
3408void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3409{
3410 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3411 yyextra = user_defined ;
3412}
3413
3414/** Set the current line number.
3415 * @param line_number
3416 * @param yyscanner The scanner object.
3417 */
3418void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner)
3419{
3420 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3421
3422 /* lineno is only valid if an input buffer exists. */
3423 if (! YY_CURRENT_BUFFER )
3424 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner);
3425
3426 yylineno = line_number;
3427}
3428
3429/** Set the current column.
3430 * @param line_number
3431 * @param yyscanner The scanner object.
3432 */
3433void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner)
3434{
3435 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3436
3437 /* column is only valid if an input buffer exists. */
3438 if (! YY_CURRENT_BUFFER )
3439 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner);
3440
3441 yycolumn = column_no;
3442}
3443
3444/** Set the input stream. This does not discard the current
3445 * input buffer.
3446 * @param in_str A readable stream.
3447 * @param yyscanner The scanner object.
3448 * @see _mesa_glsl__switch_to_buffer
3449 */
3450void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner)
3451{
3452 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3453 yyin = in_str ;
3454}
3455
3456void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner)
3457{
3458 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3459 yyout = out_str ;
3460}
3461
3462int _mesa_glsl_get_debug (yyscan_t yyscanner)
3463{
3464 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3465 return yy_flex_debug;
3466}
3467
3468void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner)
3469{
3470 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3471 yy_flex_debug = bdebug ;
3472}
3473
3474/* Accessor methods for yylval and yylloc */
3475
3476YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner)
3477{
3478 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3479 return yylval;
3480}
3481
3482void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3483{
3484 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3485 yylval = yylval_param;
3486}
3487
3488YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner)
3489{
3490 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3491 return yylloc;
3492}
3493
3494void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3495{
3496 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3497 yylloc = yylloc_param;
3498}
3499
3500/* User-visible API */
3501
3502/* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3503 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3504 * That's why we explicitly handle the declaration, instead of using our macros.
3505 */
3506
3507int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals)
3508
3509{
3510 if (ptr_yy_globals == NULL){
3511 errno = EINVAL;
3512 return 1;
3513 }
3514
3515 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL );
3516
3517 if (*ptr_yy_globals == NULL){
3518 errno = ENOMEM;
3519 return 1;
3520 }
3521
3522 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3523 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3524
3525 return yy_init_globals ( *ptr_yy_globals );
3526}
3527
3528/* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3529 * convention of taking the scanner as the last argument. Note however, that
3530 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3531 * is the reason, too, why this function also must handle its own declaration).
3532 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3533 * the yyextra field.
3534 */
3535
3536int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3537
3538{
3539 struct yyguts_t dummy_yyguts;
3540
3541 _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts);
3542
3543 if (ptr_yy_globals == NULL){
3544 errno = EINVAL;
3545 return 1;
3546 }
3547
3548 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3549
3550 if (*ptr_yy_globals == NULL){
3551 errno = ENOMEM;
3552 return 1;
3553 }
3554
3555 /* By setting to 0xAA, we expose bugs in
3556 yy_init_globals. Leave at 0x00 for releases. */
3557 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3558
3559 _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals);
3560
3561 return yy_init_globals ( *ptr_yy_globals );
3562}
3563
3564static int yy_init_globals (yyscan_t yyscanner)
3565{
3566 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3567 /* Initialization is the same as for the non-reentrant scanner.
3568 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3569 */
3570
3571 yyg->yy_buffer_stack = 0;
3572 yyg->yy_buffer_stack_top = 0;
3573 yyg->yy_buffer_stack_max = 0;
3574 yyg->yy_c_buf_p = (char *) 0;
3575 yyg->yy_init = 0;
3576 yyg->yy_start = 0;
3577
3578 yyg->yy_start_stack_ptr = 0;
3579 yyg->yy_start_stack_depth = 0;
3580 yyg->yy_start_stack = NULL;
3581
3582/* Defined in main.c */
3583#ifdef YY_STDINIT
3584 yyin = stdin;
3585 yyout = stdout;
3586#else
3587 yyin = (FILE *) 0;
3588 yyout = (FILE *) 0;
3589#endif
3590
3591 /* For future reference: Set errno on error, since we are called by
3592 * _mesa_glsl_lex_init()
3593 */
3594 return 0;
3595}
3596
3597/* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3598int _mesa_glsl_lex_destroy (yyscan_t yyscanner)
3599{
3600 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3601
3602 /* Pop the buffer stack, destroying each element. */
3603 while(YY_CURRENT_BUFFER){
3604 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3605 YY_CURRENT_BUFFER_LVALUE = NULL;
3606 _mesa_glsl_pop_buffer_state(yyscanner);
3607 }
3608
3609 /* Destroy the stack itself. */
3610 _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner);
3611 yyg->yy_buffer_stack = NULL;
3612
3613 /* Destroy the start condition stack. */
3614 _mesa_glsl_free(yyg->yy_start_stack ,yyscanner );
3615 yyg->yy_start_stack = NULL;
3616
3617 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3618 * _mesa_glsl_lex() is called, initialization will occur. */
3619 yy_init_globals( yyscanner);
3620
3621 /* Destroy the main struct (reentrant only). */
3622 _mesa_glsl_free ( yyscanner , yyscanner );
3623 yyscanner = NULL;
3624 return 0;
3625}
3626
3627/*
3628 * Internal utility routines.
3629 */
3630
3631#ifndef yytext_ptr
3632static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3633{
3634 register int i;
3635 for ( i = 0; i < n; ++i )
3636 s1[i] = s2[i];
3637}
3638#endif
3639
3640#ifdef YY_NEED_STRLEN
3641static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3642{
3643 register int n;
3644 for ( n = 0; s[n]; ++n )
3645 ;
3646
3647 return n;
3648}
3649#endif
3650
3651void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner)
3652{
3653 return (void *) malloc( size );
3654}
3655
3656void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3657{
3658 /* The cast to (char *) in the following accommodates both
3659 * implementations that use char* generic pointers, and those
3660 * that use void* generic pointers. It works with the latter
3661 * because both ANSI C and C++ allow castless assignment from
3662 * any pointer type to void*, and deal with argument conversions
3663 * as though doing an assignment.
3664 */
3665 return (void *) realloc( (char *) ptr, size );
3666}
3667
3668void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
3669{
3670 free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */
3671}
3672
3673#define YYTABLES_NAME "yytables"
3674
Kenneth Graunke0d082c02010-11-13 22:02:32 -08003675#line 421 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003676
3677
3678
3679void
3680_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
3681{
3682 _mesa_glsl_lex_init_extra(state,& state->scanner);
3683 _mesa_glsl__scan_string(string,state->scanner);
3684}
3685
3686void
3687_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
3688{
3689 _mesa_glsl_lex_destroy(state->scanner);
3690}
3691