blob: 4f14c58bc526979113603b39a9dc748d56d8edf7 [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)
1752 || (yyextra->ARB_fragment_coord_conventions_enable)){
1753 return LAYOUT_TOK;
1754 } else {
1755 yylval->identifier = strdup(yytext);
1756 return IDENTIFIER;
1757 }
1758 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001759 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001760case 75:
1761YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001762#line 229 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001763return INC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001764 YY_BREAK
1765case 76:
1766YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001767#line 230 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001768return DEC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001769 YY_BREAK
1770case 77:
1771YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001772#line 231 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001773return LE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001774 YY_BREAK
1775case 78:
1776YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001777#line 232 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001778return GE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001779 YY_BREAK
1780case 79:
1781YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001782#line 233 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001783return EQ_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001784 YY_BREAK
1785case 80:
1786YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001787#line 234 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001788return NE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001789 YY_BREAK
1790case 81:
1791YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001792#line 235 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001793return AND_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001794 YY_BREAK
1795case 82:
1796YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001797#line 236 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001798return OR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001799 YY_BREAK
1800case 83:
1801YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001802#line 237 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001803return XOR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001804 YY_BREAK
1805case 84:
1806YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001807#line 239 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001808return MUL_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001809 YY_BREAK
1810case 85:
1811YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001812#line 240 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001813return DIV_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001814 YY_BREAK
1815case 86:
1816YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001817#line 241 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001818return ADD_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001819 YY_BREAK
1820case 87:
1821YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001822#line 242 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001823return MOD_ASSIGN;
Ian Romanickf50f0652010-06-30 17:30:03 -07001824 YY_BREAK
1825case 88:
1826YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001827#line 243 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001828return LEFT_ASSIGN;
1829 YY_BREAK
1830case 89:
1831YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001832#line 244 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001833return RIGHT_ASSIGN;
1834 YY_BREAK
1835case 90:
1836YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001837#line 245 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001838return AND_ASSIGN;
1839 YY_BREAK
1840case 91:
1841YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001842#line 246 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001843return XOR_ASSIGN;
1844 YY_BREAK
1845case 92:
1846YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001847#line 247 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001848return OR_ASSIGN;
1849 YY_BREAK
1850case 93:
1851YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001852#line 248 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001853return SUB_ASSIGN;
1854 YY_BREAK
1855case 94:
1856YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001857#line 250 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001858{
1859 yylval->n = strtol(yytext, NULL, 10);
1860 return INTCONSTANT;
1861 }
1862 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001863case 95:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001864YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001865#line 254 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001866{
1867 yylval->n = strtol(yytext + 2, NULL, 16);
1868 return INTCONSTANT;
1869 }
1870 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001871case 96:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001872YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001873#line 258 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001874{
1875 yylval->n = strtol(yytext, NULL, 8);
1876 return INTCONSTANT;
1877 }
1878 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001879case 97:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001880YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001881#line 263 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001882{
1883 yylval->real = strtod(yytext, NULL);
1884 return FLOATCONSTANT;
1885 }
1886 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001887case 98:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001888YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001889#line 267 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001890{
1891 yylval->real = strtod(yytext, NULL);
1892 return FLOATCONSTANT;
1893 }
1894 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001895case 99:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001896YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001897#line 271 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001898{
1899 yylval->real = strtod(yytext, NULL);
1900 return FLOATCONSTANT;
1901 }
1902 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001903case 100:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001904YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001905#line 275 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001906{
1907 yylval->real = strtod(yytext, NULL);
1908 return FLOATCONSTANT;
1909 }
1910 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001911case 101:
Ian Romanickf50f0652010-06-30 17:30:03 -07001912YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001913#line 279 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001914{
Eric Anholt47f3f222010-08-02 11:26:43 -07001915 yylval->real = strtod(yytext, NULL);
1916 return FLOATCONSTANT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001917 }
1918 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001919case 102:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001920YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001921#line 284 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001922{
Eric Anholt47f3f222010-08-02 11:26:43 -07001923 yylval->n = 1;
1924 return BOOLCONSTANT;
1925 }
1926 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001927case 103:
Eric Anholt47f3f222010-08-02 11:26:43 -07001928YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001929#line 288 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07001930{
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001931 yylval->n = 0;
1932 return BOOLCONSTANT;
1933 }
1934 YY_BREAK
1935/* Reserved words in GLSL 1.10. */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001936case 104:
1937YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001938#line 295 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001939RESERVED_WORD(999, ASM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001940 YY_BREAK
1941case 105:
1942YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001943#line 296 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001944RESERVED_WORD(999, CLASS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001945 YY_BREAK
1946case 106:
1947YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001948#line 297 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001949RESERVED_WORD(999, UNION);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001950 YY_BREAK
1951case 107:
1952YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001953#line 298 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001954RESERVED_WORD(999, ENUM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001955 YY_BREAK
1956case 108:
1957YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001958#line 299 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001959RESERVED_WORD(999, TYPEDEF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001960 YY_BREAK
1961case 109:
1962YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001963#line 300 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001964RESERVED_WORD(999, TEMPLATE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001965 YY_BREAK
1966case 110:
1967YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001968#line 301 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001969RESERVED_WORD(999, THIS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001970 YY_BREAK
1971case 111:
1972YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001973#line 302 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001974RESERVED_WORD(999, PACKED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001975 YY_BREAK
1976case 112:
1977YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001978#line 303 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001979RESERVED_WORD(999, GOTO);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001980 YY_BREAK
1981case 113:
1982YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001983#line 304 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001984RESERVED_WORD(130, SWITCH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001985 YY_BREAK
1986case 114:
1987YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001988#line 305 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001989RESERVED_WORD(130, DEFAULT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001990 YY_BREAK
1991case 115:
1992YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001993#line 306 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001994RESERVED_WORD(999, INLINE_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001995 YY_BREAK
1996case 116:
1997YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001998#line 307 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001999RESERVED_WORD(999, NOINLINE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002000 YY_BREAK
2001case 117:
2002YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002003#line 308 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002004RESERVED_WORD(999, VOLATILE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002005 YY_BREAK
2006case 118:
2007YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002008#line 309 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002009RESERVED_WORD(999, PUBLIC_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002010 YY_BREAK
2011case 119:
2012YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002013#line 310 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002014RESERVED_WORD(999, STATIC);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002015 YY_BREAK
2016case 120:
2017YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002018#line 311 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002019RESERVED_WORD(999, EXTERN);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002020 YY_BREAK
2021case 121:
2022YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002023#line 312 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002024RESERVED_WORD(999, EXTERNAL);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002025 YY_BREAK
2026case 122:
2027YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002028#line 313 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002029RESERVED_WORD(999, INTERFACE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002030 YY_BREAK
2031case 123:
2032YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002033#line 314 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002034RESERVED_WORD(999, LONG_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002035 YY_BREAK
2036case 124:
2037YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002038#line 315 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002039RESERVED_WORD(999, SHORT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002040 YY_BREAK
2041case 125:
2042YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002043#line 316 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002044RESERVED_WORD(999, DOUBLE_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002045 YY_BREAK
2046case 126:
2047YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002048#line 317 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002049RESERVED_WORD(999, HALF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002050 YY_BREAK
2051case 127:
2052YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002053#line 318 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002054RESERVED_WORD(999, FIXED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002055 YY_BREAK
2056case 128:
2057YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002058#line 319 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002059RESERVED_WORD(999, UNSIGNED);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002060 YY_BREAK
2061case 129:
2062YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002063#line 320 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002064RESERVED_WORD(999, INPUT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002065 YY_BREAK
2066case 130:
2067YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002068#line 321 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002069RESERVED_WORD(999, OUTPUT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002070 YY_BREAK
2071case 131:
2072YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002073#line 322 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002074RESERVED_WORD(999, HVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002075 YY_BREAK
2076case 132:
2077YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002078#line 323 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002079RESERVED_WORD(999, HVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002080 YY_BREAK
2081case 133:
2082YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002083#line 324 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002084RESERVED_WORD(999, HVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002085 YY_BREAK
2086case 134:
2087YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002088#line 325 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002089RESERVED_WORD(999, DVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002090 YY_BREAK
2091case 135:
2092YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002093#line 326 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002094RESERVED_WORD(999, DVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002095 YY_BREAK
2096case 136:
2097YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002098#line 327 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002099RESERVED_WORD(999, DVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002100 YY_BREAK
2101case 137:
2102YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002103#line 328 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002104RESERVED_WORD(999, FVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002105 YY_BREAK
2106case 138:
2107YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002108#line 329 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002109RESERVED_WORD(999, FVEC3);
Ian Romanickf50f0652010-06-30 17:30:03 -07002110 YY_BREAK
2111case 139:
2112YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002113#line 330 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002114RESERVED_WORD(999, FVEC4);
Eric Anholt47f3f222010-08-02 11:26:43 -07002115 YY_BREAK
2116case 140:
2117YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002118#line 331 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002119return SAMPLER2DRECT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002120 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002121case 141:
2122YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002123#line 332 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002124RESERVED_WORD(999, SAMPLER3DRECT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002125 YY_BREAK
2126case 142:
2127YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002128#line 333 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002129return SAMPLER2DRECTSHADOW;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002130 YY_BREAK
2131case 143:
2132YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002133#line 334 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002134RESERVED_WORD(999, SIZEOF);
Ian Romanickf50f0652010-06-30 17:30:03 -07002135 YY_BREAK
2136case 144:
2137YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002138#line 335 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002139RESERVED_WORD(999, CAST);
Eric Anholt47f3f222010-08-02 11:26:43 -07002140 YY_BREAK
2141case 145:
2142YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002143#line 336 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002144RESERVED_WORD(999, NAMESPACE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002145 YY_BREAK
2146case 146:
2147YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002148#line 337 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002149RESERVED_WORD(999, USING);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002150 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002151/* Additional reserved words in GLSL 1.20. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002152case 147:
2153YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002154#line 340 "glsl_lexer.lpp"
2155TOKEN_OR_IDENTIFIER_ES(120, LOWP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002156 YY_BREAK
2157case 148:
2158YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002159#line 341 "glsl_lexer.lpp"
2160TOKEN_OR_IDENTIFIER_ES(120, MEDIUMP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002161 YY_BREAK
2162case 149:
2163YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002164#line 342 "glsl_lexer.lpp"
2165TOKEN_OR_IDENTIFIER_ES(120, HIGHP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002166 YY_BREAK
2167case 150:
2168YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002169#line 343 "glsl_lexer.lpp"
2170TOKEN_OR_IDENTIFIER_ES(120, PRECISION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002171 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002172/* Additional reserved words in GLSL 1.30. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002173case 151:
2174YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002175#line 346 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002176TOKEN_OR_IDENTIFIER(130, COMMON);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002177 YY_BREAK
2178case 152:
2179YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002180#line 347 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002181TOKEN_OR_IDENTIFIER(130, PARTITION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002182 YY_BREAK
2183case 153:
2184YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002185#line 348 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002186TOKEN_OR_IDENTIFIER(130, ACTIVE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002187 YY_BREAK
2188case 154:
2189YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002190#line 349 "glsl_lexer.lpp"
2191TOKEN_OR_IDENTIFIER_ES(130, SUPERP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002192 YY_BREAK
2193case 155:
2194YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002195#line 350 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002196TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002197 YY_BREAK
2198case 156:
2199YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002200#line 351 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002201TOKEN_OR_IDENTIFIER(130, FILTER);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002202 YY_BREAK
2203case 157:
2204YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002205#line 352 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002206TOKEN_OR_IDENTIFIER(130, IMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002207 YY_BREAK
2208case 158:
2209YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002210#line 353 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002211TOKEN_OR_IDENTIFIER(130, IMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002212 YY_BREAK
2213case 159:
2214YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002215#line 354 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002216TOKEN_OR_IDENTIFIER(130, IMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002217 YY_BREAK
2218case 160:
2219YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002220#line 355 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002221TOKEN_OR_IDENTIFIER(130, IMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002222 YY_BREAK
2223case 161:
2224YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002225#line 356 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002226TOKEN_OR_IDENTIFIER(130, IIMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002227 YY_BREAK
2228case 162:
2229YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002230#line 357 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002231TOKEN_OR_IDENTIFIER(130, IIMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002232 YY_BREAK
2233case 163:
2234YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002235#line 358 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002236TOKEN_OR_IDENTIFIER(130, IIMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002237 YY_BREAK
2238case 164:
2239YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002240#line 359 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002241TOKEN_OR_IDENTIFIER(130, IIMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002242 YY_BREAK
2243case 165:
2244YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002245#line 360 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002246TOKEN_OR_IDENTIFIER(130, UIMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002247 YY_BREAK
2248case 166:
2249YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002250#line 361 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002251TOKEN_OR_IDENTIFIER(130, UIMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002252 YY_BREAK
2253case 167:
2254YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002255#line 362 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002256TOKEN_OR_IDENTIFIER(130, UIMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002257 YY_BREAK
2258case 168:
2259YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002260#line 363 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002261TOKEN_OR_IDENTIFIER(130, UIMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002262 YY_BREAK
2263case 169:
2264YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002265#line 364 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002266TOKEN_OR_IDENTIFIER(130, IMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002267 YY_BREAK
2268case 170:
2269YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002270#line 365 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002271TOKEN_OR_IDENTIFIER(130, IMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002272 YY_BREAK
2273case 171:
2274YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002275#line 366 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002276TOKEN_OR_IDENTIFIER(130, IIMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002277 YY_BREAK
2278case 172:
2279YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002280#line 367 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002281TOKEN_OR_IDENTIFIER(130, IIMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002282 YY_BREAK
2283case 173:
2284YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002285#line 368 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002286TOKEN_OR_IDENTIFIER(130, UIMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002287 YY_BREAK
2288case 174:
2289YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002290#line 369 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002291TOKEN_OR_IDENTIFIER(130, UIMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002292 YY_BREAK
2293case 175:
2294YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002295#line 370 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002296TOKEN_OR_IDENTIFIER(130, IMAGE1DSHADOW);
2297 YY_BREAK
2298case 176:
2299YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002300#line 371 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002301TOKEN_OR_IDENTIFIER(130, IMAGE2DSHADOW);
2302 YY_BREAK
2303case 177:
2304YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002305#line 372 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002306TOKEN_OR_IDENTIFIER(130, IMAGEBUFFER);
2307 YY_BREAK
2308case 178:
2309YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002310#line 373 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002311TOKEN_OR_IDENTIFIER(130, IIMAGEBUFFER);
2312 YY_BREAK
2313case 179:
2314YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002315#line 374 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002316TOKEN_OR_IDENTIFIER(130, UIMAGEBUFFER);
2317 YY_BREAK
2318case 180:
2319YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002320#line 375 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002321TOKEN_OR_IDENTIFIER(130, ROW_MAJOR);
2322 YY_BREAK
2323case 181:
2324YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002325#line 377 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002326{
2327 struct _mesa_glsl_parse_state *state = yyextra;
2328 void *ctx = state;
2329 yylval->identifier = talloc_strdup(ctx, yytext);
2330 return IDENTIFIER;
2331 }
2332 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002333case 182:
Ian Romanickf50f0652010-06-30 17:30:03 -07002334YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002335#line 384 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07002336{ return yytext[0]; }
2337 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002338case 183:
Eric Anholt47f3f222010-08-02 11:26:43 -07002339YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002340#line 386 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002341ECHO;
2342 YY_BREAK
Ian Romanick5ed66102010-10-05 16:40:00 -07002343#line 2344 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002344case YY_STATE_EOF(INITIAL):
2345case YY_STATE_EOF(PP):
Ian Romanick33fe3642010-08-30 11:59:48 -07002346case YY_STATE_EOF(PRAGMA):
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002347 yyterminate();
2348
2349 case YY_END_OF_BUFFER:
2350 {
2351 /* Amount of text matched not including the EOB char. */
2352 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2353
2354 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2355 *yy_cp = yyg->yy_hold_char;
2356 YY_RESTORE_YY_MORE_OFFSET
2357
2358 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2359 {
2360 /* We're scanning a new file or input source. It's
2361 * possible that this happened because the user
2362 * just pointed yyin at a new source and called
2363 * _mesa_glsl_lex(). If so, then we have to assure
2364 * consistency between YY_CURRENT_BUFFER and our
2365 * globals. Here is the right place to do so, because
2366 * this is the first action (other than possibly a
2367 * back-up) that will match for the new input source.
2368 */
2369 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2370 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2371 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2372 }
2373
2374 /* Note that here we test for yy_c_buf_p "<=" to the position
2375 * of the first EOB in the buffer, since yy_c_buf_p will
2376 * already have been incremented past the NUL character
2377 * (since all states make transitions on EOB to the
2378 * end-of-buffer state). Contrast this with the test
2379 * in input().
2380 */
2381 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2382 { /* This was really a NUL. */
2383 yy_state_type yy_next_state;
2384
2385 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2386
2387 yy_current_state = yy_get_previous_state( yyscanner );
2388
2389 /* Okay, we're now positioned to make the NUL
2390 * transition. We couldn't have
2391 * yy_get_previous_state() go ahead and do it
2392 * for us because it doesn't know how to deal
2393 * with the possibility of jamming (and we don't
2394 * want to build jamming into it because then it
2395 * will run more slowly).
2396 */
2397
2398 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2399
2400 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2401
2402 if ( yy_next_state )
2403 {
2404 /* Consume the NUL. */
2405 yy_cp = ++yyg->yy_c_buf_p;
2406 yy_current_state = yy_next_state;
2407 goto yy_match;
2408 }
2409
2410 else
2411 {
2412 yy_cp = yyg->yy_last_accepting_cpos;
2413 yy_current_state = yyg->yy_last_accepting_state;
2414 goto yy_find_action;
2415 }
2416 }
2417
2418 else switch ( yy_get_next_buffer( yyscanner ) )
2419 {
2420 case EOB_ACT_END_OF_FILE:
2421 {
2422 yyg->yy_did_buffer_switch_on_eof = 0;
2423
2424 if ( _mesa_glsl_wrap(yyscanner ) )
2425 {
2426 /* Note: because we've taken care in
2427 * yy_get_next_buffer() to have set up
2428 * yytext, we can now set up
2429 * yy_c_buf_p so that if some total
2430 * hoser (like flex itself) wants to
2431 * call the scanner after we return the
2432 * YY_NULL, it'll still work - another
2433 * YY_NULL will get returned.
2434 */
2435 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2436
2437 yy_act = YY_STATE_EOF(YY_START);
2438 goto do_action;
2439 }
2440
2441 else
2442 {
2443 if ( ! yyg->yy_did_buffer_switch_on_eof )
2444 YY_NEW_FILE;
2445 }
2446 break;
2447 }
2448
2449 case EOB_ACT_CONTINUE_SCAN:
2450 yyg->yy_c_buf_p =
2451 yyg->yytext_ptr + yy_amount_of_matched_text;
2452
2453 yy_current_state = yy_get_previous_state( yyscanner );
2454
2455 yy_cp = yyg->yy_c_buf_p;
2456 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2457 goto yy_match;
2458
2459 case EOB_ACT_LAST_MATCH:
2460 yyg->yy_c_buf_p =
2461 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2462
2463 yy_current_state = yy_get_previous_state( yyscanner );
2464
2465 yy_cp = yyg->yy_c_buf_p;
2466 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2467 goto yy_find_action;
2468 }
2469 break;
2470 }
2471
2472 default:
2473 YY_FATAL_ERROR(
2474 "fatal flex scanner internal error--no action found" );
2475 } /* end of action switch */
2476 } /* end of scanning one token */
2477} /* end of _mesa_glsl_lex */
2478
2479/* yy_get_next_buffer - try to read in a new buffer
2480 *
2481 * Returns a code representing an action:
2482 * EOB_ACT_LAST_MATCH -
2483 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2484 * EOB_ACT_END_OF_FILE - end of file
2485 */
2486static int yy_get_next_buffer (yyscan_t yyscanner)
2487{
2488 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2489 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2490 register char *source = yyg->yytext_ptr;
2491 register int number_to_move, i;
2492 int ret_val;
2493
2494 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2495 YY_FATAL_ERROR(
2496 "fatal flex scanner internal error--end of buffer missed" );
2497
2498 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2499 { /* Don't try to fill the buffer, so this is an EOF. */
2500 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2501 {
2502 /* We matched a single character, the EOB, so
2503 * treat this as a final EOF.
2504 */
2505 return EOB_ACT_END_OF_FILE;
2506 }
2507
2508 else
2509 {
2510 /* We matched some text prior to the EOB, first
2511 * process it.
2512 */
2513 return EOB_ACT_LAST_MATCH;
2514 }
2515 }
2516
2517 /* Try to read more data. */
2518
2519 /* First move last chars to start of buffer. */
2520 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2521
2522 for ( i = 0; i < number_to_move; ++i )
2523 *(dest++) = *(source++);
2524
2525 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2526 /* don't do the read, it's not guaranteed to return an EOF,
2527 * just force an EOF
2528 */
2529 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2530
2531 else
2532 {
2533 int num_to_read =
2534 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2535
2536 while ( num_to_read <= 0 )
2537 { /* Not enough room in the buffer - grow it. */
2538
2539 /* just a shorter name for the current buffer */
2540 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2541
2542 int yy_c_buf_p_offset =
2543 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2544
2545 if ( b->yy_is_our_buffer )
2546 {
2547 int new_size = b->yy_buf_size * 2;
2548
2549 if ( new_size <= 0 )
2550 b->yy_buf_size += b->yy_buf_size / 8;
2551 else
2552 b->yy_buf_size *= 2;
2553
2554 b->yy_ch_buf = (char *)
2555 /* Include room in for 2 EOB chars. */
2556 _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2557 }
2558 else
2559 /* Can't grow it, we don't own it. */
2560 b->yy_ch_buf = 0;
2561
2562 if ( ! b->yy_ch_buf )
2563 YY_FATAL_ERROR(
2564 "fatal error - scanner input buffer overflow" );
2565
2566 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2567
2568 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2569 number_to_move - 1;
2570
2571 }
2572
2573 if ( num_to_read > YY_READ_BUF_SIZE )
2574 num_to_read = YY_READ_BUF_SIZE;
2575
2576 /* Read in more data. */
2577 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2578 yyg->yy_n_chars, (size_t) num_to_read );
2579
2580 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2581 }
2582
2583 if ( yyg->yy_n_chars == 0 )
2584 {
2585 if ( number_to_move == YY_MORE_ADJ )
2586 {
2587 ret_val = EOB_ACT_END_OF_FILE;
2588 _mesa_glsl_restart(yyin ,yyscanner);
2589 }
2590
2591 else
2592 {
2593 ret_val = EOB_ACT_LAST_MATCH;
2594 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2595 YY_BUFFER_EOF_PENDING;
2596 }
2597 }
2598
2599 else
2600 ret_val = EOB_ACT_CONTINUE_SCAN;
2601
2602 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2603 /* Extend the array by 50%, plus the number we really need. */
2604 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2605 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2606 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2607 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2608 }
2609
2610 yyg->yy_n_chars += number_to_move;
2611 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2612 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2613
2614 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2615
2616 return ret_val;
2617}
2618
2619/* yy_get_previous_state - get the state just before the EOB char was reached */
2620
2621 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2622{
2623 register yy_state_type yy_current_state;
2624 register char *yy_cp;
2625 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2626
2627 yy_current_state = yyg->yy_start;
2628 yy_current_state += YY_AT_BOL();
2629
2630 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2631 {
2632 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2633 if ( yy_accept[yy_current_state] )
2634 {
2635 yyg->yy_last_accepting_state = yy_current_state;
2636 yyg->yy_last_accepting_cpos = yy_cp;
2637 }
2638 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2639 {
2640 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07002641 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002642 yy_c = yy_meta[(unsigned int) yy_c];
2643 }
2644 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2645 }
2646
2647 return yy_current_state;
2648}
2649
2650/* yy_try_NUL_trans - try to make a transition on the NUL character
2651 *
2652 * synopsis
2653 * next_state = yy_try_NUL_trans( current_state );
2654 */
2655 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2656{
2657 register int yy_is_jam;
2658 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2659 register char *yy_cp = yyg->yy_c_buf_p;
2660
2661 register YY_CHAR yy_c = 1;
2662 if ( yy_accept[yy_current_state] )
2663 {
2664 yyg->yy_last_accepting_state = yy_current_state;
2665 yyg->yy_last_accepting_cpos = yy_cp;
2666 }
2667 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2668 {
2669 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07002670 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002671 yy_c = yy_meta[(unsigned int) yy_c];
2672 }
2673 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Ian Romanick33fe3642010-08-30 11:59:48 -07002674 yy_is_jam = (yy_current_state == 707);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002675
2676 return yy_is_jam ? 0 : yy_current_state;
2677}
2678
2679#ifndef YY_NO_INPUT
2680#ifdef __cplusplus
2681 static int yyinput (yyscan_t yyscanner)
2682#else
2683 static int input (yyscan_t yyscanner)
2684#endif
2685
2686{
2687 int c;
2688 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2689
2690 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2691
2692 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2693 {
2694 /* yy_c_buf_p now points to the character we want to return.
2695 * If this occurs *before* the EOB characters, then it's a
2696 * valid NUL; if not, then we've hit the end of the buffer.
2697 */
2698 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2699 /* This was really a NUL. */
2700 *yyg->yy_c_buf_p = '\0';
2701
2702 else
2703 { /* need more input */
2704 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2705 ++yyg->yy_c_buf_p;
2706
2707 switch ( yy_get_next_buffer( yyscanner ) )
2708 {
2709 case EOB_ACT_LAST_MATCH:
2710 /* This happens because yy_g_n_b()
2711 * sees that we've accumulated a
2712 * token and flags that we need to
2713 * try matching the token before
2714 * proceeding. But for input(),
2715 * there's no matching to consider.
2716 * So convert the EOB_ACT_LAST_MATCH
2717 * to EOB_ACT_END_OF_FILE.
2718 */
2719
2720 /* Reset buffer status. */
2721 _mesa_glsl_restart(yyin ,yyscanner);
2722
2723 /*FALLTHROUGH*/
2724
2725 case EOB_ACT_END_OF_FILE:
2726 {
2727 if ( _mesa_glsl_wrap(yyscanner ) )
2728 return EOF;
2729
2730 if ( ! yyg->yy_did_buffer_switch_on_eof )
2731 YY_NEW_FILE;
2732#ifdef __cplusplus
2733 return yyinput(yyscanner);
2734#else
2735 return input(yyscanner);
2736#endif
2737 }
2738
2739 case EOB_ACT_CONTINUE_SCAN:
2740 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2741 break;
2742 }
2743 }
2744 }
2745
2746 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2747 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2748 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2749
2750 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2751
2752 return c;
2753}
2754#endif /* ifndef YY_NO_INPUT */
2755
2756/** Immediately switch to a different input stream.
2757 * @param input_file A readable stream.
2758 * @param yyscanner The scanner object.
2759 * @note This function does not reset the start condition to @c INITIAL .
2760 */
2761 void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner)
2762{
2763 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2764
2765 if ( ! YY_CURRENT_BUFFER ){
2766 _mesa_glsl_ensure_buffer_stack (yyscanner);
2767 YY_CURRENT_BUFFER_LVALUE =
2768 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2769 }
2770
2771 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2772 _mesa_glsl__load_buffer_state(yyscanner );
2773}
2774
2775/** Switch to a different input buffer.
2776 * @param new_buffer The new input buffer.
2777 * @param yyscanner The scanner object.
2778 */
2779 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2780{
2781 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2782
2783 /* TODO. We should be able to replace this entire function body
2784 * with
2785 * _mesa_glsl_pop_buffer_state();
2786 * _mesa_glsl_push_buffer_state(new_buffer);
2787 */
2788 _mesa_glsl_ensure_buffer_stack (yyscanner);
2789 if ( YY_CURRENT_BUFFER == new_buffer )
2790 return;
2791
2792 if ( YY_CURRENT_BUFFER )
2793 {
2794 /* Flush out information for old buffer. */
2795 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2796 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2797 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2798 }
2799
2800 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2801 _mesa_glsl__load_buffer_state(yyscanner );
2802
2803 /* We don't actually know whether we did this switch during
2804 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2805 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2806 * to go ahead and always set it.
2807 */
2808 yyg->yy_did_buffer_switch_on_eof = 1;
2809}
2810
2811static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner)
2812{
2813 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2814 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2815 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2816 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2817 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2818}
2819
2820/** Allocate and initialize an input buffer state.
2821 * @param file A readable stream.
2822 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2823 * @param yyscanner The scanner object.
2824 * @return the allocated buffer state.
2825 */
2826 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner)
2827{
2828 YY_BUFFER_STATE b;
2829
2830 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2831 if ( ! b )
2832 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2833
2834 b->yy_buf_size = size;
2835
2836 /* yy_ch_buf has to be 2 characters longer than the size given because
2837 * we need to put in 2 end-of-buffer characters.
2838 */
2839 b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner );
2840 if ( ! b->yy_ch_buf )
2841 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2842
2843 b->yy_is_our_buffer = 1;
2844
2845 _mesa_glsl__init_buffer(b,file ,yyscanner);
2846
2847 return b;
2848}
2849
2850/** Destroy the buffer.
2851 * @param b a buffer created with _mesa_glsl__create_buffer()
2852 * @param yyscanner The scanner object.
2853 */
2854 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2855{
2856 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2857
2858 if ( ! b )
2859 return;
2860
2861 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2862 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2863
2864 if ( b->yy_is_our_buffer )
2865 _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner );
2866
2867 _mesa_glsl_free((void *) b ,yyscanner );
2868}
2869
2870/* Initializes or reinitializes a buffer.
2871 * This function is sometimes called more than once on the same buffer,
2872 * such as during a _mesa_glsl_restart() or at EOF.
2873 */
2874 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2875
2876{
2877 int oerrno = errno;
2878 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2879
2880 _mesa_glsl__flush_buffer(b ,yyscanner);
2881
2882 b->yy_input_file = file;
2883 b->yy_fill_buffer = 1;
2884
2885 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
2886 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
2887 * In that case, we don't want to reset the lineno or column.
2888 */
2889 if (b != YY_CURRENT_BUFFER){
2890 b->yy_bs_lineno = 1;
2891 b->yy_bs_column = 0;
2892 }
2893
2894 b->yy_is_interactive = 0;
2895
2896 errno = oerrno;
2897}
2898
2899/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2900 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2901 * @param yyscanner The scanner object.
2902 */
2903 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2904{
2905 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2906 if ( ! b )
2907 return;
2908
2909 b->yy_n_chars = 0;
2910
2911 /* We always need two end-of-buffer characters. The first causes
2912 * a transition to the end-of-buffer state. The second causes
2913 * a jam in that state.
2914 */
2915 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2916 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2917
2918 b->yy_buf_pos = &b->yy_ch_buf[0];
2919
2920 b->yy_at_bol = 1;
2921 b->yy_buffer_status = YY_BUFFER_NEW;
2922
2923 if ( b == YY_CURRENT_BUFFER )
2924 _mesa_glsl__load_buffer_state(yyscanner );
2925}
2926
2927/** Pushes the new state onto the stack. The new state becomes
2928 * the current state. This function will allocate the stack
2929 * if necessary.
2930 * @param new_buffer The new state.
2931 * @param yyscanner The scanner object.
2932 */
2933void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2934{
2935 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2936 if (new_buffer == NULL)
2937 return;
2938
2939 _mesa_glsl_ensure_buffer_stack(yyscanner);
2940
2941 /* This block is copied from _mesa_glsl__switch_to_buffer. */
2942 if ( YY_CURRENT_BUFFER )
2943 {
2944 /* Flush out information for old buffer. */
2945 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2946 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2947 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2948 }
2949
2950 /* Only push if top exists. Otherwise, replace top. */
2951 if (YY_CURRENT_BUFFER)
2952 yyg->yy_buffer_stack_top++;
2953 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2954
2955 /* copied from _mesa_glsl__switch_to_buffer. */
2956 _mesa_glsl__load_buffer_state(yyscanner );
2957 yyg->yy_did_buffer_switch_on_eof = 1;
2958}
2959
2960/** Removes and deletes the top of the stack, if present.
2961 * The next element becomes the new top.
2962 * @param yyscanner The scanner object.
2963 */
2964void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner)
2965{
2966 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2967 if (!YY_CURRENT_BUFFER)
2968 return;
2969
2970 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2971 YY_CURRENT_BUFFER_LVALUE = NULL;
2972 if (yyg->yy_buffer_stack_top > 0)
2973 --yyg->yy_buffer_stack_top;
2974
2975 if (YY_CURRENT_BUFFER) {
2976 _mesa_glsl__load_buffer_state(yyscanner );
2977 yyg->yy_did_buffer_switch_on_eof = 1;
2978 }
2979}
2980
2981/* Allocates the stack if it does not exist.
2982 * Guarantees space for at least one push.
2983 */
2984static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner)
2985{
2986 int num_to_alloc;
2987 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2988
2989 if (!yyg->yy_buffer_stack) {
2990
2991 /* First allocation is just for 2 elements, since we don't know if this
2992 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2993 * immediate realloc on the next call.
2994 */
2995 num_to_alloc = 1;
2996 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc
2997 (num_to_alloc * sizeof(struct yy_buffer_state*)
2998 , yyscanner);
2999 if ( ! yyg->yy_buffer_stack )
3000 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3001
3002 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3003
3004 yyg->yy_buffer_stack_max = num_to_alloc;
3005 yyg->yy_buffer_stack_top = 0;
3006 return;
3007 }
3008
3009 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3010
3011 /* Increase the buffer to prepare for a possible push. */
3012 int grow_size = 8 /* arbitrary grow size */;
3013
3014 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3015 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc
3016 (yyg->yy_buffer_stack,
3017 num_to_alloc * sizeof(struct yy_buffer_state*)
3018 , yyscanner);
3019 if ( ! yyg->yy_buffer_stack )
3020 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3021
3022 /* zero only the new slots.*/
3023 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3024 yyg->yy_buffer_stack_max = num_to_alloc;
3025 }
3026}
3027
3028/** Setup the input buffer state to scan directly from a user-specified character buffer.
3029 * @param base the character buffer
3030 * @param size the size in bytes of the character buffer
3031 * @param yyscanner The scanner object.
3032 * @return the newly allocated buffer state object.
3033 */
3034YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3035{
3036 YY_BUFFER_STATE b;
3037
3038 if ( size < 2 ||
3039 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3040 base[size-1] != YY_END_OF_BUFFER_CHAR )
3041 /* They forgot to leave room for the EOB's. */
3042 return 0;
3043
3044 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3045 if ( ! b )
3046 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3047
3048 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3049 b->yy_buf_pos = b->yy_ch_buf = base;
3050 b->yy_is_our_buffer = 0;
3051 b->yy_input_file = 0;
3052 b->yy_n_chars = b->yy_buf_size;
3053 b->yy_is_interactive = 0;
3054 b->yy_at_bol = 1;
3055 b->yy_fill_buffer = 0;
3056 b->yy_buffer_status = YY_BUFFER_NEW;
3057
3058 _mesa_glsl__switch_to_buffer(b ,yyscanner );
3059
3060 return b;
3061}
3062
3063/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3064 * scan from a @e copy of @a str.
3065 * @param yystr a NUL-terminated string to scan
3066 * @param yyscanner The scanner object.
3067 * @return the newly allocated buffer state object.
3068 * @note If you want to scan bytes that may contain NUL values, then use
3069 * _mesa_glsl__scan_bytes() instead.
3070 */
3071YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner)
3072{
3073
3074 return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner);
3075}
3076
3077/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3078 * scan from a @e copy of @a bytes.
Ian Romanick5ed66102010-10-05 16:40:00 -07003079 * @param yybytes the byte buffer to scan
3080 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003081 * @param yyscanner The scanner object.
3082 * @return the newly allocated buffer state object.
3083 */
3084YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3085{
3086 YY_BUFFER_STATE b;
3087 char *buf;
3088 yy_size_t n;
3089 int i;
3090
3091 /* Get memory for full buffer, including space for trailing EOB's. */
3092 n = _yybytes_len + 2;
3093 buf = (char *) _mesa_glsl_alloc(n ,yyscanner );
3094 if ( ! buf )
3095 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3096
3097 for ( i = 0; i < _yybytes_len; ++i )
3098 buf[i] = yybytes[i];
3099
3100 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3101
3102 b = _mesa_glsl__scan_buffer(buf,n ,yyscanner);
3103 if ( ! b )
3104 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3105
3106 /* It's okay to grow etc. this buffer, and we should throw it
3107 * away when we're done.
3108 */
3109 b->yy_is_our_buffer = 1;
3110
3111 return b;
3112}
3113
3114#ifndef YY_EXIT_FAILURE
3115#define YY_EXIT_FAILURE 2
3116#endif
3117
3118static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3119{
3120 (void) fprintf( stderr, "%s\n", msg );
3121 exit( YY_EXIT_FAILURE );
3122}
3123
3124/* Redefine yyless() so it works in section 3 code. */
3125
3126#undef yyless
3127#define yyless(n) \
3128 do \
3129 { \
3130 /* Undo effects of setting up yytext. */ \
3131 int yyless_macro_arg = (n); \
3132 YY_LESS_LINENO(yyless_macro_arg);\
3133 yytext[yyleng] = yyg->yy_hold_char; \
3134 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3135 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3136 *yyg->yy_c_buf_p = '\0'; \
3137 yyleng = yyless_macro_arg; \
3138 } \
3139 while ( 0 )
3140
3141/* Accessor methods (get/set functions) to struct members. */
3142
3143/** Get the user-defined data for this scanner.
3144 * @param yyscanner The scanner object.
3145 */
3146YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner)
3147{
3148 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3149 return yyextra;
3150}
3151
3152/** Get the current line number.
3153 * @param yyscanner The scanner object.
3154 */
3155int _mesa_glsl_get_lineno (yyscan_t yyscanner)
3156{
3157 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3158
3159 if (! YY_CURRENT_BUFFER)
3160 return 0;
3161
3162 return yylineno;
3163}
3164
3165/** Get the current column number.
3166 * @param yyscanner The scanner object.
3167 */
3168int _mesa_glsl_get_column (yyscan_t yyscanner)
3169{
3170 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3171
3172 if (! YY_CURRENT_BUFFER)
3173 return 0;
3174
3175 return yycolumn;
3176}
3177
3178/** Get the input stream.
3179 * @param yyscanner The scanner object.
3180 */
3181FILE *_mesa_glsl_get_in (yyscan_t yyscanner)
3182{
3183 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3184 return yyin;
3185}
3186
3187/** Get the output stream.
3188 * @param yyscanner The scanner object.
3189 */
3190FILE *_mesa_glsl_get_out (yyscan_t yyscanner)
3191{
3192 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3193 return yyout;
3194}
3195
3196/** Get the length of the current token.
3197 * @param yyscanner The scanner object.
3198 */
3199int _mesa_glsl_get_leng (yyscan_t yyscanner)
3200{
3201 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3202 return yyleng;
3203}
3204
3205/** Get the current token.
3206 * @param yyscanner The scanner object.
3207 */
3208
3209char *_mesa_glsl_get_text (yyscan_t yyscanner)
3210{
3211 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3212 return yytext;
3213}
3214
3215/** Set the user-defined data. This data is never touched by the scanner.
3216 * @param user_defined The data to be associated with this scanner.
3217 * @param yyscanner The scanner object.
3218 */
3219void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3220{
3221 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3222 yyextra = user_defined ;
3223}
3224
3225/** Set the current line number.
3226 * @param line_number
3227 * @param yyscanner The scanner object.
3228 */
3229void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner)
3230{
3231 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3232
3233 /* lineno is only valid if an input buffer exists. */
3234 if (! YY_CURRENT_BUFFER )
3235 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner);
3236
3237 yylineno = line_number;
3238}
3239
3240/** Set the current column.
3241 * @param line_number
3242 * @param yyscanner The scanner object.
3243 */
3244void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner)
3245{
3246 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3247
3248 /* column is only valid if an input buffer exists. */
3249 if (! YY_CURRENT_BUFFER )
3250 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner);
3251
3252 yycolumn = column_no;
3253}
3254
3255/** Set the input stream. This does not discard the current
3256 * input buffer.
3257 * @param in_str A readable stream.
3258 * @param yyscanner The scanner object.
3259 * @see _mesa_glsl__switch_to_buffer
3260 */
3261void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner)
3262{
3263 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3264 yyin = in_str ;
3265}
3266
3267void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner)
3268{
3269 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3270 yyout = out_str ;
3271}
3272
3273int _mesa_glsl_get_debug (yyscan_t yyscanner)
3274{
3275 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3276 return yy_flex_debug;
3277}
3278
3279void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner)
3280{
3281 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3282 yy_flex_debug = bdebug ;
3283}
3284
3285/* Accessor methods for yylval and yylloc */
3286
3287YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner)
3288{
3289 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3290 return yylval;
3291}
3292
3293void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3294{
3295 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3296 yylval = yylval_param;
3297}
3298
3299YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner)
3300{
3301 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3302 return yylloc;
3303}
3304
3305void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3306{
3307 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3308 yylloc = yylloc_param;
3309}
3310
3311/* User-visible API */
3312
3313/* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3314 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3315 * That's why we explicitly handle the declaration, instead of using our macros.
3316 */
3317
3318int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals)
3319
3320{
3321 if (ptr_yy_globals == NULL){
3322 errno = EINVAL;
3323 return 1;
3324 }
3325
3326 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL );
3327
3328 if (*ptr_yy_globals == NULL){
3329 errno = ENOMEM;
3330 return 1;
3331 }
3332
3333 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3334 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3335
3336 return yy_init_globals ( *ptr_yy_globals );
3337}
3338
3339/* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3340 * convention of taking the scanner as the last argument. Note however, that
3341 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3342 * is the reason, too, why this function also must handle its own declaration).
3343 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3344 * the yyextra field.
3345 */
3346
3347int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3348
3349{
3350 struct yyguts_t dummy_yyguts;
3351
3352 _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts);
3353
3354 if (ptr_yy_globals == NULL){
3355 errno = EINVAL;
3356 return 1;
3357 }
3358
3359 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3360
3361 if (*ptr_yy_globals == NULL){
3362 errno = ENOMEM;
3363 return 1;
3364 }
3365
3366 /* By setting to 0xAA, we expose bugs in
3367 yy_init_globals. Leave at 0x00 for releases. */
3368 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3369
3370 _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals);
3371
3372 return yy_init_globals ( *ptr_yy_globals );
3373}
3374
3375static int yy_init_globals (yyscan_t yyscanner)
3376{
3377 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3378 /* Initialization is the same as for the non-reentrant scanner.
3379 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3380 */
3381
3382 yyg->yy_buffer_stack = 0;
3383 yyg->yy_buffer_stack_top = 0;
3384 yyg->yy_buffer_stack_max = 0;
3385 yyg->yy_c_buf_p = (char *) 0;
3386 yyg->yy_init = 0;
3387 yyg->yy_start = 0;
3388
3389 yyg->yy_start_stack_ptr = 0;
3390 yyg->yy_start_stack_depth = 0;
3391 yyg->yy_start_stack = NULL;
3392
3393/* Defined in main.c */
3394#ifdef YY_STDINIT
3395 yyin = stdin;
3396 yyout = stdout;
3397#else
3398 yyin = (FILE *) 0;
3399 yyout = (FILE *) 0;
3400#endif
3401
3402 /* For future reference: Set errno on error, since we are called by
3403 * _mesa_glsl_lex_init()
3404 */
3405 return 0;
3406}
3407
3408/* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3409int _mesa_glsl_lex_destroy (yyscan_t yyscanner)
3410{
3411 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3412
3413 /* Pop the buffer stack, destroying each element. */
3414 while(YY_CURRENT_BUFFER){
3415 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3416 YY_CURRENT_BUFFER_LVALUE = NULL;
3417 _mesa_glsl_pop_buffer_state(yyscanner);
3418 }
3419
3420 /* Destroy the stack itself. */
3421 _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner);
3422 yyg->yy_buffer_stack = NULL;
3423
3424 /* Destroy the start condition stack. */
3425 _mesa_glsl_free(yyg->yy_start_stack ,yyscanner );
3426 yyg->yy_start_stack = NULL;
3427
3428 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3429 * _mesa_glsl_lex() is called, initialization will occur. */
3430 yy_init_globals( yyscanner);
3431
3432 /* Destroy the main struct (reentrant only). */
3433 _mesa_glsl_free ( yyscanner , yyscanner );
3434 yyscanner = NULL;
3435 return 0;
3436}
3437
3438/*
3439 * Internal utility routines.
3440 */
3441
3442#ifndef yytext_ptr
3443static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3444{
3445 register int i;
3446 for ( i = 0; i < n; ++i )
3447 s1[i] = s2[i];
3448}
3449#endif
3450
3451#ifdef YY_NEED_STRLEN
3452static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3453{
3454 register int n;
3455 for ( n = 0; s[n]; ++n )
3456 ;
3457
3458 return n;
3459}
3460#endif
3461
3462void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner)
3463{
3464 return (void *) malloc( size );
3465}
3466
3467void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3468{
3469 /* The cast to (char *) in the following accommodates both
3470 * implementations that use char* generic pointers, and those
3471 * that use void* generic pointers. It works with the latter
3472 * because both ANSI C and C++ allow castless assignment from
3473 * any pointer type to void*, and deal with argument conversions
3474 * as though doing an assignment.
3475 */
3476 return (void *) realloc( (char *) ptr, size );
3477}
3478
3479void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
3480{
3481 free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */
3482}
3483
3484#define YYTABLES_NAME "yytables"
3485
Kenneth Graunkec5e74872010-09-05 01:32:32 -07003486#line 386 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003487
3488
3489
3490void
3491_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
3492{
3493 _mesa_glsl_lex_init_extra(state,& state->scanner);
3494 _mesa_glsl__scan_string(string,state->scanner);
3495}
3496
3497void
3498_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
3499{
3500 _mesa_glsl_lex_destroy(state->scanner);
3501}
3502