blob: 873df609d34899af898b3f8a0971528d5042cfce [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 Romanickdb36e882010-08-11 17:03:37 -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 Romanickdb36e882010-08-11 17:03:37 -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 Romanickdb36e882010-08-11 17:03:37 -0700170#endif /* __ia64__ */
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700171#endif
172
173/* The state buf must be large enough to hold one state per character in the main buffer.
174 */
175#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
176
177#ifndef YY_TYPEDEF_YY_BUFFER_STATE
178#define YY_TYPEDEF_YY_BUFFER_STATE
179typedef struct yy_buffer_state *YY_BUFFER_STATE;
180#endif
181
182#define EOB_ACT_CONTINUE_SCAN 0
183#define EOB_ACT_END_OF_FILE 1
184#define EOB_ACT_LAST_MATCH 2
185
186 #define YY_LESS_LINENO(n)
187
188/* Return all but the first "n" matched characters back to the input stream. */
189#define yyless(n) \
190 do \
191 { \
192 /* Undo effects of setting up yytext. */ \
193 int yyless_macro_arg = (n); \
194 YY_LESS_LINENO(yyless_macro_arg);\
195 *yy_cp = yyg->yy_hold_char; \
196 YY_RESTORE_YY_MORE_OFFSET \
197 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
199 } \
200 while ( 0 )
201
202#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
203
204#ifndef YY_TYPEDEF_YY_SIZE_T
205#define YY_TYPEDEF_YY_SIZE_T
206typedef size_t yy_size_t;
207#endif
208
209#ifndef YY_STRUCT_YY_BUFFER_STATE
210#define YY_STRUCT_YY_BUFFER_STATE
211struct yy_buffer_state
212 {
213 FILE *yy_input_file;
214
215 char *yy_ch_buf; /* input buffer */
216 char *yy_buf_pos; /* current position in input buffer */
217
218 /* Size of input buffer in bytes, not including room for EOB
219 * characters.
220 */
221 yy_size_t yy_buf_size;
222
223 /* Number of characters read into yy_ch_buf, not including EOB
224 * characters.
225 */
226 int yy_n_chars;
227
228 /* Whether we "own" the buffer - i.e., we know we created it,
229 * and can realloc() it to grow it, and should free() it to
230 * delete it.
231 */
232 int yy_is_our_buffer;
233
234 /* Whether this is an "interactive" input source; if so, and
235 * if we're using stdio for input, then we want to use getc()
236 * instead of fread(), to make sure we stop fetching input after
237 * each newline.
238 */
239 int yy_is_interactive;
240
241 /* Whether we're considered to be at the beginning of a line.
242 * If so, '^' rules will be active on the next match, otherwise
243 * not.
244 */
245 int yy_at_bol;
246
247 int yy_bs_lineno; /**< The line count. */
248 int yy_bs_column; /**< The column count. */
249
250 /* Whether to try to fill the input buffer when we reach the
251 * end of it.
252 */
253 int yy_fill_buffer;
254
255 int yy_buffer_status;
256
257#define YY_BUFFER_NEW 0
258#define YY_BUFFER_NORMAL 1
259 /* When an EOF's been seen but there's still some text to process
260 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261 * shouldn't try reading from the input source any more. We might
262 * still have a bunch of tokens to match, though, because of
263 * possible backing-up.
264 *
265 * When we actually see the EOF, we change the status to "new"
266 * (via _mesa_glsl_restart()), so that the user can continue scanning by
267 * just pointing yyin at a new input file.
268 */
269#define YY_BUFFER_EOF_PENDING 2
270
271 };
272#endif /* !YY_STRUCT_YY_BUFFER_STATE */
273
274/* We provide macros for accessing buffer states in case in the
275 * future we want to put the buffer states in a more general
276 * "scanner state".
277 *
278 * Returns the top of the stack, or NULL.
279 */
280#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
281 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
282 : NULL)
283
284/* Same as previous macro, but useful when we know that the buffer stack is not
285 * NULL or when we need an lvalue. For internal use only.
286 */
287#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
288
289void _mesa_glsl_restart (FILE *input_file ,yyscan_t yyscanner );
290void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
291YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
292void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
293void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
294void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
295void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner );
296
297static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner );
298static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner );
299static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
300
301#define YY_FLUSH_BUFFER _mesa_glsl__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
302
303YY_BUFFER_STATE _mesa_glsl__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
304YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
305YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
306
307void *_mesa_glsl_alloc (yy_size_t ,yyscan_t yyscanner );
308void *_mesa_glsl_realloc (void *,yy_size_t ,yyscan_t yyscanner );
309void _mesa_glsl_free (void * ,yyscan_t yyscanner );
310
311#define yy_new_buffer _mesa_glsl__create_buffer
312
313#define yy_set_interactive(is_interactive) \
314 { \
315 if ( ! YY_CURRENT_BUFFER ){ \
316 _mesa_glsl_ensure_buffer_stack (yyscanner); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
319 } \
320 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321 }
322
323#define yy_set_bol(at_bol) \
324 { \
325 if ( ! YY_CURRENT_BUFFER ){\
326 _mesa_glsl_ensure_buffer_stack (yyscanner); \
327 YY_CURRENT_BUFFER_LVALUE = \
328 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
329 } \
330 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331 }
332
333#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
334
335/* Begin user sect3 */
336
337#define _mesa_glsl_wrap(n) 1
338#define YY_SKIP_YYWRAP
339
340typedef unsigned char YY_CHAR;
341
342typedef int yy_state_type;
343
344#define yytext_ptr yytext_r
345
346static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
347static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
348static int yy_get_next_buffer (yyscan_t yyscanner );
349static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
350
351/* Done after the current pattern has been matched and before the
352 * corresponding action - sets up yytext.
353 */
354#define YY_DO_BEFORE_ACTION \
355 yyg->yytext_ptr = yy_bp; \
356 yyleng = (size_t) (yy_cp - yy_bp); \
357 yyg->yy_hold_char = *yy_cp; \
358 *yy_cp = '\0'; \
359 yyg->yy_c_buf_p = yy_cp;
360
Ian Romanick33fe3642010-08-30 11:59:48 -0700361#define YY_NUM_RULES 183
362#define YY_END_OF_BUFFER 184
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700363/* This struct is not used in this scanner,
364 but its presence is necessary. */
365struct yy_trans_info
366 {
367 flex_int32_t yy_verify;
368 flex_int32_t yy_nxt;
369 };
Ian Romanick33fe3642010-08-30 11:59:48 -0700370static yyconst flex_int16_t yy_accept[708] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700371 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700372 0, 0, 15, 15, 0, 0, 184, 182, 1, 20,
373 182, 182, 182, 182, 182, 182, 182, 182, 96, 94,
374 182, 182, 182, 181, 182, 181, 181, 181, 181, 181,
375 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
376 181, 181, 181, 181, 181, 182, 1, 182, 91, 183,
377 15, 19, 183, 18, 16, 17, 13, 12, 1, 80,
378 87, 81, 90, 84, 75, 86, 76, 93, 98, 85,
379 99, 96, 0, 0, 101, 0, 94, 0, 77, 79,
380 78, 0, 181, 83, 181, 181, 181, 181, 181, 181,
381 181, 181, 181, 181, 181, 181, 28, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700382
Ian Romanick33fe3642010-08-30 11:59:48 -0700383 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
384 32, 181, 181, 56, 181, 181, 181, 181, 181, 181,
385 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
386 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
387 181, 181, 181, 181, 181, 92, 82, 1, 0, 0,
388 2, 0, 0, 0, 0, 15, 14, 18, 17, 0,
389 98, 97, 0, 99, 0, 100, 95, 88, 89, 181,
390 104, 181, 181, 181, 181, 181, 181, 181, 181, 181,
391 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
392 181, 181, 31, 181, 181, 181, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700393
Ian Romanick33fe3642010-08-30 11:59:48 -0700394 181, 181, 181, 25, 181, 181, 181, 181, 181, 181,
395 181, 181, 181, 181, 57, 181, 181, 181, 181, 181,
396 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
397 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
398 181, 181, 0, 0, 0, 0, 14, 0, 98, 0,
399 97, 0, 99, 100, 181, 181, 23, 181, 181, 144,
400 181, 181, 181, 181, 181, 181, 181, 181, 181, 30,
401 107, 181, 181, 181, 181, 63, 181, 181, 112, 126,
402 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
403 181, 123, 147, 44, 45, 46, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700404
Ian Romanick33fe3642010-08-30 11:59:48 -0700405 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
406 181, 181, 181, 181, 181, 181, 110, 102, 181, 181,
407 181, 181, 181, 181, 181, 41, 42, 43, 73, 181,
408 181, 0, 0, 0, 0, 0, 97, 181, 181, 26,
409 35, 36, 37, 181, 105, 181, 22, 181, 181, 181,
410 181, 134, 135, 136, 181, 103, 181, 127, 24, 137,
411 138, 139, 149, 131, 132, 133, 181, 181, 181, 58,
412 129, 181, 181, 38, 39, 40, 181, 181, 181, 181,
413 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
414 181, 181, 124, 181, 181, 181, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700415
Ian Romanick33fe3642010-08-30 11:59:48 -0700416 181, 181, 181, 106, 181, 146, 181, 181, 29, 0,
417 0, 0, 0, 153, 181, 181, 151, 181, 181, 181,
418 125, 120, 156, 181, 181, 181, 181, 181, 181, 115,
419 181, 181, 74, 47, 48, 49, 50, 51, 52, 53,
420 54, 55, 181, 181, 181, 181, 130, 111, 181, 181,
421 118, 34, 181, 181, 143, 64, 119, 72, 154, 113,
422 181, 181, 181, 181, 181, 181, 181, 0, 0, 0,
423 0, 181, 181, 181, 114, 33, 181, 181, 181, 181,
424 181, 181, 157, 158, 159, 181, 181, 181, 181, 148,
425 181, 181, 181, 181, 181, 181, 181, 181, 108, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700426
Ian Romanick33fe3642010-08-30 11:59:48 -0700427 181, 181, 181, 181, 59, 181, 60, 181, 0, 0,
428 0, 0, 0, 181, 61, 27, 121, 161, 162, 163,
429 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
430 181, 116, 181, 181, 181, 181, 181, 181, 181, 181,
431 181, 109, 165, 166, 167, 181, 181, 128, 117, 0,
432 0, 6, 0, 0, 0, 11, 3, 21, 181, 181,
433 181, 181, 181, 181, 181, 181, 181, 160, 122, 62,
434 145, 181, 152, 150, 180, 66, 67, 68, 181, 181,
435 181, 181, 181, 181, 0, 0, 0, 0, 0, 0,
436 181, 181, 181, 164, 181, 181, 181, 181, 181, 181,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700437
Ian Romanick33fe3642010-08-30 11:59:48 -0700438 181, 181, 181, 181, 181, 181, 181, 181, 181, 168,
439 4, 0, 5, 0, 0, 0, 0, 0, 181, 181,
440 181, 181, 181, 181, 181, 177, 181, 181, 181, 181,
441 181, 181, 69, 181, 181, 181, 0, 0, 0, 181,
442 181, 178, 169, 181, 170, 181, 181, 181, 181, 181,
443 181, 181, 181, 181, 179, 0, 0, 171, 172, 175,
444 176, 65, 181, 140, 181, 141, 155, 173, 174, 0,
445 0, 181, 181, 181, 0, 0, 0, 70, 181, 71,
446 0, 0, 0, 181, 0, 0, 0, 181, 0, 0,
447 7, 0, 0, 181, 0, 8, 0, 0, 142, 0,
448
449 0, 0, 0, 9, 0, 10, 0
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700450 } ;
451
452static yyconst flex_int32_t yy_ec[256] =
453 { 0,
454 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
455 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700457 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
458 10, 11, 12, 1, 13, 14, 15, 16, 17, 18,
459 19, 20, 21, 21, 21, 22, 22, 23, 1, 24,
460 25, 26, 1, 1, 27, 28, 29, 30, 31, 32,
461 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
462 33, 34, 35, 33, 33, 33, 33, 36, 33, 33,
463 1, 1, 1, 37, 38, 1, 39, 40, 41, 42,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700464
Ian Romanick33fe3642010-08-30 11:59:48 -0700465 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
466 53, 54, 33, 55, 56, 57, 58, 59, 60, 61,
467 62, 63, 1, 64, 1, 1, 1, 1, 1, 1,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481 1, 1, 1, 1, 1
482 } ;
483
Ian Romanick33fe3642010-08-30 11:59:48 -0700484static yyconst flex_int32_t yy_meta[65] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700485 { 0,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700486 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700487 1, 1, 1, 1, 1, 4, 4, 4, 4, 4,
488 4, 5, 1, 1, 1, 1, 6, 6, 6, 6,
489 5, 5, 7, 7, 7, 8, 1, 7, 6, 6,
490 6, 6, 5, 5, 7, 7, 7, 7, 7, 7,
491 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
492 8, 7, 7, 1
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700493 } ;
494
Ian Romanick33fe3642010-08-30 11:59:48 -0700495static yyconst flex_int16_t yy_base[719] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700496 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700497 0, 63, 88, 0, 1076, 1075, 1077, 1080, 64, 1080,
498 1051, 1050, 59, 1049, 58, 60, 58, 1048, 139, 187,
499 47, 1047, 56, 0, 1034, 121, 110, 137, 138, 134,
500 163, 1017, 173, 177, 115, 149, 140, 1011, 159, 121,
501 187, 194, 194, 172, 1022, 171, 249, 240, 1042, 1080,
502 250, 1080, 1051, 241, 1080, 0, 1080, 1080, 262, 1080,
503 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 236, 1080,
504 238, 187, 286, 303, 1080, 0, 0, 1040, 1080, 1080,
505 1080, 1039, 0, 1080, 1006, 1011, 1004, 1007, 1016, 1015,
506 1001, 1004, 1016, 35, 1010, 997, 994, 1008, 994, 991,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700507
Ian Romanick33fe3642010-08-30 11:59:48 -0700508 991, 997, 215, 232, 991, 1002, 987, 993, 997, 998,
509 0, 989, 1000, 234, 995, 975, 226, 979, 993, 983,
510 119, 976, 234, 989, 991, 973, 969, 977, 974, 963,
511 972, 256, 970, 976, 971, 974, 962, 965, 967, 245,
512 970, 961, 974, 227, 967, 1080, 1080, 308, 294, 324,
513 1080, 952, 965, 956, 967, 329, 0, 338, 0, 368,
514 1080, 303, 379, 1080, 386, 393, 0, 1080, 1080, 962,
515 0, 953, 957, 967, 964, 947, 946, 946, 950, 216,
516 961, 958, 958, 956, 953, 944, 951, 937, 935, 948,
517 933, 950, 0, 947, 934, 942, 939, 943, 944, 937,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700518
Ian Romanick33fe3642010-08-30 11:59:48 -0700519 934, 922, 921, 935, 938, 935, 922, 929, 919, 320,
520 925, 928, 918, 926, 914, 918, 909, 924, 914, 905,
521 924, 907, 905, 916, 905, 900, 898, 912, 897, 899,
522 896, 908, 907, 910, 288, 901, 895, 884, 331, 903,
523 905, 893, 885, 889, 901, 884, 0, 400, 410, 427,
524 1080, 439, 446, 1080, 879, 890, 0, 887, 343, 0,
525 880, 878, 880, 875, 884, 872, 890, 878, 346, 0,
526 0, 872, 883, 882, 882, 0, 866, 350, 0, 0,
527 868, 353, 876, 877, 867, 861, 860, 861, 860, 357,
528 856, 0, 0, 852, 851, 850, 852, 853, 858, 852,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700529
Ian Romanick33fe3642010-08-30 11:59:48 -0700530 848, 862, 857, 856, 855, 846, 849, 849, 841, 844,
531 839, 848, 853, 838, 851, 841, 0, 0, 848, 844,
532 835, 835, 841, 840, 837, 0, 0, 0, 0, 826,
533 839, 838, 837, 834, 822, 453, 463, 834, 836, 0,
534 0, 0, 0, 822, 0, 822, 0, 821, 822, 816,
535 827, 0, 0, 0, 817, 0, 813, 0, 0, 0,
536 0, 0, 0, 0, 0, 0, 824, 469, 823, 0,
537 0, 821, 817, 0, 0, 0, 806, 415, 432, 473,
538 811, 807, 813, 803, 801, 815, 799, 799, 813, 801,
539 813, 808, 0, 806, 803, 807, 790, 792, 799, 805,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700540
Ian Romanick33fe3642010-08-30 11:59:48 -0700541 800, 799, 786, 0, 788, 0, 787, 791, 0, 785,
542 834, 784, 787, 0, 775, 785, 0, 773, 773, 787,
543 0, 789, 0, 482, 797, 796, 795, 766, 765, 0,
544 783, 782, 0, 0, 0, 0, 0, 0, 0, 0,
545 0, 0, 766, 780, 766, 763, 0, 0, 769, 768,
546 0, 0, 766, 758, 0, 0, 0, 0, 0, 0,
547 755, 767, 485, 759, 766, 763, 757, 750, 503, 766,
548 751, 746, 760, 758, 0, 0, 750, 769, 768, 767,
549 738, 737, 301, 481, 0, 750, 753, 751, 739, 0,
550 749, 746, 745, 734, 733, 732, 509, 741, 0, 753,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700551
Ian Romanick33fe3642010-08-30 11:59:48 -0700552 752, 751, 722, 721, 0, 736, 0, 734, 729, 515,
553 527, 773, 722, 730, 0, 0, 0, 745, 744, 0,
554 726, 729, 713, 721, 711, 719, 720, 720, 719, 704,
555 717, 0, 718, 706, 705, 701, 725, 724, 723, 694,
556 693, 0, 723, 722, 0, 704, 707, 0, 0, 693,
557 537, 1080, 561, 0, 567, 340, 1080, 0, 690, 689,
558 699, 699, 686, 701, 684, 699, 694, 0, 0, 0,
559 0, 679, 0, 0, 0, 700, 389, 700, 689, 692,
560 676, 675, 685, 685, 675, 529, 589, 474, 683, 671,
561 669, 668, 679, 0, 682, 678, 680, 676, 662, 669,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700562
Ian Romanick33fe3642010-08-30 11:59:48 -0700563 669, 671, 667, 669, 667, 667, 654, 653, 664, 0,
564 1080, 531, 1080, 596, 0, 616, 666, 648, 665, 664,
565 647, 635, 643, 633, 634, 0, 627, 646, 635, 607,
566 604, 601, 0, 604, 603, 586, 533, 572, 580, 564,
567 563, 0, 0, 564, 0, 540, 554, 552, 516, 530,
568 505, 486, 453, 450, 0, 461, 443, 0, 0, 0,
569 0, 0, 400, 406, 385, 0, 0, 0, 0, 343,
570 389, 319, 267, 249, 487, 341, 235, 0, 200, 0,
571 507, 498, 184, 157, 150, 564, 559, 136, 565, 591,
572 1080, 593, 550, 112, 594, 1080, 569, 576, 0, 123,
573
574 619, 621, 637, 1080, 638, 1080, 1080, 648, 653, 658,
575 663, 665, 667, 673, 680, 685, 690, 695
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700576 } ;
577
Ian Romanick33fe3642010-08-30 11:59:48 -0700578static yyconst flex_int16_t yy_def[719] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700579 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700580 707, 1, 707, 3, 708, 708, 707, 707, 707, 707,
581 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
582 707, 707, 707, 709, 707, 709, 709, 709, 709, 709,
583 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
584 709, 709, 709, 709, 709, 707, 707, 707, 707, 707,
585 707, 707, 707, 707, 707, 710, 707, 707, 707, 707,
586 707, 707, 707, 707, 707, 707, 707, 707, 711, 707,
587 712, 19, 707, 707, 707, 713, 20, 707, 707, 707,
588 707, 707, 709, 707, 709, 709, 709, 709, 709, 709,
589 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700590
Ian Romanick33fe3642010-08-30 11:59:48 -0700591 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
592 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
593 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
594 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
595 709, 709, 709, 709, 709, 707, 707, 707, 707, 707,
596 707, 707, 707, 707, 707, 707, 714, 707, 710, 707,
597 707, 712, 707, 707, 707, 707, 713, 707, 707, 709,
598 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
599 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
600 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700601
Ian Romanick33fe3642010-08-30 11:59:48 -0700602 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
603 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
604 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
605 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
606 709, 709, 707, 707, 707, 707, 714, 707, 707, 707,
607 707, 707, 707, 707, 709, 709, 709, 709, 709, 709,
608 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
609 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
610 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
611 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700612
Ian Romanick33fe3642010-08-30 11:59:48 -0700613 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
614 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
615 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
616 709, 707, 707, 707, 707, 707, 707, 709, 709, 709,
617 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
618 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
619 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
620 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
621 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
622 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700623
Ian Romanick33fe3642010-08-30 11:59:48 -0700624 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
625 707, 707, 707, 709, 709, 709, 709, 709, 709, 709,
626 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
627 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
628 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
629 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
630 709, 709, 709, 709, 709, 709, 709, 707, 707, 707,
631 707, 709, 709, 709, 709, 709, 709, 709, 709, 709,
632 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
633 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700634
Ian Romanick33fe3642010-08-30 11:59:48 -0700635 709, 709, 709, 709, 709, 709, 709, 709, 707, 715,
636 707, 707, 707, 709, 709, 709, 709, 709, 709, 709,
637 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
638 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
639 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
640 707, 707, 707, 716, 707, 707, 707, 709, 709, 709,
641 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
642 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
643 709, 709, 709, 709, 707, 717, 707, 716, 707, 707,
644 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700645
Ian Romanick33fe3642010-08-30 11:59:48 -0700646 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
647 707, 707, 707, 707, 718, 707, 707, 707, 709, 709,
648 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
649 709, 709, 709, 709, 709, 709, 718, 707, 707, 709,
650 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
651 709, 709, 709, 709, 709, 707, 707, 709, 709, 709,
652 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
653 707, 709, 709, 709, 707, 707, 707, 709, 709, 709,
654 707, 707, 707, 709, 707, 707, 707, 709, 707, 707,
655 707, 707, 707, 709, 707, 707, 707, 707, 709, 707,
656
657 707, 707, 707, 707, 707, 707, 0, 707, 707, 707,
658 707, 707, 707, 707, 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700659 } ;
660
Ian Romanick33fe3642010-08-30 11:59:48 -0700661static yyconst flex_int16_t yy_nxt[1145] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700662 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700663 8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
664 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
665 20, 20, 8, 21, 22, 23, 24, 24, 24, 24,
666 24, 24, 24, 24, 24, 24, 25, 24, 26, 27,
667 28, 29, 30, 31, 32, 33, 34, 24, 24, 35,
668 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
669 24, 24, 24, 46, 47, 59, 62, 59, 48, 65,
670 78, 79, 67, 69, 69, 69, 69, 69, 69, 69,
671 81, 82, 66, 63, 68, 179, 180, 49, 50, 51,
672 52, 51, 50, 50, 50, 50, 50, 50, 50, 50,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700673
Ian Romanick33fe3642010-08-30 11:59:48 -0700674 50, 50, 53, 50, 54, 54, 54, 54, 54, 54,
675 55, 50, 50, 50, 56, 56, 56, 56, 56, 56,
676 56, 56, 56, 56, 50, 56, 56, 56, 56, 56,
677 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
678 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
679 56, 50, 71, 116, 72, 72, 72, 72, 72, 72,
680 73, 85, 88, 126, 89, 213, 702, 117, 90, 74,
681 75, 699, 214, 127, 76, 91, 86, 87, 120, 92,
682 95, 74, 75, 99, 96, 100, 93, 118, 694, 94,
683 97, 119, 121, 689, 101, 146, 98, 123, 688, 76,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700684
Ian Romanick33fe3642010-08-30 11:59:48 -0700685 71, 102, 77, 77, 77, 77, 77, 77, 77, 103,
686 142, 108, 104, 124, 143, 105, 125, 74, 75, 109,
687 111, 106, 707, 112, 144, 128, 687, 113, 114, 74,
688 75, 110, 129, 130, 147, 115, 135, 131, 684, 136,
689 139, 150, 151, 132, 133, 140, 134, 707, 137, 141,
690 148, 156, 59, 156, 149, 138, 158, 158, 158, 158,
691 158, 158, 158, 59, 189, 59, 160, 161, 163, 164,
692 191, 264, 265, 240, 216, 190, 241, 208, 160, 161,
693 163, 164, 152, 201, 192, 209, 202, 203, 217, 153,
694 204, 235, 205, 154, 226, 150, 151, 683, 155, 71,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700695
Ian Romanick33fe3642010-08-30 11:59:48 -0700696 236, 73, 73, 73, 73, 73, 73, 73, 680, 148,
697 227, 59, 679, 149, 165, 165, 74, 75, 166, 166,
698 166, 166, 166, 166, 166, 150, 151, 523, 74, 75,
699 156, 321, 156, 250, 251, 524, 152, 294, 295, 296,
700 322, 556, 681, 153, 675, 250, 251, 154, 326, 327,
701 328, 676, 155, 158, 158, 158, 158, 158, 158, 158,
702 341, 342, 343, 352, 353, 354, 152, 360, 361, 362,
703 364, 365, 366, 153, 374, 375, 376, 154, 678, 248,
704 248, 589, 155, 249, 249, 249, 249, 249, 249, 249,
705 252, 252, 590, 682, 253, 253, 253, 253, 253, 253,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700706
Ian Romanick33fe3642010-08-30 11:59:48 -0700707 253, 166, 166, 166, 166, 166, 166, 166, 166, 166,
708 166, 166, 166, 166, 166, 249, 249, 249, 249, 249,
709 249, 249, 602, 603, 254, 249, 249, 249, 249, 249,
710 249, 249, 434, 435, 436, 677, 254, 674, 336, 336,
711 673, 161, 337, 337, 337, 337, 337, 337, 337, 437,
712 438, 439, 672, 161, 253, 253, 253, 253, 253, 253,
713 253, 253, 253, 253, 253, 253, 253, 253, 337, 337,
714 337, 337, 337, 337, 337, 551, 552, 164, 337, 337,
715 337, 337, 337, 337, 337, 425, 426, 427, 675, 164,
716 440, 441, 442, 671, 251, 676, 428, 429, 478, 479,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700717
Ian Romanick33fe3642010-08-30 11:59:48 -0700718 480, 500, 501, 502, 469, 670, 251, 525, 681, 481,
719 482, 669, 503, 504, 668, 526, 551, 552, 510, 511,
720 511, 511, 511, 511, 511, 537, 538, 539, 551, 552,
721 612, 613, 612, 613, 612, 613, 540, 541, 551, 552,
722 667, 685, 555, 555, 555, 555, 555, 555, 555, 686,
723 554, 697, 586, 587, 587, 587, 587, 587, 587, 682,
724 692, 666, 551, 552, 615, 690, 695, 693, 551, 552,
725 697, 665, 664, 691, 696, 554, 553, 553, 553, 553,
726 553, 553, 555, 555, 555, 555, 555, 555, 555, 615,
727 612, 613, 690, 663, 692, 695, 662, 612, 613, 661,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700728
Ian Romanick33fe3642010-08-30 11:59:48 -0700729 691, 693, 698, 696, 616, 616, 616, 616, 616, 616,
730 616, 614, 614, 614, 614, 614, 614, 612, 613, 700,
731 703, 698, 705, 660, 659, 658, 657, 701, 704, 656,
732 706, 616, 616, 616, 616, 616, 616, 616, 703, 705,
733 655, 654, 653, 652, 651, 650, 704, 706, 57, 57,
734 57, 57, 57, 57, 57, 57, 83, 83, 83, 83,
735 83, 159, 159, 159, 159, 159, 69, 69, 162, 162,
736 167, 167, 167, 247, 247, 649, 247, 247, 247, 247,
737 247, 553, 553, 553, 648, 647, 646, 553, 588, 588,
738 588, 614, 614, 614, 645, 644, 643, 614, 637, 637,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700739
Ian Romanick33fe3642010-08-30 11:59:48 -0700740 637, 642, 641, 640, 639, 638, 636, 635, 634, 633,
741 632, 631, 630, 629, 628, 627, 626, 625, 624, 623,
742 622, 621, 620, 619, 618, 617, 611, 610, 609, 608,
743 607, 606, 605, 604, 601, 600, 599, 598, 597, 596,
744 595, 594, 593, 592, 591, 585, 584, 583, 582, 581,
745 580, 579, 578, 577, 576, 575, 574, 573, 572, 571,
746 570, 569, 568, 567, 566, 565, 564, 563, 562, 561,
747 560, 559, 558, 557, 556, 550, 549, 548, 547, 546,
748 545, 544, 543, 542, 536, 535, 534, 533, 532, 531,
749 530, 529, 528, 527, 522, 521, 520, 519, 518, 517,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700750
Ian Romanick33fe3642010-08-30 11:59:48 -0700751 516, 515, 514, 513, 512, 509, 508, 507, 506, 505,
752 499, 498, 497, 496, 495, 494, 493, 492, 491, 490,
753 489, 488, 487, 486, 485, 484, 483, 477, 476, 475,
754 474, 473, 472, 471, 470, 469, 468, 467, 466, 465,
755 464, 463, 462, 461, 460, 459, 458, 457, 456, 455,
756 454, 453, 452, 451, 450, 449, 448, 447, 446, 445,
757 444, 443, 433, 432, 431, 430, 424, 423, 422, 421,
758 420, 419, 418, 417, 416, 415, 414, 413, 412, 411,
759 410, 409, 408, 407, 406, 405, 404, 403, 402, 401,
760 400, 399, 398, 397, 396, 395, 394, 393, 392, 391,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700761
Ian Romanick33fe3642010-08-30 11:59:48 -0700762 390, 389, 388, 387, 386, 385, 384, 383, 382, 381,
763 380, 379, 378, 377, 373, 372, 371, 370, 369, 368,
764 367, 363, 359, 358, 357, 356, 355, 351, 350, 349,
765 348, 347, 346, 345, 344, 340, 339, 338, 335, 334,
766 333, 332, 331, 330, 329, 325, 324, 323, 320, 319,
767 318, 317, 316, 315, 314, 313, 312, 311, 310, 309,
768 308, 307, 306, 305, 304, 303, 302, 301, 300, 299,
769 298, 297, 293, 292, 291, 290, 289, 288, 287, 286,
770 285, 284, 283, 282, 281, 280, 279, 278, 277, 276,
771 275, 274, 273, 272, 271, 270, 269, 268, 267, 266,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700772
Ian Romanick33fe3642010-08-30 11:59:48 -0700773 263, 262, 261, 260, 259, 258, 257, 256, 255, 246,
774 245, 244, 243, 242, 239, 238, 237, 234, 233, 232,
775 231, 230, 229, 228, 225, 224, 223, 222, 221, 220,
776 219, 218, 215, 212, 211, 210, 207, 206, 200, 199,
777 198, 197, 196, 195, 194, 193, 188, 187, 186, 185,
778 184, 183, 182, 181, 178, 177, 176, 175, 174, 173,
779 172, 171, 170, 169, 168, 157, 80, 145, 122, 107,
780 84, 80, 70, 64, 61, 60, 707, 58, 58, 7,
781 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
782 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
783
784 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
785 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
786 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
787 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
788 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700789 } ;
790
Ian Romanick33fe3642010-08-30 11:59:48 -0700791static yyconst flex_int16_t yy_chk[1145] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700792 { 0,
793 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
794 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
795 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
796 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
797 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700798 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700799 1, 1, 1, 1, 2, 9, 13, 9, 2, 15,
800 21, 21, 16, 17, 17, 17, 17, 17, 17, 17,
801 23, 23, 15, 13, 16, 94, 94, 2, 3, 3,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700802 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
803
804 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
805 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
806 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
807 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
Ian Romanick33fe3642010-08-30 11:59:48 -0700808 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
809 3, 3, 19, 35, 19, 19, 19, 19, 19, 19,
810 19, 26, 27, 40, 27, 121, 700, 35, 27, 19,
811 19, 694, 121, 40, 19, 28, 26, 26, 37, 28,
812 29, 19, 19, 30, 29, 30, 28, 36, 688, 28,
813 29, 36, 37, 685, 30, 46, 29, 39, 684, 19,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700814
Ian Romanick33fe3642010-08-30 11:59:48 -0700815 20, 31, 20, 20, 20, 20, 20, 20, 20, 31,
816 44, 33, 31, 39, 44, 31, 39, 20, 20, 33,
817 34, 31, 72, 34, 44, 41, 683, 34, 34, 20,
818 20, 33, 41, 41, 46, 34, 42, 41, 679, 42,
819 43, 48, 48, 41, 41, 43, 41, 72, 42, 43,
820 47, 51, 47, 51, 47, 42, 54, 54, 54, 54,
821 54, 54, 54, 59, 103, 59, 69, 69, 71, 71,
822 104, 180, 180, 144, 123, 103, 144, 117, 69, 69,
823 71, 71, 48, 114, 104, 117, 114, 114, 123, 48,
824 114, 140, 114, 48, 132, 149, 149, 677, 48, 73,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700825
Ian Romanick33fe3642010-08-30 11:59:48 -0700826 140, 73, 73, 73, 73, 73, 73, 73, 674, 148,
827 132, 148, 673, 148, 74, 74, 73, 73, 74, 74,
828 74, 74, 74, 74, 74, 150, 150, 483, 73, 73,
829 156, 235, 156, 162, 162, 483, 149, 210, 210, 210,
830 235, 556, 676, 149, 670, 162, 162, 149, 239, 239,
831 239, 670, 149, 158, 158, 158, 158, 158, 158, 158,
832 259, 259, 259, 269, 269, 269, 150, 278, 278, 278,
833 282, 282, 282, 150, 290, 290, 290, 150, 672, 160,
834 160, 556, 150, 160, 160, 160, 160, 160, 160, 160,
835 163, 163, 556, 676, 163, 163, 163, 163, 163, 163,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700836
Ian Romanick33fe3642010-08-30 11:59:48 -0700837 163, 165, 165, 165, 165, 165, 165, 165, 166, 166,
838 166, 166, 166, 166, 166, 248, 248, 248, 248, 248,
839 248, 248, 577, 577, 166, 249, 249, 249, 249, 249,
840 249, 249, 378, 378, 378, 671, 166, 665, 250, 250,
841 664, 249, 250, 250, 250, 250, 250, 250, 250, 379,
842 379, 379, 663, 249, 252, 252, 252, 252, 252, 252,
843 252, 253, 253, 253, 253, 253, 253, 253, 336, 336,
844 336, 336, 336, 336, 336, 588, 588, 253, 337, 337,
845 337, 337, 337, 337, 337, 368, 368, 368, 675, 253,
846 380, 380, 380, 657, 337, 675, 368, 368, 424, 424,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700847
Ian Romanick33fe3642010-08-30 11:59:48 -0700848 424, 463, 463, 463, 469, 656, 337, 484, 681, 424,
849 424, 654, 463, 463, 653, 484, 510, 510, 469, 469,
850 469, 469, 469, 469, 469, 497, 497, 497, 511, 511,
851 586, 586, 612, 612, 637, 637, 497, 497, 551, 551,
852 652, 682, 511, 511, 511, 511, 511, 511, 511, 682,
853 510, 693, 551, 551, 551, 551, 551, 551, 551, 681,
854 687, 651, 553, 553, 586, 686, 689, 687, 555, 555,
855 697, 650, 649, 686, 689, 510, 553, 553, 553, 553,
856 553, 553, 555, 555, 555, 555, 555, 555, 555, 586,
857 587, 587, 690, 648, 692, 695, 647, 614, 614, 646,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700858
Ian Romanick33fe3642010-08-30 11:59:48 -0700859 690, 692, 693, 695, 587, 587, 587, 587, 587, 587,
860 587, 614, 614, 614, 614, 614, 614, 616, 616, 698,
861 701, 697, 702, 644, 641, 640, 639, 698, 701, 638,
862 702, 616, 616, 616, 616, 616, 616, 616, 703, 705,
863 636, 635, 634, 632, 631, 630, 703, 705, 708, 708,
864 708, 708, 708, 708, 708, 708, 709, 709, 709, 709,
865 709, 710, 710, 710, 710, 710, 711, 711, 712, 712,
866 713, 713, 713, 714, 714, 629, 714, 714, 714, 714,
867 714, 715, 715, 715, 628, 627, 625, 715, 716, 716,
868 716, 717, 717, 717, 624, 623, 622, 717, 718, 718,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700869
Ian Romanick33fe3642010-08-30 11:59:48 -0700870 718, 621, 620, 619, 618, 617, 609, 608, 607, 606,
871 605, 604, 603, 602, 601, 600, 599, 598, 597, 596,
872 595, 593, 592, 591, 590, 589, 585, 584, 583, 582,
873 581, 580, 579, 578, 576, 572, 567, 566, 565, 564,
874 563, 562, 561, 560, 559, 550, 547, 546, 544, 543,
875 541, 540, 539, 538, 537, 536, 535, 534, 533, 531,
876 530, 529, 528, 527, 526, 525, 524, 523, 522, 521,
877 519, 518, 514, 513, 512, 509, 508, 506, 504, 503,
878 502, 501, 500, 498, 496, 495, 494, 493, 492, 491,
879 489, 488, 487, 486, 482, 481, 480, 479, 478, 477,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700880
Ian Romanick33fe3642010-08-30 11:59:48 -0700881 474, 473, 472, 471, 470, 468, 467, 466, 465, 464,
882 462, 461, 454, 453, 450, 449, 446, 445, 444, 443,
883 432, 431, 429, 428, 427, 426, 425, 422, 420, 419,
884 418, 416, 415, 413, 412, 411, 410, 408, 407, 405,
885 403, 402, 401, 400, 399, 398, 397, 396, 395, 394,
886 392, 391, 390, 389, 388, 387, 386, 385, 384, 383,
887 382, 381, 377, 373, 372, 369, 367, 357, 355, 351,
888 350, 349, 348, 346, 344, 339, 338, 335, 334, 333,
889 332, 331, 330, 325, 324, 323, 322, 321, 320, 319,
890 316, 315, 314, 313, 312, 311, 310, 309, 308, 307,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700891
Ian Romanick33fe3642010-08-30 11:59:48 -0700892 306, 305, 304, 303, 302, 301, 300, 299, 298, 297,
893 296, 295, 294, 291, 289, 288, 287, 286, 285, 284,
894 283, 281, 277, 275, 274, 273, 272, 268, 267, 266,
895 265, 264, 263, 262, 261, 258, 256, 255, 246, 245,
896 244, 243, 242, 241, 240, 238, 237, 236, 234, 233,
897 232, 231, 230, 229, 228, 227, 226, 225, 224, 223,
898 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
899 212, 211, 209, 208, 207, 206, 205, 204, 203, 202,
900 201, 200, 199, 198, 197, 196, 195, 194, 192, 191,
901 190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700902
Ian Romanick33fe3642010-08-30 11:59:48 -0700903 179, 178, 177, 176, 175, 174, 173, 172, 170, 155,
904 154, 153, 152, 145, 143, 142, 141, 139, 138, 137,
905 136, 135, 134, 133, 131, 130, 129, 128, 127, 126,
906 125, 124, 122, 120, 119, 118, 116, 115, 113, 112,
907 110, 109, 108, 107, 106, 105, 102, 101, 100, 99,
908 98, 97, 96, 95, 93, 92, 91, 90, 89, 88,
909 87, 86, 85, 82, 78, 53, 49, 45, 38, 32,
910 25, 22, 18, 14, 12, 11, 7, 6, 5, 707,
911 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
912 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
913
914 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
915 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
916 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
917 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
918 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700919 } ;
920
921/* The intent behind this definition is that it'll catch
922 * any uses of REJECT which flex missed.
923 */
924#define REJECT reject_used_but_not_detected
925#define yymore() yymore_used_but_not_detected
926#define YY_MORE_ADJ 0
927#define YY_RESTORE_YY_MORE_OFFSET
928#line 1 "glsl_lexer.lpp"
929#line 2 "glsl_lexer.lpp"
930/*
931 * Copyright © 2008, 2009 Intel Corporation
932 *
933 * Permission is hereby granted, free of charge, to any person obtaining a
934 * copy of this software and associated documentation files (the "Software"),
935 * to deal in the Software without restriction, including without limitation
936 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
937 * and/or sell copies of the Software, and to permit persons to whom the
938 * Software is furnished to do so, subject to the following conditions:
939 *
940 * The above copyright notice and this permission notice (including the next
941 * paragraph) shall be included in all copies or substantial portions of the
942 * Software.
943 *
944 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
945 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
946 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
947 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
948 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
949 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
950 * DEALINGS IN THE SOFTWARE.
951 */
952#include <ctype.h>
953#include "ast.h"
954#include "glsl_parser_extras.h"
955#include "glsl_parser.h"
956
957#define YY_USER_ACTION \
958 do { \
959 yylloc->source = 0; \
960 yylloc->first_column = yycolumn + 1; \
961 yylloc->first_line = yylineno + 1; \
962 yycolumn += yyleng; \
963 } while(0);
964
965#define YY_USER_INIT yylineno = 0; yycolumn = 0;
966
Eric Anholt6a416262010-08-01 18:44:21 -0700967#define TOKEN_OR_IDENTIFIER(version, token) \
968 do { \
969 if (yyextra->language_version >= version) { \
970 return token; \
971 } else { \
972 yylval->identifier = strdup(yytext); \
973 return IDENTIFIER; \
974 } \
975 } while (0)
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700976
Ian Romanickdb36e882010-08-11 17:03:37 -0700977#define RESERVED_WORD(version, token) \
978 do { \
979 if (yyextra->language_version >= version) { \
980 return token; \
981 } else { \
982 _mesa_glsl_error(yylloc, yyextra, \
983 "Illegal use of reserved word `%s'", yytext); \
984 return ERROR_TOK; \
985 } \
986 } while (0)
Eric Anholt6a416262010-08-01 18:44:21 -0700987
Ian Romanick33fe3642010-08-30 11:59:48 -0700988#line 989 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700989
990#define INITIAL 0
991#define PP 1
Ian Romanick33fe3642010-08-30 11:59:48 -0700992#define PRAGMA 2
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700993
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700994#define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
995
996/* Holds the entire state of the reentrant scanner. */
997struct yyguts_t
998 {
999
1000 /* User-defined. Not touched by flex. */
1001 YY_EXTRA_TYPE yyextra_r;
1002
1003 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1004 FILE *yyin_r, *yyout_r;
1005 size_t yy_buffer_stack_top; /**< index of top of stack. */
1006 size_t yy_buffer_stack_max; /**< capacity of stack. */
1007 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1008 char yy_hold_char;
1009 int yy_n_chars;
1010 int yyleng_r;
1011 char *yy_c_buf_p;
1012 int yy_init;
1013 int yy_start;
1014 int yy_did_buffer_switch_on_eof;
1015 int yy_start_stack_ptr;
1016 int yy_start_stack_depth;
1017 int *yy_start_stack;
1018 yy_state_type yy_last_accepting_state;
1019 char* yy_last_accepting_cpos;
1020
1021 int yylineno_r;
1022 int yy_flex_debug_r;
1023
1024 char *yytext_r;
1025 int yy_more_flag;
1026 int yy_more_len;
1027
1028 YYSTYPE * yylval_r;
1029
1030 YYLTYPE * yylloc_r;
1031
1032 }; /* end struct yyguts_t */
1033
1034static int yy_init_globals (yyscan_t yyscanner );
1035
1036 /* This must go here because YYSTYPE and YYLTYPE are included
1037 * from bison output in section 1.*/
1038 # define yylval yyg->yylval_r
1039
1040 # define yylloc yyg->yylloc_r
1041
1042int _mesa_glsl_lex_init (yyscan_t* scanner);
1043
1044int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1045
1046/* Accessor methods to globals.
1047 These are made visible to non-reentrant scanners for convenience. */
1048
1049int _mesa_glsl_lex_destroy (yyscan_t yyscanner );
1050
1051int _mesa_glsl_get_debug (yyscan_t yyscanner );
1052
1053void _mesa_glsl_set_debug (int debug_flag ,yyscan_t yyscanner );
1054
1055YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner );
1056
1057void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1058
1059FILE *_mesa_glsl_get_in (yyscan_t yyscanner );
1060
1061void _mesa_glsl_set_in (FILE * in_str ,yyscan_t yyscanner );
1062
1063FILE *_mesa_glsl_get_out (yyscan_t yyscanner );
1064
1065void _mesa_glsl_set_out (FILE * out_str ,yyscan_t yyscanner );
1066
1067int _mesa_glsl_get_leng (yyscan_t yyscanner );
1068
1069char *_mesa_glsl_get_text (yyscan_t yyscanner );
1070
1071int _mesa_glsl_get_lineno (yyscan_t yyscanner );
1072
1073void _mesa_glsl_set_lineno (int line_number ,yyscan_t yyscanner );
1074
1075YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner );
1076
1077void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1078
1079 YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner );
1080
1081 void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
1082
1083/* Macros after this point can all be overridden by user definitions in
1084 * section 1.
1085 */
1086
1087#ifndef YY_SKIP_YYWRAP
1088#ifdef __cplusplus
1089extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner );
1090#else
1091extern int _mesa_glsl_wrap (yyscan_t yyscanner );
1092#endif
1093#endif
1094
1095#ifndef yytext_ptr
1096static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1097#endif
1098
1099#ifdef YY_NEED_STRLEN
1100static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1101#endif
1102
1103#ifndef YY_NO_INPUT
1104
1105#ifdef __cplusplus
1106static int yyinput (yyscan_t yyscanner );
1107#else
1108static int input (yyscan_t yyscanner );
1109#endif
1110
1111#endif
1112
1113/* Amount of stuff to slurp up with each read. */
1114#ifndef YY_READ_BUF_SIZE
Ian Romanickdb36e882010-08-11 17:03:37 -07001115#ifdef __ia64__
1116/* On IA-64, the buffer size is 16k, not 8k */
1117#define YY_READ_BUF_SIZE 16384
1118#else
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001119#define YY_READ_BUF_SIZE 8192
Ian Romanickdb36e882010-08-11 17:03:37 -07001120#endif /* __ia64__ */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001121#endif
1122
1123/* Copy whatever the last rule matched to the standard output. */
1124#ifndef ECHO
1125/* This used to be an fputs(), but since the string might contain NUL's,
1126 * we now use fwrite().
1127 */
Ian Romanickdb36e882010-08-11 17:03:37 -07001128#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001129#endif
1130
1131/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1132 * is returned in "result".
1133 */
1134#ifndef YY_INPUT
1135#define YY_INPUT(buf,result,max_size) \
1136 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1137 { \
1138 int c = '*'; \
Ian Romanickdb36e882010-08-11 17:03:37 -07001139 size_t n; \
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001140 for ( n = 0; n < max_size && \
1141 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1142 buf[n] = (char) c; \
1143 if ( c == '\n' ) \
1144 buf[n++] = (char) c; \
1145 if ( c == EOF && ferror( yyin ) ) \
1146 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1147 result = n; \
1148 } \
1149 else \
1150 { \
1151 errno=0; \
1152 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1153 { \
1154 if( errno != EINTR) \
1155 { \
1156 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1157 break; \
1158 } \
1159 errno=0; \
1160 clearerr(yyin); \
1161 } \
1162 }\
1163\
1164
1165#endif
1166
1167/* No semi-colon after return; correct usage is to write "yyterminate();" -
1168 * we don't want an extra ';' after the "return" because that will cause
1169 * some compilers to complain about unreachable statements.
1170 */
1171#ifndef yyterminate
1172#define yyterminate() return YY_NULL
1173#endif
1174
1175/* Number of entries by which start-condition stack grows. */
1176#ifndef YY_START_STACK_INCR
1177#define YY_START_STACK_INCR 25
1178#endif
1179
1180/* Report a fatal error. */
1181#ifndef YY_FATAL_ERROR
1182#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1183#endif
1184
1185/* end tables serialization structures and prototypes */
1186
1187/* Default declaration of generated scanner - a define so the user can
1188 * easily add parameters.
1189 */
1190#ifndef YY_DECL
1191#define YY_DECL_IS_OURS 1
1192
1193extern int _mesa_glsl_lex \
1194 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1195
1196#define YY_DECL int _mesa_glsl_lex \
1197 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1198#endif /* !YY_DECL */
1199
1200/* Code executed at the beginning of each rule, after yytext and yyleng
1201 * have been set up.
1202 */
1203#ifndef YY_USER_ACTION
1204#define YY_USER_ACTION
1205#endif
1206
1207/* Code executed at the end of each rule. */
1208#ifndef YY_BREAK
1209#define YY_BREAK break;
1210#endif
1211
1212#define YY_RULE_SETUP \
1213 if ( yyleng > 0 ) \
1214 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1215 (yytext[yyleng - 1] == '\n'); \
1216 YY_USER_ACTION
1217
1218/** The main scanner function which does all the work.
1219 */
1220YY_DECL
1221{
1222 register yy_state_type yy_current_state;
1223 register char *yy_cp, *yy_bp;
1224 register int yy_act;
1225 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1226
Ian Romanickdb36e882010-08-11 17:03:37 -07001227#line 76 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001228
1229
Ian Romanick33fe3642010-08-30 11:59:48 -07001230#line 1231 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001231
1232 yylval = yylval_param;
1233
1234 yylloc = yylloc_param;
1235
1236 if ( !yyg->yy_init )
1237 {
1238 yyg->yy_init = 1;
1239
1240#ifdef YY_USER_INIT
1241 YY_USER_INIT;
1242#endif
1243
1244 if ( ! yyg->yy_start )
1245 yyg->yy_start = 1; /* first start state */
1246
1247 if ( ! yyin )
1248 yyin = stdin;
1249
1250 if ( ! yyout )
1251 yyout = stdout;
1252
1253 if ( ! YY_CURRENT_BUFFER ) {
1254 _mesa_glsl_ensure_buffer_stack (yyscanner);
1255 YY_CURRENT_BUFFER_LVALUE =
1256 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1257 }
1258
1259 _mesa_glsl__load_buffer_state(yyscanner );
1260 }
1261
1262 while ( 1 ) /* loops until end-of-file is reached */
1263 {
1264 yy_cp = yyg->yy_c_buf_p;
1265
1266 /* Support of yytext. */
1267 *yy_cp = yyg->yy_hold_char;
1268
1269 /* yy_bp points to the position in yy_ch_buf of the start of
1270 * the current run.
1271 */
1272 yy_bp = yy_cp;
1273
1274 yy_current_state = yyg->yy_start;
1275 yy_current_state += YY_AT_BOL();
1276yy_match:
1277 do
1278 {
1279 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1280 if ( yy_accept[yy_current_state] )
1281 {
1282 yyg->yy_last_accepting_state = yy_current_state;
1283 yyg->yy_last_accepting_cpos = yy_cp;
1284 }
1285 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1286 {
1287 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07001288 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001289 yy_c = yy_meta[(unsigned int) yy_c];
1290 }
1291 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1292 ++yy_cp;
1293 }
Ian Romanick33fe3642010-08-30 11:59:48 -07001294 while ( yy_current_state != 707 );
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001295 yy_cp = yyg->yy_last_accepting_cpos;
1296 yy_current_state = yyg->yy_last_accepting_state;
1297
1298yy_find_action:
1299 yy_act = yy_accept[yy_current_state];
1300
1301 YY_DO_BEFORE_ACTION;
1302
1303do_action: /* This label is used only to access EOF actions. */
1304
1305 switch ( yy_act )
1306 { /* beginning of action switch */
1307 case 0: /* must back up */
1308 /* undo the effects of YY_DO_BEFORE_ACTION */
1309 *yy_cp = yyg->yy_hold_char;
1310 yy_cp = yyg->yy_last_accepting_cpos;
1311 yy_current_state = yyg->yy_last_accepting_state;
1312 goto yy_find_action;
1313
1314case 1:
1315YY_RULE_SETUP
Ian Romanickdb36e882010-08-11 17:03:37 -07001316#line 78 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001317;
1318 YY_BREAK
1319/* Preprocessor tokens. */
1320case 2:
1321*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1322yyg->yy_c_buf_p = yy_cp -= 1;
1323YY_DO_BEFORE_ACTION; /* set up yytext again */
1324YY_RULE_SETUP
Ian Romanickdb36e882010-08-11 17:03:37 -07001325#line 81 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001326;
1327 YY_BREAK
1328case 3:
1329YY_RULE_SETUP
Ian Romanickdb36e882010-08-11 17:03:37 -07001330#line 82 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001331{ BEGIN PP; return VERSION; }
1332 YY_BREAK
1333case 4:
1334YY_RULE_SETUP
Ian Romanickdb36e882010-08-11 17:03:37 -07001335#line 83 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001336{ BEGIN PP; return EXTENSION; }
1337 YY_BREAK
1338case 5:
1339*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1340yyg->yy_c_buf_p = yy_cp -= 1;
1341YY_DO_BEFORE_ACTION; /* set up yytext again */
1342YY_RULE_SETUP
Ian Romanickdb36e882010-08-11 17:03:37 -07001343#line 84 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001344{
1345 /* Eat characters until the first digit is
1346 * encountered
1347 */
1348 char *ptr = yytext;
1349 while (!isdigit(*ptr))
1350 ptr++;
1351
1352 /* Subtract one from the line number because
1353 * yylineno is zero-based instead of
1354 * one-based.
1355 */
1356 yylineno = strtol(ptr, &ptr, 0) - 1;
1357 yylloc->source = strtol(ptr, NULL, 0);
1358 }
1359 YY_BREAK
1360case 6:
1361*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1362yyg->yy_c_buf_p = yy_cp -= 1;
1363YY_DO_BEFORE_ACTION; /* set up yytext again */
1364YY_RULE_SETUP
Ian Romanickdb36e882010-08-11 17:03:37 -07001365#line 99 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001366{
1367 /* Eat characters until the first digit is
1368 * encountered
1369 */
1370 char *ptr = yytext;
1371 while (!isdigit(*ptr))
1372 ptr++;
1373
1374 /* Subtract one from the line number because
1375 * yylineno is zero-based instead of
1376 * one-based.
1377 */
1378 yylineno = strtol(ptr, &ptr, 0) - 1;
1379 }
1380 YY_BREAK
1381case 7:
1382YY_RULE_SETUP
Ian Romanickdb36e882010-08-11 17:03:37 -07001383#line 113 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001384{
1385 BEGIN PP;
1386 return PRAGMA_DEBUG_ON;
1387 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001388 YY_BREAK
1389case 8:
1390YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001391#line 117 "glsl_lexer.lpp"
1392{
1393 BEGIN PP;
1394 return PRAGMA_DEBUG_OFF;
1395 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001396 YY_BREAK
1397case 9:
1398YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001399#line 121 "glsl_lexer.lpp"
1400{
1401 BEGIN PP;
1402 return PRAGMA_OPTIMIZE_ON;
1403 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001404 YY_BREAK
1405case 10:
1406YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001407#line 125 "glsl_lexer.lpp"
1408{
1409 BEGIN PP;
1410 return PRAGMA_OPTIMIZE_OFF;
1411 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001412 YY_BREAK
1413case 11:
1414YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001415#line 129 "glsl_lexer.lpp"
1416{ BEGIN PRAGMA; }
1417 YY_BREAK
1418case 12:
1419/* rule 12 can match eol */
1420YY_RULE_SETUP
1421#line 131 "glsl_lexer.lpp"
1422{ BEGIN 0; yylineno++; yycolumn = 0; }
1423 YY_BREAK
1424case 13:
1425YY_RULE_SETUP
1426#line 132 "glsl_lexer.lpp"
1427{ }
1428 YY_BREAK
1429case 14:
1430YY_RULE_SETUP
1431#line 134 "glsl_lexer.lpp"
1432{ }
1433 YY_BREAK
1434case 15:
1435YY_RULE_SETUP
1436#line 135 "glsl_lexer.lpp"
1437{ }
1438 YY_BREAK
1439case 16:
1440YY_RULE_SETUP
1441#line 136 "glsl_lexer.lpp"
1442return COLON;
1443 YY_BREAK
1444case 17:
1445YY_RULE_SETUP
1446#line 137 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001447{
1448 yylval->identifier = strdup(yytext);
1449 return IDENTIFIER;
1450 }
1451 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001452case 18:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001453YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001454#line 141 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001455{
1456 yylval->n = strtol(yytext, NULL, 10);
1457 return INTCONSTANT;
1458 }
1459 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001460case 19:
1461/* rule 19 can match eol */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001462YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001463#line 145 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001464{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
1465 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001466case 20:
Ian Romanick33fe3642010-08-30 11:59:48 -07001467/* rule 20 can match eol */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001468YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001469#line 147 "glsl_lexer.lpp"
1470{ yylineno++; yycolumn = 0; }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001471 YY_BREAK
1472case 21:
1473YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001474#line 149 "glsl_lexer.lpp"
1475return ATTRIBUTE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001476 YY_BREAK
1477case 22:
1478YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001479#line 150 "glsl_lexer.lpp"
1480return CONST_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001481 YY_BREAK
1482case 23:
1483YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001484#line 151 "glsl_lexer.lpp"
1485return BOOL_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001486 YY_BREAK
1487case 24:
1488YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001489#line 152 "glsl_lexer.lpp"
1490return FLOAT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001491 YY_BREAK
1492case 25:
1493YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001494#line 153 "glsl_lexer.lpp"
1495return INT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001496 YY_BREAK
1497case 26:
1498YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001499#line 155 "glsl_lexer.lpp"
1500return BREAK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001501 YY_BREAK
1502case 27:
1503YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001504#line 156 "glsl_lexer.lpp"
1505return CONTINUE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001506 YY_BREAK
1507case 28:
1508YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001509#line 157 "glsl_lexer.lpp"
1510return DO;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001511 YY_BREAK
1512case 29:
1513YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001514#line 158 "glsl_lexer.lpp"
1515return WHILE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001516 YY_BREAK
1517case 30:
1518YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001519#line 159 "glsl_lexer.lpp"
1520return ELSE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001521 YY_BREAK
1522case 31:
1523YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001524#line 160 "glsl_lexer.lpp"
1525return FOR;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001526 YY_BREAK
1527case 32:
1528YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001529#line 161 "glsl_lexer.lpp"
1530return IF;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001531 YY_BREAK
1532case 33:
1533YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001534#line 162 "glsl_lexer.lpp"
1535return DISCARD;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001536 YY_BREAK
1537case 34:
1538YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001539#line 163 "glsl_lexer.lpp"
1540return RETURN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001541 YY_BREAK
1542case 35:
1543YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001544#line 165 "glsl_lexer.lpp"
1545return BVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001546 YY_BREAK
1547case 36:
1548YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001549#line 166 "glsl_lexer.lpp"
1550return BVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001551 YY_BREAK
1552case 37:
1553YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001554#line 167 "glsl_lexer.lpp"
1555return BVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001556 YY_BREAK
1557case 38:
1558YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001559#line 168 "glsl_lexer.lpp"
1560return IVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001561 YY_BREAK
1562case 39:
1563YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001564#line 169 "glsl_lexer.lpp"
1565return IVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001566 YY_BREAK
1567case 40:
1568YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001569#line 170 "glsl_lexer.lpp"
1570return IVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001571 YY_BREAK
1572case 41:
1573YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001574#line 171 "glsl_lexer.lpp"
1575return VEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001576 YY_BREAK
1577case 42:
1578YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001579#line 172 "glsl_lexer.lpp"
1580return VEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001581 YY_BREAK
1582case 43:
1583YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001584#line 173 "glsl_lexer.lpp"
1585return VEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001586 YY_BREAK
1587case 44:
1588YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001589#line 174 "glsl_lexer.lpp"
1590return MAT2X2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001591 YY_BREAK
1592case 45:
1593YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001594#line 175 "glsl_lexer.lpp"
1595return MAT3X3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001596 YY_BREAK
1597case 46:
1598YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001599#line 176 "glsl_lexer.lpp"
1600return MAT4X4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001601 YY_BREAK
1602case 47:
1603YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001604#line 177 "glsl_lexer.lpp"
1605TOKEN_OR_IDENTIFIER(120, MAT2X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001606 YY_BREAK
1607case 48:
1608YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001609#line 178 "glsl_lexer.lpp"
1610TOKEN_OR_IDENTIFIER(120, MAT2X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001611 YY_BREAK
1612case 49:
1613YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001614#line 179 "glsl_lexer.lpp"
1615TOKEN_OR_IDENTIFIER(120, MAT2X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001616 YY_BREAK
1617case 50:
1618YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001619#line 180 "glsl_lexer.lpp"
1620TOKEN_OR_IDENTIFIER(120, MAT3X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001621 YY_BREAK
1622case 51:
1623YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001624#line 181 "glsl_lexer.lpp"
1625TOKEN_OR_IDENTIFIER(120, MAT3X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001626 YY_BREAK
1627case 52:
1628YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001629#line 182 "glsl_lexer.lpp"
1630TOKEN_OR_IDENTIFIER(120, MAT3X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001631 YY_BREAK
1632case 53:
1633YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001634#line 183 "glsl_lexer.lpp"
1635TOKEN_OR_IDENTIFIER(120, MAT4X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001636 YY_BREAK
1637case 54:
1638YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001639#line 184 "glsl_lexer.lpp"
1640TOKEN_OR_IDENTIFIER(120, MAT4X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001641 YY_BREAK
1642case 55:
1643YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001644#line 185 "glsl_lexer.lpp"
1645TOKEN_OR_IDENTIFIER(120, MAT4X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001646 YY_BREAK
1647case 56:
1648YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001649#line 187 "glsl_lexer.lpp"
1650return IN_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001651 YY_BREAK
1652case 57:
1653YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001654#line 188 "glsl_lexer.lpp"
1655return OUT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001656 YY_BREAK
1657case 58:
1658YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001659#line 189 "glsl_lexer.lpp"
1660return INOUT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001661 YY_BREAK
1662case 59:
1663YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001664#line 190 "glsl_lexer.lpp"
1665return UNIFORM;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001666 YY_BREAK
1667case 60:
1668YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001669#line 191 "glsl_lexer.lpp"
1670return VARYING;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001671 YY_BREAK
1672case 61:
1673YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001674#line 192 "glsl_lexer.lpp"
1675TOKEN_OR_IDENTIFIER(120, CENTROID);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001676 YY_BREAK
1677case 62:
1678YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001679#line 193 "glsl_lexer.lpp"
1680TOKEN_OR_IDENTIFIER(120, INVARIANT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001681 YY_BREAK
1682case 63:
1683YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001684#line 195 "glsl_lexer.lpp"
1685TOKEN_OR_IDENTIFIER(130, FLAT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001686 YY_BREAK
1687case 64:
1688YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001689#line 196 "glsl_lexer.lpp"
1690TOKEN_OR_IDENTIFIER(130, SMOOTH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001691 YY_BREAK
1692case 65:
1693YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001694#line 197 "glsl_lexer.lpp"
1695TOKEN_OR_IDENTIFIER(130, NOPERSPECTIVE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001696 YY_BREAK
1697case 66:
1698YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001699#line 199 "glsl_lexer.lpp"
1700return SAMPLER1D;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001701 YY_BREAK
1702case 67:
1703YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001704#line 200 "glsl_lexer.lpp"
1705return SAMPLER2D;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001706 YY_BREAK
1707case 68:
1708YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001709#line 201 "glsl_lexer.lpp"
1710return SAMPLER3D;
1711 YY_BREAK
1712case 69:
1713YY_RULE_SETUP
1714#line 202 "glsl_lexer.lpp"
1715return SAMPLERCUBE;
1716 YY_BREAK
1717case 70:
1718YY_RULE_SETUP
1719#line 203 "glsl_lexer.lpp"
1720return SAMPLER1DSHADOW;
1721 YY_BREAK
1722case 71:
1723YY_RULE_SETUP
1724#line 204 "glsl_lexer.lpp"
1725return SAMPLER2DSHADOW;
1726 YY_BREAK
1727case 72:
1728YY_RULE_SETUP
1729#line 206 "glsl_lexer.lpp"
1730return STRUCT;
1731 YY_BREAK
1732case 73:
1733YY_RULE_SETUP
1734#line 207 "glsl_lexer.lpp"
1735return VOID_TOK;
1736 YY_BREAK
1737case 74:
1738YY_RULE_SETUP
1739#line 209 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001740{
1741 if ((yyextra->language_version >= 140)
1742 || (yyextra->ARB_fragment_coord_conventions_enable)){
1743 return LAYOUT_TOK;
1744 } else {
1745 yylval->identifier = strdup(yytext);
1746 return IDENTIFIER;
1747 }
1748 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001749 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001750case 75:
1751YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001752#line 219 "glsl_lexer.lpp"
1753return INC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001754 YY_BREAK
1755case 76:
1756YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001757#line 220 "glsl_lexer.lpp"
1758return DEC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001759 YY_BREAK
1760case 77:
1761YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001762#line 221 "glsl_lexer.lpp"
1763return LE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001764 YY_BREAK
1765case 78:
1766YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001767#line 222 "glsl_lexer.lpp"
1768return GE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001769 YY_BREAK
1770case 79:
1771YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001772#line 223 "glsl_lexer.lpp"
1773return EQ_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001774 YY_BREAK
1775case 80:
1776YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001777#line 224 "glsl_lexer.lpp"
1778return NE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001779 YY_BREAK
1780case 81:
1781YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001782#line 225 "glsl_lexer.lpp"
1783return AND_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001784 YY_BREAK
1785case 82:
1786YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001787#line 226 "glsl_lexer.lpp"
1788return OR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001789 YY_BREAK
1790case 83:
1791YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001792#line 227 "glsl_lexer.lpp"
1793return XOR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001794 YY_BREAK
1795case 84:
1796YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001797#line 229 "glsl_lexer.lpp"
1798return MUL_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001799 YY_BREAK
1800case 85:
1801YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001802#line 230 "glsl_lexer.lpp"
1803return DIV_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001804 YY_BREAK
1805case 86:
1806YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001807#line 231 "glsl_lexer.lpp"
1808return ADD_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001809 YY_BREAK
1810case 87:
1811YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001812#line 232 "glsl_lexer.lpp"
1813return MOD_ASSIGN;
Ian Romanickf50f0652010-06-30 17:30:03 -07001814 YY_BREAK
1815case 88:
1816YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001817#line 233 "glsl_lexer.lpp"
1818return LEFT_ASSIGN;
1819 YY_BREAK
1820case 89:
1821YY_RULE_SETUP
1822#line 234 "glsl_lexer.lpp"
1823return RIGHT_ASSIGN;
1824 YY_BREAK
1825case 90:
1826YY_RULE_SETUP
1827#line 235 "glsl_lexer.lpp"
1828return AND_ASSIGN;
1829 YY_BREAK
1830case 91:
1831YY_RULE_SETUP
1832#line 236 "glsl_lexer.lpp"
1833return XOR_ASSIGN;
1834 YY_BREAK
1835case 92:
1836YY_RULE_SETUP
1837#line 237 "glsl_lexer.lpp"
1838return OR_ASSIGN;
1839 YY_BREAK
1840case 93:
1841YY_RULE_SETUP
1842#line 238 "glsl_lexer.lpp"
1843return SUB_ASSIGN;
1844 YY_BREAK
1845case 94:
1846YY_RULE_SETUP
1847#line 240 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001848{
1849 yylval->n = strtol(yytext, NULL, 10);
1850 return INTCONSTANT;
1851 }
1852 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001853case 95:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001854YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001855#line 244 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001856{
1857 yylval->n = strtol(yytext + 2, NULL, 16);
1858 return INTCONSTANT;
1859 }
1860 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001861case 96:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001862YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001863#line 248 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001864{
1865 yylval->n = strtol(yytext, NULL, 8);
1866 return INTCONSTANT;
1867 }
1868 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001869case 97:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001870YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001871#line 253 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001872{
1873 yylval->real = strtod(yytext, NULL);
1874 return FLOATCONSTANT;
1875 }
1876 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001877case 98:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001878YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001879#line 257 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001880{
1881 yylval->real = strtod(yytext, NULL);
1882 return FLOATCONSTANT;
1883 }
1884 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001885case 99:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001886YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001887#line 261 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001888{
1889 yylval->real = strtod(yytext, NULL);
1890 return FLOATCONSTANT;
1891 }
1892 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001893case 100:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001894YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001895#line 265 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001896{
1897 yylval->real = strtod(yytext, NULL);
1898 return FLOATCONSTANT;
1899 }
1900 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001901case 101:
Ian Romanickf50f0652010-06-30 17:30:03 -07001902YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001903#line 269 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001904{
Eric Anholt47f3f222010-08-02 11:26:43 -07001905 yylval->real = strtod(yytext, NULL);
1906 return FLOATCONSTANT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001907 }
1908 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001909case 102:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001910YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001911#line 274 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001912{
Eric Anholt47f3f222010-08-02 11:26:43 -07001913 yylval->n = 1;
1914 return BOOLCONSTANT;
1915 }
1916 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001917case 103:
Eric Anholt47f3f222010-08-02 11:26:43 -07001918YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001919#line 278 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07001920{
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001921 yylval->n = 0;
1922 return BOOLCONSTANT;
1923 }
1924 YY_BREAK
1925/* Reserved words in GLSL 1.10. */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001926case 104:
1927YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001928#line 285 "glsl_lexer.lpp"
1929RESERVED_WORD(999, ASM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001930 YY_BREAK
1931case 105:
1932YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001933#line 286 "glsl_lexer.lpp"
1934RESERVED_WORD(999, CLASS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001935 YY_BREAK
1936case 106:
1937YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001938#line 287 "glsl_lexer.lpp"
1939RESERVED_WORD(999, UNION);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001940 YY_BREAK
1941case 107:
1942YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001943#line 288 "glsl_lexer.lpp"
1944RESERVED_WORD(999, ENUM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001945 YY_BREAK
1946case 108:
1947YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001948#line 289 "glsl_lexer.lpp"
1949RESERVED_WORD(999, TYPEDEF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001950 YY_BREAK
1951case 109:
1952YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001953#line 290 "glsl_lexer.lpp"
1954RESERVED_WORD(999, TEMPLATE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001955 YY_BREAK
1956case 110:
1957YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001958#line 291 "glsl_lexer.lpp"
1959RESERVED_WORD(999, THIS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001960 YY_BREAK
1961case 111:
1962YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001963#line 292 "glsl_lexer.lpp"
1964RESERVED_WORD(999, PACKED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001965 YY_BREAK
1966case 112:
1967YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001968#line 293 "glsl_lexer.lpp"
1969RESERVED_WORD(999, GOTO);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001970 YY_BREAK
1971case 113:
1972YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001973#line 294 "glsl_lexer.lpp"
1974RESERVED_WORD(130, SWITCH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001975 YY_BREAK
1976case 114:
1977YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001978#line 295 "glsl_lexer.lpp"
1979RESERVED_WORD(130, DEFAULT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001980 YY_BREAK
1981case 115:
1982YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001983#line 296 "glsl_lexer.lpp"
1984RESERVED_WORD(999, INLINE_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001985 YY_BREAK
1986case 116:
1987YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001988#line 297 "glsl_lexer.lpp"
1989RESERVED_WORD(999, NOINLINE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001990 YY_BREAK
1991case 117:
1992YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001993#line 298 "glsl_lexer.lpp"
1994RESERVED_WORD(999, VOLATILE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001995 YY_BREAK
1996case 118:
1997YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07001998#line 299 "glsl_lexer.lpp"
1999RESERVED_WORD(999, PUBLIC_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002000 YY_BREAK
2001case 119:
2002YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002003#line 300 "glsl_lexer.lpp"
2004RESERVED_WORD(999, STATIC);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002005 YY_BREAK
2006case 120:
2007YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002008#line 301 "glsl_lexer.lpp"
2009RESERVED_WORD(999, EXTERN);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002010 YY_BREAK
2011case 121:
2012YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002013#line 302 "glsl_lexer.lpp"
2014RESERVED_WORD(999, EXTERNAL);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002015 YY_BREAK
2016case 122:
2017YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002018#line 303 "glsl_lexer.lpp"
2019RESERVED_WORD(999, INTERFACE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002020 YY_BREAK
2021case 123:
2022YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002023#line 304 "glsl_lexer.lpp"
2024RESERVED_WORD(999, LONG_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002025 YY_BREAK
2026case 124:
2027YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002028#line 305 "glsl_lexer.lpp"
2029RESERVED_WORD(999, SHORT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002030 YY_BREAK
2031case 125:
2032YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002033#line 306 "glsl_lexer.lpp"
2034RESERVED_WORD(999, DOUBLE_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002035 YY_BREAK
2036case 126:
2037YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002038#line 307 "glsl_lexer.lpp"
2039RESERVED_WORD(999, HALF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002040 YY_BREAK
2041case 127:
2042YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002043#line 308 "glsl_lexer.lpp"
2044RESERVED_WORD(999, FIXED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002045 YY_BREAK
2046case 128:
2047YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002048#line 309 "glsl_lexer.lpp"
2049RESERVED_WORD(999, UNSIGNED);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002050 YY_BREAK
2051case 129:
2052YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002053#line 310 "glsl_lexer.lpp"
2054RESERVED_WORD(999, INPUT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002055 YY_BREAK
2056case 130:
2057YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002058#line 311 "glsl_lexer.lpp"
2059RESERVED_WORD(999, OUTPUT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002060 YY_BREAK
2061case 131:
2062YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002063#line 312 "glsl_lexer.lpp"
2064RESERVED_WORD(999, HVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002065 YY_BREAK
2066case 132:
2067YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002068#line 313 "glsl_lexer.lpp"
2069RESERVED_WORD(999, HVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002070 YY_BREAK
2071case 133:
2072YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002073#line 314 "glsl_lexer.lpp"
2074RESERVED_WORD(999, HVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002075 YY_BREAK
2076case 134:
2077YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002078#line 315 "glsl_lexer.lpp"
2079RESERVED_WORD(999, DVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002080 YY_BREAK
2081case 135:
2082YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002083#line 316 "glsl_lexer.lpp"
2084RESERVED_WORD(999, DVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002085 YY_BREAK
2086case 136:
2087YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002088#line 317 "glsl_lexer.lpp"
2089RESERVED_WORD(999, DVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002090 YY_BREAK
2091case 137:
2092YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002093#line 318 "glsl_lexer.lpp"
2094RESERVED_WORD(999, FVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002095 YY_BREAK
2096case 138:
2097YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002098#line 319 "glsl_lexer.lpp"
2099RESERVED_WORD(999, FVEC3);
Ian Romanickf50f0652010-06-30 17:30:03 -07002100 YY_BREAK
2101case 139:
2102YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002103#line 320 "glsl_lexer.lpp"
2104RESERVED_WORD(999, FVEC4);
Eric Anholt47f3f222010-08-02 11:26:43 -07002105 YY_BREAK
2106case 140:
2107YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002108#line 321 "glsl_lexer.lpp"
2109return SAMPLER2DRECT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002110 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002111case 141:
2112YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002113#line 322 "glsl_lexer.lpp"
2114RESERVED_WORD(999, SAMPLER3DRECT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002115 YY_BREAK
2116case 142:
2117YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002118#line 323 "glsl_lexer.lpp"
2119return SAMPLER2DRECTSHADOW;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002120 YY_BREAK
2121case 143:
2122YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002123#line 324 "glsl_lexer.lpp"
2124RESERVED_WORD(999, SIZEOF);
Ian Romanickf50f0652010-06-30 17:30:03 -07002125 YY_BREAK
2126case 144:
2127YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002128#line 325 "glsl_lexer.lpp"
2129RESERVED_WORD(999, CAST);
Eric Anholt47f3f222010-08-02 11:26:43 -07002130 YY_BREAK
2131case 145:
2132YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002133#line 326 "glsl_lexer.lpp"
2134RESERVED_WORD(999, NAMESPACE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002135 YY_BREAK
2136case 146:
2137YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002138#line 327 "glsl_lexer.lpp"
2139RESERVED_WORD(999, USING);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002140 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002141/* Additional reserved words in GLSL 1.20. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002142case 147:
2143YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002144#line 330 "glsl_lexer.lpp"
2145TOKEN_OR_IDENTIFIER(120, LOWP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002146 YY_BREAK
2147case 148:
2148YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002149#line 331 "glsl_lexer.lpp"
2150TOKEN_OR_IDENTIFIER(120, MEDIUMP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002151 YY_BREAK
2152case 149:
2153YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002154#line 332 "glsl_lexer.lpp"
2155TOKEN_OR_IDENTIFIER(120, HIGHP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002156 YY_BREAK
2157case 150:
2158YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002159#line 333 "glsl_lexer.lpp"
2160TOKEN_OR_IDENTIFIER(120, PRECISION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002161 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002162/* Additional reserved words in GLSL 1.30. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002163case 151:
2164YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002165#line 336 "glsl_lexer.lpp"
2166TOKEN_OR_IDENTIFIER(130, COMMON);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002167 YY_BREAK
2168case 152:
2169YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002170#line 337 "glsl_lexer.lpp"
2171TOKEN_OR_IDENTIFIER(130, PARTITION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002172 YY_BREAK
2173case 153:
2174YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002175#line 338 "glsl_lexer.lpp"
2176TOKEN_OR_IDENTIFIER(130, ACTIVE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002177 YY_BREAK
2178case 154:
2179YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002180#line 339 "glsl_lexer.lpp"
2181TOKEN_OR_IDENTIFIER(130, SUPERP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002182 YY_BREAK
2183case 155:
2184YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002185#line 340 "glsl_lexer.lpp"
2186TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002187 YY_BREAK
2188case 156:
2189YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002190#line 341 "glsl_lexer.lpp"
2191TOKEN_OR_IDENTIFIER(130, FILTER);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002192 YY_BREAK
2193case 157:
2194YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002195#line 342 "glsl_lexer.lpp"
2196TOKEN_OR_IDENTIFIER(130, IMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002197 YY_BREAK
2198case 158:
2199YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002200#line 343 "glsl_lexer.lpp"
2201TOKEN_OR_IDENTIFIER(130, IMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002202 YY_BREAK
2203case 159:
2204YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002205#line 344 "glsl_lexer.lpp"
2206TOKEN_OR_IDENTIFIER(130, IMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002207 YY_BREAK
2208case 160:
2209YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002210#line 345 "glsl_lexer.lpp"
2211TOKEN_OR_IDENTIFIER(130, IMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002212 YY_BREAK
2213case 161:
2214YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002215#line 346 "glsl_lexer.lpp"
2216TOKEN_OR_IDENTIFIER(130, IIMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002217 YY_BREAK
2218case 162:
2219YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002220#line 347 "glsl_lexer.lpp"
2221TOKEN_OR_IDENTIFIER(130, IIMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002222 YY_BREAK
2223case 163:
2224YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002225#line 348 "glsl_lexer.lpp"
2226TOKEN_OR_IDENTIFIER(130, IIMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002227 YY_BREAK
2228case 164:
2229YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002230#line 349 "glsl_lexer.lpp"
2231TOKEN_OR_IDENTIFIER(130, IIMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002232 YY_BREAK
2233case 165:
2234YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002235#line 350 "glsl_lexer.lpp"
2236TOKEN_OR_IDENTIFIER(130, UIMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002237 YY_BREAK
2238case 166:
2239YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002240#line 351 "glsl_lexer.lpp"
2241TOKEN_OR_IDENTIFIER(130, UIMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002242 YY_BREAK
2243case 167:
2244YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002245#line 352 "glsl_lexer.lpp"
2246TOKEN_OR_IDENTIFIER(130, UIMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002247 YY_BREAK
2248case 168:
2249YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002250#line 353 "glsl_lexer.lpp"
2251TOKEN_OR_IDENTIFIER(130, UIMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002252 YY_BREAK
2253case 169:
2254YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002255#line 354 "glsl_lexer.lpp"
2256TOKEN_OR_IDENTIFIER(130, IMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002257 YY_BREAK
2258case 170:
2259YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002260#line 355 "glsl_lexer.lpp"
2261TOKEN_OR_IDENTIFIER(130, IMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002262 YY_BREAK
2263case 171:
2264YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002265#line 356 "glsl_lexer.lpp"
2266TOKEN_OR_IDENTIFIER(130, IIMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002267 YY_BREAK
2268case 172:
2269YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002270#line 357 "glsl_lexer.lpp"
2271TOKEN_OR_IDENTIFIER(130, IIMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002272 YY_BREAK
2273case 173:
2274YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002275#line 358 "glsl_lexer.lpp"
2276TOKEN_OR_IDENTIFIER(130, UIMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002277 YY_BREAK
2278case 174:
2279YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002280#line 359 "glsl_lexer.lpp"
2281TOKEN_OR_IDENTIFIER(130, UIMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002282 YY_BREAK
2283case 175:
2284YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002285#line 360 "glsl_lexer.lpp"
2286TOKEN_OR_IDENTIFIER(130, IMAGE1DSHADOW);
2287 YY_BREAK
2288case 176:
2289YY_RULE_SETUP
2290#line 361 "glsl_lexer.lpp"
2291TOKEN_OR_IDENTIFIER(130, IMAGE2DSHADOW);
2292 YY_BREAK
2293case 177:
2294YY_RULE_SETUP
2295#line 362 "glsl_lexer.lpp"
2296TOKEN_OR_IDENTIFIER(130, IMAGEBUFFER);
2297 YY_BREAK
2298case 178:
2299YY_RULE_SETUP
2300#line 363 "glsl_lexer.lpp"
2301TOKEN_OR_IDENTIFIER(130, IIMAGEBUFFER);
2302 YY_BREAK
2303case 179:
2304YY_RULE_SETUP
2305#line 364 "glsl_lexer.lpp"
2306TOKEN_OR_IDENTIFIER(130, UIMAGEBUFFER);
2307 YY_BREAK
2308case 180:
2309YY_RULE_SETUP
2310#line 365 "glsl_lexer.lpp"
2311TOKEN_OR_IDENTIFIER(130, ROW_MAJOR);
2312 YY_BREAK
2313case 181:
2314YY_RULE_SETUP
2315#line 367 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002316{
2317 struct _mesa_glsl_parse_state *state = yyextra;
2318 void *ctx = state;
2319 yylval->identifier = talloc_strdup(ctx, yytext);
2320 return IDENTIFIER;
2321 }
2322 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002323case 182:
Ian Romanickf50f0652010-06-30 17:30:03 -07002324YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002325#line 374 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07002326{ return yytext[0]; }
2327 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002328case 183:
Eric Anholt47f3f222010-08-02 11:26:43 -07002329YY_RULE_SETUP
Ian Romanick33fe3642010-08-30 11:59:48 -07002330#line 376 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002331ECHO;
2332 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002333#line 2334 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002334case YY_STATE_EOF(INITIAL):
2335case YY_STATE_EOF(PP):
Ian Romanick33fe3642010-08-30 11:59:48 -07002336case YY_STATE_EOF(PRAGMA):
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002337 yyterminate();
2338
2339 case YY_END_OF_BUFFER:
2340 {
2341 /* Amount of text matched not including the EOB char. */
2342 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2343
2344 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2345 *yy_cp = yyg->yy_hold_char;
2346 YY_RESTORE_YY_MORE_OFFSET
2347
2348 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2349 {
2350 /* We're scanning a new file or input source. It's
2351 * possible that this happened because the user
2352 * just pointed yyin at a new source and called
2353 * _mesa_glsl_lex(). If so, then we have to assure
2354 * consistency between YY_CURRENT_BUFFER and our
2355 * globals. Here is the right place to do so, because
2356 * this is the first action (other than possibly a
2357 * back-up) that will match for the new input source.
2358 */
2359 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2360 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2361 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2362 }
2363
2364 /* Note that here we test for yy_c_buf_p "<=" to the position
2365 * of the first EOB in the buffer, since yy_c_buf_p will
2366 * already have been incremented past the NUL character
2367 * (since all states make transitions on EOB to the
2368 * end-of-buffer state). Contrast this with the test
2369 * in input().
2370 */
2371 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2372 { /* This was really a NUL. */
2373 yy_state_type yy_next_state;
2374
2375 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2376
2377 yy_current_state = yy_get_previous_state( yyscanner );
2378
2379 /* Okay, we're now positioned to make the NUL
2380 * transition. We couldn't have
2381 * yy_get_previous_state() go ahead and do it
2382 * for us because it doesn't know how to deal
2383 * with the possibility of jamming (and we don't
2384 * want to build jamming into it because then it
2385 * will run more slowly).
2386 */
2387
2388 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2389
2390 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2391
2392 if ( yy_next_state )
2393 {
2394 /* Consume the NUL. */
2395 yy_cp = ++yyg->yy_c_buf_p;
2396 yy_current_state = yy_next_state;
2397 goto yy_match;
2398 }
2399
2400 else
2401 {
2402 yy_cp = yyg->yy_last_accepting_cpos;
2403 yy_current_state = yyg->yy_last_accepting_state;
2404 goto yy_find_action;
2405 }
2406 }
2407
2408 else switch ( yy_get_next_buffer( yyscanner ) )
2409 {
2410 case EOB_ACT_END_OF_FILE:
2411 {
2412 yyg->yy_did_buffer_switch_on_eof = 0;
2413
2414 if ( _mesa_glsl_wrap(yyscanner ) )
2415 {
2416 /* Note: because we've taken care in
2417 * yy_get_next_buffer() to have set up
2418 * yytext, we can now set up
2419 * yy_c_buf_p so that if some total
2420 * hoser (like flex itself) wants to
2421 * call the scanner after we return the
2422 * YY_NULL, it'll still work - another
2423 * YY_NULL will get returned.
2424 */
2425 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2426
2427 yy_act = YY_STATE_EOF(YY_START);
2428 goto do_action;
2429 }
2430
2431 else
2432 {
2433 if ( ! yyg->yy_did_buffer_switch_on_eof )
2434 YY_NEW_FILE;
2435 }
2436 break;
2437 }
2438
2439 case EOB_ACT_CONTINUE_SCAN:
2440 yyg->yy_c_buf_p =
2441 yyg->yytext_ptr + yy_amount_of_matched_text;
2442
2443 yy_current_state = yy_get_previous_state( yyscanner );
2444
2445 yy_cp = yyg->yy_c_buf_p;
2446 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2447 goto yy_match;
2448
2449 case EOB_ACT_LAST_MATCH:
2450 yyg->yy_c_buf_p =
2451 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2452
2453 yy_current_state = yy_get_previous_state( yyscanner );
2454
2455 yy_cp = yyg->yy_c_buf_p;
2456 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2457 goto yy_find_action;
2458 }
2459 break;
2460 }
2461
2462 default:
2463 YY_FATAL_ERROR(
2464 "fatal flex scanner internal error--no action found" );
2465 } /* end of action switch */
2466 } /* end of scanning one token */
2467} /* end of _mesa_glsl_lex */
2468
2469/* yy_get_next_buffer - try to read in a new buffer
2470 *
2471 * Returns a code representing an action:
2472 * EOB_ACT_LAST_MATCH -
2473 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2474 * EOB_ACT_END_OF_FILE - end of file
2475 */
2476static int yy_get_next_buffer (yyscan_t yyscanner)
2477{
2478 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2479 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2480 register char *source = yyg->yytext_ptr;
2481 register int number_to_move, i;
2482 int ret_val;
2483
2484 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2485 YY_FATAL_ERROR(
2486 "fatal flex scanner internal error--end of buffer missed" );
2487
2488 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2489 { /* Don't try to fill the buffer, so this is an EOF. */
2490 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2491 {
2492 /* We matched a single character, the EOB, so
2493 * treat this as a final EOF.
2494 */
2495 return EOB_ACT_END_OF_FILE;
2496 }
2497
2498 else
2499 {
2500 /* We matched some text prior to the EOB, first
2501 * process it.
2502 */
2503 return EOB_ACT_LAST_MATCH;
2504 }
2505 }
2506
2507 /* Try to read more data. */
2508
2509 /* First move last chars to start of buffer. */
2510 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2511
2512 for ( i = 0; i < number_to_move; ++i )
2513 *(dest++) = *(source++);
2514
2515 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2516 /* don't do the read, it's not guaranteed to return an EOF,
2517 * just force an EOF
2518 */
2519 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2520
2521 else
2522 {
2523 int num_to_read =
2524 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2525
2526 while ( num_to_read <= 0 )
2527 { /* Not enough room in the buffer - grow it. */
2528
2529 /* just a shorter name for the current buffer */
2530 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2531
2532 int yy_c_buf_p_offset =
2533 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2534
2535 if ( b->yy_is_our_buffer )
2536 {
2537 int new_size = b->yy_buf_size * 2;
2538
2539 if ( new_size <= 0 )
2540 b->yy_buf_size += b->yy_buf_size / 8;
2541 else
2542 b->yy_buf_size *= 2;
2543
2544 b->yy_ch_buf = (char *)
2545 /* Include room in for 2 EOB chars. */
2546 _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2547 }
2548 else
2549 /* Can't grow it, we don't own it. */
2550 b->yy_ch_buf = 0;
2551
2552 if ( ! b->yy_ch_buf )
2553 YY_FATAL_ERROR(
2554 "fatal error - scanner input buffer overflow" );
2555
2556 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2557
2558 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2559 number_to_move - 1;
2560
2561 }
2562
2563 if ( num_to_read > YY_READ_BUF_SIZE )
2564 num_to_read = YY_READ_BUF_SIZE;
2565
2566 /* Read in more data. */
2567 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2568 yyg->yy_n_chars, (size_t) num_to_read );
2569
2570 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2571 }
2572
2573 if ( yyg->yy_n_chars == 0 )
2574 {
2575 if ( number_to_move == YY_MORE_ADJ )
2576 {
2577 ret_val = EOB_ACT_END_OF_FILE;
2578 _mesa_glsl_restart(yyin ,yyscanner);
2579 }
2580
2581 else
2582 {
2583 ret_val = EOB_ACT_LAST_MATCH;
2584 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2585 YY_BUFFER_EOF_PENDING;
2586 }
2587 }
2588
2589 else
2590 ret_val = EOB_ACT_CONTINUE_SCAN;
2591
2592 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2593 /* Extend the array by 50%, plus the number we really need. */
2594 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2595 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2596 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2597 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2598 }
2599
2600 yyg->yy_n_chars += number_to_move;
2601 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2602 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2603
2604 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2605
2606 return ret_val;
2607}
2608
2609/* yy_get_previous_state - get the state just before the EOB char was reached */
2610
2611 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2612{
2613 register yy_state_type yy_current_state;
2614 register char *yy_cp;
2615 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2616
2617 yy_current_state = yyg->yy_start;
2618 yy_current_state += YY_AT_BOL();
2619
2620 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2621 {
2622 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2623 if ( yy_accept[yy_current_state] )
2624 {
2625 yyg->yy_last_accepting_state = yy_current_state;
2626 yyg->yy_last_accepting_cpos = yy_cp;
2627 }
2628 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2629 {
2630 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07002631 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002632 yy_c = yy_meta[(unsigned int) yy_c];
2633 }
2634 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2635 }
2636
2637 return yy_current_state;
2638}
2639
2640/* yy_try_NUL_trans - try to make a transition on the NUL character
2641 *
2642 * synopsis
2643 * next_state = yy_try_NUL_trans( current_state );
2644 */
2645 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2646{
2647 register int yy_is_jam;
2648 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2649 register char *yy_cp = yyg->yy_c_buf_p;
2650
2651 register YY_CHAR yy_c = 1;
2652 if ( yy_accept[yy_current_state] )
2653 {
2654 yyg->yy_last_accepting_state = yy_current_state;
2655 yyg->yy_last_accepting_cpos = yy_cp;
2656 }
2657 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2658 {
2659 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07002660 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002661 yy_c = yy_meta[(unsigned int) yy_c];
2662 }
2663 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Ian Romanick33fe3642010-08-30 11:59:48 -07002664 yy_is_jam = (yy_current_state == 707);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002665
2666 return yy_is_jam ? 0 : yy_current_state;
2667}
2668
2669#ifndef YY_NO_INPUT
2670#ifdef __cplusplus
2671 static int yyinput (yyscan_t yyscanner)
2672#else
2673 static int input (yyscan_t yyscanner)
2674#endif
2675
2676{
2677 int c;
2678 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2679
2680 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2681
2682 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2683 {
2684 /* yy_c_buf_p now points to the character we want to return.
2685 * If this occurs *before* the EOB characters, then it's a
2686 * valid NUL; if not, then we've hit the end of the buffer.
2687 */
2688 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2689 /* This was really a NUL. */
2690 *yyg->yy_c_buf_p = '\0';
2691
2692 else
2693 { /* need more input */
2694 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2695 ++yyg->yy_c_buf_p;
2696
2697 switch ( yy_get_next_buffer( yyscanner ) )
2698 {
2699 case EOB_ACT_LAST_MATCH:
2700 /* This happens because yy_g_n_b()
2701 * sees that we've accumulated a
2702 * token and flags that we need to
2703 * try matching the token before
2704 * proceeding. But for input(),
2705 * there's no matching to consider.
2706 * So convert the EOB_ACT_LAST_MATCH
2707 * to EOB_ACT_END_OF_FILE.
2708 */
2709
2710 /* Reset buffer status. */
2711 _mesa_glsl_restart(yyin ,yyscanner);
2712
2713 /*FALLTHROUGH*/
2714
2715 case EOB_ACT_END_OF_FILE:
2716 {
2717 if ( _mesa_glsl_wrap(yyscanner ) )
2718 return EOF;
2719
2720 if ( ! yyg->yy_did_buffer_switch_on_eof )
2721 YY_NEW_FILE;
2722#ifdef __cplusplus
2723 return yyinput(yyscanner);
2724#else
2725 return input(yyscanner);
2726#endif
2727 }
2728
2729 case EOB_ACT_CONTINUE_SCAN:
2730 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2731 break;
2732 }
2733 }
2734 }
2735
2736 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2737 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2738 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2739
2740 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2741
2742 return c;
2743}
2744#endif /* ifndef YY_NO_INPUT */
2745
2746/** Immediately switch to a different input stream.
2747 * @param input_file A readable stream.
2748 * @param yyscanner The scanner object.
2749 * @note This function does not reset the start condition to @c INITIAL .
2750 */
2751 void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner)
2752{
2753 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2754
2755 if ( ! YY_CURRENT_BUFFER ){
2756 _mesa_glsl_ensure_buffer_stack (yyscanner);
2757 YY_CURRENT_BUFFER_LVALUE =
2758 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2759 }
2760
2761 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2762 _mesa_glsl__load_buffer_state(yyscanner );
2763}
2764
2765/** Switch to a different input buffer.
2766 * @param new_buffer The new input buffer.
2767 * @param yyscanner The scanner object.
2768 */
2769 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2770{
2771 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2772
2773 /* TODO. We should be able to replace this entire function body
2774 * with
2775 * _mesa_glsl_pop_buffer_state();
2776 * _mesa_glsl_push_buffer_state(new_buffer);
2777 */
2778 _mesa_glsl_ensure_buffer_stack (yyscanner);
2779 if ( YY_CURRENT_BUFFER == new_buffer )
2780 return;
2781
2782 if ( YY_CURRENT_BUFFER )
2783 {
2784 /* Flush out information for old buffer. */
2785 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2786 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2787 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2788 }
2789
2790 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2791 _mesa_glsl__load_buffer_state(yyscanner );
2792
2793 /* We don't actually know whether we did this switch during
2794 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2795 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2796 * to go ahead and always set it.
2797 */
2798 yyg->yy_did_buffer_switch_on_eof = 1;
2799}
2800
2801static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner)
2802{
2803 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2804 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2805 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2806 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2807 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2808}
2809
2810/** Allocate and initialize an input buffer state.
2811 * @param file A readable stream.
2812 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2813 * @param yyscanner The scanner object.
2814 * @return the allocated buffer state.
2815 */
2816 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner)
2817{
2818 YY_BUFFER_STATE b;
2819
2820 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2821 if ( ! b )
2822 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2823
2824 b->yy_buf_size = size;
2825
2826 /* yy_ch_buf has to be 2 characters longer than the size given because
2827 * we need to put in 2 end-of-buffer characters.
2828 */
2829 b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner );
2830 if ( ! b->yy_ch_buf )
2831 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2832
2833 b->yy_is_our_buffer = 1;
2834
2835 _mesa_glsl__init_buffer(b,file ,yyscanner);
2836
2837 return b;
2838}
2839
2840/** Destroy the buffer.
2841 * @param b a buffer created with _mesa_glsl__create_buffer()
2842 * @param yyscanner The scanner object.
2843 */
2844 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2845{
2846 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2847
2848 if ( ! b )
2849 return;
2850
2851 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2852 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2853
2854 if ( b->yy_is_our_buffer )
2855 _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner );
2856
2857 _mesa_glsl_free((void *) b ,yyscanner );
2858}
2859
2860/* Initializes or reinitializes a buffer.
2861 * This function is sometimes called more than once on the same buffer,
2862 * such as during a _mesa_glsl_restart() or at EOF.
2863 */
2864 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2865
2866{
2867 int oerrno = errno;
2868 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2869
2870 _mesa_glsl__flush_buffer(b ,yyscanner);
2871
2872 b->yy_input_file = file;
2873 b->yy_fill_buffer = 1;
2874
2875 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
2876 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
2877 * In that case, we don't want to reset the lineno or column.
2878 */
2879 if (b != YY_CURRENT_BUFFER){
2880 b->yy_bs_lineno = 1;
2881 b->yy_bs_column = 0;
2882 }
2883
2884 b->yy_is_interactive = 0;
2885
2886 errno = oerrno;
2887}
2888
2889/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2890 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2891 * @param yyscanner The scanner object.
2892 */
2893 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2894{
2895 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2896 if ( ! b )
2897 return;
2898
2899 b->yy_n_chars = 0;
2900
2901 /* We always need two end-of-buffer characters. The first causes
2902 * a transition to the end-of-buffer state. The second causes
2903 * a jam in that state.
2904 */
2905 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2906 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2907
2908 b->yy_buf_pos = &b->yy_ch_buf[0];
2909
2910 b->yy_at_bol = 1;
2911 b->yy_buffer_status = YY_BUFFER_NEW;
2912
2913 if ( b == YY_CURRENT_BUFFER )
2914 _mesa_glsl__load_buffer_state(yyscanner );
2915}
2916
2917/** Pushes the new state onto the stack. The new state becomes
2918 * the current state. This function will allocate the stack
2919 * if necessary.
2920 * @param new_buffer The new state.
2921 * @param yyscanner The scanner object.
2922 */
2923void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2924{
2925 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2926 if (new_buffer == NULL)
2927 return;
2928
2929 _mesa_glsl_ensure_buffer_stack(yyscanner);
2930
2931 /* This block is copied from _mesa_glsl__switch_to_buffer. */
2932 if ( YY_CURRENT_BUFFER )
2933 {
2934 /* Flush out information for old buffer. */
2935 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2936 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2937 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2938 }
2939
2940 /* Only push if top exists. Otherwise, replace top. */
2941 if (YY_CURRENT_BUFFER)
2942 yyg->yy_buffer_stack_top++;
2943 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2944
2945 /* copied from _mesa_glsl__switch_to_buffer. */
2946 _mesa_glsl__load_buffer_state(yyscanner );
2947 yyg->yy_did_buffer_switch_on_eof = 1;
2948}
2949
2950/** Removes and deletes the top of the stack, if present.
2951 * The next element becomes the new top.
2952 * @param yyscanner The scanner object.
2953 */
2954void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner)
2955{
2956 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2957 if (!YY_CURRENT_BUFFER)
2958 return;
2959
2960 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2961 YY_CURRENT_BUFFER_LVALUE = NULL;
2962 if (yyg->yy_buffer_stack_top > 0)
2963 --yyg->yy_buffer_stack_top;
2964
2965 if (YY_CURRENT_BUFFER) {
2966 _mesa_glsl__load_buffer_state(yyscanner );
2967 yyg->yy_did_buffer_switch_on_eof = 1;
2968 }
2969}
2970
2971/* Allocates the stack if it does not exist.
2972 * Guarantees space for at least one push.
2973 */
2974static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner)
2975{
2976 int num_to_alloc;
2977 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2978
2979 if (!yyg->yy_buffer_stack) {
2980
2981 /* First allocation is just for 2 elements, since we don't know if this
2982 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2983 * immediate realloc on the next call.
2984 */
2985 num_to_alloc = 1;
2986 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc
2987 (num_to_alloc * sizeof(struct yy_buffer_state*)
2988 , yyscanner);
2989 if ( ! yyg->yy_buffer_stack )
2990 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
2991
2992 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2993
2994 yyg->yy_buffer_stack_max = num_to_alloc;
2995 yyg->yy_buffer_stack_top = 0;
2996 return;
2997 }
2998
2999 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3000
3001 /* Increase the buffer to prepare for a possible push. */
3002 int grow_size = 8 /* arbitrary grow size */;
3003
3004 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3005 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc
3006 (yyg->yy_buffer_stack,
3007 num_to_alloc * sizeof(struct yy_buffer_state*)
3008 , yyscanner);
3009 if ( ! yyg->yy_buffer_stack )
3010 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3011
3012 /* zero only the new slots.*/
3013 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3014 yyg->yy_buffer_stack_max = num_to_alloc;
3015 }
3016}
3017
3018/** Setup the input buffer state to scan directly from a user-specified character buffer.
3019 * @param base the character buffer
3020 * @param size the size in bytes of the character buffer
3021 * @param yyscanner The scanner object.
3022 * @return the newly allocated buffer state object.
3023 */
3024YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3025{
3026 YY_BUFFER_STATE b;
3027
3028 if ( size < 2 ||
3029 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3030 base[size-1] != YY_END_OF_BUFFER_CHAR )
3031 /* They forgot to leave room for the EOB's. */
3032 return 0;
3033
3034 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3035 if ( ! b )
3036 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3037
3038 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3039 b->yy_buf_pos = b->yy_ch_buf = base;
3040 b->yy_is_our_buffer = 0;
3041 b->yy_input_file = 0;
3042 b->yy_n_chars = b->yy_buf_size;
3043 b->yy_is_interactive = 0;
3044 b->yy_at_bol = 1;
3045 b->yy_fill_buffer = 0;
3046 b->yy_buffer_status = YY_BUFFER_NEW;
3047
3048 _mesa_glsl__switch_to_buffer(b ,yyscanner );
3049
3050 return b;
3051}
3052
3053/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3054 * scan from a @e copy of @a str.
3055 * @param yystr a NUL-terminated string to scan
3056 * @param yyscanner The scanner object.
3057 * @return the newly allocated buffer state object.
3058 * @note If you want to scan bytes that may contain NUL values, then use
3059 * _mesa_glsl__scan_bytes() instead.
3060 */
3061YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner)
3062{
3063
3064 return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner);
3065}
3066
3067/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3068 * scan from a @e copy of @a bytes.
Ian Romanickdb36e882010-08-11 17:03:37 -07003069 * @param yybytes the byte buffer to scan
3070 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003071 * @param yyscanner The scanner object.
3072 * @return the newly allocated buffer state object.
3073 */
3074YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3075{
3076 YY_BUFFER_STATE b;
3077 char *buf;
3078 yy_size_t n;
3079 int i;
3080
3081 /* Get memory for full buffer, including space for trailing EOB's. */
3082 n = _yybytes_len + 2;
3083 buf = (char *) _mesa_glsl_alloc(n ,yyscanner );
3084 if ( ! buf )
3085 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3086
3087 for ( i = 0; i < _yybytes_len; ++i )
3088 buf[i] = yybytes[i];
3089
3090 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3091
3092 b = _mesa_glsl__scan_buffer(buf,n ,yyscanner);
3093 if ( ! b )
3094 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3095
3096 /* It's okay to grow etc. this buffer, and we should throw it
3097 * away when we're done.
3098 */
3099 b->yy_is_our_buffer = 1;
3100
3101 return b;
3102}
3103
3104#ifndef YY_EXIT_FAILURE
3105#define YY_EXIT_FAILURE 2
3106#endif
3107
3108static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3109{
3110 (void) fprintf( stderr, "%s\n", msg );
3111 exit( YY_EXIT_FAILURE );
3112}
3113
3114/* Redefine yyless() so it works in section 3 code. */
3115
3116#undef yyless
3117#define yyless(n) \
3118 do \
3119 { \
3120 /* Undo effects of setting up yytext. */ \
3121 int yyless_macro_arg = (n); \
3122 YY_LESS_LINENO(yyless_macro_arg);\
3123 yytext[yyleng] = yyg->yy_hold_char; \
3124 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3125 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3126 *yyg->yy_c_buf_p = '\0'; \
3127 yyleng = yyless_macro_arg; \
3128 } \
3129 while ( 0 )
3130
3131/* Accessor methods (get/set functions) to struct members. */
3132
3133/** Get the user-defined data for this scanner.
3134 * @param yyscanner The scanner object.
3135 */
3136YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner)
3137{
3138 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3139 return yyextra;
3140}
3141
3142/** Get the current line number.
3143 * @param yyscanner The scanner object.
3144 */
3145int _mesa_glsl_get_lineno (yyscan_t yyscanner)
3146{
3147 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3148
3149 if (! YY_CURRENT_BUFFER)
3150 return 0;
3151
3152 return yylineno;
3153}
3154
3155/** Get the current column number.
3156 * @param yyscanner The scanner object.
3157 */
3158int _mesa_glsl_get_column (yyscan_t yyscanner)
3159{
3160 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3161
3162 if (! YY_CURRENT_BUFFER)
3163 return 0;
3164
3165 return yycolumn;
3166}
3167
3168/** Get the input stream.
3169 * @param yyscanner The scanner object.
3170 */
3171FILE *_mesa_glsl_get_in (yyscan_t yyscanner)
3172{
3173 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3174 return yyin;
3175}
3176
3177/** Get the output stream.
3178 * @param yyscanner The scanner object.
3179 */
3180FILE *_mesa_glsl_get_out (yyscan_t yyscanner)
3181{
3182 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3183 return yyout;
3184}
3185
3186/** Get the length of the current token.
3187 * @param yyscanner The scanner object.
3188 */
3189int _mesa_glsl_get_leng (yyscan_t yyscanner)
3190{
3191 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3192 return yyleng;
3193}
3194
3195/** Get the current token.
3196 * @param yyscanner The scanner object.
3197 */
3198
3199char *_mesa_glsl_get_text (yyscan_t yyscanner)
3200{
3201 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3202 return yytext;
3203}
3204
3205/** Set the user-defined data. This data is never touched by the scanner.
3206 * @param user_defined The data to be associated with this scanner.
3207 * @param yyscanner The scanner object.
3208 */
3209void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3210{
3211 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3212 yyextra = user_defined ;
3213}
3214
3215/** Set the current line number.
3216 * @param line_number
3217 * @param yyscanner The scanner object.
3218 */
3219void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner)
3220{
3221 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3222
3223 /* lineno is only valid if an input buffer exists. */
3224 if (! YY_CURRENT_BUFFER )
3225 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner);
3226
3227 yylineno = line_number;
3228}
3229
3230/** Set the current column.
3231 * @param line_number
3232 * @param yyscanner The scanner object.
3233 */
3234void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner)
3235{
3236 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3237
3238 /* column is only valid if an input buffer exists. */
3239 if (! YY_CURRENT_BUFFER )
3240 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner);
3241
3242 yycolumn = column_no;
3243}
3244
3245/** Set the input stream. This does not discard the current
3246 * input buffer.
3247 * @param in_str A readable stream.
3248 * @param yyscanner The scanner object.
3249 * @see _mesa_glsl__switch_to_buffer
3250 */
3251void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner)
3252{
3253 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3254 yyin = in_str ;
3255}
3256
3257void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner)
3258{
3259 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3260 yyout = out_str ;
3261}
3262
3263int _mesa_glsl_get_debug (yyscan_t yyscanner)
3264{
3265 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3266 return yy_flex_debug;
3267}
3268
3269void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner)
3270{
3271 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3272 yy_flex_debug = bdebug ;
3273}
3274
3275/* Accessor methods for yylval and yylloc */
3276
3277YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner)
3278{
3279 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3280 return yylval;
3281}
3282
3283void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3284{
3285 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3286 yylval = yylval_param;
3287}
3288
3289YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner)
3290{
3291 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3292 return yylloc;
3293}
3294
3295void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3296{
3297 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3298 yylloc = yylloc_param;
3299}
3300
3301/* User-visible API */
3302
3303/* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3304 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3305 * That's why we explicitly handle the declaration, instead of using our macros.
3306 */
3307
3308int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals)
3309
3310{
3311 if (ptr_yy_globals == NULL){
3312 errno = EINVAL;
3313 return 1;
3314 }
3315
3316 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL );
3317
3318 if (*ptr_yy_globals == NULL){
3319 errno = ENOMEM;
3320 return 1;
3321 }
3322
3323 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3324 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3325
3326 return yy_init_globals ( *ptr_yy_globals );
3327}
3328
3329/* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3330 * convention of taking the scanner as the last argument. Note however, that
3331 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3332 * is the reason, too, why this function also must handle its own declaration).
3333 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3334 * the yyextra field.
3335 */
3336
3337int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3338
3339{
3340 struct yyguts_t dummy_yyguts;
3341
3342 _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts);
3343
3344 if (ptr_yy_globals == NULL){
3345 errno = EINVAL;
3346 return 1;
3347 }
3348
3349 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3350
3351 if (*ptr_yy_globals == NULL){
3352 errno = ENOMEM;
3353 return 1;
3354 }
3355
3356 /* By setting to 0xAA, we expose bugs in
3357 yy_init_globals. Leave at 0x00 for releases. */
3358 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3359
3360 _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals);
3361
3362 return yy_init_globals ( *ptr_yy_globals );
3363}
3364
3365static int yy_init_globals (yyscan_t yyscanner)
3366{
3367 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3368 /* Initialization is the same as for the non-reentrant scanner.
3369 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3370 */
3371
3372 yyg->yy_buffer_stack = 0;
3373 yyg->yy_buffer_stack_top = 0;
3374 yyg->yy_buffer_stack_max = 0;
3375 yyg->yy_c_buf_p = (char *) 0;
3376 yyg->yy_init = 0;
3377 yyg->yy_start = 0;
3378
3379 yyg->yy_start_stack_ptr = 0;
3380 yyg->yy_start_stack_depth = 0;
3381 yyg->yy_start_stack = NULL;
3382
3383/* Defined in main.c */
3384#ifdef YY_STDINIT
3385 yyin = stdin;
3386 yyout = stdout;
3387#else
3388 yyin = (FILE *) 0;
3389 yyout = (FILE *) 0;
3390#endif
3391
3392 /* For future reference: Set errno on error, since we are called by
3393 * _mesa_glsl_lex_init()
3394 */
3395 return 0;
3396}
3397
3398/* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3399int _mesa_glsl_lex_destroy (yyscan_t yyscanner)
3400{
3401 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3402
3403 /* Pop the buffer stack, destroying each element. */
3404 while(YY_CURRENT_BUFFER){
3405 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3406 YY_CURRENT_BUFFER_LVALUE = NULL;
3407 _mesa_glsl_pop_buffer_state(yyscanner);
3408 }
3409
3410 /* Destroy the stack itself. */
3411 _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner);
3412 yyg->yy_buffer_stack = NULL;
3413
3414 /* Destroy the start condition stack. */
3415 _mesa_glsl_free(yyg->yy_start_stack ,yyscanner );
3416 yyg->yy_start_stack = NULL;
3417
3418 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3419 * _mesa_glsl_lex() is called, initialization will occur. */
3420 yy_init_globals( yyscanner);
3421
3422 /* Destroy the main struct (reentrant only). */
3423 _mesa_glsl_free ( yyscanner , yyscanner );
3424 yyscanner = NULL;
3425 return 0;
3426}
3427
3428/*
3429 * Internal utility routines.
3430 */
3431
3432#ifndef yytext_ptr
3433static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3434{
3435 register int i;
3436 for ( i = 0; i < n; ++i )
3437 s1[i] = s2[i];
3438}
3439#endif
3440
3441#ifdef YY_NEED_STRLEN
3442static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3443{
3444 register int n;
3445 for ( n = 0; s[n]; ++n )
3446 ;
3447
3448 return n;
3449}
3450#endif
3451
3452void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner)
3453{
3454 return (void *) malloc( size );
3455}
3456
3457void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3458{
3459 /* The cast to (char *) in the following accommodates both
3460 * implementations that use char* generic pointers, and those
3461 * that use void* generic pointers. It works with the latter
3462 * because both ANSI C and C++ allow castless assignment from
3463 * any pointer type to void*, and deal with argument conversions
3464 * as though doing an assignment.
3465 */
3466 return (void *) realloc( (char *) ptr, size );
3467}
3468
3469void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
3470{
3471 free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */
3472}
3473
3474#define YYTABLES_NAME "yytables"
3475
Ian Romanick33fe3642010-08-30 11:59:48 -07003476#line 376 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003477
3478
3479
3480void
3481_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
3482{
3483 _mesa_glsl_lex_init_extra(state,& state->scanner);
3484 _mesa_glsl__scan_string(string,state->scanner);
3485}
3486
3487void
3488_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
3489{
3490 _mesa_glsl_lex_destroy(state->scanner);
3491}
3492