blob: 9db1652ed2facf149fa63a2f56a7199d9b0211f4 [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;
57
58/* Limits of integral types. */
59#ifndef INT8_MIN
60#define INT8_MIN (-128)
61#endif
62#ifndef INT16_MIN
63#define INT16_MIN (-32767-1)
64#endif
65#ifndef INT32_MIN
66#define INT32_MIN (-2147483647-1)
67#endif
68#ifndef INT8_MAX
69#define INT8_MAX (127)
70#endif
71#ifndef INT16_MAX
72#define INT16_MAX (32767)
73#endif
74#ifndef INT32_MAX
75#define INT32_MAX (2147483647)
76#endif
77#ifndef UINT8_MAX
78#define UINT8_MAX (255U)
79#endif
80#ifndef UINT16_MAX
81#define UINT16_MAX (65535U)
82#endif
83#ifndef UINT32_MAX
84#define UINT32_MAX (4294967295U)
85#endif
86
Ian Romanick5ed66102010-10-05 16:40:00 -070087#endif /* ! C99 */
88
Carl Worthe8a8f0f2010-07-28 12:27:33 -070089#endif /* ! FLEXINT_H */
90
91#ifdef __cplusplus
92
93/* The "const" storage-class-modifier is valid. */
94#define YY_USE_CONST
95
96#else /* ! __cplusplus */
97
98/* C99 requires __STDC__ to be defined as 1. */
99#if defined (__STDC__)
100
101#define YY_USE_CONST
102
103#endif /* defined (__STDC__) */
104#endif /* ! __cplusplus */
105
106#ifdef YY_USE_CONST
107#define yyconst const
108#else
109#define yyconst
110#endif
111
112/* Returned upon end-of-file. */
113#define YY_NULL 0
114
115/* Promotes a possibly negative, possibly signed char to an unsigned
116 * integer for use as an array index. If the signed char is negative,
117 * we want to instead treat it as an 8-bit unsigned char, hence the
118 * double cast.
119 */
120#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121
122/* An opaque pointer. */
123#ifndef YY_TYPEDEF_YY_SCANNER_T
124#define YY_TYPEDEF_YY_SCANNER_T
125typedef void* yyscan_t;
126#endif
127
128/* For convenience, these vars (plus the bison vars far below)
129 are macros in the reentrant scanner. */
130#define yyin yyg->yyin_r
131#define yyout yyg->yyout_r
132#define yyextra yyg->yyextra_r
133#define yyleng yyg->yyleng_r
134#define yytext yyg->yytext_r
135#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
136#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
137#define yy_flex_debug yyg->yy_flex_debug_r
138
139/* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
142 */
143#define BEGIN yyg->yy_start = 1 + 2 *
144
145/* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
147 * compatibility.
148 */
149#define YY_START ((yyg->yy_start - 1) / 2)
150#define YYSTATE YY_START
151
152/* Action number for EOF rule of a given start state. */
153#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
155/* Special action meaning "start processing a new file". */
156#define YY_NEW_FILE _mesa_glsl_restart(yyin ,yyscanner )
157
158#define YY_END_OF_BUFFER_CHAR 0
159
160/* Size of default input buffer. */
161#ifndef YY_BUF_SIZE
Ian Romanick5ed66102010-10-05 16:40:00 -0700162#ifdef __ia64__
163/* On IA-64, the buffer size is 16k, not 8k.
164 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
165 * Ditto for the __ia64__ case accordingly.
166 */
167#define YY_BUF_SIZE 32768
168#else
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700169#define YY_BUF_SIZE 16384
Ian Romanick5ed66102010-10-05 16:40:00 -0700170#endif /* __ia64__ */
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700171#endif
172
173/* The state buf must be large enough to hold one state per character in the main buffer.
174 */
175#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
176
177#ifndef YY_TYPEDEF_YY_BUFFER_STATE
178#define YY_TYPEDEF_YY_BUFFER_STATE
179typedef struct yy_buffer_state *YY_BUFFER_STATE;
180#endif
181
182#define EOB_ACT_CONTINUE_SCAN 0
183#define EOB_ACT_END_OF_FILE 1
184#define EOB_ACT_LAST_MATCH 2
185
186 #define YY_LESS_LINENO(n)
187
188/* Return all but the first "n" matched characters back to the input stream. */
189#define yyless(n) \
190 do \
191 { \
192 /* Undo effects of setting up yytext. */ \
193 int yyless_macro_arg = (n); \
194 YY_LESS_LINENO(yyless_macro_arg);\
195 *yy_cp = yyg->yy_hold_char; \
196 YY_RESTORE_YY_MORE_OFFSET \
197 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
199 } \
200 while ( 0 )
201
202#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
203
204#ifndef YY_TYPEDEF_YY_SIZE_T
205#define YY_TYPEDEF_YY_SIZE_T
206typedef size_t yy_size_t;
207#endif
208
209#ifndef YY_STRUCT_YY_BUFFER_STATE
210#define YY_STRUCT_YY_BUFFER_STATE
211struct yy_buffer_state
212 {
213 FILE *yy_input_file;
214
215 char *yy_ch_buf; /* input buffer */
216 char *yy_buf_pos; /* current position in input buffer */
217
218 /* Size of input buffer in bytes, not including room for EOB
219 * characters.
220 */
221 yy_size_t yy_buf_size;
222
223 /* Number of characters read into yy_ch_buf, not including EOB
224 * characters.
225 */
226 int yy_n_chars;
227
228 /* Whether we "own" the buffer - i.e., we know we created it,
229 * and can realloc() it to grow it, and should free() it to
230 * delete it.
231 */
232 int yy_is_our_buffer;
233
234 /* Whether this is an "interactive" input source; if so, and
235 * if we're using stdio for input, then we want to use getc()
236 * instead of fread(), to make sure we stop fetching input after
237 * each newline.
238 */
239 int yy_is_interactive;
240
241 /* Whether we're considered to be at the beginning of a line.
242 * If so, '^' rules will be active on the next match, otherwise
243 * not.
244 */
245 int yy_at_bol;
246
247 int yy_bs_lineno; /**< The line count. */
248 int yy_bs_column; /**< The column count. */
249
250 /* Whether to try to fill the input buffer when we reach the
251 * end of it.
252 */
253 int yy_fill_buffer;
254
255 int yy_buffer_status;
256
257#define YY_BUFFER_NEW 0
258#define YY_BUFFER_NORMAL 1
259 /* When an EOF's been seen but there's still some text to process
260 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261 * shouldn't try reading from the input source any more. We might
262 * still have a bunch of tokens to match, though, because of
263 * possible backing-up.
264 *
265 * When we actually see the EOF, we change the status to "new"
266 * (via _mesa_glsl_restart()), so that the user can continue scanning by
267 * just pointing yyin at a new input file.
268 */
269#define YY_BUFFER_EOF_PENDING 2
270
271 };
272#endif /* !YY_STRUCT_YY_BUFFER_STATE */
273
274/* We provide macros for accessing buffer states in case in the
275 * future we want to put the buffer states in a more general
276 * "scanner state".
277 *
278 * Returns the top of the stack, or NULL.
279 */
280#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
281 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
282 : NULL)
283
284/* Same as previous macro, but useful when we know that the buffer stack is not
285 * NULL or when we need an lvalue. For internal use only.
286 */
287#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
288
289void _mesa_glsl_restart (FILE *input_file ,yyscan_t yyscanner );
290void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
291YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
292void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
293void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
294void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
295void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner );
296
297static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner );
298static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner );
299static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
300
301#define YY_FLUSH_BUFFER _mesa_glsl__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
302
303YY_BUFFER_STATE _mesa_glsl__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
304YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
305YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
306
307void *_mesa_glsl_alloc (yy_size_t ,yyscan_t yyscanner );
308void *_mesa_glsl_realloc (void *,yy_size_t ,yyscan_t yyscanner );
309void _mesa_glsl_free (void * ,yyscan_t yyscanner );
310
311#define yy_new_buffer _mesa_glsl__create_buffer
312
313#define yy_set_interactive(is_interactive) \
314 { \
315 if ( ! YY_CURRENT_BUFFER ){ \
316 _mesa_glsl_ensure_buffer_stack (yyscanner); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
319 } \
320 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321 }
322
323#define yy_set_bol(at_bol) \
324 { \
325 if ( ! YY_CURRENT_BUFFER ){\
326 _mesa_glsl_ensure_buffer_stack (yyscanner); \
327 YY_CURRENT_BUFFER_LVALUE = \
328 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
329 } \
330 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331 }
332
333#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
334
335/* Begin user sect3 */
336
337#define _mesa_glsl_wrap(n) 1
338#define YY_SKIP_YYWRAP
339
340typedef unsigned char YY_CHAR;
341
342typedef int yy_state_type;
343
344#define yytext_ptr yytext_r
345
346static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
347static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
348static int yy_get_next_buffer (yyscan_t yyscanner );
349static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
350
351/* Done after the current pattern has been matched and before the
352 * corresponding action - sets up yytext.
353 */
354#define YY_DO_BEFORE_ACTION \
355 yyg->yytext_ptr = yy_bp; \
356 yyleng = (size_t) (yy_cp - yy_bp); \
357 yyg->yy_hold_char = *yy_cp; \
358 *yy_cp = '\0'; \
359 yyg->yy_c_buf_p = yy_cp;
360
Ian Romanick33fe3642010-08-30 11:59:48 -0700361#define YY_NUM_RULES 183
362#define YY_END_OF_BUFFER 184
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700363/* This struct is not used in this scanner,
364 but its presence is necessary. */
365struct yy_trans_info
366 {
367 flex_int32_t yy_verify;
368 flex_int32_t yy_nxt;
369 };
Ian Romanick33fe3642010-08-30 11:59:48 -0700370static yyconst flex_int16_t yy_accept[708] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700371 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700372 0, 0, 15, 15, 0, 0, 184, 182, 1, 20,
373 182, 182, 182, 182, 182, 182, 182, 182, 96, 94,
374 182, 182, 182, 181, 182, 181, 181, 181, 181, 181,
375 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
376 181, 181, 181, 181, 181, 182, 1, 182, 91, 183,
377 15, 19, 183, 18, 16, 17, 13, 12, 1, 80,
378 87, 81, 90, 84, 75, 86, 76, 93, 98, 85,
379 99, 96, 0, 0, 101, 0, 94, 0, 77, 79,
380 78, 0, 181, 83, 181, 181, 181, 181, 181, 181,
381 181, 181, 181, 181, 181, 181, 28, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700382
Ian Romanick33fe3642010-08-30 11:59:48 -0700383 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
384 32, 181, 181, 56, 181, 181, 181, 181, 181, 181,
385 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
386 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
387 181, 181, 181, 181, 181, 92, 82, 1, 0, 0,
388 2, 0, 0, 0, 0, 15, 14, 18, 17, 0,
389 98, 97, 0, 99, 0, 100, 95, 88, 89, 181,
390 104, 181, 181, 181, 181, 181, 181, 181, 181, 181,
391 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
392 181, 181, 31, 181, 181, 181, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700393
Ian Romanick33fe3642010-08-30 11:59:48 -0700394 181, 181, 181, 25, 181, 181, 181, 181, 181, 181,
395 181, 181, 181, 181, 57, 181, 181, 181, 181, 181,
396 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
397 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
398 181, 181, 0, 0, 0, 0, 14, 0, 98, 0,
399 97, 0, 99, 100, 181, 181, 23, 181, 181, 144,
400 181, 181, 181, 181, 181, 181, 181, 181, 181, 30,
401 107, 181, 181, 181, 181, 63, 181, 181, 112, 126,
402 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
403 181, 123, 147, 44, 45, 46, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700404
Ian Romanick33fe3642010-08-30 11:59:48 -0700405 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
406 181, 181, 181, 181, 181, 181, 110, 102, 181, 181,
407 181, 181, 181, 181, 181, 41, 42, 43, 73, 181,
408 181, 0, 0, 0, 0, 0, 97, 181, 181, 26,
409 35, 36, 37, 181, 105, 181, 22, 181, 181, 181,
410 181, 134, 135, 136, 181, 103, 181, 127, 24, 137,
411 138, 139, 149, 131, 132, 133, 181, 181, 181, 58,
412 129, 181, 181, 38, 39, 40, 181, 181, 181, 181,
413 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
414 181, 181, 124, 181, 181, 181, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700415
Ian Romanick33fe3642010-08-30 11:59:48 -0700416 181, 181, 181, 106, 181, 146, 181, 181, 29, 0,
417 0, 0, 0, 153, 181, 181, 151, 181, 181, 181,
418 125, 120, 156, 181, 181, 181, 181, 181, 181, 115,
419 181, 181, 74, 47, 48, 49, 50, 51, 52, 53,
420 54, 55, 181, 181, 181, 181, 130, 111, 181, 181,
421 118, 34, 181, 181, 143, 64, 119, 72, 154, 113,
422 181, 181, 181, 181, 181, 181, 181, 0, 0, 0,
423 0, 181, 181, 181, 114, 33, 181, 181, 181, 181,
424 181, 181, 157, 158, 159, 181, 181, 181, 181, 148,
425 181, 181, 181, 181, 181, 181, 181, 181, 108, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700426
Ian Romanick33fe3642010-08-30 11:59:48 -0700427 181, 181, 181, 181, 59, 181, 60, 181, 0, 0,
428 0, 0, 0, 181, 61, 27, 121, 161, 162, 163,
429 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
430 181, 116, 181, 181, 181, 181, 181, 181, 181, 181,
431 181, 109, 165, 166, 167, 181, 181, 128, 117, 0,
432 0, 6, 0, 0, 0, 11, 3, 21, 181, 181,
433 181, 181, 181, 181, 181, 181, 181, 160, 122, 62,
434 145, 181, 152, 150, 180, 66, 67, 68, 181, 181,
435 181, 181, 181, 181, 0, 0, 0, 0, 0, 0,
436 181, 181, 181, 164, 181, 181, 181, 181, 181, 181,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700437
Ian Romanick33fe3642010-08-30 11:59:48 -0700438 181, 181, 181, 181, 181, 181, 181, 181, 181, 168,
439 4, 0, 5, 0, 0, 0, 0, 0, 181, 181,
440 181, 181, 181, 181, 181, 177, 181, 181, 181, 181,
441 181, 181, 69, 181, 181, 181, 0, 0, 0, 181,
442 181, 178, 169, 181, 170, 181, 181, 181, 181, 181,
443 181, 181, 181, 181, 179, 0, 0, 171, 172, 175,
444 176, 65, 181, 140, 181, 141, 155, 173, 174, 0,
445 0, 181, 181, 181, 0, 0, 0, 70, 181, 71,
446 0, 0, 0, 181, 0, 0, 0, 181, 0, 0,
447 7, 0, 0, 181, 0, 8, 0, 0, 142, 0,
448
449 0, 0, 0, 9, 0, 10, 0
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700450 } ;
451
452static yyconst flex_int32_t yy_ec[256] =
453 { 0,
454 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
455 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700457 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
458 10, 11, 12, 1, 13, 14, 15, 16, 17, 18,
459 19, 20, 21, 21, 21, 22, 22, 23, 1, 24,
460 25, 26, 1, 1, 27, 28, 29, 30, 31, 32,
461 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
462 33, 34, 35, 33, 33, 33, 33, 36, 33, 33,
463 1, 1, 1, 37, 38, 1, 39, 40, 41, 42,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700464
Ian Romanick33fe3642010-08-30 11:59:48 -0700465 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
466 53, 54, 33, 55, 56, 57, 58, 59, 60, 61,
467 62, 63, 1, 64, 1, 1, 1, 1, 1, 1,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 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
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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
482 } ;
483
Ian Romanick33fe3642010-08-30 11:59:48 -0700484static yyconst flex_int32_t yy_meta[65] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700485 { 0,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700486 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700487 1, 1, 1, 1, 1, 4, 4, 4, 4, 4,
488 4, 5, 1, 1, 1, 1, 6, 6, 6, 6,
489 5, 5, 7, 7, 7, 8, 1, 7, 6, 6,
490 6, 6, 5, 5, 7, 7, 7, 7, 7, 7,
491 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
492 8, 7, 7, 1
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700493 } ;
494
Ian Romanick33fe3642010-08-30 11:59:48 -0700495static yyconst flex_int16_t yy_base[719] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700496 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700497 0, 63, 88, 0, 1076, 1075, 1077, 1080, 64, 1080,
498 1051, 1050, 59, 1049, 58, 60, 58, 1048, 139, 187,
499 47, 1047, 56, 0, 1034, 121, 110, 137, 138, 134,
500 163, 1017, 173, 177, 115, 149, 140, 1011, 159, 121,
501 187, 194, 194, 172, 1022, 171, 249, 240, 1042, 1080,
502 250, 1080, 1051, 241, 1080, 0, 1080, 1080, 262, 1080,
503 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 236, 1080,
504 238, 187, 286, 303, 1080, 0, 0, 1040, 1080, 1080,
505 1080, 1039, 0, 1080, 1006, 1011, 1004, 1007, 1016, 1015,
506 1001, 1004, 1016, 35, 1010, 997, 994, 1008, 994, 991,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700507
Ian Romanick33fe3642010-08-30 11:59:48 -0700508 991, 997, 215, 232, 991, 1002, 987, 993, 997, 998,
509 0, 989, 1000, 234, 995, 975, 226, 979, 993, 983,
510 119, 976, 234, 989, 991, 973, 969, 977, 974, 963,
511 972, 256, 970, 976, 971, 974, 962, 965, 967, 245,
512 970, 961, 974, 227, 967, 1080, 1080, 308, 294, 324,
513 1080, 952, 965, 956, 967, 329, 0, 338, 0, 368,
514 1080, 303, 379, 1080, 386, 393, 0, 1080, 1080, 962,
515 0, 953, 957, 967, 964, 947, 946, 946, 950, 216,
516 961, 958, 958, 956, 953, 944, 951, 937, 935, 948,
517 933, 950, 0, 947, 934, 942, 939, 943, 944, 937,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700518
Ian Romanick33fe3642010-08-30 11:59:48 -0700519 934, 922, 921, 935, 938, 935, 922, 929, 919, 320,
520 925, 928, 918, 926, 914, 918, 909, 924, 914, 905,
521 924, 907, 905, 916, 905, 900, 898, 912, 897, 899,
522 896, 908, 907, 910, 288, 901, 895, 884, 331, 903,
523 905, 893, 885, 889, 901, 884, 0, 400, 410, 427,
524 1080, 439, 446, 1080, 879, 890, 0, 887, 343, 0,
525 880, 878, 880, 875, 884, 872, 890, 878, 346, 0,
526 0, 872, 883, 882, 882, 0, 866, 350, 0, 0,
527 868, 353, 876, 877, 867, 861, 860, 861, 860, 357,
528 856, 0, 0, 852, 851, 850, 852, 853, 858, 852,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700529
Ian Romanick33fe3642010-08-30 11:59:48 -0700530 848, 862, 857, 856, 855, 846, 849, 849, 841, 844,
531 839, 848, 853, 838, 851, 841, 0, 0, 848, 844,
532 835, 835, 841, 840, 837, 0, 0, 0, 0, 826,
533 839, 838, 837, 834, 822, 453, 463, 834, 836, 0,
534 0, 0, 0, 822, 0, 822, 0, 821, 822, 816,
535 827, 0, 0, 0, 817, 0, 813, 0, 0, 0,
536 0, 0, 0, 0, 0, 0, 824, 469, 823, 0,
537 0, 821, 817, 0, 0, 0, 806, 415, 432, 473,
538 811, 807, 813, 803, 801, 815, 799, 799, 813, 801,
539 813, 808, 0, 806, 803, 807, 790, 792, 799, 805,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700540
Ian Romanick33fe3642010-08-30 11:59:48 -0700541 800, 799, 786, 0, 788, 0, 787, 791, 0, 785,
542 834, 784, 787, 0, 775, 785, 0, 773, 773, 787,
543 0, 789, 0, 482, 797, 796, 795, 766, 765, 0,
544 783, 782, 0, 0, 0, 0, 0, 0, 0, 0,
545 0, 0, 766, 780, 766, 763, 0, 0, 769, 768,
546 0, 0, 766, 758, 0, 0, 0, 0, 0, 0,
547 755, 767, 485, 759, 766, 763, 757, 750, 503, 766,
548 751, 746, 760, 758, 0, 0, 750, 769, 768, 767,
549 738, 737, 301, 481, 0, 750, 753, 751, 739, 0,
550 749, 746, 745, 734, 733, 732, 509, 741, 0, 753,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700551
Ian Romanick33fe3642010-08-30 11:59:48 -0700552 752, 751, 722, 721, 0, 736, 0, 734, 729, 515,
553 527, 773, 722, 730, 0, 0, 0, 745, 744, 0,
554 726, 729, 713, 721, 711, 719, 720, 720, 719, 704,
555 717, 0, 718, 706, 705, 701, 725, 724, 723, 694,
556 693, 0, 723, 722, 0, 704, 707, 0, 0, 693,
557 537, 1080, 561, 0, 567, 340, 1080, 0, 690, 689,
558 699, 699, 686, 701, 684, 699, 694, 0, 0, 0,
559 0, 679, 0, 0, 0, 700, 389, 700, 689, 692,
560 676, 675, 685, 685, 675, 529, 589, 474, 683, 671,
561 669, 668, 679, 0, 682, 678, 680, 676, 662, 669,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700562
Ian Romanick33fe3642010-08-30 11:59:48 -0700563 669, 671, 667, 669, 667, 667, 654, 653, 664, 0,
564 1080, 531, 1080, 596, 0, 616, 666, 648, 665, 664,
565 647, 635, 643, 633, 634, 0, 627, 646, 635, 607,
566 604, 601, 0, 604, 603, 586, 533, 572, 580, 564,
567 563, 0, 0, 564, 0, 540, 554, 552, 516, 530,
568 505, 486, 453, 450, 0, 461, 443, 0, 0, 0,
569 0, 0, 400, 406, 385, 0, 0, 0, 0, 343,
570 389, 319, 267, 249, 487, 341, 235, 0, 200, 0,
571 507, 498, 184, 157, 150, 564, 559, 136, 565, 591,
572 1080, 593, 550, 112, 594, 1080, 569, 576, 0, 123,
573
574 619, 621, 637, 1080, 638, 1080, 1080, 648, 653, 658,
575 663, 665, 667, 673, 680, 685, 690, 695
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700576 } ;
577
Ian Romanick33fe3642010-08-30 11:59:48 -0700578static yyconst flex_int16_t yy_def[719] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700579 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700580 707, 1, 707, 3, 708, 708, 707, 707, 707, 707,
581 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
582 707, 707, 707, 709, 707, 709, 709, 709, 709, 709,
583 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
584 709, 709, 709, 709, 709, 707, 707, 707, 707, 707,
585 707, 707, 707, 707, 707, 710, 707, 707, 707, 707,
586 707, 707, 707, 707, 707, 707, 707, 707, 711, 707,
587 712, 19, 707, 707, 707, 713, 20, 707, 707, 707,
588 707, 707, 709, 707, 709, 709, 709, 709, 709, 709,
589 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700590
Ian Romanick33fe3642010-08-30 11:59:48 -0700591 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
592 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
593 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
594 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
595 709, 709, 709, 709, 709, 707, 707, 707, 707, 707,
596 707, 707, 707, 707, 707, 707, 714, 707, 710, 707,
597 707, 712, 707, 707, 707, 707, 713, 707, 707, 709,
598 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
599 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
600 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700601
Ian Romanick33fe3642010-08-30 11:59:48 -0700602 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
603 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
604 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
605 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
606 709, 709, 707, 707, 707, 707, 714, 707, 707, 707,
607 707, 707, 707, 707, 709, 709, 709, 709, 709, 709,
608 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
609 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
610 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
611 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700612
Ian Romanick33fe3642010-08-30 11:59:48 -0700613 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
614 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
615 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
616 709, 707, 707, 707, 707, 707, 707, 709, 709, 709,
617 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
618 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
619 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
620 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
621 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
622 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700623
Ian Romanick33fe3642010-08-30 11:59:48 -0700624 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
625 707, 707, 707, 709, 709, 709, 709, 709, 709, 709,
626 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
627 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
628 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
629 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
630 709, 709, 709, 709, 709, 709, 709, 707, 707, 707,
631 707, 709, 709, 709, 709, 709, 709, 709, 709, 709,
632 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
633 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700634
Ian Romanick33fe3642010-08-30 11:59:48 -0700635 709, 709, 709, 709, 709, 709, 709, 709, 707, 715,
636 707, 707, 707, 709, 709, 709, 709, 709, 709, 709,
637 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
638 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
639 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
640 707, 707, 707, 716, 707, 707, 707, 709, 709, 709,
641 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
642 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
643 709, 709, 709, 709, 707, 717, 707, 716, 707, 707,
644 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700645
Ian Romanick33fe3642010-08-30 11:59:48 -0700646 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
647 707, 707, 707, 707, 718, 707, 707, 707, 709, 709,
648 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
649 709, 709, 709, 709, 709, 709, 718, 707, 707, 709,
650 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
651 709, 709, 709, 709, 709, 707, 707, 709, 709, 709,
652 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
653 707, 709, 709, 709, 707, 707, 707, 709, 709, 709,
654 707, 707, 707, 709, 707, 707, 707, 709, 707, 707,
655 707, 707, 707, 709, 707, 707, 707, 707, 709, 707,
656
657 707, 707, 707, 707, 707, 707, 0, 707, 707, 707,
658 707, 707, 707, 707, 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700659 } ;
660
Ian Romanick33fe3642010-08-30 11:59:48 -0700661static yyconst flex_int16_t yy_nxt[1145] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700662 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700663 8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
664 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
665 20, 20, 8, 21, 22, 23, 24, 24, 24, 24,
666 24, 24, 24, 24, 24, 24, 25, 24, 26, 27,
667 28, 29, 30, 31, 32, 33, 34, 24, 24, 35,
668 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
669 24, 24, 24, 46, 47, 59, 62, 59, 48, 65,
670 78, 79, 67, 69, 69, 69, 69, 69, 69, 69,
671 81, 82, 66, 63, 68, 179, 180, 49, 50, 51,
672 52, 51, 50, 50, 50, 50, 50, 50, 50, 50,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700673
Ian Romanick33fe3642010-08-30 11:59:48 -0700674 50, 50, 53, 50, 54, 54, 54, 54, 54, 54,
675 55, 50, 50, 50, 56, 56, 56, 56, 56, 56,
676 56, 56, 56, 56, 50, 56, 56, 56, 56, 56,
677 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
678 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
679 56, 50, 71, 116, 72, 72, 72, 72, 72, 72,
680 73, 85, 88, 126, 89, 213, 702, 117, 90, 74,
681 75, 699, 214, 127, 76, 91, 86, 87, 120, 92,
682 95, 74, 75, 99, 96, 100, 93, 118, 694, 94,
683 97, 119, 121, 689, 101, 146, 98, 123, 688, 76,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700684
Ian Romanick33fe3642010-08-30 11:59:48 -0700685 71, 102, 77, 77, 77, 77, 77, 77, 77, 103,
686 142, 108, 104, 124, 143, 105, 125, 74, 75, 109,
687 111, 106, 707, 112, 144, 128, 687, 113, 114, 74,
688 75, 110, 129, 130, 147, 115, 135, 131, 684, 136,
689 139, 150, 151, 132, 133, 140, 134, 707, 137, 141,
690 148, 156, 59, 156, 149, 138, 158, 158, 158, 158,
691 158, 158, 158, 59, 189, 59, 160, 161, 163, 164,
692 191, 264, 265, 240, 216, 190, 241, 208, 160, 161,
693 163, 164, 152, 201, 192, 209, 202, 203, 217, 153,
694 204, 235, 205, 154, 226, 150, 151, 683, 155, 71,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700695
Ian Romanick33fe3642010-08-30 11:59:48 -0700696 236, 73, 73, 73, 73, 73, 73, 73, 680, 148,
697 227, 59, 679, 149, 165, 165, 74, 75, 166, 166,
698 166, 166, 166, 166, 166, 150, 151, 523, 74, 75,
699 156, 321, 156, 250, 251, 524, 152, 294, 295, 296,
700 322, 556, 681, 153, 675, 250, 251, 154, 326, 327,
701 328, 676, 155, 158, 158, 158, 158, 158, 158, 158,
702 341, 342, 343, 352, 353, 354, 152, 360, 361, 362,
703 364, 365, 366, 153, 374, 375, 376, 154, 678, 248,
704 248, 589, 155, 249, 249, 249, 249, 249, 249, 249,
705 252, 252, 590, 682, 253, 253, 253, 253, 253, 253,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700706
Ian Romanick33fe3642010-08-30 11:59:48 -0700707 253, 166, 166, 166, 166, 166, 166, 166, 166, 166,
708 166, 166, 166, 166, 166, 249, 249, 249, 249, 249,
709 249, 249, 602, 603, 254, 249, 249, 249, 249, 249,
710 249, 249, 434, 435, 436, 677, 254, 674, 336, 336,
711 673, 161, 337, 337, 337, 337, 337, 337, 337, 437,
712 438, 439, 672, 161, 253, 253, 253, 253, 253, 253,
713 253, 253, 253, 253, 253, 253, 253, 253, 337, 337,
714 337, 337, 337, 337, 337, 551, 552, 164, 337, 337,
715 337, 337, 337, 337, 337, 425, 426, 427, 675, 164,
716 440, 441, 442, 671, 251, 676, 428, 429, 478, 479,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700717
Ian Romanick33fe3642010-08-30 11:59:48 -0700718 480, 500, 501, 502, 469, 670, 251, 525, 681, 481,
719 482, 669, 503, 504, 668, 526, 551, 552, 510, 511,
720 511, 511, 511, 511, 511, 537, 538, 539, 551, 552,
721 612, 613, 612, 613, 612, 613, 540, 541, 551, 552,
722 667, 685, 555, 555, 555, 555, 555, 555, 555, 686,
723 554, 697, 586, 587, 587, 587, 587, 587, 587, 682,
724 692, 666, 551, 552, 615, 690, 695, 693, 551, 552,
725 697, 665, 664, 691, 696, 554, 553, 553, 553, 553,
726 553, 553, 555, 555, 555, 555, 555, 555, 555, 615,
727 612, 613, 690, 663, 692, 695, 662, 612, 613, 661,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700728
Ian Romanick33fe3642010-08-30 11:59:48 -0700729 691, 693, 698, 696, 616, 616, 616, 616, 616, 616,
730 616, 614, 614, 614, 614, 614, 614, 612, 613, 700,
731 703, 698, 705, 660, 659, 658, 657, 701, 704, 656,
732 706, 616, 616, 616, 616, 616, 616, 616, 703, 705,
733 655, 654, 653, 652, 651, 650, 704, 706, 57, 57,
734 57, 57, 57, 57, 57, 57, 83, 83, 83, 83,
735 83, 159, 159, 159, 159, 159, 69, 69, 162, 162,
736 167, 167, 167, 247, 247, 649, 247, 247, 247, 247,
737 247, 553, 553, 553, 648, 647, 646, 553, 588, 588,
738 588, 614, 614, 614, 645, 644, 643, 614, 637, 637,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700739
Ian Romanick33fe3642010-08-30 11:59:48 -0700740 637, 642, 641, 640, 639, 638, 636, 635, 634, 633,
741 632, 631, 630, 629, 628, 627, 626, 625, 624, 623,
742 622, 621, 620, 619, 618, 617, 611, 610, 609, 608,
743 607, 606, 605, 604, 601, 600, 599, 598, 597, 596,
744 595, 594, 593, 592, 591, 585, 584, 583, 582, 581,
745 580, 579, 578, 577, 576, 575, 574, 573, 572, 571,
746 570, 569, 568, 567, 566, 565, 564, 563, 562, 561,
747 560, 559, 558, 557, 556, 550, 549, 548, 547, 546,
748 545, 544, 543, 542, 536, 535, 534, 533, 532, 531,
749 530, 529, 528, 527, 522, 521, 520, 519, 518, 517,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700750
Ian Romanick33fe3642010-08-30 11:59:48 -0700751 516, 515, 514, 513, 512, 509, 508, 507, 506, 505,
752 499, 498, 497, 496, 495, 494, 493, 492, 491, 490,
753 489, 488, 487, 486, 485, 484, 483, 477, 476, 475,
754 474, 473, 472, 471, 470, 469, 468, 467, 466, 465,
755 464, 463, 462, 461, 460, 459, 458, 457, 456, 455,
756 454, 453, 452, 451, 450, 449, 448, 447, 446, 445,
757 444, 443, 433, 432, 431, 430, 424, 423, 422, 421,
758 420, 419, 418, 417, 416, 415, 414, 413, 412, 411,
759 410, 409, 408, 407, 406, 405, 404, 403, 402, 401,
760 400, 399, 398, 397, 396, 395, 394, 393, 392, 391,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700761
Ian Romanick33fe3642010-08-30 11:59:48 -0700762 390, 389, 388, 387, 386, 385, 384, 383, 382, 381,
763 380, 379, 378, 377, 373, 372, 371, 370, 369, 368,
764 367, 363, 359, 358, 357, 356, 355, 351, 350, 349,
765 348, 347, 346, 345, 344, 340, 339, 338, 335, 334,
766 333, 332, 331, 330, 329, 325, 324, 323, 320, 319,
767 318, 317, 316, 315, 314, 313, 312, 311, 310, 309,
768 308, 307, 306, 305, 304, 303, 302, 301, 300, 299,
769 298, 297, 293, 292, 291, 290, 289, 288, 287, 286,
770 285, 284, 283, 282, 281, 280, 279, 278, 277, 276,
771 275, 274, 273, 272, 271, 270, 269, 268, 267, 266,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700772
Ian Romanick33fe3642010-08-30 11:59:48 -0700773 263, 262, 261, 260, 259, 258, 257, 256, 255, 246,
774 245, 244, 243, 242, 239, 238, 237, 234, 233, 232,
775 231, 230, 229, 228, 225, 224, 223, 222, 221, 220,
776 219, 218, 215, 212, 211, 210, 207, 206, 200, 199,
777 198, 197, 196, 195, 194, 193, 188, 187, 186, 185,
778 184, 183, 182, 181, 178, 177, 176, 175, 174, 173,
779 172, 171, 170, 169, 168, 157, 80, 145, 122, 107,
780 84, 80, 70, 64, 61, 60, 707, 58, 58, 7,
781 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
782 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
783
784 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
785 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
786 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
787 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
788 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700789 } ;
790
Ian Romanick33fe3642010-08-30 11:59:48 -0700791static yyconst flex_int16_t yy_chk[1145] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700792 { 0,
793 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
794 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
795 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
796 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
797 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700798 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700799 1, 1, 1, 1, 2, 9, 13, 9, 2, 15,
800 21, 21, 16, 17, 17, 17, 17, 17, 17, 17,
801 23, 23, 15, 13, 16, 94, 94, 2, 3, 3,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700802 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
803
804 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
805 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
806 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
807 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
Ian Romanick33fe3642010-08-30 11:59:48 -0700808 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
809 3, 3, 19, 35, 19, 19, 19, 19, 19, 19,
810 19, 26, 27, 40, 27, 121, 700, 35, 27, 19,
811 19, 694, 121, 40, 19, 28, 26, 26, 37, 28,
812 29, 19, 19, 30, 29, 30, 28, 36, 688, 28,
813 29, 36, 37, 685, 30, 46, 29, 39, 684, 19,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700814
Ian Romanick33fe3642010-08-30 11:59:48 -0700815 20, 31, 20, 20, 20, 20, 20, 20, 20, 31,
816 44, 33, 31, 39, 44, 31, 39, 20, 20, 33,
817 34, 31, 72, 34, 44, 41, 683, 34, 34, 20,
818 20, 33, 41, 41, 46, 34, 42, 41, 679, 42,
819 43, 48, 48, 41, 41, 43, 41, 72, 42, 43,
820 47, 51, 47, 51, 47, 42, 54, 54, 54, 54,
821 54, 54, 54, 59, 103, 59, 69, 69, 71, 71,
822 104, 180, 180, 144, 123, 103, 144, 117, 69, 69,
823 71, 71, 48, 114, 104, 117, 114, 114, 123, 48,
824 114, 140, 114, 48, 132, 149, 149, 677, 48, 73,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700825
Ian Romanick33fe3642010-08-30 11:59:48 -0700826 140, 73, 73, 73, 73, 73, 73, 73, 674, 148,
827 132, 148, 673, 148, 74, 74, 73, 73, 74, 74,
828 74, 74, 74, 74, 74, 150, 150, 483, 73, 73,
829 156, 235, 156, 162, 162, 483, 149, 210, 210, 210,
830 235, 556, 676, 149, 670, 162, 162, 149, 239, 239,
831 239, 670, 149, 158, 158, 158, 158, 158, 158, 158,
832 259, 259, 259, 269, 269, 269, 150, 278, 278, 278,
833 282, 282, 282, 150, 290, 290, 290, 150, 672, 160,
834 160, 556, 150, 160, 160, 160, 160, 160, 160, 160,
835 163, 163, 556, 676, 163, 163, 163, 163, 163, 163,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700836
Ian Romanick33fe3642010-08-30 11:59:48 -0700837 163, 165, 165, 165, 165, 165, 165, 165, 166, 166,
838 166, 166, 166, 166, 166, 248, 248, 248, 248, 248,
839 248, 248, 577, 577, 166, 249, 249, 249, 249, 249,
840 249, 249, 378, 378, 378, 671, 166, 665, 250, 250,
841 664, 249, 250, 250, 250, 250, 250, 250, 250, 379,
842 379, 379, 663, 249, 252, 252, 252, 252, 252, 252,
843 252, 253, 253, 253, 253, 253, 253, 253, 336, 336,
844 336, 336, 336, 336, 336, 588, 588, 253, 337, 337,
845 337, 337, 337, 337, 337, 368, 368, 368, 675, 253,
846 380, 380, 380, 657, 337, 675, 368, 368, 424, 424,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700847
Ian Romanick33fe3642010-08-30 11:59:48 -0700848 424, 463, 463, 463, 469, 656, 337, 484, 681, 424,
849 424, 654, 463, 463, 653, 484, 510, 510, 469, 469,
850 469, 469, 469, 469, 469, 497, 497, 497, 511, 511,
851 586, 586, 612, 612, 637, 637, 497, 497, 551, 551,
852 652, 682, 511, 511, 511, 511, 511, 511, 511, 682,
853 510, 693, 551, 551, 551, 551, 551, 551, 551, 681,
854 687, 651, 553, 553, 586, 686, 689, 687, 555, 555,
855 697, 650, 649, 686, 689, 510, 553, 553, 553, 553,
856 553, 553, 555, 555, 555, 555, 555, 555, 555, 586,
857 587, 587, 690, 648, 692, 695, 647, 614, 614, 646,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700858
Ian Romanick33fe3642010-08-30 11:59:48 -0700859 690, 692, 693, 695, 587, 587, 587, 587, 587, 587,
860 587, 614, 614, 614, 614, 614, 614, 616, 616, 698,
861 701, 697, 702, 644, 641, 640, 639, 698, 701, 638,
862 702, 616, 616, 616, 616, 616, 616, 616, 703, 705,
863 636, 635, 634, 632, 631, 630, 703, 705, 708, 708,
864 708, 708, 708, 708, 708, 708, 709, 709, 709, 709,
865 709, 710, 710, 710, 710, 710, 711, 711, 712, 712,
866 713, 713, 713, 714, 714, 629, 714, 714, 714, 714,
867 714, 715, 715, 715, 628, 627, 625, 715, 716, 716,
868 716, 717, 717, 717, 624, 623, 622, 717, 718, 718,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700869
Ian Romanick33fe3642010-08-30 11:59:48 -0700870 718, 621, 620, 619, 618, 617, 609, 608, 607, 606,
871 605, 604, 603, 602, 601, 600, 599, 598, 597, 596,
872 595, 593, 592, 591, 590, 589, 585, 584, 583, 582,
873 581, 580, 579, 578, 576, 572, 567, 566, 565, 564,
874 563, 562, 561, 560, 559, 550, 547, 546, 544, 543,
875 541, 540, 539, 538, 537, 536, 535, 534, 533, 531,
876 530, 529, 528, 527, 526, 525, 524, 523, 522, 521,
877 519, 518, 514, 513, 512, 509, 508, 506, 504, 503,
878 502, 501, 500, 498, 496, 495, 494, 493, 492, 491,
879 489, 488, 487, 486, 482, 481, 480, 479, 478, 477,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700880
Ian Romanick33fe3642010-08-30 11:59:48 -0700881 474, 473, 472, 471, 470, 468, 467, 466, 465, 464,
882 462, 461, 454, 453, 450, 449, 446, 445, 444, 443,
883 432, 431, 429, 428, 427, 426, 425, 422, 420, 419,
884 418, 416, 415, 413, 412, 411, 410, 408, 407, 405,
885 403, 402, 401, 400, 399, 398, 397, 396, 395, 394,
886 392, 391, 390, 389, 388, 387, 386, 385, 384, 383,
887 382, 381, 377, 373, 372, 369, 367, 357, 355, 351,
888 350, 349, 348, 346, 344, 339, 338, 335, 334, 333,
889 332, 331, 330, 325, 324, 323, 322, 321, 320, 319,
890 316, 315, 314, 313, 312, 311, 310, 309, 308, 307,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700891
Ian Romanick33fe3642010-08-30 11:59:48 -0700892 306, 305, 304, 303, 302, 301, 300, 299, 298, 297,
893 296, 295, 294, 291, 289, 288, 287, 286, 285, 284,
894 283, 281, 277, 275, 274, 273, 272, 268, 267, 266,
895 265, 264, 263, 262, 261, 258, 256, 255, 246, 245,
896 244, 243, 242, 241, 240, 238, 237, 236, 234, 233,
897 232, 231, 230, 229, 228, 227, 226, 225, 224, 223,
898 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
899 212, 211, 209, 208, 207, 206, 205, 204, 203, 202,
900 201, 200, 199, 198, 197, 196, 195, 194, 192, 191,
901 190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700902
Ian Romanick33fe3642010-08-30 11:59:48 -0700903 179, 178, 177, 176, 175, 174, 173, 172, 170, 155,
904 154, 153, 152, 145, 143, 142, 141, 139, 138, 137,
905 136, 135, 134, 133, 131, 130, 129, 128, 127, 126,
906 125, 124, 122, 120, 119, 118, 116, 115, 113, 112,
907 110, 109, 108, 107, 106, 105, 102, 101, 100, 99,
908 98, 97, 96, 95, 93, 92, 91, 90, 89, 88,
909 87, 86, 85, 82, 78, 53, 49, 45, 38, 32,
910 25, 22, 18, 14, 12, 11, 7, 6, 5, 707,
911 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
912 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
913
914 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
915 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
916 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
917 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
918 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700919 } ;
920
921/* The intent behind this definition is that it'll catch
922 * any uses of REJECT which flex missed.
923 */
924#define REJECT reject_used_but_not_detected
925#define yymore() yymore_used_but_not_detected
926#define YY_MORE_ADJ 0
927#define YY_RESTORE_YY_MORE_OFFSET
928#line 1 "glsl_lexer.lpp"
929#line 2 "glsl_lexer.lpp"
930/*
931 * Copyright © 2008, 2009 Intel Corporation
932 *
933 * Permission is hereby granted, free of charge, to any person obtaining a
934 * copy of this software and associated documentation files (the "Software"),
935 * to deal in the Software without restriction, including without limitation
936 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
937 * and/or sell copies of the Software, and to permit persons to whom the
938 * Software is furnished to do so, subject to the following conditions:
939 *
940 * The above copyright notice and this permission notice (including the next
941 * paragraph) shall be included in all copies or substantial portions of the
942 * Software.
943 *
944 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
945 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
946 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
947 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
948 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
949 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
950 * DEALINGS IN THE SOFTWARE.
951 */
952#include <ctype.h>
953#include "ast.h"
954#include "glsl_parser_extras.h"
955#include "glsl_parser.h"
956
957#define YY_USER_ACTION \
958 do { \
959 yylloc->source = 0; \
960 yylloc->first_column = yycolumn + 1; \
961 yylloc->first_line = yylineno + 1; \
962 yycolumn += yyleng; \
963 } while(0);
964
965#define YY_USER_INIT yylineno = 0; yycolumn = 0;
966
Eric Anholt6a416262010-08-01 18:44:21 -0700967#define TOKEN_OR_IDENTIFIER(version, token) \
968 do { \
969 if (yyextra->language_version >= version) { \
970 return token; \
971 } else { \
972 yylval->identifier = strdup(yytext); \
973 return IDENTIFIER; \
974 } \
975 } while (0)
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700976
Kenneth Graunkec5e74872010-09-05 01:32:32 -0700977/* Handle reserved words in GLSL ES (version 100) */
978#define TOKEN_OR_IDENTIFIER_ES(version, token) \
979 do { \
980 if (yyextra->es_shader) { \
981 return token; \
982 } else { \
983 TOKEN_OR_IDENTIFIER(version, token); \
984 } \
985 } while (0)
986
Ian Romanickdb36e882010-08-11 17:03:37 -0700987#define RESERVED_WORD(version, token) \
988 do { \
989 if (yyextra->language_version >= version) { \
990 return token; \
991 } else { \
992 _mesa_glsl_error(yylloc, yyextra, \
993 "Illegal use of reserved word `%s'", yytext); \
994 return ERROR_TOK; \
995 } \
996 } while (0)
Eric Anholt6a416262010-08-01 18:44:21 -0700997
Ian Romanick5ed66102010-10-05 16:40:00 -0700998#line 999 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700999
1000#define INITIAL 0
1001#define PP 1
Ian Romanick33fe3642010-08-30 11:59:48 -07001002#define PRAGMA 2
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001003
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001004#define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
1005
1006/* Holds the entire state of the reentrant scanner. */
1007struct yyguts_t
1008 {
1009
1010 /* User-defined. Not touched by flex. */
1011 YY_EXTRA_TYPE yyextra_r;
1012
1013 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1014 FILE *yyin_r, *yyout_r;
1015 size_t yy_buffer_stack_top; /**< index of top of stack. */
1016 size_t yy_buffer_stack_max; /**< capacity of stack. */
1017 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1018 char yy_hold_char;
1019 int yy_n_chars;
1020 int yyleng_r;
1021 char *yy_c_buf_p;
1022 int yy_init;
1023 int yy_start;
1024 int yy_did_buffer_switch_on_eof;
1025 int yy_start_stack_ptr;
1026 int yy_start_stack_depth;
1027 int *yy_start_stack;
1028 yy_state_type yy_last_accepting_state;
1029 char* yy_last_accepting_cpos;
1030
1031 int yylineno_r;
1032 int yy_flex_debug_r;
1033
1034 char *yytext_r;
1035 int yy_more_flag;
1036 int yy_more_len;
1037
1038 YYSTYPE * yylval_r;
1039
1040 YYLTYPE * yylloc_r;
1041
1042 }; /* end struct yyguts_t */
1043
1044static int yy_init_globals (yyscan_t yyscanner );
1045
1046 /* This must go here because YYSTYPE and YYLTYPE are included
1047 * from bison output in section 1.*/
1048 # define yylval yyg->yylval_r
1049
1050 # define yylloc yyg->yylloc_r
1051
1052int _mesa_glsl_lex_init (yyscan_t* scanner);
1053
1054int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1055
1056/* Accessor methods to globals.
1057 These are made visible to non-reentrant scanners for convenience. */
1058
1059int _mesa_glsl_lex_destroy (yyscan_t yyscanner );
1060
1061int _mesa_glsl_get_debug (yyscan_t yyscanner );
1062
1063void _mesa_glsl_set_debug (int debug_flag ,yyscan_t yyscanner );
1064
1065YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner );
1066
1067void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1068
1069FILE *_mesa_glsl_get_in (yyscan_t yyscanner );
1070
1071void _mesa_glsl_set_in (FILE * in_str ,yyscan_t yyscanner );
1072
1073FILE *_mesa_glsl_get_out (yyscan_t yyscanner );
1074
1075void _mesa_glsl_set_out (FILE * out_str ,yyscan_t yyscanner );
1076
1077int _mesa_glsl_get_leng (yyscan_t yyscanner );
1078
1079char *_mesa_glsl_get_text (yyscan_t yyscanner );
1080
1081int _mesa_glsl_get_lineno (yyscan_t yyscanner );
1082
1083void _mesa_glsl_set_lineno (int line_number ,yyscan_t yyscanner );
1084
1085YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner );
1086
1087void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1088
1089 YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner );
1090
1091 void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
1092
1093/* Macros after this point can all be overridden by user definitions in
1094 * section 1.
1095 */
1096
1097#ifndef YY_SKIP_YYWRAP
1098#ifdef __cplusplus
1099extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner );
1100#else
1101extern int _mesa_glsl_wrap (yyscan_t yyscanner );
1102#endif
1103#endif
1104
1105#ifndef yytext_ptr
1106static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1107#endif
1108
1109#ifdef YY_NEED_STRLEN
1110static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1111#endif
1112
1113#ifndef YY_NO_INPUT
1114
1115#ifdef __cplusplus
1116static int yyinput (yyscan_t yyscanner );
1117#else
1118static int input (yyscan_t yyscanner );
1119#endif
1120
1121#endif
1122
1123/* Amount of stuff to slurp up with each read. */
1124#ifndef YY_READ_BUF_SIZE
Ian Romanick5ed66102010-10-05 16:40:00 -07001125#ifdef __ia64__
1126/* On IA-64, the buffer size is 16k, not 8k */
1127#define YY_READ_BUF_SIZE 16384
1128#else
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001129#define YY_READ_BUF_SIZE 8192
Ian Romanick5ed66102010-10-05 16:40:00 -07001130#endif /* __ia64__ */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001131#endif
1132
1133/* Copy whatever the last rule matched to the standard output. */
1134#ifndef ECHO
1135/* This used to be an fputs(), but since the string might contain NUL's,
1136 * we now use fwrite().
1137 */
Ian Romanick5ed66102010-10-05 16:40:00 -07001138#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001139#endif
1140
1141/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1142 * is returned in "result".
1143 */
1144#ifndef YY_INPUT
1145#define YY_INPUT(buf,result,max_size) \
1146 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1147 { \
1148 int c = '*'; \
Ian Romanick5ed66102010-10-05 16:40:00 -07001149 size_t n; \
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001150 for ( n = 0; n < max_size && \
1151 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1152 buf[n] = (char) c; \
1153 if ( c == '\n' ) \
1154 buf[n++] = (char) c; \
1155 if ( c == EOF && ferror( yyin ) ) \
1156 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1157 result = n; \
1158 } \
1159 else \
1160 { \
1161 errno=0; \
1162 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1163 { \
1164 if( errno != EINTR) \
1165 { \
1166 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1167 break; \
1168 } \
1169 errno=0; \
1170 clearerr(yyin); \
1171 } \
1172 }\
1173\
1174
1175#endif
1176
1177/* No semi-colon after return; correct usage is to write "yyterminate();" -
1178 * we don't want an extra ';' after the "return" because that will cause
1179 * some compilers to complain about unreachable statements.
1180 */
1181#ifndef yyterminate
1182#define yyterminate() return YY_NULL
1183#endif
1184
1185/* Number of entries by which start-condition stack grows. */
1186#ifndef YY_START_STACK_INCR
1187#define YY_START_STACK_INCR 25
1188#endif
1189
1190/* Report a fatal error. */
1191#ifndef YY_FATAL_ERROR
1192#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1193#endif
1194
1195/* end tables serialization structures and prototypes */
1196
1197/* Default declaration of generated scanner - a define so the user can
1198 * easily add parameters.
1199 */
1200#ifndef YY_DECL
1201#define YY_DECL_IS_OURS 1
1202
1203extern int _mesa_glsl_lex \
1204 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1205
1206#define YY_DECL int _mesa_glsl_lex \
1207 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1208#endif /* !YY_DECL */
1209
1210/* Code executed at the beginning of each rule, after yytext and yyleng
1211 * have been set up.
1212 */
1213#ifndef YY_USER_ACTION
1214#define YY_USER_ACTION
1215#endif
1216
1217/* Code executed at the end of each rule. */
1218#ifndef YY_BREAK
1219#define YY_BREAK break;
1220#endif
1221
1222#define YY_RULE_SETUP \
1223 if ( yyleng > 0 ) \
1224 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1225 (yytext[yyleng - 1] == '\n'); \
1226 YY_USER_ACTION
1227
1228/** The main scanner function which does all the work.
1229 */
1230YY_DECL
1231{
1232 register yy_state_type yy_current_state;
1233 register char *yy_cp, *yy_bp;
1234 register int yy_act;
1235 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1236
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001237#line 86 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001238
1239
Ian Romanick5ed66102010-10-05 16:40:00 -07001240#line 1241 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001241
1242 yylval = yylval_param;
1243
1244 yylloc = yylloc_param;
1245
1246 if ( !yyg->yy_init )
1247 {
1248 yyg->yy_init = 1;
1249
1250#ifdef YY_USER_INIT
1251 YY_USER_INIT;
1252#endif
1253
1254 if ( ! yyg->yy_start )
1255 yyg->yy_start = 1; /* first start state */
1256
1257 if ( ! yyin )
1258 yyin = stdin;
1259
1260 if ( ! yyout )
1261 yyout = stdout;
1262
1263 if ( ! YY_CURRENT_BUFFER ) {
1264 _mesa_glsl_ensure_buffer_stack (yyscanner);
1265 YY_CURRENT_BUFFER_LVALUE =
1266 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1267 }
1268
1269 _mesa_glsl__load_buffer_state(yyscanner );
1270 }
1271
1272 while ( 1 ) /* loops until end-of-file is reached */
1273 {
1274 yy_cp = yyg->yy_c_buf_p;
1275
1276 /* Support of yytext. */
1277 *yy_cp = yyg->yy_hold_char;
1278
1279 /* yy_bp points to the position in yy_ch_buf of the start of
1280 * the current run.
1281 */
1282 yy_bp = yy_cp;
1283
1284 yy_current_state = yyg->yy_start;
1285 yy_current_state += YY_AT_BOL();
1286yy_match:
1287 do
1288 {
1289 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1290 if ( yy_accept[yy_current_state] )
1291 {
1292 yyg->yy_last_accepting_state = yy_current_state;
1293 yyg->yy_last_accepting_cpos = yy_cp;
1294 }
1295 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1296 {
1297 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07001298 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001299 yy_c = yy_meta[(unsigned int) yy_c];
1300 }
1301 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1302 ++yy_cp;
1303 }
Ian Romanick33fe3642010-08-30 11:59:48 -07001304 while ( yy_current_state != 707 );
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001305 yy_cp = yyg->yy_last_accepting_cpos;
1306 yy_current_state = yyg->yy_last_accepting_state;
1307
1308yy_find_action:
1309 yy_act = yy_accept[yy_current_state];
1310
1311 YY_DO_BEFORE_ACTION;
1312
1313do_action: /* This label is used only to access EOF actions. */
1314
1315 switch ( yy_act )
1316 { /* beginning of action switch */
1317 case 0: /* must back up */
1318 /* undo the effects of YY_DO_BEFORE_ACTION */
1319 *yy_cp = yyg->yy_hold_char;
1320 yy_cp = yyg->yy_last_accepting_cpos;
1321 yy_current_state = yyg->yy_last_accepting_state;
1322 goto yy_find_action;
1323
1324case 1:
1325YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001326#line 88 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001327;
1328 YY_BREAK
1329/* Preprocessor tokens. */
1330case 2:
1331*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1332yyg->yy_c_buf_p = yy_cp -= 1;
1333YY_DO_BEFORE_ACTION; /* set up yytext again */
1334YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001335#line 91 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001336;
1337 YY_BREAK
1338case 3:
1339YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001340#line 92 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001341{ BEGIN PP; return VERSION; }
1342 YY_BREAK
1343case 4:
1344YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001345#line 93 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001346{ BEGIN PP; return EXTENSION; }
1347 YY_BREAK
1348case 5:
1349*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1350yyg->yy_c_buf_p = yy_cp -= 1;
1351YY_DO_BEFORE_ACTION; /* set up yytext again */
1352YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001353#line 94 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001354{
1355 /* Eat characters until the first digit is
1356 * encountered
1357 */
1358 char *ptr = yytext;
1359 while (!isdigit(*ptr))
1360 ptr++;
1361
1362 /* Subtract one from the line number because
1363 * yylineno is zero-based instead of
1364 * one-based.
1365 */
1366 yylineno = strtol(ptr, &ptr, 0) - 1;
1367 yylloc->source = strtol(ptr, NULL, 0);
1368 }
1369 YY_BREAK
1370case 6:
1371*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1372yyg->yy_c_buf_p = yy_cp -= 1;
1373YY_DO_BEFORE_ACTION; /* set up yytext again */
1374YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001375#line 109 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001376{
1377 /* Eat characters until the first digit is
1378 * encountered
1379 */
1380 char *ptr = yytext;
1381 while (!isdigit(*ptr))
1382 ptr++;
1383
1384 /* Subtract one from the line number because
1385 * yylineno is zero-based instead of
1386 * one-based.
1387 */
1388 yylineno = strtol(ptr, &ptr, 0) - 1;
1389 }
1390 YY_BREAK
1391case 7:
1392YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001393#line 123 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001394{
1395 BEGIN PP;
1396 return PRAGMA_DEBUG_ON;
1397 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001398 YY_BREAK
1399case 8:
1400YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001401#line 127 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001402{
1403 BEGIN PP;
1404 return PRAGMA_DEBUG_OFF;
1405 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001406 YY_BREAK
1407case 9:
1408YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001409#line 131 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001410{
1411 BEGIN PP;
1412 return PRAGMA_OPTIMIZE_ON;
1413 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001414 YY_BREAK
1415case 10:
1416YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001417#line 135 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001418{
1419 BEGIN PP;
1420 return PRAGMA_OPTIMIZE_OFF;
1421 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001422 YY_BREAK
1423case 11:
1424YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001425#line 139 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001426{ BEGIN PRAGMA; }
1427 YY_BREAK
1428case 12:
1429/* rule 12 can match eol */
1430YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001431#line 141 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001432{ BEGIN 0; yylineno++; yycolumn = 0; }
1433 YY_BREAK
1434case 13:
1435YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001436#line 142 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001437{ }
1438 YY_BREAK
1439case 14:
1440YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001441#line 144 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001442{ }
1443 YY_BREAK
1444case 15:
1445YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001446#line 145 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001447{ }
1448 YY_BREAK
1449case 16:
1450YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001451#line 146 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001452return COLON;
1453 YY_BREAK
1454case 17:
1455YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001456#line 147 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001457{
1458 yylval->identifier = strdup(yytext);
1459 return IDENTIFIER;
1460 }
1461 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001462case 18:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001463YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001464#line 151 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001465{
1466 yylval->n = strtol(yytext, NULL, 10);
1467 return INTCONSTANT;
1468 }
1469 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001470case 19:
1471/* rule 19 can match eol */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001472YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001473#line 155 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001474{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
1475 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001476case 20:
Ian Romanick33fe3642010-08-30 11:59:48 -07001477/* rule 20 can match eol */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001478YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001479#line 157 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001480{ yylineno++; yycolumn = 0; }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001481 YY_BREAK
1482case 21:
1483YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001484#line 159 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001485return ATTRIBUTE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001486 YY_BREAK
1487case 22:
1488YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001489#line 160 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001490return CONST_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001491 YY_BREAK
1492case 23:
1493YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001494#line 161 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001495return BOOL_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001496 YY_BREAK
1497case 24:
1498YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001499#line 162 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001500return FLOAT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001501 YY_BREAK
1502case 25:
1503YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001504#line 163 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001505return INT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001506 YY_BREAK
1507case 26:
1508YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001509#line 165 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001510return BREAK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001511 YY_BREAK
1512case 27:
1513YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001514#line 166 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001515return CONTINUE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001516 YY_BREAK
1517case 28:
1518YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001519#line 167 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001520return DO;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001521 YY_BREAK
1522case 29:
1523YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001524#line 168 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001525return WHILE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001526 YY_BREAK
1527case 30:
1528YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001529#line 169 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001530return ELSE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001531 YY_BREAK
1532case 31:
1533YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001534#line 170 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001535return FOR;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001536 YY_BREAK
1537case 32:
1538YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001539#line 171 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001540return IF;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001541 YY_BREAK
1542case 33:
1543YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001544#line 172 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001545return DISCARD;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001546 YY_BREAK
1547case 34:
1548YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001549#line 173 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001550return RETURN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001551 YY_BREAK
1552case 35:
1553YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001554#line 175 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001555return BVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001556 YY_BREAK
1557case 36:
1558YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001559#line 176 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001560return BVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001561 YY_BREAK
1562case 37:
1563YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001564#line 177 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001565return BVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001566 YY_BREAK
1567case 38:
1568YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001569#line 178 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001570return IVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001571 YY_BREAK
1572case 39:
1573YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001574#line 179 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001575return IVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001576 YY_BREAK
1577case 40:
1578YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001579#line 180 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001580return IVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001581 YY_BREAK
1582case 41:
1583YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001584#line 181 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001585return VEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001586 YY_BREAK
1587case 42:
1588YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001589#line 182 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001590return VEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001591 YY_BREAK
1592case 43:
1593YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001594#line 183 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001595return VEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001596 YY_BREAK
1597case 44:
1598YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001599#line 184 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001600return MAT2X2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001601 YY_BREAK
1602case 45:
1603YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001604#line 185 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001605return MAT3X3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001606 YY_BREAK
1607case 46:
1608YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001609#line 186 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001610return MAT4X4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001611 YY_BREAK
1612case 47:
1613YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001614#line 187 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001615TOKEN_OR_IDENTIFIER(120, MAT2X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001616 YY_BREAK
1617case 48:
1618YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001619#line 188 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001620TOKEN_OR_IDENTIFIER(120, MAT2X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001621 YY_BREAK
1622case 49:
1623YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001624#line 189 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001625TOKEN_OR_IDENTIFIER(120, MAT2X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001626 YY_BREAK
1627case 50:
1628YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001629#line 190 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001630TOKEN_OR_IDENTIFIER(120, MAT3X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001631 YY_BREAK
1632case 51:
1633YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001634#line 191 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001635TOKEN_OR_IDENTIFIER(120, MAT3X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001636 YY_BREAK
1637case 52:
1638YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001639#line 192 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001640TOKEN_OR_IDENTIFIER(120, MAT3X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001641 YY_BREAK
1642case 53:
1643YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001644#line 193 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001645TOKEN_OR_IDENTIFIER(120, MAT4X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001646 YY_BREAK
1647case 54:
1648YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001649#line 194 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001650TOKEN_OR_IDENTIFIER(120, MAT4X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001651 YY_BREAK
1652case 55:
1653YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001654#line 195 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001655TOKEN_OR_IDENTIFIER(120, MAT4X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001656 YY_BREAK
1657case 56:
1658YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001659#line 197 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001660return IN_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001661 YY_BREAK
1662case 57:
1663YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001664#line 198 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001665return OUT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001666 YY_BREAK
1667case 58:
1668YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001669#line 199 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001670return INOUT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001671 YY_BREAK
1672case 59:
1673YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001674#line 200 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001675return UNIFORM;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001676 YY_BREAK
1677case 60:
1678YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001679#line 201 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001680return VARYING;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001681 YY_BREAK
1682case 61:
1683YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001684#line 202 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001685TOKEN_OR_IDENTIFIER(120, CENTROID);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001686 YY_BREAK
1687case 62:
1688YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001689#line 203 "glsl_lexer.lpp"
1690TOKEN_OR_IDENTIFIER_ES(120, INVARIANT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001691 YY_BREAK
1692case 63:
1693YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001694#line 205 "glsl_lexer.lpp"
1695TOKEN_OR_IDENTIFIER_ES(130, FLAT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001696 YY_BREAK
1697case 64:
1698YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001699#line 206 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001700TOKEN_OR_IDENTIFIER(130, SMOOTH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001701 YY_BREAK
1702case 65:
1703YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001704#line 207 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001705TOKEN_OR_IDENTIFIER(130, NOPERSPECTIVE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001706 YY_BREAK
1707case 66:
1708YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001709#line 209 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001710return SAMPLER1D;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001711 YY_BREAK
1712case 67:
1713YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001714#line 210 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001715return SAMPLER2D;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001716 YY_BREAK
1717case 68:
1718YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001719#line 211 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001720return SAMPLER3D;
1721 YY_BREAK
1722case 69:
1723YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001724#line 212 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001725return SAMPLERCUBE;
1726 YY_BREAK
1727case 70:
1728YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001729#line 213 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001730return SAMPLER1DSHADOW;
1731 YY_BREAK
1732case 71:
1733YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001734#line 214 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001735return SAMPLER2DSHADOW;
1736 YY_BREAK
1737case 72:
1738YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001739#line 216 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001740return STRUCT;
1741 YY_BREAK
1742case 73:
1743YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001744#line 217 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001745return VOID_TOK;
1746 YY_BREAK
1747case 74:
1748YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001749#line 219 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001750{
1751 if ((yyextra->language_version >= 140)
Ian Romanick2b45ba82010-10-05 17:03:25 -07001752 || yyextra->ARB_explicit_attrib_location_enable
Ian Romanickf50f0652010-06-30 17:30:03 -07001753 || (yyextra->ARB_fragment_coord_conventions_enable)){
1754 return LAYOUT_TOK;
1755 } else {
1756 yylval->identifier = strdup(yytext);
1757 return IDENTIFIER;
1758 }
1759 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001760 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001761case 75:
1762YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001763#line 230 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001764return INC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001765 YY_BREAK
1766case 76:
1767YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001768#line 231 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001769return DEC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001770 YY_BREAK
1771case 77:
1772YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001773#line 232 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001774return LE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001775 YY_BREAK
1776case 78:
1777YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001778#line 233 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001779return GE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001780 YY_BREAK
1781case 79:
1782YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001783#line 234 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001784return EQ_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001785 YY_BREAK
1786case 80:
1787YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001788#line 235 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001789return NE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001790 YY_BREAK
1791case 81:
1792YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001793#line 236 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001794return AND_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001795 YY_BREAK
1796case 82:
1797YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001798#line 237 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001799return OR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001800 YY_BREAK
1801case 83:
1802YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001803#line 238 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001804return XOR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001805 YY_BREAK
1806case 84:
1807YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001808#line 240 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001809return MUL_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001810 YY_BREAK
1811case 85:
1812YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001813#line 241 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001814return DIV_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001815 YY_BREAK
1816case 86:
1817YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001818#line 242 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001819return ADD_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001820 YY_BREAK
1821case 87:
1822YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001823#line 243 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001824return MOD_ASSIGN;
Ian Romanickf50f0652010-06-30 17:30:03 -07001825 YY_BREAK
1826case 88:
1827YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001828#line 244 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001829return LEFT_ASSIGN;
1830 YY_BREAK
1831case 89:
1832YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001833#line 245 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001834return RIGHT_ASSIGN;
1835 YY_BREAK
1836case 90:
1837YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001838#line 246 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001839return AND_ASSIGN;
1840 YY_BREAK
1841case 91:
1842YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001843#line 247 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001844return XOR_ASSIGN;
1845 YY_BREAK
1846case 92:
1847YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001848#line 248 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001849return OR_ASSIGN;
1850 YY_BREAK
1851case 93:
1852YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001853#line 249 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001854return SUB_ASSIGN;
1855 YY_BREAK
1856case 94:
1857YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001858#line 251 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001859{
1860 yylval->n = strtol(yytext, NULL, 10);
1861 return INTCONSTANT;
1862 }
1863 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001864case 95:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001865YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001866#line 255 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001867{
1868 yylval->n = strtol(yytext + 2, NULL, 16);
1869 return INTCONSTANT;
1870 }
1871 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001872case 96:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001873YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001874#line 259 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001875{
1876 yylval->n = strtol(yytext, NULL, 8);
1877 return INTCONSTANT;
1878 }
1879 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001880case 97:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001881YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001882#line 264 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001883{
1884 yylval->real = strtod(yytext, NULL);
1885 return FLOATCONSTANT;
1886 }
1887 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001888case 98:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001889YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001890#line 268 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001891{
1892 yylval->real = strtod(yytext, NULL);
1893 return FLOATCONSTANT;
1894 }
1895 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001896case 99:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001897YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001898#line 272 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001899{
1900 yylval->real = strtod(yytext, NULL);
1901 return FLOATCONSTANT;
1902 }
1903 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001904case 100:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001905YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001906#line 276 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001907{
1908 yylval->real = strtod(yytext, NULL);
1909 return FLOATCONSTANT;
1910 }
1911 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001912case 101:
Ian Romanickf50f0652010-06-30 17:30:03 -07001913YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001914#line 280 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001915{
Eric Anholt47f3f222010-08-02 11:26:43 -07001916 yylval->real = strtod(yytext, NULL);
1917 return FLOATCONSTANT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001918 }
1919 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001920case 102:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001921YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001922#line 285 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001923{
Eric Anholt47f3f222010-08-02 11:26:43 -07001924 yylval->n = 1;
1925 return BOOLCONSTANT;
1926 }
1927 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001928case 103:
Eric Anholt47f3f222010-08-02 11:26:43 -07001929YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001930#line 289 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07001931{
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001932 yylval->n = 0;
1933 return BOOLCONSTANT;
1934 }
1935 YY_BREAK
1936/* Reserved words in GLSL 1.10. */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001937case 104:
1938YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001939#line 296 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001940RESERVED_WORD(999, ASM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001941 YY_BREAK
1942case 105:
1943YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001944#line 297 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001945RESERVED_WORD(999, CLASS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001946 YY_BREAK
1947case 106:
1948YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001949#line 298 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001950RESERVED_WORD(999, UNION);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001951 YY_BREAK
1952case 107:
1953YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001954#line 299 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001955RESERVED_WORD(999, ENUM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001956 YY_BREAK
1957case 108:
1958YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001959#line 300 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001960RESERVED_WORD(999, TYPEDEF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001961 YY_BREAK
1962case 109:
1963YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001964#line 301 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001965RESERVED_WORD(999, TEMPLATE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001966 YY_BREAK
1967case 110:
1968YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001969#line 302 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001970RESERVED_WORD(999, THIS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001971 YY_BREAK
1972case 111:
1973YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001974#line 303 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001975RESERVED_WORD(999, PACKED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001976 YY_BREAK
1977case 112:
1978YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001979#line 304 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001980RESERVED_WORD(999, GOTO);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001981 YY_BREAK
1982case 113:
1983YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001984#line 305 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001985RESERVED_WORD(130, SWITCH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001986 YY_BREAK
1987case 114:
1988YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001989#line 306 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001990RESERVED_WORD(130, DEFAULT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001991 YY_BREAK
1992case 115:
1993YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001994#line 307 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001995RESERVED_WORD(999, INLINE_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001996 YY_BREAK
1997case 116:
1998YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001999#line 308 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002000RESERVED_WORD(999, NOINLINE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002001 YY_BREAK
2002case 117:
2003YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002004#line 309 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002005RESERVED_WORD(999, VOLATILE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002006 YY_BREAK
2007case 118:
2008YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002009#line 310 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002010RESERVED_WORD(999, PUBLIC_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002011 YY_BREAK
2012case 119:
2013YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002014#line 311 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002015RESERVED_WORD(999, STATIC);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002016 YY_BREAK
2017case 120:
2018YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002019#line 312 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002020RESERVED_WORD(999, EXTERN);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002021 YY_BREAK
2022case 121:
2023YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002024#line 313 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002025RESERVED_WORD(999, EXTERNAL);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002026 YY_BREAK
2027case 122:
2028YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002029#line 314 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002030RESERVED_WORD(999, INTERFACE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002031 YY_BREAK
2032case 123:
2033YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002034#line 315 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002035RESERVED_WORD(999, LONG_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002036 YY_BREAK
2037case 124:
2038YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002039#line 316 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002040RESERVED_WORD(999, SHORT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002041 YY_BREAK
2042case 125:
2043YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002044#line 317 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002045RESERVED_WORD(999, DOUBLE_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002046 YY_BREAK
2047case 126:
2048YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002049#line 318 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002050RESERVED_WORD(999, HALF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002051 YY_BREAK
2052case 127:
2053YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002054#line 319 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002055RESERVED_WORD(999, FIXED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002056 YY_BREAK
2057case 128:
2058YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002059#line 320 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002060RESERVED_WORD(999, UNSIGNED);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002061 YY_BREAK
2062case 129:
2063YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002064#line 321 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002065RESERVED_WORD(999, INPUT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002066 YY_BREAK
2067case 130:
2068YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002069#line 322 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002070RESERVED_WORD(999, OUTPUT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002071 YY_BREAK
2072case 131:
2073YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002074#line 323 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002075RESERVED_WORD(999, HVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002076 YY_BREAK
2077case 132:
2078YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002079#line 324 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002080RESERVED_WORD(999, HVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002081 YY_BREAK
2082case 133:
2083YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002084#line 325 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002085RESERVED_WORD(999, HVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002086 YY_BREAK
2087case 134:
2088YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002089#line 326 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002090RESERVED_WORD(999, DVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002091 YY_BREAK
2092case 135:
2093YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002094#line 327 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002095RESERVED_WORD(999, DVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002096 YY_BREAK
2097case 136:
2098YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002099#line 328 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002100RESERVED_WORD(999, DVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002101 YY_BREAK
2102case 137:
2103YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002104#line 329 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002105RESERVED_WORD(999, FVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002106 YY_BREAK
2107case 138:
2108YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002109#line 330 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002110RESERVED_WORD(999, FVEC3);
Ian Romanickf50f0652010-06-30 17:30:03 -07002111 YY_BREAK
2112case 139:
2113YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002114#line 331 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002115RESERVED_WORD(999, FVEC4);
Eric Anholt47f3f222010-08-02 11:26:43 -07002116 YY_BREAK
2117case 140:
2118YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002119#line 332 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002120return SAMPLER2DRECT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002121 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002122case 141:
2123YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002124#line 333 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002125RESERVED_WORD(999, SAMPLER3DRECT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002126 YY_BREAK
2127case 142:
2128YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002129#line 334 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002130return SAMPLER2DRECTSHADOW;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002131 YY_BREAK
2132case 143:
2133YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002134#line 335 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002135RESERVED_WORD(999, SIZEOF);
Ian Romanickf50f0652010-06-30 17:30:03 -07002136 YY_BREAK
2137case 144:
2138YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002139#line 336 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002140RESERVED_WORD(999, CAST);
Eric Anholt47f3f222010-08-02 11:26:43 -07002141 YY_BREAK
2142case 145:
2143YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002144#line 337 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002145RESERVED_WORD(999, NAMESPACE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002146 YY_BREAK
2147case 146:
2148YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002149#line 338 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002150RESERVED_WORD(999, USING);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002151 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002152/* Additional reserved words in GLSL 1.20. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002153case 147:
2154YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002155#line 341 "glsl_lexer.lpp"
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002156TOKEN_OR_IDENTIFIER_ES(120, LOWP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002157 YY_BREAK
2158case 148:
2159YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002160#line 342 "glsl_lexer.lpp"
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002161TOKEN_OR_IDENTIFIER_ES(120, MEDIUMP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002162 YY_BREAK
2163case 149:
2164YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002165#line 343 "glsl_lexer.lpp"
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002166TOKEN_OR_IDENTIFIER_ES(120, HIGHP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002167 YY_BREAK
2168case 150:
2169YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002170#line 344 "glsl_lexer.lpp"
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002171TOKEN_OR_IDENTIFIER_ES(120, PRECISION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002172 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002173/* Additional reserved words in GLSL 1.30. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002174case 151:
2175YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002176#line 347 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002177TOKEN_OR_IDENTIFIER(130, COMMON);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002178 YY_BREAK
2179case 152:
2180YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002181#line 348 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002182TOKEN_OR_IDENTIFIER(130, PARTITION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002183 YY_BREAK
2184case 153:
2185YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002186#line 349 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002187TOKEN_OR_IDENTIFIER(130, ACTIVE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002188 YY_BREAK
2189case 154:
2190YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002191#line 350 "glsl_lexer.lpp"
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002192TOKEN_OR_IDENTIFIER_ES(130, SUPERP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002193 YY_BREAK
2194case 155:
2195YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002196#line 351 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002197TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002198 YY_BREAK
2199case 156:
2200YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002201#line 352 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002202TOKEN_OR_IDENTIFIER(130, FILTER);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002203 YY_BREAK
2204case 157:
2205YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002206#line 353 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002207TOKEN_OR_IDENTIFIER(130, IMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002208 YY_BREAK
2209case 158:
2210YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002211#line 354 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002212TOKEN_OR_IDENTIFIER(130, IMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002213 YY_BREAK
2214case 159:
2215YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002216#line 355 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002217TOKEN_OR_IDENTIFIER(130, IMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002218 YY_BREAK
2219case 160:
2220YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002221#line 356 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002222TOKEN_OR_IDENTIFIER(130, IMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002223 YY_BREAK
2224case 161:
2225YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002226#line 357 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002227TOKEN_OR_IDENTIFIER(130, IIMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002228 YY_BREAK
2229case 162:
2230YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002231#line 358 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002232TOKEN_OR_IDENTIFIER(130, IIMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002233 YY_BREAK
2234case 163:
2235YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002236#line 359 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002237TOKEN_OR_IDENTIFIER(130, IIMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002238 YY_BREAK
2239case 164:
2240YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002241#line 360 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002242TOKEN_OR_IDENTIFIER(130, IIMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002243 YY_BREAK
2244case 165:
2245YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002246#line 361 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002247TOKEN_OR_IDENTIFIER(130, UIMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002248 YY_BREAK
2249case 166:
2250YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002251#line 362 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002252TOKEN_OR_IDENTIFIER(130, UIMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002253 YY_BREAK
2254case 167:
2255YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002256#line 363 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002257TOKEN_OR_IDENTIFIER(130, UIMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002258 YY_BREAK
2259case 168:
2260YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002261#line 364 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002262TOKEN_OR_IDENTIFIER(130, UIMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002263 YY_BREAK
2264case 169:
2265YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002266#line 365 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002267TOKEN_OR_IDENTIFIER(130, IMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002268 YY_BREAK
2269case 170:
2270YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002271#line 366 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002272TOKEN_OR_IDENTIFIER(130, IMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002273 YY_BREAK
2274case 171:
2275YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002276#line 367 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002277TOKEN_OR_IDENTIFIER(130, IIMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002278 YY_BREAK
2279case 172:
2280YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002281#line 368 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002282TOKEN_OR_IDENTIFIER(130, IIMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002283 YY_BREAK
2284case 173:
2285YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002286#line 369 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002287TOKEN_OR_IDENTIFIER(130, UIMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002288 YY_BREAK
2289case 174:
2290YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002291#line 370 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002292TOKEN_OR_IDENTIFIER(130, UIMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002293 YY_BREAK
2294case 175:
2295YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002296#line 371 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002297TOKEN_OR_IDENTIFIER(130, IMAGE1DSHADOW);
2298 YY_BREAK
2299case 176:
2300YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002301#line 372 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002302TOKEN_OR_IDENTIFIER(130, IMAGE2DSHADOW);
2303 YY_BREAK
2304case 177:
2305YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002306#line 373 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002307TOKEN_OR_IDENTIFIER(130, IMAGEBUFFER);
2308 YY_BREAK
2309case 178:
2310YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002311#line 374 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002312TOKEN_OR_IDENTIFIER(130, IIMAGEBUFFER);
2313 YY_BREAK
2314case 179:
2315YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002316#line 375 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002317TOKEN_OR_IDENTIFIER(130, UIMAGEBUFFER);
2318 YY_BREAK
2319case 180:
2320YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002321#line 376 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002322TOKEN_OR_IDENTIFIER(130, ROW_MAJOR);
2323 YY_BREAK
2324case 181:
2325YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002326#line 378 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002327{
2328 struct _mesa_glsl_parse_state *state = yyextra;
2329 void *ctx = state;
2330 yylval->identifier = talloc_strdup(ctx, yytext);
2331 return IDENTIFIER;
2332 }
2333 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002334case 182:
Ian Romanickf50f0652010-06-30 17:30:03 -07002335YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002336#line 385 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07002337{ return yytext[0]; }
2338 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002339case 183:
Eric Anholt47f3f222010-08-02 11:26:43 -07002340YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002341#line 387 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002342ECHO;
2343 YY_BREAK
Ian Romanick2b45ba82010-10-05 17:03:25 -07002344#line 2345 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002345case YY_STATE_EOF(INITIAL):
2346case YY_STATE_EOF(PP):
Ian Romanick33fe3642010-08-30 11:59:48 -07002347case YY_STATE_EOF(PRAGMA):
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002348 yyterminate();
2349
2350 case YY_END_OF_BUFFER:
2351 {
2352 /* Amount of text matched not including the EOB char. */
2353 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2354
2355 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2356 *yy_cp = yyg->yy_hold_char;
2357 YY_RESTORE_YY_MORE_OFFSET
2358
2359 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2360 {
2361 /* We're scanning a new file or input source. It's
2362 * possible that this happened because the user
2363 * just pointed yyin at a new source and called
2364 * _mesa_glsl_lex(). If so, then we have to assure
2365 * consistency between YY_CURRENT_BUFFER and our
2366 * globals. Here is the right place to do so, because
2367 * this is the first action (other than possibly a
2368 * back-up) that will match for the new input source.
2369 */
2370 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2371 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2372 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2373 }
2374
2375 /* Note that here we test for yy_c_buf_p "<=" to the position
2376 * of the first EOB in the buffer, since yy_c_buf_p will
2377 * already have been incremented past the NUL character
2378 * (since all states make transitions on EOB to the
2379 * end-of-buffer state). Contrast this with the test
2380 * in input().
2381 */
2382 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2383 { /* This was really a NUL. */
2384 yy_state_type yy_next_state;
2385
2386 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2387
2388 yy_current_state = yy_get_previous_state( yyscanner );
2389
2390 /* Okay, we're now positioned to make the NUL
2391 * transition. We couldn't have
2392 * yy_get_previous_state() go ahead and do it
2393 * for us because it doesn't know how to deal
2394 * with the possibility of jamming (and we don't
2395 * want to build jamming into it because then it
2396 * will run more slowly).
2397 */
2398
2399 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2400
2401 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2402
2403 if ( yy_next_state )
2404 {
2405 /* Consume the NUL. */
2406 yy_cp = ++yyg->yy_c_buf_p;
2407 yy_current_state = yy_next_state;
2408 goto yy_match;
2409 }
2410
2411 else
2412 {
2413 yy_cp = yyg->yy_last_accepting_cpos;
2414 yy_current_state = yyg->yy_last_accepting_state;
2415 goto yy_find_action;
2416 }
2417 }
2418
2419 else switch ( yy_get_next_buffer( yyscanner ) )
2420 {
2421 case EOB_ACT_END_OF_FILE:
2422 {
2423 yyg->yy_did_buffer_switch_on_eof = 0;
2424
2425 if ( _mesa_glsl_wrap(yyscanner ) )
2426 {
2427 /* Note: because we've taken care in
2428 * yy_get_next_buffer() to have set up
2429 * yytext, we can now set up
2430 * yy_c_buf_p so that if some total
2431 * hoser (like flex itself) wants to
2432 * call the scanner after we return the
2433 * YY_NULL, it'll still work - another
2434 * YY_NULL will get returned.
2435 */
2436 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2437
2438 yy_act = YY_STATE_EOF(YY_START);
2439 goto do_action;
2440 }
2441
2442 else
2443 {
2444 if ( ! yyg->yy_did_buffer_switch_on_eof )
2445 YY_NEW_FILE;
2446 }
2447 break;
2448 }
2449
2450 case EOB_ACT_CONTINUE_SCAN:
2451 yyg->yy_c_buf_p =
2452 yyg->yytext_ptr + yy_amount_of_matched_text;
2453
2454 yy_current_state = yy_get_previous_state( yyscanner );
2455
2456 yy_cp = yyg->yy_c_buf_p;
2457 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2458 goto yy_match;
2459
2460 case EOB_ACT_LAST_MATCH:
2461 yyg->yy_c_buf_p =
2462 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2463
2464 yy_current_state = yy_get_previous_state( yyscanner );
2465
2466 yy_cp = yyg->yy_c_buf_p;
2467 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2468 goto yy_find_action;
2469 }
2470 break;
2471 }
2472
2473 default:
2474 YY_FATAL_ERROR(
2475 "fatal flex scanner internal error--no action found" );
2476 } /* end of action switch */
2477 } /* end of scanning one token */
2478} /* end of _mesa_glsl_lex */
2479
2480/* yy_get_next_buffer - try to read in a new buffer
2481 *
2482 * Returns a code representing an action:
2483 * EOB_ACT_LAST_MATCH -
2484 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2485 * EOB_ACT_END_OF_FILE - end of file
2486 */
2487static int yy_get_next_buffer (yyscan_t yyscanner)
2488{
2489 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2490 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2491 register char *source = yyg->yytext_ptr;
2492 register int number_to_move, i;
2493 int ret_val;
2494
2495 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2496 YY_FATAL_ERROR(
2497 "fatal flex scanner internal error--end of buffer missed" );
2498
2499 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2500 { /* Don't try to fill the buffer, so this is an EOF. */
2501 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2502 {
2503 /* We matched a single character, the EOB, so
2504 * treat this as a final EOF.
2505 */
2506 return EOB_ACT_END_OF_FILE;
2507 }
2508
2509 else
2510 {
2511 /* We matched some text prior to the EOB, first
2512 * process it.
2513 */
2514 return EOB_ACT_LAST_MATCH;
2515 }
2516 }
2517
2518 /* Try to read more data. */
2519
2520 /* First move last chars to start of buffer. */
2521 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2522
2523 for ( i = 0; i < number_to_move; ++i )
2524 *(dest++) = *(source++);
2525
2526 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2527 /* don't do the read, it's not guaranteed to return an EOF,
2528 * just force an EOF
2529 */
2530 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2531
2532 else
2533 {
2534 int num_to_read =
2535 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2536
2537 while ( num_to_read <= 0 )
2538 { /* Not enough room in the buffer - grow it. */
2539
2540 /* just a shorter name for the current buffer */
2541 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2542
2543 int yy_c_buf_p_offset =
2544 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2545
2546 if ( b->yy_is_our_buffer )
2547 {
2548 int new_size = b->yy_buf_size * 2;
2549
2550 if ( new_size <= 0 )
2551 b->yy_buf_size += b->yy_buf_size / 8;
2552 else
2553 b->yy_buf_size *= 2;
2554
2555 b->yy_ch_buf = (char *)
2556 /* Include room in for 2 EOB chars. */
2557 _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2558 }
2559 else
2560 /* Can't grow it, we don't own it. */
2561 b->yy_ch_buf = 0;
2562
2563 if ( ! b->yy_ch_buf )
2564 YY_FATAL_ERROR(
2565 "fatal error - scanner input buffer overflow" );
2566
2567 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2568
2569 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2570 number_to_move - 1;
2571
2572 }
2573
2574 if ( num_to_read > YY_READ_BUF_SIZE )
2575 num_to_read = YY_READ_BUF_SIZE;
2576
2577 /* Read in more data. */
2578 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2579 yyg->yy_n_chars, (size_t) num_to_read );
2580
2581 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2582 }
2583
2584 if ( yyg->yy_n_chars == 0 )
2585 {
2586 if ( number_to_move == YY_MORE_ADJ )
2587 {
2588 ret_val = EOB_ACT_END_OF_FILE;
2589 _mesa_glsl_restart(yyin ,yyscanner);
2590 }
2591
2592 else
2593 {
2594 ret_val = EOB_ACT_LAST_MATCH;
2595 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2596 YY_BUFFER_EOF_PENDING;
2597 }
2598 }
2599
2600 else
2601 ret_val = EOB_ACT_CONTINUE_SCAN;
2602
2603 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2604 /* Extend the array by 50%, plus the number we really need. */
2605 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2606 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2607 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2608 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2609 }
2610
2611 yyg->yy_n_chars += number_to_move;
2612 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2613 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2614
2615 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2616
2617 return ret_val;
2618}
2619
2620/* yy_get_previous_state - get the state just before the EOB char was reached */
2621
2622 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2623{
2624 register yy_state_type yy_current_state;
2625 register char *yy_cp;
2626 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2627
2628 yy_current_state = yyg->yy_start;
2629 yy_current_state += YY_AT_BOL();
2630
2631 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2632 {
2633 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2634 if ( yy_accept[yy_current_state] )
2635 {
2636 yyg->yy_last_accepting_state = yy_current_state;
2637 yyg->yy_last_accepting_cpos = yy_cp;
2638 }
2639 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2640 {
2641 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07002642 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002643 yy_c = yy_meta[(unsigned int) yy_c];
2644 }
2645 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2646 }
2647
2648 return yy_current_state;
2649}
2650
2651/* yy_try_NUL_trans - try to make a transition on the NUL character
2652 *
2653 * synopsis
2654 * next_state = yy_try_NUL_trans( current_state );
2655 */
2656 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2657{
2658 register int yy_is_jam;
2659 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2660 register char *yy_cp = yyg->yy_c_buf_p;
2661
2662 register YY_CHAR yy_c = 1;
2663 if ( yy_accept[yy_current_state] )
2664 {
2665 yyg->yy_last_accepting_state = yy_current_state;
2666 yyg->yy_last_accepting_cpos = yy_cp;
2667 }
2668 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2669 {
2670 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07002671 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002672 yy_c = yy_meta[(unsigned int) yy_c];
2673 }
2674 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Ian Romanick33fe3642010-08-30 11:59:48 -07002675 yy_is_jam = (yy_current_state == 707);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002676
2677 return yy_is_jam ? 0 : yy_current_state;
2678}
2679
2680#ifndef YY_NO_INPUT
2681#ifdef __cplusplus
2682 static int yyinput (yyscan_t yyscanner)
2683#else
2684 static int input (yyscan_t yyscanner)
2685#endif
2686
2687{
2688 int c;
2689 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2690
2691 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2692
2693 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2694 {
2695 /* yy_c_buf_p now points to the character we want to return.
2696 * If this occurs *before* the EOB characters, then it's a
2697 * valid NUL; if not, then we've hit the end of the buffer.
2698 */
2699 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2700 /* This was really a NUL. */
2701 *yyg->yy_c_buf_p = '\0';
2702
2703 else
2704 { /* need more input */
2705 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2706 ++yyg->yy_c_buf_p;
2707
2708 switch ( yy_get_next_buffer( yyscanner ) )
2709 {
2710 case EOB_ACT_LAST_MATCH:
2711 /* This happens because yy_g_n_b()
2712 * sees that we've accumulated a
2713 * token and flags that we need to
2714 * try matching the token before
2715 * proceeding. But for input(),
2716 * there's no matching to consider.
2717 * So convert the EOB_ACT_LAST_MATCH
2718 * to EOB_ACT_END_OF_FILE.
2719 */
2720
2721 /* Reset buffer status. */
2722 _mesa_glsl_restart(yyin ,yyscanner);
2723
2724 /*FALLTHROUGH*/
2725
2726 case EOB_ACT_END_OF_FILE:
2727 {
2728 if ( _mesa_glsl_wrap(yyscanner ) )
2729 return EOF;
2730
2731 if ( ! yyg->yy_did_buffer_switch_on_eof )
2732 YY_NEW_FILE;
2733#ifdef __cplusplus
2734 return yyinput(yyscanner);
2735#else
2736 return input(yyscanner);
2737#endif
2738 }
2739
2740 case EOB_ACT_CONTINUE_SCAN:
2741 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2742 break;
2743 }
2744 }
2745 }
2746
2747 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2748 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2749 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2750
2751 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2752
2753 return c;
2754}
2755#endif /* ifndef YY_NO_INPUT */
2756
2757/** Immediately switch to a different input stream.
2758 * @param input_file A readable stream.
2759 * @param yyscanner The scanner object.
2760 * @note This function does not reset the start condition to @c INITIAL .
2761 */
2762 void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner)
2763{
2764 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2765
2766 if ( ! YY_CURRENT_BUFFER ){
2767 _mesa_glsl_ensure_buffer_stack (yyscanner);
2768 YY_CURRENT_BUFFER_LVALUE =
2769 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2770 }
2771
2772 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2773 _mesa_glsl__load_buffer_state(yyscanner );
2774}
2775
2776/** Switch to a different input buffer.
2777 * @param new_buffer The new input buffer.
2778 * @param yyscanner The scanner object.
2779 */
2780 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2781{
2782 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2783
2784 /* TODO. We should be able to replace this entire function body
2785 * with
2786 * _mesa_glsl_pop_buffer_state();
2787 * _mesa_glsl_push_buffer_state(new_buffer);
2788 */
2789 _mesa_glsl_ensure_buffer_stack (yyscanner);
2790 if ( YY_CURRENT_BUFFER == new_buffer )
2791 return;
2792
2793 if ( YY_CURRENT_BUFFER )
2794 {
2795 /* Flush out information for old buffer. */
2796 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2797 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2798 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2799 }
2800
2801 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2802 _mesa_glsl__load_buffer_state(yyscanner );
2803
2804 /* We don't actually know whether we did this switch during
2805 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2806 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2807 * to go ahead and always set it.
2808 */
2809 yyg->yy_did_buffer_switch_on_eof = 1;
2810}
2811
2812static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner)
2813{
2814 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2815 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2816 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2817 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2818 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2819}
2820
2821/** Allocate and initialize an input buffer state.
2822 * @param file A readable stream.
2823 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2824 * @param yyscanner The scanner object.
2825 * @return the allocated buffer state.
2826 */
2827 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner)
2828{
2829 YY_BUFFER_STATE b;
2830
2831 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2832 if ( ! b )
2833 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2834
2835 b->yy_buf_size = size;
2836
2837 /* yy_ch_buf has to be 2 characters longer than the size given because
2838 * we need to put in 2 end-of-buffer characters.
2839 */
2840 b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner );
2841 if ( ! b->yy_ch_buf )
2842 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2843
2844 b->yy_is_our_buffer = 1;
2845
2846 _mesa_glsl__init_buffer(b,file ,yyscanner);
2847
2848 return b;
2849}
2850
2851/** Destroy the buffer.
2852 * @param b a buffer created with _mesa_glsl__create_buffer()
2853 * @param yyscanner The scanner object.
2854 */
2855 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2856{
2857 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2858
2859 if ( ! b )
2860 return;
2861
2862 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2863 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2864
2865 if ( b->yy_is_our_buffer )
2866 _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner );
2867
2868 _mesa_glsl_free((void *) b ,yyscanner );
2869}
2870
2871/* Initializes or reinitializes a buffer.
2872 * This function is sometimes called more than once on the same buffer,
2873 * such as during a _mesa_glsl_restart() or at EOF.
2874 */
2875 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2876
2877{
2878 int oerrno = errno;
2879 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2880
2881 _mesa_glsl__flush_buffer(b ,yyscanner);
2882
2883 b->yy_input_file = file;
2884 b->yy_fill_buffer = 1;
2885
2886 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
2887 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
2888 * In that case, we don't want to reset the lineno or column.
2889 */
2890 if (b != YY_CURRENT_BUFFER){
2891 b->yy_bs_lineno = 1;
2892 b->yy_bs_column = 0;
2893 }
2894
2895 b->yy_is_interactive = 0;
2896
2897 errno = oerrno;
2898}
2899
2900/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2901 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2902 * @param yyscanner The scanner object.
2903 */
2904 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2905{
2906 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2907 if ( ! b )
2908 return;
2909
2910 b->yy_n_chars = 0;
2911
2912 /* We always need two end-of-buffer characters. The first causes
2913 * a transition to the end-of-buffer state. The second causes
2914 * a jam in that state.
2915 */
2916 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2917 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2918
2919 b->yy_buf_pos = &b->yy_ch_buf[0];
2920
2921 b->yy_at_bol = 1;
2922 b->yy_buffer_status = YY_BUFFER_NEW;
2923
2924 if ( b == YY_CURRENT_BUFFER )
2925 _mesa_glsl__load_buffer_state(yyscanner );
2926}
2927
2928/** Pushes the new state onto the stack. The new state becomes
2929 * the current state. This function will allocate the stack
2930 * if necessary.
2931 * @param new_buffer The new state.
2932 * @param yyscanner The scanner object.
2933 */
2934void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2935{
2936 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2937 if (new_buffer == NULL)
2938 return;
2939
2940 _mesa_glsl_ensure_buffer_stack(yyscanner);
2941
2942 /* This block is copied from _mesa_glsl__switch_to_buffer. */
2943 if ( YY_CURRENT_BUFFER )
2944 {
2945 /* Flush out information for old buffer. */
2946 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2947 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2948 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2949 }
2950
2951 /* Only push if top exists. Otherwise, replace top. */
2952 if (YY_CURRENT_BUFFER)
2953 yyg->yy_buffer_stack_top++;
2954 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2955
2956 /* copied from _mesa_glsl__switch_to_buffer. */
2957 _mesa_glsl__load_buffer_state(yyscanner );
2958 yyg->yy_did_buffer_switch_on_eof = 1;
2959}
2960
2961/** Removes and deletes the top of the stack, if present.
2962 * The next element becomes the new top.
2963 * @param yyscanner The scanner object.
2964 */
2965void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner)
2966{
2967 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2968 if (!YY_CURRENT_BUFFER)
2969 return;
2970
2971 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2972 YY_CURRENT_BUFFER_LVALUE = NULL;
2973 if (yyg->yy_buffer_stack_top > 0)
2974 --yyg->yy_buffer_stack_top;
2975
2976 if (YY_CURRENT_BUFFER) {
2977 _mesa_glsl__load_buffer_state(yyscanner );
2978 yyg->yy_did_buffer_switch_on_eof = 1;
2979 }
2980}
2981
2982/* Allocates the stack if it does not exist.
2983 * Guarantees space for at least one push.
2984 */
2985static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner)
2986{
2987 int num_to_alloc;
2988 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2989
2990 if (!yyg->yy_buffer_stack) {
2991
2992 /* First allocation is just for 2 elements, since we don't know if this
2993 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2994 * immediate realloc on the next call.
2995 */
2996 num_to_alloc = 1;
2997 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc
2998 (num_to_alloc * sizeof(struct yy_buffer_state*)
2999 , yyscanner);
3000 if ( ! yyg->yy_buffer_stack )
3001 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3002
3003 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3004
3005 yyg->yy_buffer_stack_max = num_to_alloc;
3006 yyg->yy_buffer_stack_top = 0;
3007 return;
3008 }
3009
3010 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3011
3012 /* Increase the buffer to prepare for a possible push. */
3013 int grow_size = 8 /* arbitrary grow size */;
3014
3015 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3016 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc
3017 (yyg->yy_buffer_stack,
3018 num_to_alloc * sizeof(struct yy_buffer_state*)
3019 , yyscanner);
3020 if ( ! yyg->yy_buffer_stack )
3021 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3022
3023 /* zero only the new slots.*/
3024 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3025 yyg->yy_buffer_stack_max = num_to_alloc;
3026 }
3027}
3028
3029/** Setup the input buffer state to scan directly from a user-specified character buffer.
3030 * @param base the character buffer
3031 * @param size the size in bytes of the character buffer
3032 * @param yyscanner The scanner object.
3033 * @return the newly allocated buffer state object.
3034 */
3035YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3036{
3037 YY_BUFFER_STATE b;
3038
3039 if ( size < 2 ||
3040 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3041 base[size-1] != YY_END_OF_BUFFER_CHAR )
3042 /* They forgot to leave room for the EOB's. */
3043 return 0;
3044
3045 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3046 if ( ! b )
3047 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3048
3049 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3050 b->yy_buf_pos = b->yy_ch_buf = base;
3051 b->yy_is_our_buffer = 0;
3052 b->yy_input_file = 0;
3053 b->yy_n_chars = b->yy_buf_size;
3054 b->yy_is_interactive = 0;
3055 b->yy_at_bol = 1;
3056 b->yy_fill_buffer = 0;
3057 b->yy_buffer_status = YY_BUFFER_NEW;
3058
3059 _mesa_glsl__switch_to_buffer(b ,yyscanner );
3060
3061 return b;
3062}
3063
3064/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3065 * scan from a @e copy of @a str.
3066 * @param yystr a NUL-terminated string to scan
3067 * @param yyscanner The scanner object.
3068 * @return the newly allocated buffer state object.
3069 * @note If you want to scan bytes that may contain NUL values, then use
3070 * _mesa_glsl__scan_bytes() instead.
3071 */
3072YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner)
3073{
3074
3075 return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner);
3076}
3077
3078/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3079 * scan from a @e copy of @a bytes.
Ian Romanick5ed66102010-10-05 16:40:00 -07003080 * @param yybytes the byte buffer to scan
3081 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003082 * @param yyscanner The scanner object.
3083 * @return the newly allocated buffer state object.
3084 */
3085YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3086{
3087 YY_BUFFER_STATE b;
3088 char *buf;
3089 yy_size_t n;
3090 int i;
3091
3092 /* Get memory for full buffer, including space for trailing EOB's. */
3093 n = _yybytes_len + 2;
3094 buf = (char *) _mesa_glsl_alloc(n ,yyscanner );
3095 if ( ! buf )
3096 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3097
3098 for ( i = 0; i < _yybytes_len; ++i )
3099 buf[i] = yybytes[i];
3100
3101 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3102
3103 b = _mesa_glsl__scan_buffer(buf,n ,yyscanner);
3104 if ( ! b )
3105 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3106
3107 /* It's okay to grow etc. this buffer, and we should throw it
3108 * away when we're done.
3109 */
3110 b->yy_is_our_buffer = 1;
3111
3112 return b;
3113}
3114
3115#ifndef YY_EXIT_FAILURE
3116#define YY_EXIT_FAILURE 2
3117#endif
3118
3119static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3120{
3121 (void) fprintf( stderr, "%s\n", msg );
3122 exit( YY_EXIT_FAILURE );
3123}
3124
3125/* Redefine yyless() so it works in section 3 code. */
3126
3127#undef yyless
3128#define yyless(n) \
3129 do \
3130 { \
3131 /* Undo effects of setting up yytext. */ \
3132 int yyless_macro_arg = (n); \
3133 YY_LESS_LINENO(yyless_macro_arg);\
3134 yytext[yyleng] = yyg->yy_hold_char; \
3135 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3136 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3137 *yyg->yy_c_buf_p = '\0'; \
3138 yyleng = yyless_macro_arg; \
3139 } \
3140 while ( 0 )
3141
3142/* Accessor methods (get/set functions) to struct members. */
3143
3144/** Get the user-defined data for this scanner.
3145 * @param yyscanner The scanner object.
3146 */
3147YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner)
3148{
3149 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3150 return yyextra;
3151}
3152
3153/** Get the current line number.
3154 * @param yyscanner The scanner object.
3155 */
3156int _mesa_glsl_get_lineno (yyscan_t yyscanner)
3157{
3158 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3159
3160 if (! YY_CURRENT_BUFFER)
3161 return 0;
3162
3163 return yylineno;
3164}
3165
3166/** Get the current column number.
3167 * @param yyscanner The scanner object.
3168 */
3169int _mesa_glsl_get_column (yyscan_t yyscanner)
3170{
3171 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3172
3173 if (! YY_CURRENT_BUFFER)
3174 return 0;
3175
3176 return yycolumn;
3177}
3178
3179/** Get the input stream.
3180 * @param yyscanner The scanner object.
3181 */
3182FILE *_mesa_glsl_get_in (yyscan_t yyscanner)
3183{
3184 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3185 return yyin;
3186}
3187
3188/** Get the output stream.
3189 * @param yyscanner The scanner object.
3190 */
3191FILE *_mesa_glsl_get_out (yyscan_t yyscanner)
3192{
3193 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3194 return yyout;
3195}
3196
3197/** Get the length of the current token.
3198 * @param yyscanner The scanner object.
3199 */
3200int _mesa_glsl_get_leng (yyscan_t yyscanner)
3201{
3202 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3203 return yyleng;
3204}
3205
3206/** Get the current token.
3207 * @param yyscanner The scanner object.
3208 */
3209
3210char *_mesa_glsl_get_text (yyscan_t yyscanner)
3211{
3212 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3213 return yytext;
3214}
3215
3216/** Set the user-defined data. This data is never touched by the scanner.
3217 * @param user_defined The data to be associated with this scanner.
3218 * @param yyscanner The scanner object.
3219 */
3220void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3221{
3222 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3223 yyextra = user_defined ;
3224}
3225
3226/** Set the current line number.
3227 * @param line_number
3228 * @param yyscanner The scanner object.
3229 */
3230void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner)
3231{
3232 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3233
3234 /* lineno is only valid if an input buffer exists. */
3235 if (! YY_CURRENT_BUFFER )
3236 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner);
3237
3238 yylineno = line_number;
3239}
3240
3241/** Set the current column.
3242 * @param line_number
3243 * @param yyscanner The scanner object.
3244 */
3245void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner)
3246{
3247 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3248
3249 /* column is only valid if an input buffer exists. */
3250 if (! YY_CURRENT_BUFFER )
3251 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner);
3252
3253 yycolumn = column_no;
3254}
3255
3256/** Set the input stream. This does not discard the current
3257 * input buffer.
3258 * @param in_str A readable stream.
3259 * @param yyscanner The scanner object.
3260 * @see _mesa_glsl__switch_to_buffer
3261 */
3262void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner)
3263{
3264 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3265 yyin = in_str ;
3266}
3267
3268void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner)
3269{
3270 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3271 yyout = out_str ;
3272}
3273
3274int _mesa_glsl_get_debug (yyscan_t yyscanner)
3275{
3276 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3277 return yy_flex_debug;
3278}
3279
3280void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner)
3281{
3282 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3283 yy_flex_debug = bdebug ;
3284}
3285
3286/* Accessor methods for yylval and yylloc */
3287
3288YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner)
3289{
3290 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3291 return yylval;
3292}
3293
3294void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3295{
3296 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3297 yylval = yylval_param;
3298}
3299
3300YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner)
3301{
3302 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3303 return yylloc;
3304}
3305
3306void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3307{
3308 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3309 yylloc = yylloc_param;
3310}
3311
3312/* User-visible API */
3313
3314/* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3315 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3316 * That's why we explicitly handle the declaration, instead of using our macros.
3317 */
3318
3319int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals)
3320
3321{
3322 if (ptr_yy_globals == NULL){
3323 errno = EINVAL;
3324 return 1;
3325 }
3326
3327 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL );
3328
3329 if (*ptr_yy_globals == NULL){
3330 errno = ENOMEM;
3331 return 1;
3332 }
3333
3334 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3335 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3336
3337 return yy_init_globals ( *ptr_yy_globals );
3338}
3339
3340/* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3341 * convention of taking the scanner as the last argument. Note however, that
3342 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3343 * is the reason, too, why this function also must handle its own declaration).
3344 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3345 * the yyextra field.
3346 */
3347
3348int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3349
3350{
3351 struct yyguts_t dummy_yyguts;
3352
3353 _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts);
3354
3355 if (ptr_yy_globals == NULL){
3356 errno = EINVAL;
3357 return 1;
3358 }
3359
3360 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3361
3362 if (*ptr_yy_globals == NULL){
3363 errno = ENOMEM;
3364 return 1;
3365 }
3366
3367 /* By setting to 0xAA, we expose bugs in
3368 yy_init_globals. Leave at 0x00 for releases. */
3369 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3370
3371 _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals);
3372
3373 return yy_init_globals ( *ptr_yy_globals );
3374}
3375
3376static int yy_init_globals (yyscan_t yyscanner)
3377{
3378 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3379 /* Initialization is the same as for the non-reentrant scanner.
3380 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3381 */
3382
3383 yyg->yy_buffer_stack = 0;
3384 yyg->yy_buffer_stack_top = 0;
3385 yyg->yy_buffer_stack_max = 0;
3386 yyg->yy_c_buf_p = (char *) 0;
3387 yyg->yy_init = 0;
3388 yyg->yy_start = 0;
3389
3390 yyg->yy_start_stack_ptr = 0;
3391 yyg->yy_start_stack_depth = 0;
3392 yyg->yy_start_stack = NULL;
3393
3394/* Defined in main.c */
3395#ifdef YY_STDINIT
3396 yyin = stdin;
3397 yyout = stdout;
3398#else
3399 yyin = (FILE *) 0;
3400 yyout = (FILE *) 0;
3401#endif
3402
3403 /* For future reference: Set errno on error, since we are called by
3404 * _mesa_glsl_lex_init()
3405 */
3406 return 0;
3407}
3408
3409/* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3410int _mesa_glsl_lex_destroy (yyscan_t yyscanner)
3411{
3412 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3413
3414 /* Pop the buffer stack, destroying each element. */
3415 while(YY_CURRENT_BUFFER){
3416 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3417 YY_CURRENT_BUFFER_LVALUE = NULL;
3418 _mesa_glsl_pop_buffer_state(yyscanner);
3419 }
3420
3421 /* Destroy the stack itself. */
3422 _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner);
3423 yyg->yy_buffer_stack = NULL;
3424
3425 /* Destroy the start condition stack. */
3426 _mesa_glsl_free(yyg->yy_start_stack ,yyscanner );
3427 yyg->yy_start_stack = NULL;
3428
3429 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3430 * _mesa_glsl_lex() is called, initialization will occur. */
3431 yy_init_globals( yyscanner);
3432
3433 /* Destroy the main struct (reentrant only). */
3434 _mesa_glsl_free ( yyscanner , yyscanner );
3435 yyscanner = NULL;
3436 return 0;
3437}
3438
3439/*
3440 * Internal utility routines.
3441 */
3442
3443#ifndef yytext_ptr
3444static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3445{
3446 register int i;
3447 for ( i = 0; i < n; ++i )
3448 s1[i] = s2[i];
3449}
3450#endif
3451
3452#ifdef YY_NEED_STRLEN
3453static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3454{
3455 register int n;
3456 for ( n = 0; s[n]; ++n )
3457 ;
3458
3459 return n;
3460}
3461#endif
3462
3463void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner)
3464{
3465 return (void *) malloc( size );
3466}
3467
3468void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3469{
3470 /* The cast to (char *) in the following accommodates both
3471 * implementations that use char* generic pointers, and those
3472 * that use void* generic pointers. It works with the latter
3473 * because both ANSI C and C++ allow castless assignment from
3474 * any pointer type to void*, and deal with argument conversions
3475 * as though doing an assignment.
3476 */
3477 return (void *) realloc( (char *) ptr, size );
3478}
3479
3480void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
3481{
3482 free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */
3483}
3484
3485#define YYTABLES_NAME "yytables"
3486
Ian Romanick2b45ba82010-10-05 17:03:25 -07003487#line 387 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003488
3489
3490
3491void
3492_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
3493{
3494 _mesa_glsl_lex_init_extra(state,& state->scanner);
3495 _mesa_glsl__scan_string(string,state->scanner);
3496}
3497
3498void
3499_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
3500{
3501 _mesa_glsl_lex_destroy(state->scanner);
3502}
3503