blob: c93cc3a97903ec0a30d03ef20c9cfae248f1ae91 [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 Versace41c20792010-10-08 12:05:02 -0700361#define YY_NUM_RULES 187
362#define YY_END_OF_BUFFER 188
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 Versace41c20792010-10-08 12:05:02 -0700372 0, 0, 15, 15, 0, 0, 188, 186, 1, 20,
373 186, 186, 186, 186, 186, 186, 186, 186, 100, 98,
374 186, 186, 186, 185, 186, 185, 185, 185, 185, 185,
375 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
376 185, 185, 185, 185, 185, 186, 1, 186, 95, 187,
377 15, 19, 187, 18, 16, 17, 13, 12, 1, 84,
378 91, 85, 94, 88, 79, 90, 80, 97, 102, 89,
379 103, 100, 0, 0, 105, 0, 98, 0, 81, 83,
380 82, 0, 185, 87, 185, 185, 185, 185, 185, 185,
381 185, 185, 185, 185, 185, 185, 29, 185, 185, 185,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700382
Chad Versace41c20792010-10-08 12:05:02 -0700383 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
384 33, 185, 185, 60, 185, 185, 185, 185, 185, 185,
385 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
386 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
387 185, 185, 185, 185, 185, 185, 96, 86, 1, 0,
388 0, 2, 0, 0, 0, 0, 15, 14, 18, 17,
389 0, 102, 101, 0, 103, 0, 104, 99, 92, 93,
390 185, 108, 185, 185, 185, 185, 185, 185, 185, 185,
391 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
392 185, 185, 185, 32, 185, 185, 185, 185, 185, 185,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700393
Chad Versace41c20792010-10-08 12:05:02 -0700394 185, 185, 185, 185, 25, 185, 185, 185, 185, 185,
395 185, 185, 185, 185, 185, 61, 185, 185, 185, 185,
396 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
397 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
398 185, 185, 185, 185, 185, 0, 0, 0, 0, 14,
399 0, 102, 0, 101, 0, 103, 104, 185, 185, 23,
400 185, 185, 148, 185, 185, 185, 185, 185, 185, 185,
401 185, 185, 31, 111, 185, 185, 185, 185, 67, 185,
402 185, 116, 130, 185, 185, 185, 185, 185, 185, 185,
403 185, 185, 185, 185, 127, 151, 48, 49, 50, 185,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700404
Chad Versace41c20792010-10-08 12:05:02 -0700405 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
406 185, 185, 185, 185, 185, 185, 185, 185, 185, 114,
407 106, 185, 185, 26, 185, 185, 185, 185, 185, 185,
408 45, 46, 47, 77, 185, 185, 0, 0, 0, 0,
409 0, 101, 185, 185, 27, 36, 37, 38, 185, 109,
410 185, 22, 185, 185, 185, 185, 138, 139, 140, 185,
411 107, 185, 131, 24, 141, 142, 143, 153, 135, 136,
412 137, 185, 185, 185, 62, 133, 185, 185, 39, 40,
413 41, 185, 185, 185, 185, 185, 185, 185, 185, 185,
414 185, 185, 185, 185, 185, 185, 185, 128, 185, 185,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700415
Chad Versace41c20792010-10-08 12:05:02 -0700416 185, 185, 185, 185, 185, 185, 185, 185, 110, 185,
417 150, 42, 43, 44, 185, 185, 30, 0, 0, 0,
418 0, 157, 185, 185, 155, 185, 185, 185, 129, 124,
419 160, 185, 185, 185, 185, 185, 185, 119, 185, 185,
420 78, 51, 52, 53, 54, 55, 56, 57, 58, 59,
421 185, 185, 185, 185, 134, 115, 185, 185, 122, 35,
422 185, 185, 147, 68, 123, 76, 158, 117, 185, 185,
423 185, 185, 185, 185, 185, 0, 0, 0, 0, 185,
424 185, 185, 118, 34, 185, 185, 185, 185, 185, 185,
425 161, 162, 163, 185, 185, 185, 185, 152, 185, 185,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700426
Chad Versace41c20792010-10-08 12:05:02 -0700427 185, 185, 185, 185, 185, 185, 112, 185, 185, 185,
428 185, 185, 63, 185, 64, 185, 0, 0, 0, 0,
429 0, 185, 65, 28, 125, 165, 166, 167, 185, 185,
430 185, 185, 185, 185, 185, 185, 185, 185, 185, 120,
431 185, 185, 185, 185, 185, 185, 185, 185, 185, 113,
432 169, 170, 171, 185, 185, 132, 121, 0, 0, 6,
433 0, 0, 0, 11, 3, 21, 185, 185, 185, 185,
434 185, 185, 185, 185, 185, 164, 126, 66, 149, 185,
435 156, 154, 184, 70, 71, 72, 185, 185, 185, 185,
436 185, 185, 0, 0, 0, 0, 0, 0, 185, 185,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700437
Chad Versace41c20792010-10-08 12:05:02 -0700438 185, 168, 185, 185, 185, 185, 185, 185, 185, 185,
439 185, 185, 185, 185, 185, 185, 185, 172, 4, 0,
440 5, 0, 0, 0, 0, 0, 185, 185, 185, 185,
441 185, 185, 185, 181, 185, 185, 185, 185, 185, 185,
442 73, 185, 185, 185, 0, 0, 0, 185, 185, 182,
443 173, 185, 174, 185, 185, 185, 185, 185, 185, 185,
444 185, 185, 183, 0, 0, 175, 176, 179, 180, 69,
445 185, 144, 185, 145, 159, 177, 178, 0, 0, 185,
446 185, 185, 0, 0, 0, 74, 185, 75, 0, 0,
447 0, 185, 0, 0, 0, 185, 0, 0, 7, 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700448
Chad Versace41c20792010-10-08 12:05:02 -0700449 0, 185, 0, 8, 0, 0, 146, 0, 0, 0,
450 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
Ian Romanick2b45ba82010-10-05 17:03:25 -07001833#line 244 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001834return MUL_ASSIGN;
Ian Romanick33fe3642010-08-30 11:59:48 -07001835 YY_BREAK
1836case 89:
1837YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001838#line 245 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001839return DIV_ASSIGN;
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 Versace41c20792010-10-08 12:05:02 -07001844return ADD_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 Versace41c20792010-10-08 12:05:02 -07001849return MOD_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 Versace41c20792010-10-08 12:05:02 -07001854return LEFT_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 Versace41c20792010-10-08 12:05:02 -07001859return RIGHT_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"
1864return AND_ASSIGN;
1865 YY_BREAK
1866case 95:
1867YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001868#line 251 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001869return XOR_ASSIGN;
1870 YY_BREAK
1871case 96:
1872YY_RULE_SETUP
1873#line 252 "glsl_lexer.lpp"
1874return OR_ASSIGN;
1875 YY_BREAK
1876case 97:
1877YY_RULE_SETUP
1878#line 253 "glsl_lexer.lpp"
1879return SUB_ASSIGN;
1880 YY_BREAK
1881case 98:
1882YY_RULE_SETUP
1883#line 255 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001884{
1885 yylval->n = strtol(yytext, NULL, 10);
1886 return INTCONSTANT;
1887 }
1888 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001889case 99:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001890YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07001891#line 259 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001892{
1893 yylval->n = strtol(yytext + 2, NULL, 16);
1894 return INTCONSTANT;
1895 }
1896 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001897case 100:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001898YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07001899#line 263 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001900{
1901 yylval->n = strtol(yytext, NULL, 8);
1902 return INTCONSTANT;
1903 }
1904 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001905case 101:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001906YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001907#line 268 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001908{
1909 yylval->real = strtod(yytext, NULL);
1910 return FLOATCONSTANT;
1911 }
1912 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001913case 102:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001914YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001915#line 272 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001916{
1917 yylval->real = strtod(yytext, NULL);
1918 return FLOATCONSTANT;
1919 }
1920 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001921case 103:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001922YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001923#line 276 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001924{
1925 yylval->real = strtod(yytext, NULL);
1926 return FLOATCONSTANT;
1927 }
1928 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001929case 104:
Ian Romanickf50f0652010-06-30 17:30:03 -07001930YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001931#line 280 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001932{
Eric Anholt47f3f222010-08-02 11:26:43 -07001933 yylval->real = strtod(yytext, NULL);
1934 return FLOATCONSTANT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001935 }
1936 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001937case 105:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001938YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07001939#line 284 "glsl_lexer.lpp"
1940{
1941 yylval->real = strtod(yytext, NULL);
1942 return FLOATCONSTANT;
1943 }
1944 YY_BREAK
1945case 106:
1946YY_RULE_SETUP
1947#line 289 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001948{
Eric Anholt47f3f222010-08-02 11:26:43 -07001949 yylval->n = 1;
1950 return BOOLCONSTANT;
1951 }
1952 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07001953case 107:
Eric Anholt47f3f222010-08-02 11:26:43 -07001954YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07001955#line 293 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07001956{
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001957 yylval->n = 0;
1958 return BOOLCONSTANT;
1959 }
1960 YY_BREAK
1961/* Reserved words in GLSL 1.10. */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001962case 108:
1963YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001964#line 300 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001965RESERVED_WORD(999, ASM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001966 YY_BREAK
1967case 109:
1968YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001969#line 301 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001970RESERVED_WORD(999, CLASS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001971 YY_BREAK
1972case 110:
1973YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07001974#line 302 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07001975RESERVED_WORD(999, UNION);
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 Versace41c20792010-10-08 12:05:02 -07001980RESERVED_WORD(999, ENUM);
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 Versace41c20792010-10-08 12:05:02 -07001985RESERVED_WORD(999, TYPEDEF);
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 Versace41c20792010-10-08 12:05:02 -07001990RESERVED_WORD(999, TEMPLATE);
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 Versace41c20792010-10-08 12:05:02 -07001995RESERVED_WORD(999, THIS);
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 Versace41c20792010-10-08 12:05:02 -07002000RESERVED_WORD(999, PACKED_TOK);
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 Versace41c20792010-10-08 12:05:02 -07002005RESERVED_WORD(999, GOTO);
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 Versace41c20792010-10-08 12:05:02 -07002010RESERVED_WORD(130, SWITCH);
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 Versace41c20792010-10-08 12:05:02 -07002015RESERVED_WORD(130, DEFAULT);
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 Versace41c20792010-10-08 12:05:02 -07002020RESERVED_WORD(999, INLINE_TOK);
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 Versace41c20792010-10-08 12:05:02 -07002025RESERVED_WORD(999, NOINLINE);
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 Versace41c20792010-10-08 12:05:02 -07002030RESERVED_WORD(999, VOLATILE);
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 Versace41c20792010-10-08 12:05:02 -07002035RESERVED_WORD(999, PUBLIC_TOK);
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 Versace41c20792010-10-08 12:05:02 -07002040RESERVED_WORD(999, STATIC);
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 Versace41c20792010-10-08 12:05:02 -07002045RESERVED_WORD(999, EXTERN);
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 Versace41c20792010-10-08 12:05:02 -07002050RESERVED_WORD(999, EXTERNAL);
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 Versace41c20792010-10-08 12:05:02 -07002055RESERVED_WORD(999, INTERFACE);
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 Versace41c20792010-10-08 12:05:02 -07002060RESERVED_WORD(999, LONG_TOK);
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 Versace41c20792010-10-08 12:05:02 -07002065RESERVED_WORD(999, SHORT_TOK);
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 Versace41c20792010-10-08 12:05:02 -07002070RESERVED_WORD(999, DOUBLE_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 Versace41c20792010-10-08 12:05:02 -07002075RESERVED_WORD(999, HALF);
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 Versace41c20792010-10-08 12:05:02 -07002080RESERVED_WORD(999, FIXED_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 Versace41c20792010-10-08 12:05:02 -07002085RESERVED_WORD(999, UNSIGNED);
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 Versace41c20792010-10-08 12:05:02 -07002090RESERVED_WORD(999, INPUT_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 Versace41c20792010-10-08 12:05:02 -07002095RESERVED_WORD(999, OUTPUT);
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 Versace41c20792010-10-08 12:05:02 -07002100RESERVED_WORD(999, HVEC2);
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 Versace41c20792010-10-08 12:05:02 -07002105RESERVED_WORD(999, HVEC3);
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 Versace41c20792010-10-08 12:05:02 -07002110RESERVED_WORD(999, HVEC4);
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 Versace41c20792010-10-08 12:05:02 -07002115RESERVED_WORD(999, DVEC2);
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 Versace41c20792010-10-08 12:05:02 -07002120RESERVED_WORD(999, DVEC3);
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 Versace41c20792010-10-08 12:05:02 -07002125RESERVED_WORD(999, DVEC4);
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 Versace41c20792010-10-08 12:05:02 -07002130RESERVED_WORD(999, FVEC2);
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 Versace41c20792010-10-08 12:05:02 -07002135RESERVED_WORD(999, FVEC3);
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 Versace41c20792010-10-08 12:05:02 -07002140RESERVED_WORD(999, FVEC4);
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 Versace41c20792010-10-08 12:05:02 -07002145return SAMPLER2DRECT;
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 Versace41c20792010-10-08 12:05:02 -07002150RESERVED_WORD(999, SAMPLER3DRECT);
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 Versace41c20792010-10-08 12:05:02 -07002155return SAMPLER2DRECTSHADOW;
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"
2160RESERVED_WORD(999, SIZEOF);
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"
2165RESERVED_WORD(999, CAST);
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"
2170RESERVED_WORD(999, NAMESPACE);
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"
2175RESERVED_WORD(999, USING);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002176 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07002177/* Additional reserved words in GLSL 1.20. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002178case 151:
2179YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07002180#line 345 "glsl_lexer.lpp"
2181TOKEN_OR_IDENTIFIER_ES(120, LOWP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002182 YY_BREAK
2183case 152:
2184YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07002185#line 346 "glsl_lexer.lpp"
2186TOKEN_OR_IDENTIFIER_ES(120, MEDIUMP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002187 YY_BREAK
2188case 153:
2189YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07002190#line 347 "glsl_lexer.lpp"
2191TOKEN_OR_IDENTIFIER_ES(120, HIGHP);
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"
2196TOKEN_OR_IDENTIFIER_ES(120, PRECISION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002197 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07002198/* Additional reserved words in GLSL 1.30. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002199case 155:
2200YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002201#line 351 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07002202TOKEN_OR_IDENTIFIER(130, COMMON);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002203 YY_BREAK
2204case 156:
2205YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002206#line 352 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07002207TOKEN_OR_IDENTIFIER(130, PARTITION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002208 YY_BREAK
2209case 157:
2210YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002211#line 353 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07002212TOKEN_OR_IDENTIFIER(130, ACTIVE);
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 Versace41c20792010-10-08 12:05:02 -07002217TOKEN_OR_IDENTIFIER_ES(130, SUPERP);
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 Versace41c20792010-10-08 12:05:02 -07002222TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER);
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 Versace41c20792010-10-08 12:05:02 -07002227TOKEN_OR_IDENTIFIER(130, FILTER);
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 Versace41c20792010-10-08 12:05:02 -07002232TOKEN_OR_IDENTIFIER(130, IMAGE1D);
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 Versace41c20792010-10-08 12:05:02 -07002237TOKEN_OR_IDENTIFIER(130, IMAGE2D);
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 Versace41c20792010-10-08 12:05:02 -07002242TOKEN_OR_IDENTIFIER(130, IMAGE3D);
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 Versace41c20792010-10-08 12:05:02 -07002247TOKEN_OR_IDENTIFIER(130, IMAGECUBE);
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 Versace41c20792010-10-08 12:05:02 -07002252TOKEN_OR_IDENTIFIER(130, IIMAGE1D);
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 Versace41c20792010-10-08 12:05:02 -07002257TOKEN_OR_IDENTIFIER(130, IIMAGE2D);
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 Versace41c20792010-10-08 12:05:02 -07002262TOKEN_OR_IDENTIFIER(130, IIMAGE3D);
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 Versace41c20792010-10-08 12:05:02 -07002267TOKEN_OR_IDENTIFIER(130, IIMAGECUBE);
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 Versace41c20792010-10-08 12:05:02 -07002272TOKEN_OR_IDENTIFIER(130, UIMAGE1D);
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 Versace41c20792010-10-08 12:05:02 -07002277TOKEN_OR_IDENTIFIER(130, UIMAGE2D);
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 Versace41c20792010-10-08 12:05:02 -07002282TOKEN_OR_IDENTIFIER(130, UIMAGE3D);
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 Versace41c20792010-10-08 12:05:02 -07002287TOKEN_OR_IDENTIFIER(130, UIMAGECUBE);
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 Versace41c20792010-10-08 12:05:02 -07002292TOKEN_OR_IDENTIFIER(130, IMAGE1DARRAY);
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 Versace41c20792010-10-08 12:05:02 -07002297TOKEN_OR_IDENTIFIER(130, IMAGE2DARRAY);
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 Versace41c20792010-10-08 12:05:02 -07002302TOKEN_OR_IDENTIFIER(130, IIMAGE1DARRAY);
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 Versace41c20792010-10-08 12:05:02 -07002307TOKEN_OR_IDENTIFIER(130, IIMAGE2DARRAY);
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 Versace41c20792010-10-08 12:05:02 -07002312TOKEN_OR_IDENTIFIER(130, UIMAGE1DARRAY);
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 Versace41c20792010-10-08 12:05:02 -07002317TOKEN_OR_IDENTIFIER(130, UIMAGE2DARRAY);
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 Versace41c20792010-10-08 12:05:02 -07002322TOKEN_OR_IDENTIFIER(130, IMAGE1DSHADOW);
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 Versace41c20792010-10-08 12:05:02 -07002327TOKEN_OR_IDENTIFIER(130, IMAGE2DSHADOW);
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"
2332TOKEN_OR_IDENTIFIER(130, IMAGEBUFFER);
2333 YY_BREAK
2334case 182:
2335YY_RULE_SETUP
Ian Romanick2b45ba82010-10-05 17:03:25 -07002336#line 378 "glsl_lexer.lpp"
Chad Versace41c20792010-10-08 12:05:02 -07002337TOKEN_OR_IDENTIFIER(130, IIMAGEBUFFER);
2338 YY_BREAK
2339case 183:
2340YY_RULE_SETUP
2341#line 379 "glsl_lexer.lpp"
2342TOKEN_OR_IDENTIFIER(130, UIMAGEBUFFER);
2343 YY_BREAK
2344case 184:
2345YY_RULE_SETUP
2346#line 380 "glsl_lexer.lpp"
2347TOKEN_OR_IDENTIFIER(130, ROW_MAJOR);
2348 YY_BREAK
2349case 185:
2350YY_RULE_SETUP
2351#line 382 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002352{
2353 struct _mesa_glsl_parse_state *state = yyextra;
2354 void *ctx = state;
2355 yylval->identifier = talloc_strdup(ctx, yytext);
2356 return IDENTIFIER;
2357 }
2358 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07002359case 186:
Ian Romanickf50f0652010-06-30 17:30:03 -07002360YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07002361#line 389 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07002362{ return yytext[0]; }
2363 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07002364case 187:
Eric Anholt47f3f222010-08-02 11:26:43 -07002365YY_RULE_SETUP
Chad Versace41c20792010-10-08 12:05:02 -07002366#line 391 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002367ECHO;
2368 YY_BREAK
Chad Versace41c20792010-10-08 12:05:02 -07002369#line 2370 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002370case YY_STATE_EOF(INITIAL):
2371case YY_STATE_EOF(PP):
Ian Romanick33fe3642010-08-30 11:59:48 -07002372case YY_STATE_EOF(PRAGMA):
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002373 yyterminate();
2374
2375 case YY_END_OF_BUFFER:
2376 {
2377 /* Amount of text matched not including the EOB char. */
2378 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2379
2380 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2381 *yy_cp = yyg->yy_hold_char;
2382 YY_RESTORE_YY_MORE_OFFSET
2383
2384 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2385 {
2386 /* We're scanning a new file or input source. It's
2387 * possible that this happened because the user
2388 * just pointed yyin at a new source and called
2389 * _mesa_glsl_lex(). If so, then we have to assure
2390 * consistency between YY_CURRENT_BUFFER and our
2391 * globals. Here is the right place to do so, because
2392 * this is the first action (other than possibly a
2393 * back-up) that will match for the new input source.
2394 */
2395 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2396 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2397 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2398 }
2399
2400 /* Note that here we test for yy_c_buf_p "<=" to the position
2401 * of the first EOB in the buffer, since yy_c_buf_p will
2402 * already have been incremented past the NUL character
2403 * (since all states make transitions on EOB to the
2404 * end-of-buffer state). Contrast this with the test
2405 * in input().
2406 */
2407 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2408 { /* This was really a NUL. */
2409 yy_state_type yy_next_state;
2410
2411 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2412
2413 yy_current_state = yy_get_previous_state( yyscanner );
2414
2415 /* Okay, we're now positioned to make the NUL
2416 * transition. We couldn't have
2417 * yy_get_previous_state() go ahead and do it
2418 * for us because it doesn't know how to deal
2419 * with the possibility of jamming (and we don't
2420 * want to build jamming into it because then it
2421 * will run more slowly).
2422 */
2423
2424 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2425
2426 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2427
2428 if ( yy_next_state )
2429 {
2430 /* Consume the NUL. */
2431 yy_cp = ++yyg->yy_c_buf_p;
2432 yy_current_state = yy_next_state;
2433 goto yy_match;
2434 }
2435
2436 else
2437 {
2438 yy_cp = yyg->yy_last_accepting_cpos;
2439 yy_current_state = yyg->yy_last_accepting_state;
2440 goto yy_find_action;
2441 }
2442 }
2443
2444 else switch ( yy_get_next_buffer( yyscanner ) )
2445 {
2446 case EOB_ACT_END_OF_FILE:
2447 {
2448 yyg->yy_did_buffer_switch_on_eof = 0;
2449
2450 if ( _mesa_glsl_wrap(yyscanner ) )
2451 {
2452 /* Note: because we've taken care in
2453 * yy_get_next_buffer() to have set up
2454 * yytext, we can now set up
2455 * yy_c_buf_p so that if some total
2456 * hoser (like flex itself) wants to
2457 * call the scanner after we return the
2458 * YY_NULL, it'll still work - another
2459 * YY_NULL will get returned.
2460 */
2461 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2462
2463 yy_act = YY_STATE_EOF(YY_START);
2464 goto do_action;
2465 }
2466
2467 else
2468 {
2469 if ( ! yyg->yy_did_buffer_switch_on_eof )
2470 YY_NEW_FILE;
2471 }
2472 break;
2473 }
2474
2475 case EOB_ACT_CONTINUE_SCAN:
2476 yyg->yy_c_buf_p =
2477 yyg->yytext_ptr + yy_amount_of_matched_text;
2478
2479 yy_current_state = yy_get_previous_state( yyscanner );
2480
2481 yy_cp = yyg->yy_c_buf_p;
2482 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2483 goto yy_match;
2484
2485 case EOB_ACT_LAST_MATCH:
2486 yyg->yy_c_buf_p =
2487 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
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_find_action;
2494 }
2495 break;
2496 }
2497
2498 default:
2499 YY_FATAL_ERROR(
2500 "fatal flex scanner internal error--no action found" );
2501 } /* end of action switch */
2502 } /* end of scanning one token */
2503} /* end of _mesa_glsl_lex */
2504
2505/* yy_get_next_buffer - try to read in a new buffer
2506 *
2507 * Returns a code representing an action:
2508 * EOB_ACT_LAST_MATCH -
2509 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2510 * EOB_ACT_END_OF_FILE - end of file
2511 */
2512static int yy_get_next_buffer (yyscan_t yyscanner)
2513{
2514 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2515 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2516 register char *source = yyg->yytext_ptr;
2517 register int number_to_move, i;
2518 int ret_val;
2519
2520 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2521 YY_FATAL_ERROR(
2522 "fatal flex scanner internal error--end of buffer missed" );
2523
2524 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2525 { /* Don't try to fill the buffer, so this is an EOF. */
2526 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2527 {
2528 /* We matched a single character, the EOB, so
2529 * treat this as a final EOF.
2530 */
2531 return EOB_ACT_END_OF_FILE;
2532 }
2533
2534 else
2535 {
2536 /* We matched some text prior to the EOB, first
2537 * process it.
2538 */
2539 return EOB_ACT_LAST_MATCH;
2540 }
2541 }
2542
2543 /* Try to read more data. */
2544
2545 /* First move last chars to start of buffer. */
2546 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2547
2548 for ( i = 0; i < number_to_move; ++i )
2549 *(dest++) = *(source++);
2550
2551 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2552 /* don't do the read, it's not guaranteed to return an EOF,
2553 * just force an EOF
2554 */
2555 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2556
2557 else
2558 {
2559 int num_to_read =
2560 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2561
2562 while ( num_to_read <= 0 )
2563 { /* Not enough room in the buffer - grow it. */
2564
2565 /* just a shorter name for the current buffer */
2566 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2567
2568 int yy_c_buf_p_offset =
2569 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2570
2571 if ( b->yy_is_our_buffer )
2572 {
2573 int new_size = b->yy_buf_size * 2;
2574
2575 if ( new_size <= 0 )
2576 b->yy_buf_size += b->yy_buf_size / 8;
2577 else
2578 b->yy_buf_size *= 2;
2579
2580 b->yy_ch_buf = (char *)
2581 /* Include room in for 2 EOB chars. */
2582 _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2583 }
2584 else
2585 /* Can't grow it, we don't own it. */
2586 b->yy_ch_buf = 0;
2587
2588 if ( ! b->yy_ch_buf )
2589 YY_FATAL_ERROR(
2590 "fatal error - scanner input buffer overflow" );
2591
2592 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2593
2594 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2595 number_to_move - 1;
2596
2597 }
2598
2599 if ( num_to_read > YY_READ_BUF_SIZE )
2600 num_to_read = YY_READ_BUF_SIZE;
2601
2602 /* Read in more data. */
2603 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2604 yyg->yy_n_chars, (size_t) num_to_read );
2605
2606 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2607 }
2608
2609 if ( yyg->yy_n_chars == 0 )
2610 {
2611 if ( number_to_move == YY_MORE_ADJ )
2612 {
2613 ret_val = EOB_ACT_END_OF_FILE;
2614 _mesa_glsl_restart(yyin ,yyscanner);
2615 }
2616
2617 else
2618 {
2619 ret_val = EOB_ACT_LAST_MATCH;
2620 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2621 YY_BUFFER_EOF_PENDING;
2622 }
2623 }
2624
2625 else
2626 ret_val = EOB_ACT_CONTINUE_SCAN;
2627
2628 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2629 /* Extend the array by 50%, plus the number we really need. */
2630 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2631 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2632 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2633 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2634 }
2635
2636 yyg->yy_n_chars += number_to_move;
2637 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2638 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2639
2640 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2641
2642 return ret_val;
2643}
2644
2645/* yy_get_previous_state - get the state just before the EOB char was reached */
2646
2647 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2648{
2649 register yy_state_type yy_current_state;
2650 register char *yy_cp;
2651 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2652
2653 yy_current_state = yyg->yy_start;
2654 yy_current_state += YY_AT_BOL();
2655
2656 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2657 {
2658 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2659 if ( yy_accept[yy_current_state] )
2660 {
2661 yyg->yy_last_accepting_state = yy_current_state;
2662 yyg->yy_last_accepting_cpos = yy_cp;
2663 }
2664 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2665 {
2666 yy_current_state = (int) yy_def[yy_current_state];
Chad Versace41c20792010-10-08 12:05:02 -07002667 if ( yy_current_state >= 716 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002668 yy_c = yy_meta[(unsigned int) yy_c];
2669 }
2670 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2671 }
2672
2673 return yy_current_state;
2674}
2675
2676/* yy_try_NUL_trans - try to make a transition on the NUL character
2677 *
2678 * synopsis
2679 * next_state = yy_try_NUL_trans( current_state );
2680 */
2681 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2682{
2683 register int yy_is_jam;
2684 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2685 register char *yy_cp = yyg->yy_c_buf_p;
2686
2687 register YY_CHAR yy_c = 1;
2688 if ( yy_accept[yy_current_state] )
2689 {
2690 yyg->yy_last_accepting_state = yy_current_state;
2691 yyg->yy_last_accepting_cpos = yy_cp;
2692 }
2693 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2694 {
2695 yy_current_state = (int) yy_def[yy_current_state];
Chad Versace41c20792010-10-08 12:05:02 -07002696 if ( yy_current_state >= 716 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002697 yy_c = yy_meta[(unsigned int) yy_c];
2698 }
2699 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Chad Versace41c20792010-10-08 12:05:02 -07002700 yy_is_jam = (yy_current_state == 715);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002701
2702 return yy_is_jam ? 0 : yy_current_state;
2703}
2704
2705#ifndef YY_NO_INPUT
2706#ifdef __cplusplus
2707 static int yyinput (yyscan_t yyscanner)
2708#else
2709 static int input (yyscan_t yyscanner)
2710#endif
2711
2712{
2713 int c;
2714 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2715
2716 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2717
2718 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2719 {
2720 /* yy_c_buf_p now points to the character we want to return.
2721 * If this occurs *before* the EOB characters, then it's a
2722 * valid NUL; if not, then we've hit the end of the buffer.
2723 */
2724 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2725 /* This was really a NUL. */
2726 *yyg->yy_c_buf_p = '\0';
2727
2728 else
2729 { /* need more input */
2730 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2731 ++yyg->yy_c_buf_p;
2732
2733 switch ( yy_get_next_buffer( yyscanner ) )
2734 {
2735 case EOB_ACT_LAST_MATCH:
2736 /* This happens because yy_g_n_b()
2737 * sees that we've accumulated a
2738 * token and flags that we need to
2739 * try matching the token before
2740 * proceeding. But for input(),
2741 * there's no matching to consider.
2742 * So convert the EOB_ACT_LAST_MATCH
2743 * to EOB_ACT_END_OF_FILE.
2744 */
2745
2746 /* Reset buffer status. */
2747 _mesa_glsl_restart(yyin ,yyscanner);
2748
2749 /*FALLTHROUGH*/
2750
2751 case EOB_ACT_END_OF_FILE:
2752 {
2753 if ( _mesa_glsl_wrap(yyscanner ) )
2754 return EOF;
2755
2756 if ( ! yyg->yy_did_buffer_switch_on_eof )
2757 YY_NEW_FILE;
2758#ifdef __cplusplus
2759 return yyinput(yyscanner);
2760#else
2761 return input(yyscanner);
2762#endif
2763 }
2764
2765 case EOB_ACT_CONTINUE_SCAN:
2766 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2767 break;
2768 }
2769 }
2770 }
2771
2772 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2773 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2774 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2775
2776 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2777
2778 return c;
2779}
2780#endif /* ifndef YY_NO_INPUT */
2781
2782/** Immediately switch to a different input stream.
2783 * @param input_file A readable stream.
2784 * @param yyscanner The scanner object.
2785 * @note This function does not reset the start condition to @c INITIAL .
2786 */
2787 void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner)
2788{
2789 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2790
2791 if ( ! YY_CURRENT_BUFFER ){
2792 _mesa_glsl_ensure_buffer_stack (yyscanner);
2793 YY_CURRENT_BUFFER_LVALUE =
2794 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2795 }
2796
2797 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2798 _mesa_glsl__load_buffer_state(yyscanner );
2799}
2800
2801/** Switch to a different input buffer.
2802 * @param new_buffer The new input buffer.
2803 * @param yyscanner The scanner object.
2804 */
2805 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2806{
2807 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2808
2809 /* TODO. We should be able to replace this entire function body
2810 * with
2811 * _mesa_glsl_pop_buffer_state();
2812 * _mesa_glsl_push_buffer_state(new_buffer);
2813 */
2814 _mesa_glsl_ensure_buffer_stack (yyscanner);
2815 if ( YY_CURRENT_BUFFER == new_buffer )
2816 return;
2817
2818 if ( YY_CURRENT_BUFFER )
2819 {
2820 /* Flush out information for old buffer. */
2821 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2822 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2823 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2824 }
2825
2826 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2827 _mesa_glsl__load_buffer_state(yyscanner );
2828
2829 /* We don't actually know whether we did this switch during
2830 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2831 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2832 * to go ahead and always set it.
2833 */
2834 yyg->yy_did_buffer_switch_on_eof = 1;
2835}
2836
2837static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner)
2838{
2839 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2840 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2841 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2842 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2843 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2844}
2845
2846/** Allocate and initialize an input buffer state.
2847 * @param file A readable stream.
2848 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2849 * @param yyscanner The scanner object.
2850 * @return the allocated buffer state.
2851 */
2852 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner)
2853{
2854 YY_BUFFER_STATE b;
2855
2856 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2857 if ( ! b )
2858 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2859
2860 b->yy_buf_size = size;
2861
2862 /* yy_ch_buf has to be 2 characters longer than the size given because
2863 * we need to put in 2 end-of-buffer characters.
2864 */
2865 b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner );
2866 if ( ! b->yy_ch_buf )
2867 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2868
2869 b->yy_is_our_buffer = 1;
2870
2871 _mesa_glsl__init_buffer(b,file ,yyscanner);
2872
2873 return b;
2874}
2875
2876/** Destroy the buffer.
2877 * @param b a buffer created with _mesa_glsl__create_buffer()
2878 * @param yyscanner The scanner object.
2879 */
2880 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2881{
2882 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2883
2884 if ( ! b )
2885 return;
2886
2887 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2888 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2889
2890 if ( b->yy_is_our_buffer )
2891 _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner );
2892
2893 _mesa_glsl_free((void *) b ,yyscanner );
2894}
2895
2896/* Initializes or reinitializes a buffer.
2897 * This function is sometimes called more than once on the same buffer,
2898 * such as during a _mesa_glsl_restart() or at EOF.
2899 */
2900 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2901
2902{
2903 int oerrno = errno;
2904 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2905
2906 _mesa_glsl__flush_buffer(b ,yyscanner);
2907
2908 b->yy_input_file = file;
2909 b->yy_fill_buffer = 1;
2910
2911 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
2912 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
2913 * In that case, we don't want to reset the lineno or column.
2914 */
2915 if (b != YY_CURRENT_BUFFER){
2916 b->yy_bs_lineno = 1;
2917 b->yy_bs_column = 0;
2918 }
2919
2920 b->yy_is_interactive = 0;
2921
2922 errno = oerrno;
2923}
2924
2925/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2926 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2927 * @param yyscanner The scanner object.
2928 */
2929 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2930{
2931 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2932 if ( ! b )
2933 return;
2934
2935 b->yy_n_chars = 0;
2936
2937 /* We always need two end-of-buffer characters. The first causes
2938 * a transition to the end-of-buffer state. The second causes
2939 * a jam in that state.
2940 */
2941 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2942 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2943
2944 b->yy_buf_pos = &b->yy_ch_buf[0];
2945
2946 b->yy_at_bol = 1;
2947 b->yy_buffer_status = YY_BUFFER_NEW;
2948
2949 if ( b == YY_CURRENT_BUFFER )
2950 _mesa_glsl__load_buffer_state(yyscanner );
2951}
2952
2953/** Pushes the new state onto the stack. The new state becomes
2954 * the current state. This function will allocate the stack
2955 * if necessary.
2956 * @param new_buffer The new state.
2957 * @param yyscanner The scanner object.
2958 */
2959void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2960{
2961 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2962 if (new_buffer == NULL)
2963 return;
2964
2965 _mesa_glsl_ensure_buffer_stack(yyscanner);
2966
2967 /* This block is copied from _mesa_glsl__switch_to_buffer. */
2968 if ( YY_CURRENT_BUFFER )
2969 {
2970 /* Flush out information for old buffer. */
2971 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2972 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2973 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2974 }
2975
2976 /* Only push if top exists. Otherwise, replace top. */
2977 if (YY_CURRENT_BUFFER)
2978 yyg->yy_buffer_stack_top++;
2979 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2980
2981 /* copied from _mesa_glsl__switch_to_buffer. */
2982 _mesa_glsl__load_buffer_state(yyscanner );
2983 yyg->yy_did_buffer_switch_on_eof = 1;
2984}
2985
2986/** Removes and deletes the top of the stack, if present.
2987 * The next element becomes the new top.
2988 * @param yyscanner The scanner object.
2989 */
2990void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner)
2991{
2992 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2993 if (!YY_CURRENT_BUFFER)
2994 return;
2995
2996 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2997 YY_CURRENT_BUFFER_LVALUE = NULL;
2998 if (yyg->yy_buffer_stack_top > 0)
2999 --yyg->yy_buffer_stack_top;
3000
3001 if (YY_CURRENT_BUFFER) {
3002 _mesa_glsl__load_buffer_state(yyscanner );
3003 yyg->yy_did_buffer_switch_on_eof = 1;
3004 }
3005}
3006
3007/* Allocates the stack if it does not exist.
3008 * Guarantees space for at least one push.
3009 */
3010static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner)
3011{
3012 int num_to_alloc;
3013 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3014
3015 if (!yyg->yy_buffer_stack) {
3016
3017 /* First allocation is just for 2 elements, since we don't know if this
3018 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3019 * immediate realloc on the next call.
3020 */
3021 num_to_alloc = 1;
3022 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc
3023 (num_to_alloc * sizeof(struct yy_buffer_state*)
3024 , yyscanner);
3025 if ( ! yyg->yy_buffer_stack )
3026 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3027
3028 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3029
3030 yyg->yy_buffer_stack_max = num_to_alloc;
3031 yyg->yy_buffer_stack_top = 0;
3032 return;
3033 }
3034
3035 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3036
3037 /* Increase the buffer to prepare for a possible push. */
3038 int grow_size = 8 /* arbitrary grow size */;
3039
3040 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3041 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc
3042 (yyg->yy_buffer_stack,
3043 num_to_alloc * sizeof(struct yy_buffer_state*)
3044 , yyscanner);
3045 if ( ! yyg->yy_buffer_stack )
3046 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3047
3048 /* zero only the new slots.*/
3049 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3050 yyg->yy_buffer_stack_max = num_to_alloc;
3051 }
3052}
3053
3054/** Setup the input buffer state to scan directly from a user-specified character buffer.
3055 * @param base the character buffer
3056 * @param size the size in bytes of the character buffer
3057 * @param yyscanner The scanner object.
3058 * @return the newly allocated buffer state object.
3059 */
3060YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3061{
3062 YY_BUFFER_STATE b;
3063
3064 if ( size < 2 ||
3065 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3066 base[size-1] != YY_END_OF_BUFFER_CHAR )
3067 /* They forgot to leave room for the EOB's. */
3068 return 0;
3069
3070 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3071 if ( ! b )
3072 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3073
3074 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3075 b->yy_buf_pos = b->yy_ch_buf = base;
3076 b->yy_is_our_buffer = 0;
3077 b->yy_input_file = 0;
3078 b->yy_n_chars = b->yy_buf_size;
3079 b->yy_is_interactive = 0;
3080 b->yy_at_bol = 1;
3081 b->yy_fill_buffer = 0;
3082 b->yy_buffer_status = YY_BUFFER_NEW;
3083
3084 _mesa_glsl__switch_to_buffer(b ,yyscanner );
3085
3086 return b;
3087}
3088
3089/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3090 * scan from a @e copy of @a str.
3091 * @param yystr a NUL-terminated string to scan
3092 * @param yyscanner The scanner object.
3093 * @return the newly allocated buffer state object.
3094 * @note If you want to scan bytes that may contain NUL values, then use
3095 * _mesa_glsl__scan_bytes() instead.
3096 */
3097YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner)
3098{
3099
3100 return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner);
3101}
3102
3103/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3104 * scan from a @e copy of @a bytes.
Ian Romanick5ed66102010-10-05 16:40:00 -07003105 * @param yybytes the byte buffer to scan
3106 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003107 * @param yyscanner The scanner object.
3108 * @return the newly allocated buffer state object.
3109 */
3110YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3111{
3112 YY_BUFFER_STATE b;
3113 char *buf;
3114 yy_size_t n;
3115 int i;
3116
3117 /* Get memory for full buffer, including space for trailing EOB's. */
3118 n = _yybytes_len + 2;
3119 buf = (char *) _mesa_glsl_alloc(n ,yyscanner );
3120 if ( ! buf )
3121 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3122
3123 for ( i = 0; i < _yybytes_len; ++i )
3124 buf[i] = yybytes[i];
3125
3126 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3127
3128 b = _mesa_glsl__scan_buffer(buf,n ,yyscanner);
3129 if ( ! b )
3130 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3131
3132 /* It's okay to grow etc. this buffer, and we should throw it
3133 * away when we're done.
3134 */
3135 b->yy_is_our_buffer = 1;
3136
3137 return b;
3138}
3139
3140#ifndef YY_EXIT_FAILURE
3141#define YY_EXIT_FAILURE 2
3142#endif
3143
3144static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3145{
3146 (void) fprintf( stderr, "%s\n", msg );
3147 exit( YY_EXIT_FAILURE );
3148}
3149
3150/* Redefine yyless() so it works in section 3 code. */
3151
3152#undef yyless
3153#define yyless(n) \
3154 do \
3155 { \
3156 /* Undo effects of setting up yytext. */ \
3157 int yyless_macro_arg = (n); \
3158 YY_LESS_LINENO(yyless_macro_arg);\
3159 yytext[yyleng] = yyg->yy_hold_char; \
3160 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3161 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3162 *yyg->yy_c_buf_p = '\0'; \
3163 yyleng = yyless_macro_arg; \
3164 } \
3165 while ( 0 )
3166
3167/* Accessor methods (get/set functions) to struct members. */
3168
3169/** Get the user-defined data for this scanner.
3170 * @param yyscanner The scanner object.
3171 */
3172YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner)
3173{
3174 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3175 return yyextra;
3176}
3177
3178/** Get the current line number.
3179 * @param yyscanner The scanner object.
3180 */
3181int _mesa_glsl_get_lineno (yyscan_t yyscanner)
3182{
3183 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3184
3185 if (! YY_CURRENT_BUFFER)
3186 return 0;
3187
3188 return yylineno;
3189}
3190
3191/** Get the current column number.
3192 * @param yyscanner The scanner object.
3193 */
3194int _mesa_glsl_get_column (yyscan_t yyscanner)
3195{
3196 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3197
3198 if (! YY_CURRENT_BUFFER)
3199 return 0;
3200
3201 return yycolumn;
3202}
3203
3204/** Get the input stream.
3205 * @param yyscanner The scanner object.
3206 */
3207FILE *_mesa_glsl_get_in (yyscan_t yyscanner)
3208{
3209 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3210 return yyin;
3211}
3212
3213/** Get the output stream.
3214 * @param yyscanner The scanner object.
3215 */
3216FILE *_mesa_glsl_get_out (yyscan_t yyscanner)
3217{
3218 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3219 return yyout;
3220}
3221
3222/** Get the length of the current token.
3223 * @param yyscanner The scanner object.
3224 */
3225int _mesa_glsl_get_leng (yyscan_t yyscanner)
3226{
3227 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3228 return yyleng;
3229}
3230
3231/** Get the current token.
3232 * @param yyscanner The scanner object.
3233 */
3234
3235char *_mesa_glsl_get_text (yyscan_t yyscanner)
3236{
3237 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3238 return yytext;
3239}
3240
3241/** Set the user-defined data. This data is never touched by the scanner.
3242 * @param user_defined The data to be associated with this scanner.
3243 * @param yyscanner The scanner object.
3244 */
3245void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3246{
3247 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3248 yyextra = user_defined ;
3249}
3250
3251/** Set the current line number.
3252 * @param line_number
3253 * @param yyscanner The scanner object.
3254 */
3255void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner)
3256{
3257 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3258
3259 /* lineno is only valid if an input buffer exists. */
3260 if (! YY_CURRENT_BUFFER )
3261 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner);
3262
3263 yylineno = line_number;
3264}
3265
3266/** Set the current column.
3267 * @param line_number
3268 * @param yyscanner The scanner object.
3269 */
3270void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner)
3271{
3272 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3273
3274 /* column is only valid if an input buffer exists. */
3275 if (! YY_CURRENT_BUFFER )
3276 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner);
3277
3278 yycolumn = column_no;
3279}
3280
3281/** Set the input stream. This does not discard the current
3282 * input buffer.
3283 * @param in_str A readable stream.
3284 * @param yyscanner The scanner object.
3285 * @see _mesa_glsl__switch_to_buffer
3286 */
3287void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner)
3288{
3289 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3290 yyin = in_str ;
3291}
3292
3293void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner)
3294{
3295 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3296 yyout = out_str ;
3297}
3298
3299int _mesa_glsl_get_debug (yyscan_t yyscanner)
3300{
3301 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3302 return yy_flex_debug;
3303}
3304
3305void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner)
3306{
3307 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3308 yy_flex_debug = bdebug ;
3309}
3310
3311/* Accessor methods for yylval and yylloc */
3312
3313YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner)
3314{
3315 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3316 return yylval;
3317}
3318
3319void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3320{
3321 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3322 yylval = yylval_param;
3323}
3324
3325YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner)
3326{
3327 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3328 return yylloc;
3329}
3330
3331void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3332{
3333 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3334 yylloc = yylloc_param;
3335}
3336
3337/* User-visible API */
3338
3339/* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3340 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3341 * That's why we explicitly handle the declaration, instead of using our macros.
3342 */
3343
3344int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals)
3345
3346{
3347 if (ptr_yy_globals == NULL){
3348 errno = EINVAL;
3349 return 1;
3350 }
3351
3352 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL );
3353
3354 if (*ptr_yy_globals == NULL){
3355 errno = ENOMEM;
3356 return 1;
3357 }
3358
3359 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3360 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3361
3362 return yy_init_globals ( *ptr_yy_globals );
3363}
3364
3365/* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3366 * convention of taking the scanner as the last argument. Note however, that
3367 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3368 * is the reason, too, why this function also must handle its own declaration).
3369 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3370 * the yyextra field.
3371 */
3372
3373int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3374
3375{
3376 struct yyguts_t dummy_yyguts;
3377
3378 _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts);
3379
3380 if (ptr_yy_globals == NULL){
3381 errno = EINVAL;
3382 return 1;
3383 }
3384
3385 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3386
3387 if (*ptr_yy_globals == NULL){
3388 errno = ENOMEM;
3389 return 1;
3390 }
3391
3392 /* By setting to 0xAA, we expose bugs in
3393 yy_init_globals. Leave at 0x00 for releases. */
3394 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3395
3396 _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals);
3397
3398 return yy_init_globals ( *ptr_yy_globals );
3399}
3400
3401static int yy_init_globals (yyscan_t yyscanner)
3402{
3403 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3404 /* Initialization is the same as for the non-reentrant scanner.
3405 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3406 */
3407
3408 yyg->yy_buffer_stack = 0;
3409 yyg->yy_buffer_stack_top = 0;
3410 yyg->yy_buffer_stack_max = 0;
3411 yyg->yy_c_buf_p = (char *) 0;
3412 yyg->yy_init = 0;
3413 yyg->yy_start = 0;
3414
3415 yyg->yy_start_stack_ptr = 0;
3416 yyg->yy_start_stack_depth = 0;
3417 yyg->yy_start_stack = NULL;
3418
3419/* Defined in main.c */
3420#ifdef YY_STDINIT
3421 yyin = stdin;
3422 yyout = stdout;
3423#else
3424 yyin = (FILE *) 0;
3425 yyout = (FILE *) 0;
3426#endif
3427
3428 /* For future reference: Set errno on error, since we are called by
3429 * _mesa_glsl_lex_init()
3430 */
3431 return 0;
3432}
3433
3434/* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3435int _mesa_glsl_lex_destroy (yyscan_t yyscanner)
3436{
3437 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3438
3439 /* Pop the buffer stack, destroying each element. */
3440 while(YY_CURRENT_BUFFER){
3441 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3442 YY_CURRENT_BUFFER_LVALUE = NULL;
3443 _mesa_glsl_pop_buffer_state(yyscanner);
3444 }
3445
3446 /* Destroy the stack itself. */
3447 _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner);
3448 yyg->yy_buffer_stack = NULL;
3449
3450 /* Destroy the start condition stack. */
3451 _mesa_glsl_free(yyg->yy_start_stack ,yyscanner );
3452 yyg->yy_start_stack = NULL;
3453
3454 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3455 * _mesa_glsl_lex() is called, initialization will occur. */
3456 yy_init_globals( yyscanner);
3457
3458 /* Destroy the main struct (reentrant only). */
3459 _mesa_glsl_free ( yyscanner , yyscanner );
3460 yyscanner = NULL;
3461 return 0;
3462}
3463
3464/*
3465 * Internal utility routines.
3466 */
3467
3468#ifndef yytext_ptr
3469static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3470{
3471 register int i;
3472 for ( i = 0; i < n; ++i )
3473 s1[i] = s2[i];
3474}
3475#endif
3476
3477#ifdef YY_NEED_STRLEN
3478static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3479{
3480 register int n;
3481 for ( n = 0; s[n]; ++n )
3482 ;
3483
3484 return n;
3485}
3486#endif
3487
3488void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner)
3489{
3490 return (void *) malloc( size );
3491}
3492
3493void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3494{
3495 /* The cast to (char *) in the following accommodates both
3496 * implementations that use char* generic pointers, and those
3497 * that use void* generic pointers. It works with the latter
3498 * because both ANSI C and C++ allow castless assignment from
3499 * any pointer type to void*, and deal with argument conversions
3500 * as though doing an assignment.
3501 */
3502 return (void *) realloc( (char *) ptr, size );
3503}
3504
3505void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
3506{
3507 free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */
3508}
3509
3510#define YYTABLES_NAME "yytables"
3511
Chad Versace41c20792010-10-08 12:05:02 -07003512#line 391 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003513
3514
3515
3516void
3517_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
3518{
3519 _mesa_glsl_lex_init_extra(state,& state->scanner);
3520 _mesa_glsl__scan_string(string,state->scanner);
3521}
3522
3523void
3524_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
3525{
3526 _mesa_glsl_lex_destroy(state->scanner);
3527}
3528