blob: 43be3170ba8e341091d2cde5789877db4a1e75a5 [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
87#endif /* ! C99 */
88
89#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
162#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
169#define YY_BUF_SIZE 16384
170#endif /* __ia64__ */
171#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
Eric Anholt47f3f222010-08-02 11:26:43 -0700361#define YY_NUM_RULES 147
362#define YY_END_OF_BUFFER 148
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 };
Eric Anholt47f3f222010-08-02 11:26:43 -0700370static yyconst flex_int16_t yy_accept[525] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700371 { 0,
Eric Anholt47f3f222010-08-02 11:26:43 -0700372 0, 0, 9, 9, 148, 146, 1, 14, 146, 146,
373 146, 146, 146, 146, 146, 146, 90, 88, 146, 146,
374 146, 145, 146, 145, 145, 145, 145, 145, 145, 145,
375 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
376 145, 145, 145, 146, 1, 146, 85, 147, 9, 13,
377 147, 12, 10, 11, 1, 74, 81, 75, 84, 78,
Ian Romanickf50f0652010-06-30 17:30:03 -0700378 69, 80, 70, 87, 92, 79, 93, 90, 0, 0,
Eric Anholt47f3f222010-08-02 11:26:43 -0700379 95, 0, 88, 0, 71, 73, 72, 0, 145, 77,
380 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
381 145, 22, 145, 145, 145, 145, 145, 145, 145, 145,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700382
Eric Anholt47f3f222010-08-02 11:26:43 -0700383 145, 145, 145, 145, 145, 26, 50, 145, 145, 145,
384 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
385 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
386 145, 145, 145, 145, 145, 86, 76, 1, 0, 0,
387 2, 0, 0, 0, 0, 9, 8, 12, 11, 0,
388 92, 91, 0, 93, 0, 94, 89, 82, 83, 98,
389 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
390 145, 145, 145, 145, 145, 145, 145, 145, 145, 25,
391 145, 145, 145, 145, 145, 145, 145, 145, 19, 145,
392 145, 145, 145, 145, 145, 145, 145, 145, 145, 51,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700393
Eric Anholt47f3f222010-08-02 11:26:43 -0700394 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
395 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
396 145, 145, 145, 0, 0, 0, 0, 8, 0, 92,
397 0, 91, 0, 93, 94, 145, 17, 145, 145, 138,
398 145, 145, 145, 145, 145, 145, 145, 145, 24, 101,
399 145, 145, 145, 57, 145, 145, 106, 120, 145, 145,
400 145, 145, 145, 145, 145, 145, 145, 117, 141, 38,
401 39, 40, 145, 145, 145, 145, 145, 145, 145, 145,
402 145, 145, 145, 145, 145, 145, 145, 145, 145, 104,
403 96, 145, 145, 145, 145, 145, 145, 35, 36, 37,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700404
Eric Anholt47f3f222010-08-02 11:26:43 -0700405 67, 145, 145, 0, 0, 0, 0, 0, 91, 145,
406 20, 29, 30, 31, 145, 99, 16, 145, 145, 145,
407 145, 128, 129, 130, 145, 97, 121, 18, 131, 132,
408 133, 143, 125, 126, 127, 145, 52, 123, 145, 145,
409 32, 33, 34, 145, 145, 145, 145, 145, 145, 145,
410 145, 145, 145, 145, 145, 145, 145, 118, 145, 145,
411 145, 145, 145, 145, 145, 145, 100, 145, 140, 145,
412 145, 23, 0, 0, 0, 0, 145, 145, 145, 145,
413 145, 119, 114, 109, 145, 145, 68, 41, 42, 43,
414 44, 45, 46, 47, 48, 49, 145, 145, 145, 145,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700415
Eric Anholt47f3f222010-08-02 11:26:43 -0700416 124, 105, 145, 112, 28, 145, 137, 58, 113, 66,
417 107, 145, 145, 145, 145, 145, 145, 0, 0, 0,
418 0, 145, 145, 145, 108, 27, 145, 145, 145, 142,
419 145, 145, 145, 145, 145, 145, 102, 53, 145, 54,
420 145, 0, 0, 0, 7, 0, 145, 55, 21, 115,
421 145, 145, 145, 110, 145, 145, 145, 145, 145, 145,
422 103, 122, 111, 0, 0, 6, 0, 0, 0, 3,
423 15, 116, 56, 139, 145, 144, 60, 61, 62, 145,
424 0, 0, 0, 0, 145, 145, 145, 145, 145, 145,
425 4, 0, 5, 0, 0, 0, 145, 145, 145, 145,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700426
Eric Anholt47f3f222010-08-02 11:26:43 -0700427 145, 63, 0, 145, 145, 145, 145, 145, 59, 145,
428 134, 145, 135, 145, 145, 145, 64, 145, 65, 145,
429 145, 145, 136, 0
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700430 } ;
431
432static yyconst flex_int32_t yy_ec[256] =
433 { 0,
434 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
435 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 2, 5, 1, 6, 1, 7, 8, 1, 1,
438 1, 9, 10, 1, 11, 12, 13, 14, 15, 16,
439 17, 18, 19, 19, 19, 20, 20, 21, 1, 22,
440 23, 24, 1, 1, 25, 25, 26, 27, 28, 29,
441 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
442 30, 31, 32, 30, 30, 30, 30, 33, 30, 30,
443 1, 1, 1, 34, 30, 1, 35, 36, 37, 38,
444
445 39, 40, 41, 42, 43, 30, 44, 45, 46, 47,
446 48, 49, 30, 50, 51, 52, 53, 54, 55, 56,
447 57, 58, 1, 59, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
455
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461 1, 1, 1, 1, 1
462 } ;
463
464static yyconst flex_int32_t yy_meta[60] =
465 { 0,
466 1, 2, 3, 1, 1, 1, 1, 1, 1, 4,
Eric Anholt47f3f222010-08-02 11:26:43 -0700467 4, 1, 1, 5, 5, 5, 5, 5, 5, 6,
468 1, 1, 1, 1, 7, 7, 7, 8, 8, 9,
469 9, 9, 10, 1, 7, 7, 7, 7, 8, 8,
470 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
471 9, 9, 9, 9, 9, 10, 9, 9, 1
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700472 } ;
473
Eric Anholt47f3f222010-08-02 11:26:43 -0700474static yyconst flex_int16_t yy_base[542] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700475 { 0,
Ian Romanickf50f0652010-06-30 17:30:03 -0700476 0, 58, 81, 0, 814, 815, 59, 815, 790, 789,
Eric Anholt47f3f222010-08-02 11:26:43 -0700477 54, 788, 55, 56, 54, 787, 129, 174, 53, 786,
478 127, 0, 774, 101, 106, 126, 116, 128, 152, 759,
479 161, 158, 128, 142, 131, 753, 166, 766, 175, 181,
480 131, 187, 762, 149, 205, 222, 780, 815, 230, 815,
481 789, 225, 815, 0, 244, 815, 815, 815, 815, 815,
482 815, 815, 815, 815, 223, 815, 225, 200, 265, 218,
483 815, 0, 0, 778, 815, 815, 815, 777, 0, 815,
484 753, 746, 749, 757, 756, 743, 746, 757, 744, 750,
485 738, 735, 748, 735, 732, 732, 738, 726, 132, 731,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700486
Eric Anholt47f3f222010-08-02 11:26:43 -0700487 741, 727, 733, 736, 737, 0, 221, 736, 717, 200,
488 721, 734, 725, 225, 718, 732, 729, 731, 714, 719,
489 716, 705, 714, 222, 718, 714, 716, 705, 708, 207,
490 713, 705, 717, 243, 710, 815, 815, 285, 257, 295,
491 815, 696, 708, 700, 710, 288, 0, 298, 0, 226,
492 815, 280, 289, 815, 307, 318, 0, 815, 815, 0,
493 698, 702, 711, 708, 692, 691, 691, 279, 706, 703,
494 703, 701, 698, 690, 696, 683, 694, 680, 696, 0,
495 693, 681, 688, 685, 689, 682, 671, 670, 683, 686,
496 683, 671, 677, 668, 319, 673, 676, 667, 674, 663,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700497
Eric Anholt47f3f222010-08-02 11:26:43 -0700498 667, 673, 664, 655, 658, 656, 666, 656, 651, 649,
499 649, 651, 648, 659, 658, 255, 653, 648, 637, 325,
500 655, 657, 646, 638, 642, 653, 637, 0, 336, 328,
501 322, 815, 345, 356, 815, 643, 0, 641, 353, 0,
502 634, 632, 630, 638, 627, 644, 633, 356, 0, 0,
503 627, 637, 637, 0, 622, 359, 0, 0, 624, 362,
504 625, 619, 618, 619, 618, 365, 614, 0, 0, 610,
505 609, 608, 610, 611, 616, 610, 606, 619, 614, 613,
506 605, 609, 601, 604, 599, 607, 612, 611, 602, 0,
507 0, 608, 597, 597, 602, 601, 598, 0, 0, 0,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700508
Eric Anholt47f3f222010-08-02 11:26:43 -0700509 0, 588, 600, 599, 598, 595, 584, 372, 383, 598,
510 0, 0, 0, 0, 585, 0, 0, 585, 586, 580,
511 590, 0, 0, 0, 581, 0, 0, 0, 0, 0,
512 0, 0, 0, 0, 0, 588, 0, 0, 586, 582,
513 0, 0, 0, 572, 381, 384, 387, 577, 573, 578,
514 569, 567, 580, 566, 579, 568, 575, 0, 573, 570,
515 574, 558, 567, 573, 568, 556, 0, 558, 0, 557,
516 560, 0, 555, 599, 554, 556, 545, 554, 543, 543,
517 556, 0, 558, 0, 557, 556, 0, 0, 0, 0,
518 0, 0, 0, 0, 0, 0, 541, 554, 541, 538,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700519
Eric Anholt47f3f222010-08-02 11:26:43 -0700520 0, 0, 543, 0, 0, 535, 0, 0, 0, 0,
521 0, 532, 543, 536, 542, 539, 534, 527, 411, 542,
522 522, 514, 527, 525, 0, 0, 518, 524, 505, 0,
523 510, 504, 503, 493, 391, 501, 0, 0, 500, 0,
524 480, 465, 407, 343, 815, 457, 449, 0, 0, 0,
525 448, 434, 446, 0, 447, 436, 455, 454, 453, 426,
526 0, 0, 0, 430, 418, 815, 431, 0, 412, 815,
527 0, 0, 0, 0, 425, 0, 444, 387, 444, 438,
528 426, 433, 435, 439, 422, 422, 423, 419, 421, 420,
529 815, 441, 815, 453, 0, 449, 404, 422, 402, 389,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700530
Eric Anholt47f3f222010-08-02 11:26:43 -0700531 385, 0, 451, 377, 373, 343, 346, 296, 0, 262,
532 275, 253, 0, 223, 207, 144, 0, 148, 0, 104,
533 32, 11, 0, 815, 485, 491, 497, 501, 506, 508,
534 516, 523, 526, 529, 534, 543, 548, 550, 557, 566,
535 568
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700536 } ;
537
Eric Anholt47f3f222010-08-02 11:26:43 -0700538static yyconst flex_int16_t yy_def[542] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700539 { 0,
Eric Anholt47f3f222010-08-02 11:26:43 -0700540 524, 1, 524, 3, 524, 524, 524, 524, 524, 524,
541 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
542 524, 525, 524, 525, 525, 525, 525, 525, 525, 525,
Ian Romanickf50f0652010-06-30 17:30:03 -0700543 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700544 525, 525, 525, 524, 524, 524, 524, 524, 524, 524,
545 524, 524, 524, 526, 524, 524, 524, 524, 524, 524,
546 524, 524, 524, 524, 527, 524, 528, 17, 524, 529,
547 524, 530, 18, 524, 524, 524, 524, 524, 525, 524,
Ian Romanickf50f0652010-06-30 17:30:03 -0700548 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
549 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700550
Ian Romanickf50f0652010-06-30 17:30:03 -0700551 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
552 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
553 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700554 525, 525, 525, 525, 525, 524, 524, 524, 524, 524,
555 524, 524, 524, 524, 524, 524, 531, 524, 526, 532,
556 524, 528, 533, 524, 524, 529, 530, 524, 524, 525,
Ian Romanickf50f0652010-06-30 17:30:03 -0700557 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
558 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
559 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
560 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700561
Ian Romanickf50f0652010-06-30 17:30:03 -0700562 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
563 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700564 525, 525, 525, 524, 524, 524, 524, 531, 524, 532,
565 534, 524, 524, 533, 524, 525, 525, 525, 525, 525,
Ian Romanickf50f0652010-06-30 17:30:03 -0700566 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
567 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
568 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
569 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
570 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
571 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700572
Eric Anholt47f3f222010-08-02 11:26:43 -0700573 525, 525, 525, 524, 524, 524, 524, 524, 534, 525,
Ian Romanickf50f0652010-06-30 17:30:03 -0700574 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
575 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
576 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
577 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
578 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
579 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700580 525, 525, 524, 524, 524, 524, 525, 525, 525, 525,
Ian Romanickf50f0652010-06-30 17:30:03 -0700581 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
582 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700583
Ian Romanickf50f0652010-06-30 17:30:03 -0700584 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700585 525, 525, 525, 525, 525, 525, 525, 524, 524, 524,
586 524, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Ian Romanickf50f0652010-06-30 17:30:03 -0700587 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700588 525, 524, 535, 536, 524, 524, 525, 525, 525, 525,
Ian Romanickf50f0652010-06-30 17:30:03 -0700589 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700590 525, 525, 525, 524, 537, 524, 524, 538, 536, 524,
Ian Romanickf50f0652010-06-30 17:30:03 -0700591 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700592 524, 539, 540, 538, 525, 525, 525, 525, 525, 525,
593 524, 524, 524, 524, 541, 540, 525, 525, 525, 525,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700594
Eric Anholt47f3f222010-08-02 11:26:43 -0700595 525, 525, 541, 525, 525, 525, 525, 525, 525, 525,
Ian Romanickf50f0652010-06-30 17:30:03 -0700596 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
Eric Anholt47f3f222010-08-02 11:26:43 -0700597 525, 525, 525, 0, 524, 524, 524, 524, 524, 524,
598 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
599 524
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700600 } ;
601
Ian Romanickf50f0652010-06-30 17:30:03 -0700602static yyconst flex_int16_t yy_nxt[875] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700603 { 0,
604 6, 7, 8, 7, 9, 6, 10, 11, 12, 13,
605 14, 15, 16, 17, 18, 18, 18, 18, 18, 18,
606 6, 19, 20, 21, 22, 22, 22, 22, 22, 22,
607 22, 22, 22, 23, 24, 25, 26, 27, 28, 29,
608 30, 31, 32, 22, 33, 34, 35, 36, 37, 38,
609 39, 40, 41, 42, 43, 22, 22, 22, 44, 45,
Eric Anholt47f3f222010-08-02 11:26:43 -0700610 55, 58, 55, 46, 61, 523, 63, 65, 65, 65,
611 65, 65, 65, 65, 74, 75, 59, 62, 64, 522,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700612 47, 48, 49, 50, 49, 48, 48, 48, 48, 48,
613 48, 48, 48, 51, 48, 52, 52, 52, 52, 52,
614
615 52, 53, 48, 48, 48, 54, 54, 54, 54, 54,
616 54, 54, 54, 54, 48, 54, 54, 54, 54, 54,
617 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
618 54, 54, 54, 54, 54, 54, 54, 54, 54, 48,
Eric Anholt47f3f222010-08-02 11:26:43 -0700619 67, 521, 68, 68, 68, 68, 68, 68, 69, 77,
620 78, 81, 82, 83, 90, 84, 70, 71, 91, 85,
621 86, 72, 109, 92, 87, 113, 178, 70, 71, 93,
622 88, 136, 94, 89, 95, 110, 111, 130, 114, 179,
623 112, 131, 520, 96, 72, 67, 97, 73, 73, 73,
624 73, 73, 73, 73, 98, 103, 99, 106, 519, 100,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700625
Eric Anholt47f3f222010-08-02 11:26:43 -0700626 116, 70, 71, 104, 107, 101, 138, 137, 55, 120,
627 139, 108, 70, 71, 105, 117, 121, 122, 118, 126,
628 123, 132, 127, 140, 141, 133, 124, 155, 155, 125,
629 128, 146, 524, 146, 134, 229, 229, 129, 148, 148,
630 148, 148, 148, 148, 148, 55, 193, 55, 518, 216,
631 150, 151, 153, 154, 194, 524, 209, 217, 140, 141,
632 142, 150, 151, 153, 154, 186, 143, 198, 187, 188,
633 144, 210, 189, 199, 190, 145, 67, 517, 69, 69,
634 69, 69, 69, 69, 69, 221, 138, 222, 55, 146,
635 139, 146, 70, 71, 293, 142, 140, 141, 233, 233,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700636
Eric Anholt47f3f222010-08-02 11:26:43 -0700637 516, 143, 294, 70, 71, 144, 515, 231, 232, 514,
638 145, 148, 148, 148, 148, 148, 148, 148, 231, 232,
639 156, 156, 156, 156, 156, 156, 156, 524, 524, 243,
640 244, 308, 308, 142, 270, 271, 272, 524, 524, 143,
641 298, 299, 300, 144, 465, 466, 235, 513, 145, 230,
642 230, 230, 230, 230, 230, 230, 151, 235, 234, 234,
643 234, 234, 234, 234, 234, 524, 524, 151, 312, 313,
644 314, 322, 323, 324, 329, 330, 331, 333, 334, 335,
645 341, 342, 343, 512, 154, 309, 309, 309, 309, 309,
646 309, 309, 524, 524, 511, 154, 388, 389, 390, 391,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700647
Eric Anholt47f3f222010-08-02 11:26:43 -0700648 392, 393, 394, 395, 396, 457, 458, 459, 465, 466,
649 510, 232, 419, 465, 466, 509, 460, 487, 488, 465,
650 466, 508, 232, 507, 443, 444, 444, 444, 444, 444,
651 444, 482, 465, 466, 492, 493, 492, 493, 506, 468,
652 465, 466, 492, 493, 467, 467, 467, 467, 467, 467,
653 492, 493, 492, 493, 492, 493, 505, 504, 502, 501,
654 500, 499, 468, 498, 497, 495, 494, 494, 494, 494,
655 494, 494, 491, 490, 489, 486, 485, 481, 480, 479,
656 478, 477, 476, 475, 474, 473, 472, 471, 495, 79,
657 79, 79, 79, 79, 79, 149, 149, 149, 149, 149,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700658
Eric Anholt47f3f222010-08-02 11:26:43 -0700659 149, 65, 65, 470, 65, 152, 152, 464, 152, 156,
660 156, 156, 157, 157, 157, 157, 228, 228, 463, 228,
661 228, 228, 228, 228, 228, 228, 230, 230, 230, 234,
662 234, 234, 309, 309, 309, 467, 467, 462, 467, 461,
663 456, 455, 454, 467, 469, 469, 453, 469, 469, 483,
664 483, 452, 483, 483, 484, 484, 484, 484, 494, 494,
665 451, 494, 450, 449, 448, 447, 494, 496, 496, 446,
666 496, 496, 503, 503, 503, 503, 445, 442, 441, 440,
667 439, 438, 437, 436, 435, 434, 433, 432, 431, 430,
668 429, 428, 427, 426, 425, 424, 423, 422, 421, 420,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700669
Eric Anholt47f3f222010-08-02 11:26:43 -0700670 419, 418, 417, 416, 415, 414, 413, 412, 411, 410,
671 409, 408, 407, 406, 405, 404, 403, 402, 401, 400,
672 399, 398, 397, 387, 386, 385, 384, 383, 382, 381,
673 380, 379, 378, 377, 376, 375, 374, 373, 372, 371,
674 370, 369, 368, 367, 366, 365, 364, 363, 362, 361,
675 360, 359, 358, 357, 356, 355, 354, 353, 352, 351,
676 350, 349, 348, 347, 346, 345, 344, 340, 339, 338,
677 337, 336, 332, 328, 327, 326, 325, 321, 320, 319,
678 318, 317, 316, 315, 311, 310, 307, 306, 305, 304,
679 303, 302, 301, 297, 296, 295, 292, 291, 290, 289,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700680
Eric Anholt47f3f222010-08-02 11:26:43 -0700681 288, 287, 286, 285, 284, 283, 282, 281, 280, 279,
682 278, 277, 276, 275, 274, 273, 269, 268, 267, 266,
683 265, 264, 263, 262, 261, 260, 259, 258, 257, 256,
684 255, 254, 253, 252, 251, 250, 249, 248, 247, 246,
685 245, 242, 241, 240, 239, 238, 237, 236, 227, 226,
686 225, 224, 223, 220, 219, 218, 215, 214, 213, 212,
687 211, 208, 207, 206, 205, 204, 203, 202, 201, 200,
688 197, 196, 195, 192, 191, 185, 184, 183, 182, 181,
689 180, 177, 176, 175, 174, 173, 172, 171, 170, 169,
690 168, 167, 166, 165, 164, 163, 162, 161, 160, 159,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700691
Eric Anholt47f3f222010-08-02 11:26:43 -0700692 158, 147, 76, 135, 119, 115, 102, 80, 76, 66,
693 60, 57, 56, 524, 5, 524, 524, 524, 524, 524,
694 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
695 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
696 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
697 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
698 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
699 524, 524, 524, 524
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700700 } ;
701
Ian Romanickf50f0652010-06-30 17:30:03 -0700702static yyconst flex_int16_t yy_chk[875] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700703 { 0,
704 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
705 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
706 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
707 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
708 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
709 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
Eric Anholt47f3f222010-08-02 11:26:43 -0700710 7, 11, 7, 2, 13, 522, 14, 15, 15, 15,
711 15, 15, 15, 15, 19, 19, 11, 13, 14, 521,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700712 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
713 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
714
715 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
716 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
717 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
718 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
Eric Anholt47f3f222010-08-02 11:26:43 -0700719 17, 520, 17, 17, 17, 17, 17, 17, 17, 21,
720 21, 24, 24, 25, 27, 25, 17, 17, 27, 25,
721 26, 17, 33, 27, 26, 35, 99, 17, 17, 27,
722 26, 44, 28, 26, 28, 33, 34, 41, 35, 99,
723 34, 41, 518, 28, 17, 18, 29, 18, 18, 18,
724 18, 18, 18, 18, 29, 31, 29, 32, 516, 29,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700725
Eric Anholt47f3f222010-08-02 11:26:43 -0700726 37, 18, 18, 31, 32, 29, 45, 44, 45, 39,
727 45, 32, 18, 18, 31, 37, 39, 39, 37, 40,
728 39, 42, 40, 46, 46, 42, 39, 70, 70, 39,
729 40, 49, 68, 49, 42, 150, 150, 40, 52, 52,
730 52, 52, 52, 52, 52, 55, 110, 55, 515, 130,
731 65, 65, 67, 67, 110, 68, 124, 130, 139, 139,
732 46, 65, 65, 67, 67, 107, 46, 114, 107, 107,
733 46, 124, 107, 114, 107, 46, 69, 514, 69, 69,
734 69, 69, 69, 69, 69, 134, 138, 134, 138, 146,
735 138, 146, 69, 69, 216, 139, 140, 140, 153, 153,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700736
Eric Anholt47f3f222010-08-02 11:26:43 -0700737 512, 139, 216, 69, 69, 139, 511, 152, 152, 510,
738 139, 148, 148, 148, 148, 148, 148, 148, 152, 152,
739 155, 155, 155, 155, 155, 155, 155, 156, 156, 168,
740 168, 231, 231, 140, 195, 195, 195, 230, 230, 140,
741 220, 220, 220, 140, 444, 444, 156, 508, 140, 229,
742 229, 229, 229, 229, 229, 229, 230, 156, 233, 233,
743 233, 233, 233, 233, 233, 234, 234, 230, 239, 239,
744 239, 248, 248, 248, 256, 256, 256, 260, 260, 260,
745 266, 266, 266, 507, 234, 308, 308, 308, 308, 308,
746 308, 308, 309, 309, 506, 234, 345, 345, 345, 346,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700747
Eric Anholt47f3f222010-08-02 11:26:43 -0700748 346, 346, 347, 347, 347, 435, 435, 435, 443, 443,
749 505, 309, 419, 469, 469, 504, 435, 478, 478, 465,
750 465, 501, 309, 500, 419, 419, 419, 419, 419, 419,
751 419, 465, 467, 467, 482, 482, 483, 483, 499, 443,
752 484, 484, 492, 492, 467, 467, 467, 467, 467, 467,
753 496, 496, 503, 503, 494, 494, 498, 497, 490, 489,
754 488, 487, 443, 486, 485, 482, 494, 494, 494, 494,
755 494, 494, 481, 480, 479, 477, 475, 464, 460, 459,
756 458, 457, 456, 455, 453, 452, 451, 447, 482, 525,
757 525, 525, 525, 525, 525, 526, 526, 526, 526, 526,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700758
Eric Anholt47f3f222010-08-02 11:26:43 -0700759 526, 527, 527, 446, 527, 528, 528, 442, 528, 529,
760 529, 529, 530, 530, 530, 530, 531, 531, 441, 531,
761 531, 531, 531, 531, 531, 531, 532, 532, 532, 533,
762 533, 533, 534, 534, 534, 535, 535, 439, 535, 436,
763 434, 433, 432, 535, 536, 536, 431, 536, 536, 537,
764 537, 429, 537, 537, 538, 538, 538, 538, 539, 539,
765 428, 539, 427, 424, 423, 422, 539, 540, 540, 421,
766 540, 540, 541, 541, 541, 541, 420, 418, 417, 416,
767 415, 414, 413, 412, 406, 403, 400, 399, 398, 397,
768 386, 385, 383, 381, 380, 379, 378, 377, 376, 375,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700769
Eric Anholt47f3f222010-08-02 11:26:43 -0700770 374, 373, 371, 370, 368, 366, 365, 364, 363, 362,
771 361, 360, 359, 357, 356, 355, 354, 353, 352, 351,
772 350, 349, 348, 344, 340, 339, 336, 325, 321, 320,
773 319, 318, 315, 310, 307, 306, 305, 304, 303, 302,
774 297, 296, 295, 294, 293, 292, 289, 288, 287, 286,
775 285, 284, 283, 282, 281, 280, 279, 278, 277, 276,
776 275, 274, 273, 272, 271, 270, 267, 265, 264, 263,
777 262, 261, 259, 255, 253, 252, 251, 247, 246, 245,
778 244, 243, 242, 241, 238, 236, 227, 226, 225, 224,
779 223, 222, 221, 219, 218, 217, 215, 214, 213, 212,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700780
Eric Anholt47f3f222010-08-02 11:26:43 -0700781 211, 210, 209, 208, 207, 206, 205, 204, 203, 202,
782 201, 200, 199, 198, 197, 196, 194, 193, 192, 191,
783 190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
784 179, 178, 177, 176, 175, 174, 173, 172, 171, 170,
785 169, 167, 166, 165, 164, 163, 162, 161, 145, 144,
786 143, 142, 135, 133, 132, 131, 129, 128, 127, 126,
787 125, 123, 122, 121, 120, 119, 118, 117, 116, 115,
788 113, 112, 111, 109, 108, 105, 104, 103, 102, 101,
789 100, 98, 97, 96, 95, 94, 93, 92, 91, 90,
790 89, 88, 87, 86, 85, 84, 83, 82, 81, 78,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700791
Eric Anholt47f3f222010-08-02 11:26:43 -0700792 74, 51, 47, 43, 38, 36, 30, 23, 20, 16,
793 12, 10, 9, 5, 524, 524, 524, 524, 524, 524,
794 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
795 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
796 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
797 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
798 524, 524, 524, 524, 524, 524, 524, 524, 524, 524,
799 524, 524, 524, 524
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700800 } ;
801
802/* The intent behind this definition is that it'll catch
803 * any uses of REJECT which flex missed.
804 */
805#define REJECT reject_used_but_not_detected
806#define yymore() yymore_used_but_not_detected
807#define YY_MORE_ADJ 0
808#define YY_RESTORE_YY_MORE_OFFSET
809#line 1 "glsl_lexer.lpp"
810#line 2 "glsl_lexer.lpp"
811/*
812 * Copyright © 2008, 2009 Intel Corporation
813 *
814 * Permission is hereby granted, free of charge, to any person obtaining a
815 * copy of this software and associated documentation files (the "Software"),
816 * to deal in the Software without restriction, including without limitation
817 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
818 * and/or sell copies of the Software, and to permit persons to whom the
819 * Software is furnished to do so, subject to the following conditions:
820 *
821 * The above copyright notice and this permission notice (including the next
822 * paragraph) shall be included in all copies or substantial portions of the
823 * Software.
824 *
825 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
826 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
827 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
828 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
829 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
830 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
831 * DEALINGS IN THE SOFTWARE.
832 */
833#include <ctype.h>
834#include "ast.h"
835#include "glsl_parser_extras.h"
836#include "glsl_parser.h"
837
838#define YY_USER_ACTION \
839 do { \
840 yylloc->source = 0; \
841 yylloc->first_column = yycolumn + 1; \
842 yylloc->first_line = yylineno + 1; \
843 yycolumn += yyleng; \
844 } while(0);
845
846#define YY_USER_INIT yylineno = 0; yycolumn = 0;
847
Eric Anholt6a416262010-08-01 18:44:21 -0700848#define TOKEN_OR_IDENTIFIER(version, token) \
849 do { \
850 if (yyextra->language_version >= version) { \
851 return token; \
852 } else { \
853 yylval->identifier = strdup(yytext); \
854 return IDENTIFIER; \
855 } \
856 } while (0)
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700857
Eric Anholt6a416262010-08-01 18:44:21 -0700858
859#line 860 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700860
861#define INITIAL 0
862#define PP 1
863
864#ifndef YY_NO_UNISTD_H
865/* Special case for "unistd.h", since it is non-ANSI. We include it way
866 * down here because we want the user's section 1 to have been scanned first.
867 * The user has a chance to override it with an option.
868 */
869#include <unistd.h>
870#endif
871
872#define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
873
874/* Holds the entire state of the reentrant scanner. */
875struct yyguts_t
876 {
877
878 /* User-defined. Not touched by flex. */
879 YY_EXTRA_TYPE yyextra_r;
880
881 /* The rest are the same as the globals declared in the non-reentrant scanner. */
882 FILE *yyin_r, *yyout_r;
883 size_t yy_buffer_stack_top; /**< index of top of stack. */
884 size_t yy_buffer_stack_max; /**< capacity of stack. */
885 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
886 char yy_hold_char;
887 int yy_n_chars;
888 int yyleng_r;
889 char *yy_c_buf_p;
890 int yy_init;
891 int yy_start;
892 int yy_did_buffer_switch_on_eof;
893 int yy_start_stack_ptr;
894 int yy_start_stack_depth;
895 int *yy_start_stack;
896 yy_state_type yy_last_accepting_state;
897 char* yy_last_accepting_cpos;
898
899 int yylineno_r;
900 int yy_flex_debug_r;
901
902 char *yytext_r;
903 int yy_more_flag;
904 int yy_more_len;
905
906 YYSTYPE * yylval_r;
907
908 YYLTYPE * yylloc_r;
909
910 }; /* end struct yyguts_t */
911
912static int yy_init_globals (yyscan_t yyscanner );
913
914 /* This must go here because YYSTYPE and YYLTYPE are included
915 * from bison output in section 1.*/
916 # define yylval yyg->yylval_r
917
918 # define yylloc yyg->yylloc_r
919
920int _mesa_glsl_lex_init (yyscan_t* scanner);
921
922int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
923
924/* Accessor methods to globals.
925 These are made visible to non-reentrant scanners for convenience. */
926
927int _mesa_glsl_lex_destroy (yyscan_t yyscanner );
928
929int _mesa_glsl_get_debug (yyscan_t yyscanner );
930
931void _mesa_glsl_set_debug (int debug_flag ,yyscan_t yyscanner );
932
933YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner );
934
935void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
936
937FILE *_mesa_glsl_get_in (yyscan_t yyscanner );
938
939void _mesa_glsl_set_in (FILE * in_str ,yyscan_t yyscanner );
940
941FILE *_mesa_glsl_get_out (yyscan_t yyscanner );
942
943void _mesa_glsl_set_out (FILE * out_str ,yyscan_t yyscanner );
944
945int _mesa_glsl_get_leng (yyscan_t yyscanner );
946
947char *_mesa_glsl_get_text (yyscan_t yyscanner );
948
949int _mesa_glsl_get_lineno (yyscan_t yyscanner );
950
951void _mesa_glsl_set_lineno (int line_number ,yyscan_t yyscanner );
952
953YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner );
954
955void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
956
957 YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner );
958
959 void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
960
961/* Macros after this point can all be overridden by user definitions in
962 * section 1.
963 */
964
965#ifndef YY_SKIP_YYWRAP
966#ifdef __cplusplus
967extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner );
968#else
969extern int _mesa_glsl_wrap (yyscan_t yyscanner );
970#endif
971#endif
972
973#ifndef yytext_ptr
974static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
975#endif
976
977#ifdef YY_NEED_STRLEN
978static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
979#endif
980
981#ifndef YY_NO_INPUT
982
983#ifdef __cplusplus
984static int yyinput (yyscan_t yyscanner );
985#else
986static int input (yyscan_t yyscanner );
987#endif
988
989#endif
990
991/* Amount of stuff to slurp up with each read. */
992#ifndef YY_READ_BUF_SIZE
993#ifdef __ia64__
994/* On IA-64, the buffer size is 16k, not 8k */
995#define YY_READ_BUF_SIZE 16384
996#else
997#define YY_READ_BUF_SIZE 8192
998#endif /* __ia64__ */
999#endif
1000
1001/* Copy whatever the last rule matched to the standard output. */
1002#ifndef ECHO
1003/* This used to be an fputs(), but since the string might contain NUL's,
1004 * we now use fwrite().
1005 */
1006#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1007#endif
1008
1009/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1010 * is returned in "result".
1011 */
1012#ifndef YY_INPUT
1013#define YY_INPUT(buf,result,max_size) \
1014 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1015 { \
1016 int c = '*'; \
1017 size_t n; \
1018 for ( n = 0; n < max_size && \
1019 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1020 buf[n] = (char) c; \
1021 if ( c == '\n' ) \
1022 buf[n++] = (char) c; \
1023 if ( c == EOF && ferror( yyin ) ) \
1024 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1025 result = n; \
1026 } \
1027 else \
1028 { \
1029 errno=0; \
1030 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1031 { \
1032 if( errno != EINTR) \
1033 { \
1034 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1035 break; \
1036 } \
1037 errno=0; \
1038 clearerr(yyin); \
1039 } \
1040 }\
1041\
1042
1043#endif
1044
1045/* No semi-colon after return; correct usage is to write "yyterminate();" -
1046 * we don't want an extra ';' after the "return" because that will cause
1047 * some compilers to complain about unreachable statements.
1048 */
1049#ifndef yyterminate
1050#define yyterminate() return YY_NULL
1051#endif
1052
1053/* Number of entries by which start-condition stack grows. */
1054#ifndef YY_START_STACK_INCR
1055#define YY_START_STACK_INCR 25
1056#endif
1057
1058/* Report a fatal error. */
1059#ifndef YY_FATAL_ERROR
1060#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1061#endif
1062
1063/* end tables serialization structures and prototypes */
1064
1065/* Default declaration of generated scanner - a define so the user can
1066 * easily add parameters.
1067 */
1068#ifndef YY_DECL
1069#define YY_DECL_IS_OURS 1
1070
1071extern int _mesa_glsl_lex \
1072 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1073
1074#define YY_DECL int _mesa_glsl_lex \
1075 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1076#endif /* !YY_DECL */
1077
1078/* Code executed at the beginning of each rule, after yytext and yyleng
1079 * have been set up.
1080 */
1081#ifndef YY_USER_ACTION
1082#define YY_USER_ACTION
1083#endif
1084
1085/* Code executed at the end of each rule. */
1086#ifndef YY_BREAK
1087#define YY_BREAK break;
1088#endif
1089
1090#define YY_RULE_SETUP \
1091 if ( yyleng > 0 ) \
1092 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1093 (yytext[yyleng - 1] == '\n'); \
1094 YY_USER_ACTION
1095
1096/** The main scanner function which does all the work.
1097 */
1098YY_DECL
1099{
1100 register yy_state_type yy_current_state;
1101 register char *yy_cp, *yy_bp;
1102 register int yy_act;
1103 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1104
Eric Anholt6a416262010-08-01 18:44:21 -07001105#line 66 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001106
1107
Eric Anholt6a416262010-08-01 18:44:21 -07001108#line 1109 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001109
1110 yylval = yylval_param;
1111
1112 yylloc = yylloc_param;
1113
1114 if ( !yyg->yy_init )
1115 {
1116 yyg->yy_init = 1;
1117
1118#ifdef YY_USER_INIT
1119 YY_USER_INIT;
1120#endif
1121
1122 if ( ! yyg->yy_start )
1123 yyg->yy_start = 1; /* first start state */
1124
1125 if ( ! yyin )
1126 yyin = stdin;
1127
1128 if ( ! yyout )
1129 yyout = stdout;
1130
1131 if ( ! YY_CURRENT_BUFFER ) {
1132 _mesa_glsl_ensure_buffer_stack (yyscanner);
1133 YY_CURRENT_BUFFER_LVALUE =
1134 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1135 }
1136
1137 _mesa_glsl__load_buffer_state(yyscanner );
1138 }
1139
1140 while ( 1 ) /* loops until end-of-file is reached */
1141 {
1142 yy_cp = yyg->yy_c_buf_p;
1143
1144 /* Support of yytext. */
1145 *yy_cp = yyg->yy_hold_char;
1146
1147 /* yy_bp points to the position in yy_ch_buf of the start of
1148 * the current run.
1149 */
1150 yy_bp = yy_cp;
1151
1152 yy_current_state = yyg->yy_start;
1153 yy_current_state += YY_AT_BOL();
1154yy_match:
1155 do
1156 {
1157 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1158 if ( yy_accept[yy_current_state] )
1159 {
1160 yyg->yy_last_accepting_state = yy_current_state;
1161 yyg->yy_last_accepting_cpos = yy_cp;
1162 }
1163 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1164 {
1165 yy_current_state = (int) yy_def[yy_current_state];
Eric Anholt47f3f222010-08-02 11:26:43 -07001166 if ( yy_current_state >= 525 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001167 yy_c = yy_meta[(unsigned int) yy_c];
1168 }
1169 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1170 ++yy_cp;
1171 }
Eric Anholt47f3f222010-08-02 11:26:43 -07001172 while ( yy_current_state != 524 );
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001173 yy_cp = yyg->yy_last_accepting_cpos;
1174 yy_current_state = yyg->yy_last_accepting_state;
1175
1176yy_find_action:
1177 yy_act = yy_accept[yy_current_state];
1178
1179 YY_DO_BEFORE_ACTION;
1180
1181do_action: /* This label is used only to access EOF actions. */
1182
1183 switch ( yy_act )
1184 { /* beginning of action switch */
1185 case 0: /* must back up */
1186 /* undo the effects of YY_DO_BEFORE_ACTION */
1187 *yy_cp = yyg->yy_hold_char;
1188 yy_cp = yyg->yy_last_accepting_cpos;
1189 yy_current_state = yyg->yy_last_accepting_state;
1190 goto yy_find_action;
1191
1192case 1:
1193YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001194#line 68 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001195;
1196 YY_BREAK
1197/* Preprocessor tokens. */
1198case 2:
1199*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1200yyg->yy_c_buf_p = yy_cp -= 1;
1201YY_DO_BEFORE_ACTION; /* set up yytext again */
1202YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001203#line 71 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001204;
1205 YY_BREAK
1206case 3:
1207YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001208#line 72 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001209{ BEGIN PP; return VERSION; }
1210 YY_BREAK
1211case 4:
1212YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001213#line 73 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001214{ BEGIN PP; return EXTENSION; }
1215 YY_BREAK
1216case 5:
1217*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1218yyg->yy_c_buf_p = yy_cp -= 1;
1219YY_DO_BEFORE_ACTION; /* set up yytext again */
1220YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001221#line 74 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001222{
1223 /* Eat characters until the first digit is
1224 * encountered
1225 */
1226 char *ptr = yytext;
1227 while (!isdigit(*ptr))
1228 ptr++;
1229
1230 /* Subtract one from the line number because
1231 * yylineno is zero-based instead of
1232 * one-based.
1233 */
1234 yylineno = strtol(ptr, &ptr, 0) - 1;
1235 yylloc->source = strtol(ptr, NULL, 0);
1236 }
1237 YY_BREAK
1238case 6:
1239*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1240yyg->yy_c_buf_p = yy_cp -= 1;
1241YY_DO_BEFORE_ACTION; /* set up yytext again */
1242YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001243#line 89 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001244{
1245 /* Eat characters until the first digit is
1246 * encountered
1247 */
1248 char *ptr = yytext;
1249 while (!isdigit(*ptr))
1250 ptr++;
1251
1252 /* Subtract one from the line number because
1253 * yylineno is zero-based instead of
1254 * one-based.
1255 */
1256 yylineno = strtol(ptr, &ptr, 0) - 1;
1257 }
1258 YY_BREAK
1259case 7:
1260YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001261#line 103 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001262{ BEGIN PP; return PRAGMA; }
1263 YY_BREAK
1264case 8:
1265YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001266#line 104 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001267{ }
1268 YY_BREAK
1269case 9:
1270YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001271#line 105 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001272{ }
1273 YY_BREAK
1274case 10:
1275YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001276#line 106 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001277return COLON;
1278 YY_BREAK
1279case 11:
1280YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001281#line 107 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001282{
1283 yylval->identifier = strdup(yytext);
1284 return IDENTIFIER;
1285 }
1286 YY_BREAK
1287case 12:
1288YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001289#line 111 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001290{
1291 yylval->n = strtol(yytext, NULL, 10);
1292 return INTCONSTANT;
1293 }
1294 YY_BREAK
1295case 13:
1296/* rule 13 can match eol */
1297YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001298#line 115 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001299{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
1300 YY_BREAK
1301case 14:
1302/* rule 14 can match eol */
1303YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001304#line 117 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001305{ yylineno++; yycolumn = 0; }
1306 YY_BREAK
1307case 15:
1308YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001309#line 119 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001310return ATTRIBUTE;
1311 YY_BREAK
1312case 16:
1313YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001314#line 120 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001315return CONST_TOK;
1316 YY_BREAK
1317case 17:
1318YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001319#line 121 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001320return BOOL;
1321 YY_BREAK
1322case 18:
1323YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001324#line 122 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001325return FLOAT;
1326 YY_BREAK
1327case 19:
1328YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001329#line 123 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001330return INT;
1331 YY_BREAK
1332case 20:
1333YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001334#line 125 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001335return BREAK;
1336 YY_BREAK
1337case 21:
1338YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001339#line 126 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001340return CONTINUE;
1341 YY_BREAK
1342case 22:
1343YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001344#line 127 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001345return DO;
1346 YY_BREAK
1347case 23:
1348YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001349#line 128 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001350return WHILE;
1351 YY_BREAK
1352case 24:
1353YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001354#line 129 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001355return ELSE;
1356 YY_BREAK
1357case 25:
1358YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001359#line 130 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001360return FOR;
1361 YY_BREAK
1362case 26:
1363YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001364#line 131 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001365return IF;
1366 YY_BREAK
1367case 27:
1368YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001369#line 132 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001370return DISCARD;
1371 YY_BREAK
1372case 28:
1373YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001374#line 133 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001375return RETURN;
1376 YY_BREAK
1377case 29:
1378YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001379#line 135 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001380return BVEC2;
1381 YY_BREAK
1382case 30:
1383YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001384#line 136 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001385return BVEC3;
1386 YY_BREAK
1387case 31:
1388YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001389#line 137 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001390return BVEC4;
1391 YY_BREAK
1392case 32:
1393YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001394#line 138 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001395return IVEC2;
1396 YY_BREAK
1397case 33:
1398YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001399#line 139 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001400return IVEC3;
1401 YY_BREAK
1402case 34:
1403YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001404#line 140 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001405return IVEC4;
1406 YY_BREAK
1407case 35:
1408YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001409#line 141 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001410return VEC2;
1411 YY_BREAK
1412case 36:
1413YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001414#line 142 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001415return VEC3;
1416 YY_BREAK
1417case 37:
1418YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001419#line 143 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001420return VEC4;
1421 YY_BREAK
1422case 38:
1423YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001424#line 144 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001425return MAT2;
1426 YY_BREAK
1427case 39:
1428YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001429#line 145 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001430return MAT3;
1431 YY_BREAK
1432case 40:
1433YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001434#line 146 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001435return MAT4;
1436 YY_BREAK
1437case 41:
1438YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001439#line 147 "glsl_lexer.lpp"
1440TOKEN_OR_IDENTIFIER(120, MAT2X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001441 YY_BREAK
1442case 42:
1443YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001444#line 148 "glsl_lexer.lpp"
1445TOKEN_OR_IDENTIFIER(120, MAT2X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001446 YY_BREAK
1447case 43:
1448YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001449#line 149 "glsl_lexer.lpp"
1450TOKEN_OR_IDENTIFIER(120, MAT2X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001451 YY_BREAK
1452case 44:
1453YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001454#line 150 "glsl_lexer.lpp"
1455TOKEN_OR_IDENTIFIER(120, MAT3X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001456 YY_BREAK
1457case 45:
1458YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001459#line 151 "glsl_lexer.lpp"
1460TOKEN_OR_IDENTIFIER(120, MAT3X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001461 YY_BREAK
1462case 46:
1463YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001464#line 152 "glsl_lexer.lpp"
1465TOKEN_OR_IDENTIFIER(120, MAT3X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001466 YY_BREAK
1467case 47:
1468YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001469#line 153 "glsl_lexer.lpp"
1470TOKEN_OR_IDENTIFIER(120, MAT4X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001471 YY_BREAK
1472case 48:
1473YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001474#line 154 "glsl_lexer.lpp"
1475TOKEN_OR_IDENTIFIER(120, MAT4X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001476 YY_BREAK
1477case 49:
1478YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001479#line 155 "glsl_lexer.lpp"
1480TOKEN_OR_IDENTIFIER(120, MAT4X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001481 YY_BREAK
1482case 50:
1483YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001484#line 157 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001485return IN;
1486 YY_BREAK
1487case 51:
1488YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001489#line 158 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001490return OUT;
1491 YY_BREAK
1492case 52:
1493YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001494#line 159 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001495return INOUT;
1496 YY_BREAK
1497case 53:
1498YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001499#line 160 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001500return UNIFORM;
1501 YY_BREAK
1502case 54:
1503YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001504#line 161 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001505return VARYING;
1506 YY_BREAK
1507case 55:
1508YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001509#line 162 "glsl_lexer.lpp"
1510TOKEN_OR_IDENTIFIER(120, CENTROID);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001511 YY_BREAK
1512case 56:
1513YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001514#line 163 "glsl_lexer.lpp"
1515TOKEN_OR_IDENTIFIER(120, INVARIANT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001516 YY_BREAK
1517case 57:
1518YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001519#line 165 "glsl_lexer.lpp"
1520TOKEN_OR_IDENTIFIER(130, FLAT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001521 YY_BREAK
1522case 58:
1523YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001524#line 166 "glsl_lexer.lpp"
1525TOKEN_OR_IDENTIFIER(130, SMOOTH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001526 YY_BREAK
1527case 59:
1528YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001529#line 167 "glsl_lexer.lpp"
1530TOKEN_OR_IDENTIFIER(130, NOPERSPECTIVE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001531 YY_BREAK
1532case 60:
1533YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001534#line 169 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001535return SAMPLER1D;
1536 YY_BREAK
1537case 61:
1538YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001539#line 170 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001540return SAMPLER2D;
1541 YY_BREAK
1542case 62:
1543YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001544#line 171 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001545return SAMPLER3D;
1546 YY_BREAK
1547case 63:
1548YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001549#line 172 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001550return SAMPLERCUBE;
1551 YY_BREAK
1552case 64:
1553YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001554#line 173 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001555return SAMPLER1DSHADOW;
1556 YY_BREAK
1557case 65:
1558YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001559#line 174 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001560return SAMPLER2DSHADOW;
1561 YY_BREAK
1562case 66:
1563YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001564#line 176 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001565return STRUCT;
1566 YY_BREAK
1567case 67:
1568YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001569#line 177 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001570return VOID;
1571 YY_BREAK
1572case 68:
1573YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001574#line 179 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001575{
1576 if ((yyextra->language_version >= 140)
1577 || (yyextra->ARB_fragment_coord_conventions_enable)){
1578 return LAYOUT_TOK;
1579 } else {
1580 yylval->identifier = strdup(yytext);
1581 return IDENTIFIER;
1582 }
1583 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001584 YY_BREAK
1585case 69:
1586YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001587#line 189 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001588return INC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001589 YY_BREAK
1590case 70:
1591YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001592#line 190 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001593return DEC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001594 YY_BREAK
1595case 71:
1596YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001597#line 191 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001598return LE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001599 YY_BREAK
1600case 72:
1601YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001602#line 192 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001603return GE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001604 YY_BREAK
1605case 73:
1606YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001607#line 193 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001608return EQ_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001609 YY_BREAK
1610case 74:
1611YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001612#line 194 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001613return NE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001614 YY_BREAK
1615case 75:
1616YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001617#line 195 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001618return AND_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001619 YY_BREAK
1620case 76:
1621YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001622#line 196 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001623return OR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001624 YY_BREAK
1625case 77:
1626YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001627#line 197 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001628return XOR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001629 YY_BREAK
1630case 78:
1631YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001632#line 199 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001633return MUL_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001634 YY_BREAK
1635case 79:
1636YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001637#line 200 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001638return DIV_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001639 YY_BREAK
1640case 80:
1641YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001642#line 201 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001643return ADD_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001644 YY_BREAK
1645case 81:
1646YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001647#line 202 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001648return MOD_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001649 YY_BREAK
1650case 82:
1651YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001652#line 203 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001653return LEFT_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001654 YY_BREAK
1655case 83:
1656YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001657#line 204 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001658return RIGHT_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001659 YY_BREAK
1660case 84:
1661YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001662#line 205 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001663return AND_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001664 YY_BREAK
1665case 85:
1666YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001667#line 206 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001668return XOR_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001669 YY_BREAK
1670case 86:
1671YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001672#line 207 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001673return OR_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001674 YY_BREAK
1675case 87:
1676YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001677#line 208 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001678return SUB_ASSIGN;
1679 YY_BREAK
1680case 88:
1681YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001682#line 210 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001683{
1684 yylval->n = strtol(yytext, NULL, 10);
1685 return INTCONSTANT;
1686 }
1687 YY_BREAK
Ian Romanickf50f0652010-06-30 17:30:03 -07001688case 89:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001689YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001690#line 214 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001691{
1692 yylval->n = strtol(yytext + 2, NULL, 16);
1693 return INTCONSTANT;
1694 }
1695 YY_BREAK
Ian Romanickf50f0652010-06-30 17:30:03 -07001696case 90:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001697YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001698#line 218 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001699{
1700 yylval->n = strtol(yytext, NULL, 8);
1701 return INTCONSTANT;
1702 }
1703 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001704case 91:
1705YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001706#line 223 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001707{
1708 yylval->real = strtod(yytext, NULL);
1709 return FLOATCONSTANT;
1710 }
1711 YY_BREAK
1712case 92:
1713YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001714#line 227 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001715{
1716 yylval->real = strtod(yytext, NULL);
1717 return FLOATCONSTANT;
1718 }
1719 YY_BREAK
1720case 93:
1721YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001722#line 231 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001723{
1724 yylval->real = strtod(yytext, NULL);
1725 return FLOATCONSTANT;
1726 }
1727 YY_BREAK
1728case 94:
1729YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001730#line 235 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001731{
1732 yylval->real = strtod(yytext, NULL);
1733 return FLOATCONSTANT;
1734 }
1735 YY_BREAK
1736case 95:
1737YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001738#line 239 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001739{
Eric Anholt47f3f222010-08-02 11:26:43 -07001740 yylval->real = strtod(yytext, NULL);
1741 return FLOATCONSTANT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001742 }
1743 YY_BREAK
Ian Romanickf50f0652010-06-30 17:30:03 -07001744case 96:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001745YY_RULE_SETUP
Eric Anholt6a416262010-08-01 18:44:21 -07001746#line 244 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001747{
Eric Anholt47f3f222010-08-02 11:26:43 -07001748 yylval->n = 1;
1749 return BOOLCONSTANT;
1750 }
1751 YY_BREAK
1752case 97:
1753YY_RULE_SETUP
1754#line 248 "glsl_lexer.lpp"
1755{
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001756 yylval->n = 0;
1757 return BOOLCONSTANT;
1758 }
1759 YY_BREAK
1760/* Reserved words in GLSL 1.10. */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001761case 98:
1762YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001763#line 255 "glsl_lexer.lpp"
1764return ASM;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001765 YY_BREAK
1766case 99:
1767YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001768#line 256 "glsl_lexer.lpp"
1769return CLASS;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001770 YY_BREAK
1771case 100:
1772YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001773#line 257 "glsl_lexer.lpp"
1774return UNION;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001775 YY_BREAK
1776case 101:
1777YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001778#line 258 "glsl_lexer.lpp"
1779return ENUM;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001780 YY_BREAK
1781case 102:
1782YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001783#line 259 "glsl_lexer.lpp"
1784return TYPEDEF;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001785 YY_BREAK
1786case 103:
1787YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001788#line 260 "glsl_lexer.lpp"
1789return TEMPLATE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001790 YY_BREAK
1791case 104:
1792YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001793#line 261 "glsl_lexer.lpp"
1794return THIS;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001795 YY_BREAK
1796case 105:
1797YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001798#line 262 "glsl_lexer.lpp"
1799return PACKED;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001800 YY_BREAK
1801case 106:
1802YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001803#line 263 "glsl_lexer.lpp"
1804return GOTO;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001805 YY_BREAK
1806case 107:
1807YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001808#line 264 "glsl_lexer.lpp"
1809return SWITCH;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001810 YY_BREAK
1811case 108:
1812YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001813#line 265 "glsl_lexer.lpp"
1814return DEFAULT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001815 YY_BREAK
1816case 109:
1817YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001818#line 266 "glsl_lexer.lpp"
1819return INLINE_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001820 YY_BREAK
1821case 110:
1822YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001823#line 267 "glsl_lexer.lpp"
1824return NOINLINE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001825 YY_BREAK
1826case 111:
1827YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001828#line 268 "glsl_lexer.lpp"
1829return VOLATILE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001830 YY_BREAK
1831case 112:
1832YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001833#line 269 "glsl_lexer.lpp"
1834return PUBLIC_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001835 YY_BREAK
1836case 113:
1837YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001838#line 270 "glsl_lexer.lpp"
1839return STATIC;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001840 YY_BREAK
1841case 114:
1842YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001843#line 271 "glsl_lexer.lpp"
1844return EXTERN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001845 YY_BREAK
1846case 115:
1847YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001848#line 272 "glsl_lexer.lpp"
1849return EXTERNAL;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001850 YY_BREAK
1851case 116:
1852YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001853#line 273 "glsl_lexer.lpp"
1854return INTERFACE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001855 YY_BREAK
1856case 117:
1857YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001858#line 274 "glsl_lexer.lpp"
1859return LONG;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001860 YY_BREAK
1861case 118:
1862YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001863#line 275 "glsl_lexer.lpp"
1864return SHORT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001865 YY_BREAK
1866case 119:
1867YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001868#line 276 "glsl_lexer.lpp"
1869return DOUBLE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001870 YY_BREAK
1871case 120:
1872YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001873#line 277 "glsl_lexer.lpp"
1874return HALF;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001875 YY_BREAK
1876case 121:
1877YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001878#line 278 "glsl_lexer.lpp"
1879return FIXED;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001880 YY_BREAK
1881case 122:
1882YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001883#line 279 "glsl_lexer.lpp"
1884return UNSIGNED;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001885 YY_BREAK
1886case 123:
1887YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001888#line 280 "glsl_lexer.lpp"
1889return INPUT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001890 YY_BREAK
1891case 124:
1892YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001893#line 281 "glsl_lexer.lpp"
1894return OUTPUT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001895 YY_BREAK
1896case 125:
1897YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001898#line 282 "glsl_lexer.lpp"
1899return HVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001900 YY_BREAK
1901case 126:
1902YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001903#line 283 "glsl_lexer.lpp"
1904return HVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001905 YY_BREAK
1906case 127:
1907YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001908#line 284 "glsl_lexer.lpp"
1909return HVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001910 YY_BREAK
1911case 128:
1912YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001913#line 285 "glsl_lexer.lpp"
1914return DVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001915 YY_BREAK
1916case 129:
1917YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001918#line 286 "glsl_lexer.lpp"
1919return DVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001920 YY_BREAK
1921case 130:
1922YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001923#line 287 "glsl_lexer.lpp"
1924return DVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001925 YY_BREAK
1926case 131:
1927YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001928#line 288 "glsl_lexer.lpp"
1929return FVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001930 YY_BREAK
1931case 132:
1932YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001933#line 289 "glsl_lexer.lpp"
1934return FVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001935 YY_BREAK
1936case 133:
1937YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001938#line 290 "glsl_lexer.lpp"
1939return FVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001940 YY_BREAK
1941case 134:
1942YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001943#line 291 "glsl_lexer.lpp"
1944return SAMPLER2DRECT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001945 YY_BREAK
1946case 135:
1947YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001948#line 292 "glsl_lexer.lpp"
1949return SAMPLER3DRECT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001950 YY_BREAK
1951case 136:
1952YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001953#line 293 "glsl_lexer.lpp"
1954return SAMPLER2DRECTSHADOW;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001955 YY_BREAK
1956case 137:
1957YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001958#line 294 "glsl_lexer.lpp"
1959return SIZEOF;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001960 YY_BREAK
1961case 138:
1962YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001963#line 295 "glsl_lexer.lpp"
1964return CAST;
Ian Romanickf50f0652010-06-30 17:30:03 -07001965 YY_BREAK
1966case 139:
1967YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001968#line 296 "glsl_lexer.lpp"
1969return NAMESPACE;
1970 YY_BREAK
1971case 140:
1972YY_RULE_SETUP
1973#line 297 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001974return USING;
1975 YY_BREAK
1976/* Additional reserved words in GLSL 1.20. */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001977case 141:
1978YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001979#line 300 "glsl_lexer.lpp"
1980TOKEN_OR_IDENTIFIER(120, LOWP);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001981 YY_BREAK
1982case 142:
1983YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001984#line 301 "glsl_lexer.lpp"
1985TOKEN_OR_IDENTIFIER(120, MEDIUMP);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001986 YY_BREAK
1987case 143:
1988YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001989#line 302 "glsl_lexer.lpp"
1990TOKEN_OR_IDENTIFIER(120, HIGHP);
Ian Romanickf50f0652010-06-30 17:30:03 -07001991 YY_BREAK
1992case 144:
1993YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07001994#line 303 "glsl_lexer.lpp"
1995TOKEN_OR_IDENTIFIER(120, PRECISION);
1996 YY_BREAK
1997case 145:
1998YY_RULE_SETUP
1999#line 305 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002000{
2001 struct _mesa_glsl_parse_state *state = yyextra;
2002 void *ctx = state;
2003 yylval->identifier = talloc_strdup(ctx, yytext);
2004 return IDENTIFIER;
2005 }
2006 YY_BREAK
Ian Romanickf50f0652010-06-30 17:30:03 -07002007case 146:
2008YY_RULE_SETUP
Eric Anholt47f3f222010-08-02 11:26:43 -07002009#line 312 "glsl_lexer.lpp"
2010{ return yytext[0]; }
2011 YY_BREAK
2012case 147:
2013YY_RULE_SETUP
2014#line 314 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002015ECHO;
2016 YY_BREAK
Eric Anholt47f3f222010-08-02 11:26:43 -07002017#line 2018 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002018case YY_STATE_EOF(INITIAL):
2019case YY_STATE_EOF(PP):
2020 yyterminate();
2021
2022 case YY_END_OF_BUFFER:
2023 {
2024 /* Amount of text matched not including the EOB char. */
2025 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2026
2027 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2028 *yy_cp = yyg->yy_hold_char;
2029 YY_RESTORE_YY_MORE_OFFSET
2030
2031 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2032 {
2033 /* We're scanning a new file or input source. It's
2034 * possible that this happened because the user
2035 * just pointed yyin at a new source and called
2036 * _mesa_glsl_lex(). If so, then we have to assure
2037 * consistency between YY_CURRENT_BUFFER and our
2038 * globals. Here is the right place to do so, because
2039 * this is the first action (other than possibly a
2040 * back-up) that will match for the new input source.
2041 */
2042 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2043 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2044 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2045 }
2046
2047 /* Note that here we test for yy_c_buf_p "<=" to the position
2048 * of the first EOB in the buffer, since yy_c_buf_p will
2049 * already have been incremented past the NUL character
2050 * (since all states make transitions on EOB to the
2051 * end-of-buffer state). Contrast this with the test
2052 * in input().
2053 */
2054 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2055 { /* This was really a NUL. */
2056 yy_state_type yy_next_state;
2057
2058 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2059
2060 yy_current_state = yy_get_previous_state( yyscanner );
2061
2062 /* Okay, we're now positioned to make the NUL
2063 * transition. We couldn't have
2064 * yy_get_previous_state() go ahead and do it
2065 * for us because it doesn't know how to deal
2066 * with the possibility of jamming (and we don't
2067 * want to build jamming into it because then it
2068 * will run more slowly).
2069 */
2070
2071 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2072
2073 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2074
2075 if ( yy_next_state )
2076 {
2077 /* Consume the NUL. */
2078 yy_cp = ++yyg->yy_c_buf_p;
2079 yy_current_state = yy_next_state;
2080 goto yy_match;
2081 }
2082
2083 else
2084 {
2085 yy_cp = yyg->yy_last_accepting_cpos;
2086 yy_current_state = yyg->yy_last_accepting_state;
2087 goto yy_find_action;
2088 }
2089 }
2090
2091 else switch ( yy_get_next_buffer( yyscanner ) )
2092 {
2093 case EOB_ACT_END_OF_FILE:
2094 {
2095 yyg->yy_did_buffer_switch_on_eof = 0;
2096
2097 if ( _mesa_glsl_wrap(yyscanner ) )
2098 {
2099 /* Note: because we've taken care in
2100 * yy_get_next_buffer() to have set up
2101 * yytext, we can now set up
2102 * yy_c_buf_p so that if some total
2103 * hoser (like flex itself) wants to
2104 * call the scanner after we return the
2105 * YY_NULL, it'll still work - another
2106 * YY_NULL will get returned.
2107 */
2108 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2109
2110 yy_act = YY_STATE_EOF(YY_START);
2111 goto do_action;
2112 }
2113
2114 else
2115 {
2116 if ( ! yyg->yy_did_buffer_switch_on_eof )
2117 YY_NEW_FILE;
2118 }
2119 break;
2120 }
2121
2122 case EOB_ACT_CONTINUE_SCAN:
2123 yyg->yy_c_buf_p =
2124 yyg->yytext_ptr + yy_amount_of_matched_text;
2125
2126 yy_current_state = yy_get_previous_state( yyscanner );
2127
2128 yy_cp = yyg->yy_c_buf_p;
2129 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2130 goto yy_match;
2131
2132 case EOB_ACT_LAST_MATCH:
2133 yyg->yy_c_buf_p =
2134 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2135
2136 yy_current_state = yy_get_previous_state( yyscanner );
2137
2138 yy_cp = yyg->yy_c_buf_p;
2139 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2140 goto yy_find_action;
2141 }
2142 break;
2143 }
2144
2145 default:
2146 YY_FATAL_ERROR(
2147 "fatal flex scanner internal error--no action found" );
2148 } /* end of action switch */
2149 } /* end of scanning one token */
2150} /* end of _mesa_glsl_lex */
2151
2152/* yy_get_next_buffer - try to read in a new buffer
2153 *
2154 * Returns a code representing an action:
2155 * EOB_ACT_LAST_MATCH -
2156 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2157 * EOB_ACT_END_OF_FILE - end of file
2158 */
2159static int yy_get_next_buffer (yyscan_t yyscanner)
2160{
2161 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2162 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2163 register char *source = yyg->yytext_ptr;
2164 register int number_to_move, i;
2165 int ret_val;
2166
2167 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2168 YY_FATAL_ERROR(
2169 "fatal flex scanner internal error--end of buffer missed" );
2170
2171 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2172 { /* Don't try to fill the buffer, so this is an EOF. */
2173 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2174 {
2175 /* We matched a single character, the EOB, so
2176 * treat this as a final EOF.
2177 */
2178 return EOB_ACT_END_OF_FILE;
2179 }
2180
2181 else
2182 {
2183 /* We matched some text prior to the EOB, first
2184 * process it.
2185 */
2186 return EOB_ACT_LAST_MATCH;
2187 }
2188 }
2189
2190 /* Try to read more data. */
2191
2192 /* First move last chars to start of buffer. */
2193 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2194
2195 for ( i = 0; i < number_to_move; ++i )
2196 *(dest++) = *(source++);
2197
2198 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2199 /* don't do the read, it's not guaranteed to return an EOF,
2200 * just force an EOF
2201 */
2202 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2203
2204 else
2205 {
2206 int num_to_read =
2207 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2208
2209 while ( num_to_read <= 0 )
2210 { /* Not enough room in the buffer - grow it. */
2211
2212 /* just a shorter name for the current buffer */
2213 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2214
2215 int yy_c_buf_p_offset =
2216 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2217
2218 if ( b->yy_is_our_buffer )
2219 {
2220 int new_size = b->yy_buf_size * 2;
2221
2222 if ( new_size <= 0 )
2223 b->yy_buf_size += b->yy_buf_size / 8;
2224 else
2225 b->yy_buf_size *= 2;
2226
2227 b->yy_ch_buf = (char *)
2228 /* Include room in for 2 EOB chars. */
2229 _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2230 }
2231 else
2232 /* Can't grow it, we don't own it. */
2233 b->yy_ch_buf = 0;
2234
2235 if ( ! b->yy_ch_buf )
2236 YY_FATAL_ERROR(
2237 "fatal error - scanner input buffer overflow" );
2238
2239 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2240
2241 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2242 number_to_move - 1;
2243
2244 }
2245
2246 if ( num_to_read > YY_READ_BUF_SIZE )
2247 num_to_read = YY_READ_BUF_SIZE;
2248
2249 /* Read in more data. */
2250 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2251 yyg->yy_n_chars, (size_t) num_to_read );
2252
2253 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2254 }
2255
2256 if ( yyg->yy_n_chars == 0 )
2257 {
2258 if ( number_to_move == YY_MORE_ADJ )
2259 {
2260 ret_val = EOB_ACT_END_OF_FILE;
2261 _mesa_glsl_restart(yyin ,yyscanner);
2262 }
2263
2264 else
2265 {
2266 ret_val = EOB_ACT_LAST_MATCH;
2267 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2268 YY_BUFFER_EOF_PENDING;
2269 }
2270 }
2271
2272 else
2273 ret_val = EOB_ACT_CONTINUE_SCAN;
2274
2275 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2276 /* Extend the array by 50%, plus the number we really need. */
2277 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2278 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2279 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2280 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2281 }
2282
2283 yyg->yy_n_chars += number_to_move;
2284 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2285 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2286
2287 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2288
2289 return ret_val;
2290}
2291
2292/* yy_get_previous_state - get the state just before the EOB char was reached */
2293
2294 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2295{
2296 register yy_state_type yy_current_state;
2297 register char *yy_cp;
2298 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2299
2300 yy_current_state = yyg->yy_start;
2301 yy_current_state += YY_AT_BOL();
2302
2303 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2304 {
2305 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2306 if ( yy_accept[yy_current_state] )
2307 {
2308 yyg->yy_last_accepting_state = yy_current_state;
2309 yyg->yy_last_accepting_cpos = yy_cp;
2310 }
2311 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2312 {
2313 yy_current_state = (int) yy_def[yy_current_state];
Eric Anholt47f3f222010-08-02 11:26:43 -07002314 if ( yy_current_state >= 525 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002315 yy_c = yy_meta[(unsigned int) yy_c];
2316 }
2317 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2318 }
2319
2320 return yy_current_state;
2321}
2322
2323/* yy_try_NUL_trans - try to make a transition on the NUL character
2324 *
2325 * synopsis
2326 * next_state = yy_try_NUL_trans( current_state );
2327 */
2328 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2329{
2330 register int yy_is_jam;
2331 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2332 register char *yy_cp = yyg->yy_c_buf_p;
2333
2334 register YY_CHAR yy_c = 1;
2335 if ( yy_accept[yy_current_state] )
2336 {
2337 yyg->yy_last_accepting_state = yy_current_state;
2338 yyg->yy_last_accepting_cpos = yy_cp;
2339 }
2340 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2341 {
2342 yy_current_state = (int) yy_def[yy_current_state];
Eric Anholt47f3f222010-08-02 11:26:43 -07002343 if ( yy_current_state >= 525 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002344 yy_c = yy_meta[(unsigned int) yy_c];
2345 }
2346 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Eric Anholt47f3f222010-08-02 11:26:43 -07002347 yy_is_jam = (yy_current_state == 524);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002348
2349 return yy_is_jam ? 0 : yy_current_state;
2350}
2351
2352#ifndef YY_NO_INPUT
2353#ifdef __cplusplus
2354 static int yyinput (yyscan_t yyscanner)
2355#else
2356 static int input (yyscan_t yyscanner)
2357#endif
2358
2359{
2360 int c;
2361 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2362
2363 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2364
2365 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2366 {
2367 /* yy_c_buf_p now points to the character we want to return.
2368 * If this occurs *before* the EOB characters, then it's a
2369 * valid NUL; if not, then we've hit the end of the buffer.
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 *yyg->yy_c_buf_p = '\0';
2374
2375 else
2376 { /* need more input */
2377 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2378 ++yyg->yy_c_buf_p;
2379
2380 switch ( yy_get_next_buffer( yyscanner ) )
2381 {
2382 case EOB_ACT_LAST_MATCH:
2383 /* This happens because yy_g_n_b()
2384 * sees that we've accumulated a
2385 * token and flags that we need to
2386 * try matching the token before
2387 * proceeding. But for input(),
2388 * there's no matching to consider.
2389 * So convert the EOB_ACT_LAST_MATCH
2390 * to EOB_ACT_END_OF_FILE.
2391 */
2392
2393 /* Reset buffer status. */
2394 _mesa_glsl_restart(yyin ,yyscanner);
2395
2396 /*FALLTHROUGH*/
2397
2398 case EOB_ACT_END_OF_FILE:
2399 {
2400 if ( _mesa_glsl_wrap(yyscanner ) )
2401 return EOF;
2402
2403 if ( ! yyg->yy_did_buffer_switch_on_eof )
2404 YY_NEW_FILE;
2405#ifdef __cplusplus
2406 return yyinput(yyscanner);
2407#else
2408 return input(yyscanner);
2409#endif
2410 }
2411
2412 case EOB_ACT_CONTINUE_SCAN:
2413 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2414 break;
2415 }
2416 }
2417 }
2418
2419 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2420 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2421 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2422
2423 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2424
2425 return c;
2426}
2427#endif /* ifndef YY_NO_INPUT */
2428
2429/** Immediately switch to a different input stream.
2430 * @param input_file A readable stream.
2431 * @param yyscanner The scanner object.
2432 * @note This function does not reset the start condition to @c INITIAL .
2433 */
2434 void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner)
2435{
2436 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2437
2438 if ( ! YY_CURRENT_BUFFER ){
2439 _mesa_glsl_ensure_buffer_stack (yyscanner);
2440 YY_CURRENT_BUFFER_LVALUE =
2441 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2442 }
2443
2444 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2445 _mesa_glsl__load_buffer_state(yyscanner );
2446}
2447
2448/** Switch to a different input buffer.
2449 * @param new_buffer The new input buffer.
2450 * @param yyscanner The scanner object.
2451 */
2452 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2453{
2454 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2455
2456 /* TODO. We should be able to replace this entire function body
2457 * with
2458 * _mesa_glsl_pop_buffer_state();
2459 * _mesa_glsl_push_buffer_state(new_buffer);
2460 */
2461 _mesa_glsl_ensure_buffer_stack (yyscanner);
2462 if ( YY_CURRENT_BUFFER == new_buffer )
2463 return;
2464
2465 if ( YY_CURRENT_BUFFER )
2466 {
2467 /* Flush out information for old buffer. */
2468 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2469 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2470 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2471 }
2472
2473 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2474 _mesa_glsl__load_buffer_state(yyscanner );
2475
2476 /* We don't actually know whether we did this switch during
2477 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2478 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2479 * to go ahead and always set it.
2480 */
2481 yyg->yy_did_buffer_switch_on_eof = 1;
2482}
2483
2484static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner)
2485{
2486 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2487 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2488 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2489 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2490 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2491}
2492
2493/** Allocate and initialize an input buffer state.
2494 * @param file A readable stream.
2495 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2496 * @param yyscanner The scanner object.
2497 * @return the allocated buffer state.
2498 */
2499 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner)
2500{
2501 YY_BUFFER_STATE b;
2502
2503 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2504 if ( ! b )
2505 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2506
2507 b->yy_buf_size = size;
2508
2509 /* yy_ch_buf has to be 2 characters longer than the size given because
2510 * we need to put in 2 end-of-buffer characters.
2511 */
2512 b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner );
2513 if ( ! b->yy_ch_buf )
2514 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2515
2516 b->yy_is_our_buffer = 1;
2517
2518 _mesa_glsl__init_buffer(b,file ,yyscanner);
2519
2520 return b;
2521}
2522
2523/** Destroy the buffer.
2524 * @param b a buffer created with _mesa_glsl__create_buffer()
2525 * @param yyscanner The scanner object.
2526 */
2527 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2528{
2529 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2530
2531 if ( ! b )
2532 return;
2533
2534 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2535 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2536
2537 if ( b->yy_is_our_buffer )
2538 _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner );
2539
2540 _mesa_glsl_free((void *) b ,yyscanner );
2541}
2542
2543/* Initializes or reinitializes a buffer.
2544 * This function is sometimes called more than once on the same buffer,
2545 * such as during a _mesa_glsl_restart() or at EOF.
2546 */
2547 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2548
2549{
2550 int oerrno = errno;
2551 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2552
2553 _mesa_glsl__flush_buffer(b ,yyscanner);
2554
2555 b->yy_input_file = file;
2556 b->yy_fill_buffer = 1;
2557
2558 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
2559 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
2560 * In that case, we don't want to reset the lineno or column.
2561 */
2562 if (b != YY_CURRENT_BUFFER){
2563 b->yy_bs_lineno = 1;
2564 b->yy_bs_column = 0;
2565 }
2566
2567 b->yy_is_interactive = 0;
2568
2569 errno = oerrno;
2570}
2571
2572/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2573 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2574 * @param yyscanner The scanner object.
2575 */
2576 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2577{
2578 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2579 if ( ! b )
2580 return;
2581
2582 b->yy_n_chars = 0;
2583
2584 /* We always need two end-of-buffer characters. The first causes
2585 * a transition to the end-of-buffer state. The second causes
2586 * a jam in that state.
2587 */
2588 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2589 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2590
2591 b->yy_buf_pos = &b->yy_ch_buf[0];
2592
2593 b->yy_at_bol = 1;
2594 b->yy_buffer_status = YY_BUFFER_NEW;
2595
2596 if ( b == YY_CURRENT_BUFFER )
2597 _mesa_glsl__load_buffer_state(yyscanner );
2598}
2599
2600/** Pushes the new state onto the stack. The new state becomes
2601 * the current state. This function will allocate the stack
2602 * if necessary.
2603 * @param new_buffer The new state.
2604 * @param yyscanner The scanner object.
2605 */
2606void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2607{
2608 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2609 if (new_buffer == NULL)
2610 return;
2611
2612 _mesa_glsl_ensure_buffer_stack(yyscanner);
2613
2614 /* This block is copied from _mesa_glsl__switch_to_buffer. */
2615 if ( YY_CURRENT_BUFFER )
2616 {
2617 /* Flush out information for old buffer. */
2618 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2619 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2620 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2621 }
2622
2623 /* Only push if top exists. Otherwise, replace top. */
2624 if (YY_CURRENT_BUFFER)
2625 yyg->yy_buffer_stack_top++;
2626 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2627
2628 /* copied from _mesa_glsl__switch_to_buffer. */
2629 _mesa_glsl__load_buffer_state(yyscanner );
2630 yyg->yy_did_buffer_switch_on_eof = 1;
2631}
2632
2633/** Removes and deletes the top of the stack, if present.
2634 * The next element becomes the new top.
2635 * @param yyscanner The scanner object.
2636 */
2637void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner)
2638{
2639 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2640 if (!YY_CURRENT_BUFFER)
2641 return;
2642
2643 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2644 YY_CURRENT_BUFFER_LVALUE = NULL;
2645 if (yyg->yy_buffer_stack_top > 0)
2646 --yyg->yy_buffer_stack_top;
2647
2648 if (YY_CURRENT_BUFFER) {
2649 _mesa_glsl__load_buffer_state(yyscanner );
2650 yyg->yy_did_buffer_switch_on_eof = 1;
2651 }
2652}
2653
2654/* Allocates the stack if it does not exist.
2655 * Guarantees space for at least one push.
2656 */
2657static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner)
2658{
2659 int num_to_alloc;
2660 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2661
2662 if (!yyg->yy_buffer_stack) {
2663
2664 /* First allocation is just for 2 elements, since we don't know if this
2665 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2666 * immediate realloc on the next call.
2667 */
2668 num_to_alloc = 1;
2669 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc
2670 (num_to_alloc * sizeof(struct yy_buffer_state*)
2671 , yyscanner);
2672 if ( ! yyg->yy_buffer_stack )
2673 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
2674
2675 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2676
2677 yyg->yy_buffer_stack_max = num_to_alloc;
2678 yyg->yy_buffer_stack_top = 0;
2679 return;
2680 }
2681
2682 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2683
2684 /* Increase the buffer to prepare for a possible push. */
2685 int grow_size = 8 /* arbitrary grow size */;
2686
2687 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2688 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc
2689 (yyg->yy_buffer_stack,
2690 num_to_alloc * sizeof(struct yy_buffer_state*)
2691 , yyscanner);
2692 if ( ! yyg->yy_buffer_stack )
2693 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
2694
2695 /* zero only the new slots.*/
2696 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2697 yyg->yy_buffer_stack_max = num_to_alloc;
2698 }
2699}
2700
2701/** Setup the input buffer state to scan directly from a user-specified character buffer.
2702 * @param base the character buffer
2703 * @param size the size in bytes of the character buffer
2704 * @param yyscanner The scanner object.
2705 * @return the newly allocated buffer state object.
2706 */
2707YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2708{
2709 YY_BUFFER_STATE b;
2710
2711 if ( size < 2 ||
2712 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2713 base[size-1] != YY_END_OF_BUFFER_CHAR )
2714 /* They forgot to leave room for the EOB's. */
2715 return 0;
2716
2717 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2718 if ( ! b )
2719 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
2720
2721 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2722 b->yy_buf_pos = b->yy_ch_buf = base;
2723 b->yy_is_our_buffer = 0;
2724 b->yy_input_file = 0;
2725 b->yy_n_chars = b->yy_buf_size;
2726 b->yy_is_interactive = 0;
2727 b->yy_at_bol = 1;
2728 b->yy_fill_buffer = 0;
2729 b->yy_buffer_status = YY_BUFFER_NEW;
2730
2731 _mesa_glsl__switch_to_buffer(b ,yyscanner );
2732
2733 return b;
2734}
2735
2736/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
2737 * scan from a @e copy of @a str.
2738 * @param yystr a NUL-terminated string to scan
2739 * @param yyscanner The scanner object.
2740 * @return the newly allocated buffer state object.
2741 * @note If you want to scan bytes that may contain NUL values, then use
2742 * _mesa_glsl__scan_bytes() instead.
2743 */
2744YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner)
2745{
2746
2747 return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner);
2748}
2749
2750/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
2751 * scan from a @e copy of @a bytes.
2752 * @param yybytes the byte buffer to scan
2753 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2754 * @param yyscanner The scanner object.
2755 * @return the newly allocated buffer state object.
2756 */
2757YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2758{
2759 YY_BUFFER_STATE b;
2760 char *buf;
2761 yy_size_t n;
2762 int i;
2763
2764 /* Get memory for full buffer, including space for trailing EOB's. */
2765 n = _yybytes_len + 2;
2766 buf = (char *) _mesa_glsl_alloc(n ,yyscanner );
2767 if ( ! buf )
2768 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
2769
2770 for ( i = 0; i < _yybytes_len; ++i )
2771 buf[i] = yybytes[i];
2772
2773 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2774
2775 b = _mesa_glsl__scan_buffer(buf,n ,yyscanner);
2776 if ( ! b )
2777 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
2778
2779 /* It's okay to grow etc. this buffer, and we should throw it
2780 * away when we're done.
2781 */
2782 b->yy_is_our_buffer = 1;
2783
2784 return b;
2785}
2786
2787#ifndef YY_EXIT_FAILURE
2788#define YY_EXIT_FAILURE 2
2789#endif
2790
2791static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2792{
2793 (void) fprintf( stderr, "%s\n", msg );
2794 exit( YY_EXIT_FAILURE );
2795}
2796
2797/* Redefine yyless() so it works in section 3 code. */
2798
2799#undef yyless
2800#define yyless(n) \
2801 do \
2802 { \
2803 /* Undo effects of setting up yytext. */ \
2804 int yyless_macro_arg = (n); \
2805 YY_LESS_LINENO(yyless_macro_arg);\
2806 yytext[yyleng] = yyg->yy_hold_char; \
2807 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2808 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2809 *yyg->yy_c_buf_p = '\0'; \
2810 yyleng = yyless_macro_arg; \
2811 } \
2812 while ( 0 )
2813
2814/* Accessor methods (get/set functions) to struct members. */
2815
2816/** Get the user-defined data for this scanner.
2817 * @param yyscanner The scanner object.
2818 */
2819YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner)
2820{
2821 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2822 return yyextra;
2823}
2824
2825/** Get the current line number.
2826 * @param yyscanner The scanner object.
2827 */
2828int _mesa_glsl_get_lineno (yyscan_t yyscanner)
2829{
2830 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2831
2832 if (! YY_CURRENT_BUFFER)
2833 return 0;
2834
2835 return yylineno;
2836}
2837
2838/** Get the current column number.
2839 * @param yyscanner The scanner object.
2840 */
2841int _mesa_glsl_get_column (yyscan_t yyscanner)
2842{
2843 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2844
2845 if (! YY_CURRENT_BUFFER)
2846 return 0;
2847
2848 return yycolumn;
2849}
2850
2851/** Get the input stream.
2852 * @param yyscanner The scanner object.
2853 */
2854FILE *_mesa_glsl_get_in (yyscan_t yyscanner)
2855{
2856 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2857 return yyin;
2858}
2859
2860/** Get the output stream.
2861 * @param yyscanner The scanner object.
2862 */
2863FILE *_mesa_glsl_get_out (yyscan_t yyscanner)
2864{
2865 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2866 return yyout;
2867}
2868
2869/** Get the length of the current token.
2870 * @param yyscanner The scanner object.
2871 */
2872int _mesa_glsl_get_leng (yyscan_t yyscanner)
2873{
2874 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2875 return yyleng;
2876}
2877
2878/** Get the current token.
2879 * @param yyscanner The scanner object.
2880 */
2881
2882char *_mesa_glsl_get_text (yyscan_t yyscanner)
2883{
2884 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2885 return yytext;
2886}
2887
2888/** Set the user-defined data. This data is never touched by the scanner.
2889 * @param user_defined The data to be associated with this scanner.
2890 * @param yyscanner The scanner object.
2891 */
2892void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2893{
2894 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2895 yyextra = user_defined ;
2896}
2897
2898/** Set the current line number.
2899 * @param line_number
2900 * @param yyscanner The scanner object.
2901 */
2902void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner)
2903{
2904 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2905
2906 /* lineno is only valid if an input buffer exists. */
2907 if (! YY_CURRENT_BUFFER )
2908 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner);
2909
2910 yylineno = line_number;
2911}
2912
2913/** Set the current column.
2914 * @param line_number
2915 * @param yyscanner The scanner object.
2916 */
2917void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner)
2918{
2919 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2920
2921 /* column is only valid if an input buffer exists. */
2922 if (! YY_CURRENT_BUFFER )
2923 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner);
2924
2925 yycolumn = column_no;
2926}
2927
2928/** Set the input stream. This does not discard the current
2929 * input buffer.
2930 * @param in_str A readable stream.
2931 * @param yyscanner The scanner object.
2932 * @see _mesa_glsl__switch_to_buffer
2933 */
2934void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner)
2935{
2936 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2937 yyin = in_str ;
2938}
2939
2940void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner)
2941{
2942 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2943 yyout = out_str ;
2944}
2945
2946int _mesa_glsl_get_debug (yyscan_t yyscanner)
2947{
2948 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2949 return yy_flex_debug;
2950}
2951
2952void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner)
2953{
2954 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2955 yy_flex_debug = bdebug ;
2956}
2957
2958/* Accessor methods for yylval and yylloc */
2959
2960YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner)
2961{
2962 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2963 return yylval;
2964}
2965
2966void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2967{
2968 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2969 yylval = yylval_param;
2970}
2971
2972YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner)
2973{
2974 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2975 return yylloc;
2976}
2977
2978void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
2979{
2980 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2981 yylloc = yylloc_param;
2982}
2983
2984/* User-visible API */
2985
2986/* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
2987 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2988 * That's why we explicitly handle the declaration, instead of using our macros.
2989 */
2990
2991int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals)
2992
2993{
2994 if (ptr_yy_globals == NULL){
2995 errno = EINVAL;
2996 return 1;
2997 }
2998
2999 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL );
3000
3001 if (*ptr_yy_globals == NULL){
3002 errno = ENOMEM;
3003 return 1;
3004 }
3005
3006 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3007 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3008
3009 return yy_init_globals ( *ptr_yy_globals );
3010}
3011
3012/* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3013 * convention of taking the scanner as the last argument. Note however, that
3014 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3015 * is the reason, too, why this function also must handle its own declaration).
3016 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3017 * the yyextra field.
3018 */
3019
3020int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3021
3022{
3023 struct yyguts_t dummy_yyguts;
3024
3025 _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts);
3026
3027 if (ptr_yy_globals == NULL){
3028 errno = EINVAL;
3029 return 1;
3030 }
3031
3032 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3033
3034 if (*ptr_yy_globals == NULL){
3035 errno = ENOMEM;
3036 return 1;
3037 }
3038
3039 /* By setting to 0xAA, we expose bugs in
3040 yy_init_globals. Leave at 0x00 for releases. */
3041 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3042
3043 _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals);
3044
3045 return yy_init_globals ( *ptr_yy_globals );
3046}
3047
3048static int yy_init_globals (yyscan_t yyscanner)
3049{
3050 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3051 /* Initialization is the same as for the non-reentrant scanner.
3052 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3053 */
3054
3055 yyg->yy_buffer_stack = 0;
3056 yyg->yy_buffer_stack_top = 0;
3057 yyg->yy_buffer_stack_max = 0;
3058 yyg->yy_c_buf_p = (char *) 0;
3059 yyg->yy_init = 0;
3060 yyg->yy_start = 0;
3061
3062 yyg->yy_start_stack_ptr = 0;
3063 yyg->yy_start_stack_depth = 0;
3064 yyg->yy_start_stack = NULL;
3065
3066/* Defined in main.c */
3067#ifdef YY_STDINIT
3068 yyin = stdin;
3069 yyout = stdout;
3070#else
3071 yyin = (FILE *) 0;
3072 yyout = (FILE *) 0;
3073#endif
3074
3075 /* For future reference: Set errno on error, since we are called by
3076 * _mesa_glsl_lex_init()
3077 */
3078 return 0;
3079}
3080
3081/* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3082int _mesa_glsl_lex_destroy (yyscan_t yyscanner)
3083{
3084 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3085
3086 /* Pop the buffer stack, destroying each element. */
3087 while(YY_CURRENT_BUFFER){
3088 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3089 YY_CURRENT_BUFFER_LVALUE = NULL;
3090 _mesa_glsl_pop_buffer_state(yyscanner);
3091 }
3092
3093 /* Destroy the stack itself. */
3094 _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner);
3095 yyg->yy_buffer_stack = NULL;
3096
3097 /* Destroy the start condition stack. */
3098 _mesa_glsl_free(yyg->yy_start_stack ,yyscanner );
3099 yyg->yy_start_stack = NULL;
3100
3101 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3102 * _mesa_glsl_lex() is called, initialization will occur. */
3103 yy_init_globals( yyscanner);
3104
3105 /* Destroy the main struct (reentrant only). */
3106 _mesa_glsl_free ( yyscanner , yyscanner );
3107 yyscanner = NULL;
3108 return 0;
3109}
3110
3111/*
3112 * Internal utility routines.
3113 */
3114
3115#ifndef yytext_ptr
3116static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3117{
3118 register int i;
3119 for ( i = 0; i < n; ++i )
3120 s1[i] = s2[i];
3121}
3122#endif
3123
3124#ifdef YY_NEED_STRLEN
3125static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3126{
3127 register int n;
3128 for ( n = 0; s[n]; ++n )
3129 ;
3130
3131 return n;
3132}
3133#endif
3134
3135void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner)
3136{
3137 return (void *) malloc( size );
3138}
3139
3140void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3141{
3142 /* The cast to (char *) in the following accommodates both
3143 * implementations that use char* generic pointers, and those
3144 * that use void* generic pointers. It works with the latter
3145 * because both ANSI C and C++ allow castless assignment from
3146 * any pointer type to void*, and deal with argument conversions
3147 * as though doing an assignment.
3148 */
3149 return (void *) realloc( (char *) ptr, size );
3150}
3151
3152void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
3153{
3154 free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */
3155}
3156
3157#define YYTABLES_NAME "yytables"
3158
Eric Anholt47f3f222010-08-02 11:26:43 -07003159#line 314 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003160
3161
3162
3163void
3164_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
3165{
3166 _mesa_glsl_lex_init_extra(state,& state->scanner);
3167 _mesa_glsl__scan_string(string,state->scanner);
3168}
3169
3170void
3171_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
3172{
3173 _mesa_glsl_lex_destroy(state->scanner);
3174}
3175