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