blob: 7661bbe9823412acee284120284ca3c16e39ea4e [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;
Kenneth Graunkec5e74872010-09-05 01:32:32 -070057#endif /* ! C99 */
Carl Worthe8a8f0f2010-07-28 12:27:33 -070058
59/* Limits of integral types. */
60#ifndef INT8_MIN
61#define INT8_MIN (-128)
62#endif
63#ifndef INT16_MIN
64#define INT16_MIN (-32767-1)
65#endif
66#ifndef INT32_MIN
67#define INT32_MIN (-2147483647-1)
68#endif
69#ifndef INT8_MAX
70#define INT8_MAX (127)
71#endif
72#ifndef INT16_MAX
73#define INT16_MAX (32767)
74#endif
75#ifndef INT32_MAX
76#define INT32_MAX (2147483647)
77#endif
78#ifndef UINT8_MAX
79#define UINT8_MAX (255U)
80#endif
81#ifndef UINT16_MAX
82#define UINT16_MAX (65535U)
83#endif
84#ifndef UINT32_MAX
85#define UINT32_MAX (4294967295U)
86#endif
87
Carl Worthe8a8f0f2010-07-28 12:27:33 -070088#endif /* ! FLEXINT_H */
89
90#ifdef __cplusplus
91
92/* The "const" storage-class-modifier is valid. */
93#define YY_USE_CONST
94
95#else /* ! __cplusplus */
96
97/* C99 requires __STDC__ to be defined as 1. */
98#if defined (__STDC__)
99
100#define YY_USE_CONST
101
102#endif /* defined (__STDC__) */
103#endif /* ! __cplusplus */
104
105#ifdef YY_USE_CONST
106#define yyconst const
107#else
108#define yyconst
109#endif
110
111/* Returned upon end-of-file. */
112#define YY_NULL 0
113
114/* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
117 * double cast.
118 */
119#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
121/* An opaque pointer. */
122#ifndef YY_TYPEDEF_YY_SCANNER_T
123#define YY_TYPEDEF_YY_SCANNER_T
124typedef void* yyscan_t;
125#endif
126
127/* For convenience, these vars (plus the bison vars far below)
128 are macros in the reentrant scanner. */
129#define yyin yyg->yyin_r
130#define yyout yyg->yyout_r
131#define yyextra yyg->yyextra_r
132#define yyleng yyg->yyleng_r
133#define yytext yyg->yytext_r
134#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136#define yy_flex_debug yyg->yy_flex_debug_r
137
138/* Enter a start condition. This macro really ought to take a parameter,
139 * but we do it the disgusting crufty way forced on us by the ()-less
140 * definition of BEGIN.
141 */
142#define BEGIN yyg->yy_start = 1 + 2 *
143
144/* Translate the current start state into a value that can be later handed
145 * to BEGIN to return to the state. The YYSTATE alias is for lex
146 * compatibility.
147 */
148#define YY_START ((yyg->yy_start - 1) / 2)
149#define YYSTATE YY_START
150
151/* Action number for EOF rule of a given start state. */
152#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153
154/* Special action meaning "start processing a new file". */
155#define YY_NEW_FILE _mesa_glsl_restart(yyin ,yyscanner )
156
157#define YY_END_OF_BUFFER_CHAR 0
158
159/* Size of default input buffer. */
160#ifndef YY_BUF_SIZE
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700161#define YY_BUF_SIZE 16384
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700162#endif
163
164/* The state buf must be large enough to hold one state per character in the main buffer.
165 */
166#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
167
168#ifndef YY_TYPEDEF_YY_BUFFER_STATE
169#define YY_TYPEDEF_YY_BUFFER_STATE
170typedef struct yy_buffer_state *YY_BUFFER_STATE;
171#endif
172
173#define EOB_ACT_CONTINUE_SCAN 0
174#define EOB_ACT_END_OF_FILE 1
175#define EOB_ACT_LAST_MATCH 2
176
177 #define YY_LESS_LINENO(n)
178
179/* Return all but the first "n" matched characters back to the input stream. */
180#define yyless(n) \
181 do \
182 { \
183 /* Undo effects of setting up yytext. */ \
184 int yyless_macro_arg = (n); \
185 YY_LESS_LINENO(yyless_macro_arg);\
186 *yy_cp = yyg->yy_hold_char; \
187 YY_RESTORE_YY_MORE_OFFSET \
188 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
189 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
190 } \
191 while ( 0 )
192
193#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
194
195#ifndef YY_TYPEDEF_YY_SIZE_T
196#define YY_TYPEDEF_YY_SIZE_T
197typedef size_t yy_size_t;
198#endif
199
200#ifndef YY_STRUCT_YY_BUFFER_STATE
201#define YY_STRUCT_YY_BUFFER_STATE
202struct yy_buffer_state
203 {
204 FILE *yy_input_file;
205
206 char *yy_ch_buf; /* input buffer */
207 char *yy_buf_pos; /* current position in input buffer */
208
209 /* Size of input buffer in bytes, not including room for EOB
210 * characters.
211 */
212 yy_size_t yy_buf_size;
213
214 /* Number of characters read into yy_ch_buf, not including EOB
215 * characters.
216 */
217 int yy_n_chars;
218
219 /* Whether we "own" the buffer - i.e., we know we created it,
220 * and can realloc() it to grow it, and should free() it to
221 * delete it.
222 */
223 int yy_is_our_buffer;
224
225 /* Whether this is an "interactive" input source; if so, and
226 * if we're using stdio for input, then we want to use getc()
227 * instead of fread(), to make sure we stop fetching input after
228 * each newline.
229 */
230 int yy_is_interactive;
231
232 /* Whether we're considered to be at the beginning of a line.
233 * If so, '^' rules will be active on the next match, otherwise
234 * not.
235 */
236 int yy_at_bol;
237
238 int yy_bs_lineno; /**< The line count. */
239 int yy_bs_column; /**< The column count. */
240
241 /* Whether to try to fill the input buffer when we reach the
242 * end of it.
243 */
244 int yy_fill_buffer;
245
246 int yy_buffer_status;
247
248#define YY_BUFFER_NEW 0
249#define YY_BUFFER_NORMAL 1
250 /* When an EOF's been seen but there's still some text to process
251 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
252 * shouldn't try reading from the input source any more. We might
253 * still have a bunch of tokens to match, though, because of
254 * possible backing-up.
255 *
256 * When we actually see the EOF, we change the status to "new"
257 * (via _mesa_glsl_restart()), so that the user can continue scanning by
258 * just pointing yyin at a new input file.
259 */
260#define YY_BUFFER_EOF_PENDING 2
261
262 };
263#endif /* !YY_STRUCT_YY_BUFFER_STATE */
264
265/* We provide macros for accessing buffer states in case in the
266 * future we want to put the buffer states in a more general
267 * "scanner state".
268 *
269 * Returns the top of the stack, or NULL.
270 */
271#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
272 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
273 : NULL)
274
275/* Same as previous macro, but useful when we know that the buffer stack is not
276 * NULL or when we need an lvalue. For internal use only.
277 */
278#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
279
280void _mesa_glsl_restart (FILE *input_file ,yyscan_t yyscanner );
281void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
282YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
283void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
284void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
285void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
286void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner );
287
288static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner );
289static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner );
290static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
291
292#define YY_FLUSH_BUFFER _mesa_glsl__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
293
294YY_BUFFER_STATE _mesa_glsl__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
295YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
296YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
297
298void *_mesa_glsl_alloc (yy_size_t ,yyscan_t yyscanner );
299void *_mesa_glsl_realloc (void *,yy_size_t ,yyscan_t yyscanner );
300void _mesa_glsl_free (void * ,yyscan_t yyscanner );
301
302#define yy_new_buffer _mesa_glsl__create_buffer
303
304#define yy_set_interactive(is_interactive) \
305 { \
306 if ( ! YY_CURRENT_BUFFER ){ \
307 _mesa_glsl_ensure_buffer_stack (yyscanner); \
308 YY_CURRENT_BUFFER_LVALUE = \
309 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
310 } \
311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
312 }
313
314#define yy_set_bol(at_bol) \
315 { \
316 if ( ! YY_CURRENT_BUFFER ){\
317 _mesa_glsl_ensure_buffer_stack (yyscanner); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
320 } \
321 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
322 }
323
324#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
325
326/* Begin user sect3 */
327
328#define _mesa_glsl_wrap(n) 1
329#define YY_SKIP_YYWRAP
330
331typedef unsigned char YY_CHAR;
332
333typedef int yy_state_type;
334
335#define yytext_ptr yytext_r
336
337static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
338static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
339static int yy_get_next_buffer (yyscan_t yyscanner );
340static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
341
342/* Done after the current pattern has been matched and before the
343 * corresponding action - sets up yytext.
344 */
345#define YY_DO_BEFORE_ACTION \
346 yyg->yytext_ptr = yy_bp; \
347 yyleng = (size_t) (yy_cp - yy_bp); \
348 yyg->yy_hold_char = *yy_cp; \
349 *yy_cp = '\0'; \
350 yyg->yy_c_buf_p = yy_cp;
351
Ian Romanick33fe3642010-08-30 11:59:48 -0700352#define YY_NUM_RULES 183
353#define YY_END_OF_BUFFER 184
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700354/* This struct is not used in this scanner,
355 but its presence is necessary. */
356struct yy_trans_info
357 {
358 flex_int32_t yy_verify;
359 flex_int32_t yy_nxt;
360 };
Ian Romanick33fe3642010-08-30 11:59:48 -0700361static yyconst flex_int16_t yy_accept[708] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700362 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700363 0, 0, 15, 15, 0, 0, 184, 182, 1, 20,
364 182, 182, 182, 182, 182, 182, 182, 182, 96, 94,
365 182, 182, 182, 181, 182, 181, 181, 181, 181, 181,
366 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
367 181, 181, 181, 181, 181, 182, 1, 182, 91, 183,
368 15, 19, 183, 18, 16, 17, 13, 12, 1, 80,
369 87, 81, 90, 84, 75, 86, 76, 93, 98, 85,
370 99, 96, 0, 0, 101, 0, 94, 0, 77, 79,
371 78, 0, 181, 83, 181, 181, 181, 181, 181, 181,
372 181, 181, 181, 181, 181, 181, 28, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700373
Ian Romanick33fe3642010-08-30 11:59:48 -0700374 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
375 32, 181, 181, 56, 181, 181, 181, 181, 181, 181,
376 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
377 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
378 181, 181, 181, 181, 181, 92, 82, 1, 0, 0,
379 2, 0, 0, 0, 0, 15, 14, 18, 17, 0,
380 98, 97, 0, 99, 0, 100, 95, 88, 89, 181,
381 104, 181, 181, 181, 181, 181, 181, 181, 181, 181,
382 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
383 181, 181, 31, 181, 181, 181, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700384
Ian Romanick33fe3642010-08-30 11:59:48 -0700385 181, 181, 181, 25, 181, 181, 181, 181, 181, 181,
386 181, 181, 181, 181, 57, 181, 181, 181, 181, 181,
387 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
388 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
389 181, 181, 0, 0, 0, 0, 14, 0, 98, 0,
390 97, 0, 99, 100, 181, 181, 23, 181, 181, 144,
391 181, 181, 181, 181, 181, 181, 181, 181, 181, 30,
392 107, 181, 181, 181, 181, 63, 181, 181, 112, 126,
393 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
394 181, 123, 147, 44, 45, 46, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700395
Ian Romanick33fe3642010-08-30 11:59:48 -0700396 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
397 181, 181, 181, 181, 181, 181, 110, 102, 181, 181,
398 181, 181, 181, 181, 181, 41, 42, 43, 73, 181,
399 181, 0, 0, 0, 0, 0, 97, 181, 181, 26,
400 35, 36, 37, 181, 105, 181, 22, 181, 181, 181,
401 181, 134, 135, 136, 181, 103, 181, 127, 24, 137,
402 138, 139, 149, 131, 132, 133, 181, 181, 181, 58,
403 129, 181, 181, 38, 39, 40, 181, 181, 181, 181,
404 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
405 181, 181, 124, 181, 181, 181, 181, 181, 181, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700406
Ian Romanick33fe3642010-08-30 11:59:48 -0700407 181, 181, 181, 106, 181, 146, 181, 181, 29, 0,
408 0, 0, 0, 153, 181, 181, 151, 181, 181, 181,
409 125, 120, 156, 181, 181, 181, 181, 181, 181, 115,
410 181, 181, 74, 47, 48, 49, 50, 51, 52, 53,
411 54, 55, 181, 181, 181, 181, 130, 111, 181, 181,
412 118, 34, 181, 181, 143, 64, 119, 72, 154, 113,
413 181, 181, 181, 181, 181, 181, 181, 0, 0, 0,
414 0, 181, 181, 181, 114, 33, 181, 181, 181, 181,
415 181, 181, 157, 158, 159, 181, 181, 181, 181, 148,
416 181, 181, 181, 181, 181, 181, 181, 181, 108, 181,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700417
Ian Romanick33fe3642010-08-30 11:59:48 -0700418 181, 181, 181, 181, 59, 181, 60, 181, 0, 0,
419 0, 0, 0, 181, 61, 27, 121, 161, 162, 163,
420 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
421 181, 116, 181, 181, 181, 181, 181, 181, 181, 181,
422 181, 109, 165, 166, 167, 181, 181, 128, 117, 0,
423 0, 6, 0, 0, 0, 11, 3, 21, 181, 181,
424 181, 181, 181, 181, 181, 181, 181, 160, 122, 62,
425 145, 181, 152, 150, 180, 66, 67, 68, 181, 181,
426 181, 181, 181, 181, 0, 0, 0, 0, 0, 0,
427 181, 181, 181, 164, 181, 181, 181, 181, 181, 181,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700428
Ian Romanick33fe3642010-08-30 11:59:48 -0700429 181, 181, 181, 181, 181, 181, 181, 181, 181, 168,
430 4, 0, 5, 0, 0, 0, 0, 0, 181, 181,
431 181, 181, 181, 181, 181, 177, 181, 181, 181, 181,
432 181, 181, 69, 181, 181, 181, 0, 0, 0, 181,
433 181, 178, 169, 181, 170, 181, 181, 181, 181, 181,
434 181, 181, 181, 181, 179, 0, 0, 171, 172, 175,
435 176, 65, 181, 140, 181, 141, 155, 173, 174, 0,
436 0, 181, 181, 181, 0, 0, 0, 70, 181, 71,
437 0, 0, 0, 181, 0, 0, 0, 181, 0, 0,
438 7, 0, 0, 181, 0, 8, 0, 0, 142, 0,
439
440 0, 0, 0, 9, 0, 10, 0
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700441 } ;
442
443static yyconst flex_int32_t yy_ec[256] =
444 { 0,
445 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
446 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700448 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
449 10, 11, 12, 1, 13, 14, 15, 16, 17, 18,
450 19, 20, 21, 21, 21, 22, 22, 23, 1, 24,
451 25, 26, 1, 1, 27, 28, 29, 30, 31, 32,
452 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
453 33, 34, 35, 33, 33, 33, 33, 36, 33, 33,
454 1, 1, 1, 37, 38, 1, 39, 40, 41, 42,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700455
Ian Romanick33fe3642010-08-30 11:59:48 -0700456 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
457 53, 54, 33, 55, 56, 57, 58, 59, 60, 61,
458 62, 63, 1, 64, 1, 1, 1, 1, 1, 1,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700459 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, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466
467 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1
473 } ;
474
Ian Romanick33fe3642010-08-30 11:59:48 -0700475static yyconst flex_int32_t yy_meta[65] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700476 { 0,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700477 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700478 1, 1, 1, 1, 1, 4, 4, 4, 4, 4,
479 4, 5, 1, 1, 1, 1, 6, 6, 6, 6,
480 5, 5, 7, 7, 7, 8, 1, 7, 6, 6,
481 6, 6, 5, 5, 7, 7, 7, 7, 7, 7,
482 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
483 8, 7, 7, 1
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700484 } ;
485
Ian Romanick33fe3642010-08-30 11:59:48 -0700486static yyconst flex_int16_t yy_base[719] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700487 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700488 0, 63, 88, 0, 1076, 1075, 1077, 1080, 64, 1080,
489 1051, 1050, 59, 1049, 58, 60, 58, 1048, 139, 187,
490 47, 1047, 56, 0, 1034, 121, 110, 137, 138, 134,
491 163, 1017, 173, 177, 115, 149, 140, 1011, 159, 121,
492 187, 194, 194, 172, 1022, 171, 249, 240, 1042, 1080,
493 250, 1080, 1051, 241, 1080, 0, 1080, 1080, 262, 1080,
494 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 236, 1080,
495 238, 187, 286, 303, 1080, 0, 0, 1040, 1080, 1080,
496 1080, 1039, 0, 1080, 1006, 1011, 1004, 1007, 1016, 1015,
497 1001, 1004, 1016, 35, 1010, 997, 994, 1008, 994, 991,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700498
Ian Romanick33fe3642010-08-30 11:59:48 -0700499 991, 997, 215, 232, 991, 1002, 987, 993, 997, 998,
500 0, 989, 1000, 234, 995, 975, 226, 979, 993, 983,
501 119, 976, 234, 989, 991, 973, 969, 977, 974, 963,
502 972, 256, 970, 976, 971, 974, 962, 965, 967, 245,
503 970, 961, 974, 227, 967, 1080, 1080, 308, 294, 324,
504 1080, 952, 965, 956, 967, 329, 0, 338, 0, 368,
505 1080, 303, 379, 1080, 386, 393, 0, 1080, 1080, 962,
506 0, 953, 957, 967, 964, 947, 946, 946, 950, 216,
507 961, 958, 958, 956, 953, 944, 951, 937, 935, 948,
508 933, 950, 0, 947, 934, 942, 939, 943, 944, 937,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700509
Ian Romanick33fe3642010-08-30 11:59:48 -0700510 934, 922, 921, 935, 938, 935, 922, 929, 919, 320,
511 925, 928, 918, 926, 914, 918, 909, 924, 914, 905,
512 924, 907, 905, 916, 905, 900, 898, 912, 897, 899,
513 896, 908, 907, 910, 288, 901, 895, 884, 331, 903,
514 905, 893, 885, 889, 901, 884, 0, 400, 410, 427,
515 1080, 439, 446, 1080, 879, 890, 0, 887, 343, 0,
516 880, 878, 880, 875, 884, 872, 890, 878, 346, 0,
517 0, 872, 883, 882, 882, 0, 866, 350, 0, 0,
518 868, 353, 876, 877, 867, 861, 860, 861, 860, 357,
519 856, 0, 0, 852, 851, 850, 852, 853, 858, 852,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700520
Ian Romanick33fe3642010-08-30 11:59:48 -0700521 848, 862, 857, 856, 855, 846, 849, 849, 841, 844,
522 839, 848, 853, 838, 851, 841, 0, 0, 848, 844,
523 835, 835, 841, 840, 837, 0, 0, 0, 0, 826,
524 839, 838, 837, 834, 822, 453, 463, 834, 836, 0,
525 0, 0, 0, 822, 0, 822, 0, 821, 822, 816,
526 827, 0, 0, 0, 817, 0, 813, 0, 0, 0,
527 0, 0, 0, 0, 0, 0, 824, 469, 823, 0,
528 0, 821, 817, 0, 0, 0, 806, 415, 432, 473,
529 811, 807, 813, 803, 801, 815, 799, 799, 813, 801,
530 813, 808, 0, 806, 803, 807, 790, 792, 799, 805,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700531
Ian Romanick33fe3642010-08-30 11:59:48 -0700532 800, 799, 786, 0, 788, 0, 787, 791, 0, 785,
533 834, 784, 787, 0, 775, 785, 0, 773, 773, 787,
534 0, 789, 0, 482, 797, 796, 795, 766, 765, 0,
535 783, 782, 0, 0, 0, 0, 0, 0, 0, 0,
536 0, 0, 766, 780, 766, 763, 0, 0, 769, 768,
537 0, 0, 766, 758, 0, 0, 0, 0, 0, 0,
538 755, 767, 485, 759, 766, 763, 757, 750, 503, 766,
539 751, 746, 760, 758, 0, 0, 750, 769, 768, 767,
540 738, 737, 301, 481, 0, 750, 753, 751, 739, 0,
541 749, 746, 745, 734, 733, 732, 509, 741, 0, 753,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700542
Ian Romanick33fe3642010-08-30 11:59:48 -0700543 752, 751, 722, 721, 0, 736, 0, 734, 729, 515,
544 527, 773, 722, 730, 0, 0, 0, 745, 744, 0,
545 726, 729, 713, 721, 711, 719, 720, 720, 719, 704,
546 717, 0, 718, 706, 705, 701, 725, 724, 723, 694,
547 693, 0, 723, 722, 0, 704, 707, 0, 0, 693,
548 537, 1080, 561, 0, 567, 340, 1080, 0, 690, 689,
549 699, 699, 686, 701, 684, 699, 694, 0, 0, 0,
550 0, 679, 0, 0, 0, 700, 389, 700, 689, 692,
551 676, 675, 685, 685, 675, 529, 589, 474, 683, 671,
552 669, 668, 679, 0, 682, 678, 680, 676, 662, 669,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700553
Ian Romanick33fe3642010-08-30 11:59:48 -0700554 669, 671, 667, 669, 667, 667, 654, 653, 664, 0,
555 1080, 531, 1080, 596, 0, 616, 666, 648, 665, 664,
556 647, 635, 643, 633, 634, 0, 627, 646, 635, 607,
557 604, 601, 0, 604, 603, 586, 533, 572, 580, 564,
558 563, 0, 0, 564, 0, 540, 554, 552, 516, 530,
559 505, 486, 453, 450, 0, 461, 443, 0, 0, 0,
560 0, 0, 400, 406, 385, 0, 0, 0, 0, 343,
561 389, 319, 267, 249, 487, 341, 235, 0, 200, 0,
562 507, 498, 184, 157, 150, 564, 559, 136, 565, 591,
563 1080, 593, 550, 112, 594, 1080, 569, 576, 0, 123,
564
565 619, 621, 637, 1080, 638, 1080, 1080, 648, 653, 658,
566 663, 665, 667, 673, 680, 685, 690, 695
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700567 } ;
568
Ian Romanick33fe3642010-08-30 11:59:48 -0700569static yyconst flex_int16_t yy_def[719] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700570 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700571 707, 1, 707, 3, 708, 708, 707, 707, 707, 707,
572 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
573 707, 707, 707, 709, 707, 709, 709, 709, 709, 709,
574 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
575 709, 709, 709, 709, 709, 707, 707, 707, 707, 707,
576 707, 707, 707, 707, 707, 710, 707, 707, 707, 707,
577 707, 707, 707, 707, 707, 707, 707, 707, 711, 707,
578 712, 19, 707, 707, 707, 713, 20, 707, 707, 707,
579 707, 707, 709, 707, 709, 709, 709, 709, 709, 709,
580 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700581
Ian Romanick33fe3642010-08-30 11:59:48 -0700582 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
583 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
584 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
585 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
586 709, 709, 709, 709, 709, 707, 707, 707, 707, 707,
587 707, 707, 707, 707, 707, 707, 714, 707, 710, 707,
588 707, 712, 707, 707, 707, 707, 713, 707, 707, 709,
589 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
590 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
591 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700592
Ian Romanick33fe3642010-08-30 11:59:48 -0700593 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
594 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
595 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
596 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
597 709, 709, 707, 707, 707, 707, 714, 707, 707, 707,
598 707, 707, 707, 707, 709, 709, 709, 709, 709, 709,
599 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
600 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
601 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
602 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700603
Ian Romanick33fe3642010-08-30 11:59:48 -0700604 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
605 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
606 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
607 709, 707, 707, 707, 707, 707, 707, 709, 709, 709,
608 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
609 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
610 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
611 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
612 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
613 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700614
Ian Romanick33fe3642010-08-30 11:59:48 -0700615 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
616 707, 707, 707, 709, 709, 709, 709, 709, 709, 709,
617 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
618 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
619 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
620 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
621 709, 709, 709, 709, 709, 709, 709, 707, 707, 707,
622 707, 709, 709, 709, 709, 709, 709, 709, 709, 709,
623 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
624 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700625
Ian Romanick33fe3642010-08-30 11:59:48 -0700626 709, 709, 709, 709, 709, 709, 709, 709, 707, 715,
627 707, 707, 707, 709, 709, 709, 709, 709, 709, 709,
628 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
629 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
630 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
631 707, 707, 707, 716, 707, 707, 707, 709, 709, 709,
632 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
633 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
634 709, 709, 709, 709, 707, 717, 707, 716, 707, 707,
635 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700636
Ian Romanick33fe3642010-08-30 11:59:48 -0700637 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
638 707, 707, 707, 707, 718, 707, 707, 707, 709, 709,
639 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
640 709, 709, 709, 709, 709, 709, 718, 707, 707, 709,
641 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
642 709, 709, 709, 709, 709, 707, 707, 709, 709, 709,
643 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
644 707, 709, 709, 709, 707, 707, 707, 709, 709, 709,
645 707, 707, 707, 709, 707, 707, 707, 709, 707, 707,
646 707, 707, 707, 709, 707, 707, 707, 707, 709, 707,
647
648 707, 707, 707, 707, 707, 707, 0, 707, 707, 707,
649 707, 707, 707, 707, 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700650 } ;
651
Ian Romanick33fe3642010-08-30 11:59:48 -0700652static yyconst flex_int16_t yy_nxt[1145] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700653 { 0,
Ian Romanick33fe3642010-08-30 11:59:48 -0700654 8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
655 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
656 20, 20, 8, 21, 22, 23, 24, 24, 24, 24,
657 24, 24, 24, 24, 24, 24, 25, 24, 26, 27,
658 28, 29, 30, 31, 32, 33, 34, 24, 24, 35,
659 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
660 24, 24, 24, 46, 47, 59, 62, 59, 48, 65,
661 78, 79, 67, 69, 69, 69, 69, 69, 69, 69,
662 81, 82, 66, 63, 68, 179, 180, 49, 50, 51,
663 52, 51, 50, 50, 50, 50, 50, 50, 50, 50,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700664
Ian Romanick33fe3642010-08-30 11:59:48 -0700665 50, 50, 53, 50, 54, 54, 54, 54, 54, 54,
666 55, 50, 50, 50, 56, 56, 56, 56, 56, 56,
667 56, 56, 56, 56, 50, 56, 56, 56, 56, 56,
668 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
669 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
670 56, 50, 71, 116, 72, 72, 72, 72, 72, 72,
671 73, 85, 88, 126, 89, 213, 702, 117, 90, 74,
672 75, 699, 214, 127, 76, 91, 86, 87, 120, 92,
673 95, 74, 75, 99, 96, 100, 93, 118, 694, 94,
674 97, 119, 121, 689, 101, 146, 98, 123, 688, 76,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700675
Ian Romanick33fe3642010-08-30 11:59:48 -0700676 71, 102, 77, 77, 77, 77, 77, 77, 77, 103,
677 142, 108, 104, 124, 143, 105, 125, 74, 75, 109,
678 111, 106, 707, 112, 144, 128, 687, 113, 114, 74,
679 75, 110, 129, 130, 147, 115, 135, 131, 684, 136,
680 139, 150, 151, 132, 133, 140, 134, 707, 137, 141,
681 148, 156, 59, 156, 149, 138, 158, 158, 158, 158,
682 158, 158, 158, 59, 189, 59, 160, 161, 163, 164,
683 191, 264, 265, 240, 216, 190, 241, 208, 160, 161,
684 163, 164, 152, 201, 192, 209, 202, 203, 217, 153,
685 204, 235, 205, 154, 226, 150, 151, 683, 155, 71,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700686
Ian Romanick33fe3642010-08-30 11:59:48 -0700687 236, 73, 73, 73, 73, 73, 73, 73, 680, 148,
688 227, 59, 679, 149, 165, 165, 74, 75, 166, 166,
689 166, 166, 166, 166, 166, 150, 151, 523, 74, 75,
690 156, 321, 156, 250, 251, 524, 152, 294, 295, 296,
691 322, 556, 681, 153, 675, 250, 251, 154, 326, 327,
692 328, 676, 155, 158, 158, 158, 158, 158, 158, 158,
693 341, 342, 343, 352, 353, 354, 152, 360, 361, 362,
694 364, 365, 366, 153, 374, 375, 376, 154, 678, 248,
695 248, 589, 155, 249, 249, 249, 249, 249, 249, 249,
696 252, 252, 590, 682, 253, 253, 253, 253, 253, 253,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700697
Ian Romanick33fe3642010-08-30 11:59:48 -0700698 253, 166, 166, 166, 166, 166, 166, 166, 166, 166,
699 166, 166, 166, 166, 166, 249, 249, 249, 249, 249,
700 249, 249, 602, 603, 254, 249, 249, 249, 249, 249,
701 249, 249, 434, 435, 436, 677, 254, 674, 336, 336,
702 673, 161, 337, 337, 337, 337, 337, 337, 337, 437,
703 438, 439, 672, 161, 253, 253, 253, 253, 253, 253,
704 253, 253, 253, 253, 253, 253, 253, 253, 337, 337,
705 337, 337, 337, 337, 337, 551, 552, 164, 337, 337,
706 337, 337, 337, 337, 337, 425, 426, 427, 675, 164,
707 440, 441, 442, 671, 251, 676, 428, 429, 478, 479,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700708
Ian Romanick33fe3642010-08-30 11:59:48 -0700709 480, 500, 501, 502, 469, 670, 251, 525, 681, 481,
710 482, 669, 503, 504, 668, 526, 551, 552, 510, 511,
711 511, 511, 511, 511, 511, 537, 538, 539, 551, 552,
712 612, 613, 612, 613, 612, 613, 540, 541, 551, 552,
713 667, 685, 555, 555, 555, 555, 555, 555, 555, 686,
714 554, 697, 586, 587, 587, 587, 587, 587, 587, 682,
715 692, 666, 551, 552, 615, 690, 695, 693, 551, 552,
716 697, 665, 664, 691, 696, 554, 553, 553, 553, 553,
717 553, 553, 555, 555, 555, 555, 555, 555, 555, 615,
718 612, 613, 690, 663, 692, 695, 662, 612, 613, 661,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700719
Ian Romanick33fe3642010-08-30 11:59:48 -0700720 691, 693, 698, 696, 616, 616, 616, 616, 616, 616,
721 616, 614, 614, 614, 614, 614, 614, 612, 613, 700,
722 703, 698, 705, 660, 659, 658, 657, 701, 704, 656,
723 706, 616, 616, 616, 616, 616, 616, 616, 703, 705,
724 655, 654, 653, 652, 651, 650, 704, 706, 57, 57,
725 57, 57, 57, 57, 57, 57, 83, 83, 83, 83,
726 83, 159, 159, 159, 159, 159, 69, 69, 162, 162,
727 167, 167, 167, 247, 247, 649, 247, 247, 247, 247,
728 247, 553, 553, 553, 648, 647, 646, 553, 588, 588,
729 588, 614, 614, 614, 645, 644, 643, 614, 637, 637,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700730
Ian Romanick33fe3642010-08-30 11:59:48 -0700731 637, 642, 641, 640, 639, 638, 636, 635, 634, 633,
732 632, 631, 630, 629, 628, 627, 626, 625, 624, 623,
733 622, 621, 620, 619, 618, 617, 611, 610, 609, 608,
734 607, 606, 605, 604, 601, 600, 599, 598, 597, 596,
735 595, 594, 593, 592, 591, 585, 584, 583, 582, 581,
736 580, 579, 578, 577, 576, 575, 574, 573, 572, 571,
737 570, 569, 568, 567, 566, 565, 564, 563, 562, 561,
738 560, 559, 558, 557, 556, 550, 549, 548, 547, 546,
739 545, 544, 543, 542, 536, 535, 534, 533, 532, 531,
740 530, 529, 528, 527, 522, 521, 520, 519, 518, 517,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700741
Ian Romanick33fe3642010-08-30 11:59:48 -0700742 516, 515, 514, 513, 512, 509, 508, 507, 506, 505,
743 499, 498, 497, 496, 495, 494, 493, 492, 491, 490,
744 489, 488, 487, 486, 485, 484, 483, 477, 476, 475,
745 474, 473, 472, 471, 470, 469, 468, 467, 466, 465,
746 464, 463, 462, 461, 460, 459, 458, 457, 456, 455,
747 454, 453, 452, 451, 450, 449, 448, 447, 446, 445,
748 444, 443, 433, 432, 431, 430, 424, 423, 422, 421,
749 420, 419, 418, 417, 416, 415, 414, 413, 412, 411,
750 410, 409, 408, 407, 406, 405, 404, 403, 402, 401,
751 400, 399, 398, 397, 396, 395, 394, 393, 392, 391,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700752
Ian Romanick33fe3642010-08-30 11:59:48 -0700753 390, 389, 388, 387, 386, 385, 384, 383, 382, 381,
754 380, 379, 378, 377, 373, 372, 371, 370, 369, 368,
755 367, 363, 359, 358, 357, 356, 355, 351, 350, 349,
756 348, 347, 346, 345, 344, 340, 339, 338, 335, 334,
757 333, 332, 331, 330, 329, 325, 324, 323, 320, 319,
758 318, 317, 316, 315, 314, 313, 312, 311, 310, 309,
759 308, 307, 306, 305, 304, 303, 302, 301, 300, 299,
760 298, 297, 293, 292, 291, 290, 289, 288, 287, 286,
761 285, 284, 283, 282, 281, 280, 279, 278, 277, 276,
762 275, 274, 273, 272, 271, 270, 269, 268, 267, 266,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700763
Ian Romanick33fe3642010-08-30 11:59:48 -0700764 263, 262, 261, 260, 259, 258, 257, 256, 255, 246,
765 245, 244, 243, 242, 239, 238, 237, 234, 233, 232,
766 231, 230, 229, 228, 225, 224, 223, 222, 221, 220,
767 219, 218, 215, 212, 211, 210, 207, 206, 200, 199,
768 198, 197, 196, 195, 194, 193, 188, 187, 186, 185,
769 184, 183, 182, 181, 178, 177, 176, 175, 174, 173,
770 172, 171, 170, 169, 168, 157, 80, 145, 122, 107,
771 84, 80, 70, 64, 61, 60, 707, 58, 58, 7,
772 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
773 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
774
775 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
776 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
777 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
778 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
779 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700780 } ;
781
Ian Romanick33fe3642010-08-30 11:59:48 -0700782static yyconst flex_int16_t yy_chk[1145] =
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700783 { 0,
784 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
785 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
786 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
787 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
788 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700789 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Ian Romanick33fe3642010-08-30 11:59:48 -0700790 1, 1, 1, 1, 2, 9, 13, 9, 2, 15,
791 21, 21, 16, 17, 17, 17, 17, 17, 17, 17,
792 23, 23, 15, 13, 16, 94, 94, 2, 3, 3,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700793 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
794
795 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
796 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
797 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
798 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
Ian Romanick33fe3642010-08-30 11:59:48 -0700799 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
800 3, 3, 19, 35, 19, 19, 19, 19, 19, 19,
801 19, 26, 27, 40, 27, 121, 700, 35, 27, 19,
802 19, 694, 121, 40, 19, 28, 26, 26, 37, 28,
803 29, 19, 19, 30, 29, 30, 28, 36, 688, 28,
804 29, 36, 37, 685, 30, 46, 29, 39, 684, 19,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700805
Ian Romanick33fe3642010-08-30 11:59:48 -0700806 20, 31, 20, 20, 20, 20, 20, 20, 20, 31,
807 44, 33, 31, 39, 44, 31, 39, 20, 20, 33,
808 34, 31, 72, 34, 44, 41, 683, 34, 34, 20,
809 20, 33, 41, 41, 46, 34, 42, 41, 679, 42,
810 43, 48, 48, 41, 41, 43, 41, 72, 42, 43,
811 47, 51, 47, 51, 47, 42, 54, 54, 54, 54,
812 54, 54, 54, 59, 103, 59, 69, 69, 71, 71,
813 104, 180, 180, 144, 123, 103, 144, 117, 69, 69,
814 71, 71, 48, 114, 104, 117, 114, 114, 123, 48,
815 114, 140, 114, 48, 132, 149, 149, 677, 48, 73,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700816
Ian Romanick33fe3642010-08-30 11:59:48 -0700817 140, 73, 73, 73, 73, 73, 73, 73, 674, 148,
818 132, 148, 673, 148, 74, 74, 73, 73, 74, 74,
819 74, 74, 74, 74, 74, 150, 150, 483, 73, 73,
820 156, 235, 156, 162, 162, 483, 149, 210, 210, 210,
821 235, 556, 676, 149, 670, 162, 162, 149, 239, 239,
822 239, 670, 149, 158, 158, 158, 158, 158, 158, 158,
823 259, 259, 259, 269, 269, 269, 150, 278, 278, 278,
824 282, 282, 282, 150, 290, 290, 290, 150, 672, 160,
825 160, 556, 150, 160, 160, 160, 160, 160, 160, 160,
826 163, 163, 556, 676, 163, 163, 163, 163, 163, 163,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700827
Ian Romanick33fe3642010-08-30 11:59:48 -0700828 163, 165, 165, 165, 165, 165, 165, 165, 166, 166,
829 166, 166, 166, 166, 166, 248, 248, 248, 248, 248,
830 248, 248, 577, 577, 166, 249, 249, 249, 249, 249,
831 249, 249, 378, 378, 378, 671, 166, 665, 250, 250,
832 664, 249, 250, 250, 250, 250, 250, 250, 250, 379,
833 379, 379, 663, 249, 252, 252, 252, 252, 252, 252,
834 252, 253, 253, 253, 253, 253, 253, 253, 336, 336,
835 336, 336, 336, 336, 336, 588, 588, 253, 337, 337,
836 337, 337, 337, 337, 337, 368, 368, 368, 675, 253,
837 380, 380, 380, 657, 337, 675, 368, 368, 424, 424,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700838
Ian Romanick33fe3642010-08-30 11:59:48 -0700839 424, 463, 463, 463, 469, 656, 337, 484, 681, 424,
840 424, 654, 463, 463, 653, 484, 510, 510, 469, 469,
841 469, 469, 469, 469, 469, 497, 497, 497, 511, 511,
842 586, 586, 612, 612, 637, 637, 497, 497, 551, 551,
843 652, 682, 511, 511, 511, 511, 511, 511, 511, 682,
844 510, 693, 551, 551, 551, 551, 551, 551, 551, 681,
845 687, 651, 553, 553, 586, 686, 689, 687, 555, 555,
846 697, 650, 649, 686, 689, 510, 553, 553, 553, 553,
847 553, 553, 555, 555, 555, 555, 555, 555, 555, 586,
848 587, 587, 690, 648, 692, 695, 647, 614, 614, 646,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700849
Ian Romanick33fe3642010-08-30 11:59:48 -0700850 690, 692, 693, 695, 587, 587, 587, 587, 587, 587,
851 587, 614, 614, 614, 614, 614, 614, 616, 616, 698,
852 701, 697, 702, 644, 641, 640, 639, 698, 701, 638,
853 702, 616, 616, 616, 616, 616, 616, 616, 703, 705,
854 636, 635, 634, 632, 631, 630, 703, 705, 708, 708,
855 708, 708, 708, 708, 708, 708, 709, 709, 709, 709,
856 709, 710, 710, 710, 710, 710, 711, 711, 712, 712,
857 713, 713, 713, 714, 714, 629, 714, 714, 714, 714,
858 714, 715, 715, 715, 628, 627, 625, 715, 716, 716,
859 716, 717, 717, 717, 624, 623, 622, 717, 718, 718,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700860
Ian Romanick33fe3642010-08-30 11:59:48 -0700861 718, 621, 620, 619, 618, 617, 609, 608, 607, 606,
862 605, 604, 603, 602, 601, 600, 599, 598, 597, 596,
863 595, 593, 592, 591, 590, 589, 585, 584, 583, 582,
864 581, 580, 579, 578, 576, 572, 567, 566, 565, 564,
865 563, 562, 561, 560, 559, 550, 547, 546, 544, 543,
866 541, 540, 539, 538, 537, 536, 535, 534, 533, 531,
867 530, 529, 528, 527, 526, 525, 524, 523, 522, 521,
868 519, 518, 514, 513, 512, 509, 508, 506, 504, 503,
869 502, 501, 500, 498, 496, 495, 494, 493, 492, 491,
870 489, 488, 487, 486, 482, 481, 480, 479, 478, 477,
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700871
Ian Romanick33fe3642010-08-30 11:59:48 -0700872 474, 473, 472, 471, 470, 468, 467, 466, 465, 464,
873 462, 461, 454, 453, 450, 449, 446, 445, 444, 443,
874 432, 431, 429, 428, 427, 426, 425, 422, 420, 419,
875 418, 416, 415, 413, 412, 411, 410, 408, 407, 405,
876 403, 402, 401, 400, 399, 398, 397, 396, 395, 394,
877 392, 391, 390, 389, 388, 387, 386, 385, 384, 383,
878 382, 381, 377, 373, 372, 369, 367, 357, 355, 351,
879 350, 349, 348, 346, 344, 339, 338, 335, 334, 333,
880 332, 331, 330, 325, 324, 323, 322, 321, 320, 319,
881 316, 315, 314, 313, 312, 311, 310, 309, 308, 307,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700882
Ian Romanick33fe3642010-08-30 11:59:48 -0700883 306, 305, 304, 303, 302, 301, 300, 299, 298, 297,
884 296, 295, 294, 291, 289, 288, 287, 286, 285, 284,
885 283, 281, 277, 275, 274, 273, 272, 268, 267, 266,
886 265, 264, 263, 262, 261, 258, 256, 255, 246, 245,
887 244, 243, 242, 241, 240, 238, 237, 236, 234, 233,
888 232, 231, 230, 229, 228, 227, 226, 225, 224, 223,
889 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
890 212, 211, 209, 208, 207, 206, 205, 204, 203, 202,
891 201, 200, 199, 198, 197, 196, 195, 194, 192, 191,
892 190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -0700893
Ian Romanick33fe3642010-08-30 11:59:48 -0700894 179, 178, 177, 176, 175, 174, 173, 172, 170, 155,
895 154, 153, 152, 145, 143, 142, 141, 139, 138, 137,
896 136, 135, 134, 133, 131, 130, 129, 128, 127, 126,
897 125, 124, 122, 120, 119, 118, 116, 115, 113, 112,
898 110, 109, 108, 107, 106, 105, 102, 101, 100, 99,
899 98, 97, 96, 95, 93, 92, 91, 90, 89, 88,
900 87, 86, 85, 82, 78, 53, 49, 45, 38, 32,
901 25, 22, 18, 14, 12, 11, 7, 6, 5, 707,
902 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
903 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
904
905 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
906 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
907 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
908 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
909 707, 707, 707, 707
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700910 } ;
911
912/* The intent behind this definition is that it'll catch
913 * any uses of REJECT which flex missed.
914 */
915#define REJECT reject_used_but_not_detected
916#define yymore() yymore_used_but_not_detected
917#define YY_MORE_ADJ 0
918#define YY_RESTORE_YY_MORE_OFFSET
919#line 1 "glsl_lexer.lpp"
920#line 2 "glsl_lexer.lpp"
921/*
922 * Copyright © 2008, 2009 Intel Corporation
923 *
924 * Permission is hereby granted, free of charge, to any person obtaining a
925 * copy of this software and associated documentation files (the "Software"),
926 * to deal in the Software without restriction, including without limitation
927 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
928 * and/or sell copies of the Software, and to permit persons to whom the
929 * Software is furnished to do so, subject to the following conditions:
930 *
931 * The above copyright notice and this permission notice (including the next
932 * paragraph) shall be included in all copies or substantial portions of the
933 * Software.
934 *
935 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
936 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
937 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
938 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
939 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
940 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
941 * DEALINGS IN THE SOFTWARE.
942 */
943#include <ctype.h>
944#include "ast.h"
945#include "glsl_parser_extras.h"
946#include "glsl_parser.h"
947
948#define YY_USER_ACTION \
949 do { \
950 yylloc->source = 0; \
951 yylloc->first_column = yycolumn + 1; \
952 yylloc->first_line = yylineno + 1; \
953 yycolumn += yyleng; \
954 } while(0);
955
956#define YY_USER_INIT yylineno = 0; yycolumn = 0;
957
Eric Anholt6a416262010-08-01 18:44:21 -0700958#define TOKEN_OR_IDENTIFIER(version, token) \
959 do { \
960 if (yyextra->language_version >= version) { \
961 return token; \
962 } else { \
963 yylval->identifier = strdup(yytext); \
964 return IDENTIFIER; \
965 } \
966 } while (0)
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700967
Kenneth Graunkec5e74872010-09-05 01:32:32 -0700968/* Handle reserved words in GLSL ES (version 100) */
969#define TOKEN_OR_IDENTIFIER_ES(version, token) \
970 do { \
971 if (yyextra->es_shader) { \
972 return token; \
973 } else { \
974 TOKEN_OR_IDENTIFIER(version, token); \
975 } \
976 } while (0)
977
Ian Romanickdb36e882010-08-11 17:03:37 -0700978#define RESERVED_WORD(version, token) \
979 do { \
980 if (yyextra->language_version >= version) { \
981 return token; \
982 } else { \
983 _mesa_glsl_error(yylloc, yyextra, \
984 "Illegal use of reserved word `%s'", yytext); \
985 return ERROR_TOK; \
986 } \
987 } while (0)
Eric Anholt6a416262010-08-01 18:44:21 -0700988
Kenneth Graunkec5e74872010-09-05 01:32:32 -0700989#line 990 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700990
991#define INITIAL 0
992#define PP 1
Ian Romanick33fe3642010-08-30 11:59:48 -0700993#define PRAGMA 2
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700994
Carl Worthe8a8f0f2010-07-28 12:27:33 -0700995#define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
996
997/* Holds the entire state of the reentrant scanner. */
998struct yyguts_t
999 {
1000
1001 /* User-defined. Not touched by flex. */
1002 YY_EXTRA_TYPE yyextra_r;
1003
1004 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1005 FILE *yyin_r, *yyout_r;
1006 size_t yy_buffer_stack_top; /**< index of top of stack. */
1007 size_t yy_buffer_stack_max; /**< capacity of stack. */
1008 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1009 char yy_hold_char;
1010 int yy_n_chars;
1011 int yyleng_r;
1012 char *yy_c_buf_p;
1013 int yy_init;
1014 int yy_start;
1015 int yy_did_buffer_switch_on_eof;
1016 int yy_start_stack_ptr;
1017 int yy_start_stack_depth;
1018 int *yy_start_stack;
1019 yy_state_type yy_last_accepting_state;
1020 char* yy_last_accepting_cpos;
1021
1022 int yylineno_r;
1023 int yy_flex_debug_r;
1024
1025 char *yytext_r;
1026 int yy_more_flag;
1027 int yy_more_len;
1028
1029 YYSTYPE * yylval_r;
1030
1031 YYLTYPE * yylloc_r;
1032
1033 }; /* end struct yyguts_t */
1034
1035static int yy_init_globals (yyscan_t yyscanner );
1036
1037 /* This must go here because YYSTYPE and YYLTYPE are included
1038 * from bison output in section 1.*/
1039 # define yylval yyg->yylval_r
1040
1041 # define yylloc yyg->yylloc_r
1042
1043int _mesa_glsl_lex_init (yyscan_t* scanner);
1044
1045int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1046
1047/* Accessor methods to globals.
1048 These are made visible to non-reentrant scanners for convenience. */
1049
1050int _mesa_glsl_lex_destroy (yyscan_t yyscanner );
1051
1052int _mesa_glsl_get_debug (yyscan_t yyscanner );
1053
1054void _mesa_glsl_set_debug (int debug_flag ,yyscan_t yyscanner );
1055
1056YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner );
1057
1058void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1059
1060FILE *_mesa_glsl_get_in (yyscan_t yyscanner );
1061
1062void _mesa_glsl_set_in (FILE * in_str ,yyscan_t yyscanner );
1063
1064FILE *_mesa_glsl_get_out (yyscan_t yyscanner );
1065
1066void _mesa_glsl_set_out (FILE * out_str ,yyscan_t yyscanner );
1067
1068int _mesa_glsl_get_leng (yyscan_t yyscanner );
1069
1070char *_mesa_glsl_get_text (yyscan_t yyscanner );
1071
1072int _mesa_glsl_get_lineno (yyscan_t yyscanner );
1073
1074void _mesa_glsl_set_lineno (int line_number ,yyscan_t yyscanner );
1075
1076YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner );
1077
1078void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1079
1080 YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner );
1081
1082 void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
1083
1084/* Macros after this point can all be overridden by user definitions in
1085 * section 1.
1086 */
1087
1088#ifndef YY_SKIP_YYWRAP
1089#ifdef __cplusplus
1090extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner );
1091#else
1092extern int _mesa_glsl_wrap (yyscan_t yyscanner );
1093#endif
1094#endif
1095
1096#ifndef yytext_ptr
1097static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1098#endif
1099
1100#ifdef YY_NEED_STRLEN
1101static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1102#endif
1103
1104#ifndef YY_NO_INPUT
1105
1106#ifdef __cplusplus
1107static int yyinput (yyscan_t yyscanner );
1108#else
1109static int input (yyscan_t yyscanner );
1110#endif
1111
1112#endif
1113
1114/* Amount of stuff to slurp up with each read. */
1115#ifndef YY_READ_BUF_SIZE
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001116#define YY_READ_BUF_SIZE 8192
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001117#endif
1118
1119/* Copy whatever the last rule matched to the standard output. */
1120#ifndef ECHO
1121/* This used to be an fputs(), but since the string might contain NUL's,
1122 * we now use fwrite().
1123 */
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001124#define ECHO fwrite( yytext, yyleng, 1, yyout )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001125#endif
1126
1127/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1128 * is returned in "result".
1129 */
1130#ifndef YY_INPUT
1131#define YY_INPUT(buf,result,max_size) \
1132 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1133 { \
1134 int c = '*'; \
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001135 int n; \
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001136 for ( n = 0; n < max_size && \
1137 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1138 buf[n] = (char) c; \
1139 if ( c == '\n' ) \
1140 buf[n++] = (char) c; \
1141 if ( c == EOF && ferror( yyin ) ) \
1142 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1143 result = n; \
1144 } \
1145 else \
1146 { \
1147 errno=0; \
1148 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1149 { \
1150 if( errno != EINTR) \
1151 { \
1152 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1153 break; \
1154 } \
1155 errno=0; \
1156 clearerr(yyin); \
1157 } \
1158 }\
1159\
1160
1161#endif
1162
1163/* No semi-colon after return; correct usage is to write "yyterminate();" -
1164 * we don't want an extra ';' after the "return" because that will cause
1165 * some compilers to complain about unreachable statements.
1166 */
1167#ifndef yyterminate
1168#define yyterminate() return YY_NULL
1169#endif
1170
1171/* Number of entries by which start-condition stack grows. */
1172#ifndef YY_START_STACK_INCR
1173#define YY_START_STACK_INCR 25
1174#endif
1175
1176/* Report a fatal error. */
1177#ifndef YY_FATAL_ERROR
1178#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1179#endif
1180
1181/* end tables serialization structures and prototypes */
1182
1183/* Default declaration of generated scanner - a define so the user can
1184 * easily add parameters.
1185 */
1186#ifndef YY_DECL
1187#define YY_DECL_IS_OURS 1
1188
1189extern int _mesa_glsl_lex \
1190 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1191
1192#define YY_DECL int _mesa_glsl_lex \
1193 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1194#endif /* !YY_DECL */
1195
1196/* Code executed at the beginning of each rule, after yytext and yyleng
1197 * have been set up.
1198 */
1199#ifndef YY_USER_ACTION
1200#define YY_USER_ACTION
1201#endif
1202
1203/* Code executed at the end of each rule. */
1204#ifndef YY_BREAK
1205#define YY_BREAK break;
1206#endif
1207
1208#define YY_RULE_SETUP \
1209 if ( yyleng > 0 ) \
1210 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1211 (yytext[yyleng - 1] == '\n'); \
1212 YY_USER_ACTION
1213
1214/** The main scanner function which does all the work.
1215 */
1216YY_DECL
1217{
1218 register yy_state_type yy_current_state;
1219 register char *yy_cp, *yy_bp;
1220 register int yy_act;
1221 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1222
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001223#line 86 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001224
1225
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001226#line 1227 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001227
1228 yylval = yylval_param;
1229
1230 yylloc = yylloc_param;
1231
1232 if ( !yyg->yy_init )
1233 {
1234 yyg->yy_init = 1;
1235
1236#ifdef YY_USER_INIT
1237 YY_USER_INIT;
1238#endif
1239
1240 if ( ! yyg->yy_start )
1241 yyg->yy_start = 1; /* first start state */
1242
1243 if ( ! yyin )
1244 yyin = stdin;
1245
1246 if ( ! yyout )
1247 yyout = stdout;
1248
1249 if ( ! YY_CURRENT_BUFFER ) {
1250 _mesa_glsl_ensure_buffer_stack (yyscanner);
1251 YY_CURRENT_BUFFER_LVALUE =
1252 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1253 }
1254
1255 _mesa_glsl__load_buffer_state(yyscanner );
1256 }
1257
1258 while ( 1 ) /* loops until end-of-file is reached */
1259 {
1260 yy_cp = yyg->yy_c_buf_p;
1261
1262 /* Support of yytext. */
1263 *yy_cp = yyg->yy_hold_char;
1264
1265 /* yy_bp points to the position in yy_ch_buf of the start of
1266 * the current run.
1267 */
1268 yy_bp = yy_cp;
1269
1270 yy_current_state = yyg->yy_start;
1271 yy_current_state += YY_AT_BOL();
1272yy_match:
1273 do
1274 {
1275 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1276 if ( yy_accept[yy_current_state] )
1277 {
1278 yyg->yy_last_accepting_state = yy_current_state;
1279 yyg->yy_last_accepting_cpos = yy_cp;
1280 }
1281 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1282 {
1283 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07001284 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001285 yy_c = yy_meta[(unsigned int) yy_c];
1286 }
1287 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1288 ++yy_cp;
1289 }
Ian Romanick33fe3642010-08-30 11:59:48 -07001290 while ( yy_current_state != 707 );
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001291 yy_cp = yyg->yy_last_accepting_cpos;
1292 yy_current_state = yyg->yy_last_accepting_state;
1293
1294yy_find_action:
1295 yy_act = yy_accept[yy_current_state];
1296
1297 YY_DO_BEFORE_ACTION;
1298
1299do_action: /* This label is used only to access EOF actions. */
1300
1301 switch ( yy_act )
1302 { /* beginning of action switch */
1303 case 0: /* must back up */
1304 /* undo the effects of YY_DO_BEFORE_ACTION */
1305 *yy_cp = yyg->yy_hold_char;
1306 yy_cp = yyg->yy_last_accepting_cpos;
1307 yy_current_state = yyg->yy_last_accepting_state;
1308 goto yy_find_action;
1309
1310case 1:
1311YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001312#line 88 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001313;
1314 YY_BREAK
1315/* Preprocessor tokens. */
1316case 2:
1317*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1318yyg->yy_c_buf_p = yy_cp -= 1;
1319YY_DO_BEFORE_ACTION; /* set up yytext again */
1320YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001321#line 91 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001322;
1323 YY_BREAK
1324case 3:
1325YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001326#line 92 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001327{ BEGIN PP; return VERSION; }
1328 YY_BREAK
1329case 4:
1330YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001331#line 93 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001332{ BEGIN PP; return EXTENSION; }
1333 YY_BREAK
1334case 5:
1335*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1336yyg->yy_c_buf_p = yy_cp -= 1;
1337YY_DO_BEFORE_ACTION; /* set up yytext again */
1338YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001339#line 94 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001340{
1341 /* Eat characters until the first digit is
1342 * encountered
1343 */
1344 char *ptr = yytext;
1345 while (!isdigit(*ptr))
1346 ptr++;
1347
1348 /* Subtract one from the line number because
1349 * yylineno is zero-based instead of
1350 * one-based.
1351 */
1352 yylineno = strtol(ptr, &ptr, 0) - 1;
1353 yylloc->source = strtol(ptr, NULL, 0);
1354 }
1355 YY_BREAK
1356case 6:
1357*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1358yyg->yy_c_buf_p = yy_cp -= 1;
1359YY_DO_BEFORE_ACTION; /* set up yytext again */
1360YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001361#line 109 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001362{
1363 /* Eat characters until the first digit is
1364 * encountered
1365 */
1366 char *ptr = yytext;
1367 while (!isdigit(*ptr))
1368 ptr++;
1369
1370 /* Subtract one from the line number because
1371 * yylineno is zero-based instead of
1372 * one-based.
1373 */
1374 yylineno = strtol(ptr, &ptr, 0) - 1;
1375 }
1376 YY_BREAK
1377case 7:
1378YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001379#line 123 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001380{
1381 BEGIN PP;
1382 return PRAGMA_DEBUG_ON;
1383 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001384 YY_BREAK
1385case 8:
1386YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001387#line 127 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001388{
1389 BEGIN PP;
1390 return PRAGMA_DEBUG_OFF;
1391 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001392 YY_BREAK
1393case 9:
1394YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001395#line 131 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001396{
1397 BEGIN PP;
1398 return PRAGMA_OPTIMIZE_ON;
1399 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001400 YY_BREAK
1401case 10:
1402YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001403#line 135 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001404{
1405 BEGIN PP;
1406 return PRAGMA_OPTIMIZE_OFF;
1407 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001408 YY_BREAK
1409case 11:
1410YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001411#line 139 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001412{ BEGIN PRAGMA; }
1413 YY_BREAK
1414case 12:
1415/* rule 12 can match eol */
1416YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001417#line 141 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001418{ BEGIN 0; yylineno++; yycolumn = 0; }
1419 YY_BREAK
1420case 13:
1421YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001422#line 142 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001423{ }
1424 YY_BREAK
1425case 14:
1426YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001427#line 144 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001428{ }
1429 YY_BREAK
1430case 15:
1431YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001432#line 145 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001433{ }
1434 YY_BREAK
1435case 16:
1436YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001437#line 146 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001438return COLON;
1439 YY_BREAK
1440case 17:
1441YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001442#line 147 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001443{
1444 yylval->identifier = strdup(yytext);
1445 return IDENTIFIER;
1446 }
1447 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001448case 18:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001449YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001450#line 151 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001451{
1452 yylval->n = strtol(yytext, NULL, 10);
1453 return INTCONSTANT;
1454 }
1455 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001456case 19:
1457/* rule 19 can match eol */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001458YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001459#line 155 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001460{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
1461 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001462case 20:
Ian Romanick33fe3642010-08-30 11:59:48 -07001463/* rule 20 can match eol */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001464YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001465#line 157 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001466{ yylineno++; yycolumn = 0; }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001467 YY_BREAK
1468case 21:
1469YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001470#line 159 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001471return ATTRIBUTE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001472 YY_BREAK
1473case 22:
1474YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001475#line 160 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001476return CONST_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001477 YY_BREAK
1478case 23:
1479YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001480#line 161 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001481return BOOL_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001482 YY_BREAK
1483case 24:
1484YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001485#line 162 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001486return FLOAT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001487 YY_BREAK
1488case 25:
1489YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001490#line 163 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001491return INT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001492 YY_BREAK
1493case 26:
1494YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001495#line 165 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001496return BREAK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001497 YY_BREAK
1498case 27:
1499YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001500#line 166 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001501return CONTINUE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001502 YY_BREAK
1503case 28:
1504YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001505#line 167 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001506return DO;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001507 YY_BREAK
1508case 29:
1509YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001510#line 168 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001511return WHILE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001512 YY_BREAK
1513case 30:
1514YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001515#line 169 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001516return ELSE;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001517 YY_BREAK
1518case 31:
1519YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001520#line 170 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001521return FOR;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001522 YY_BREAK
1523case 32:
1524YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001525#line 171 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001526return IF;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001527 YY_BREAK
1528case 33:
1529YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001530#line 172 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001531return DISCARD;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001532 YY_BREAK
1533case 34:
1534YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001535#line 173 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001536return RETURN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001537 YY_BREAK
1538case 35:
1539YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001540#line 175 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001541return BVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001542 YY_BREAK
1543case 36:
1544YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001545#line 176 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001546return BVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001547 YY_BREAK
1548case 37:
1549YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001550#line 177 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001551return BVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001552 YY_BREAK
1553case 38:
1554YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001555#line 178 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001556return IVEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001557 YY_BREAK
1558case 39:
1559YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001560#line 179 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001561return IVEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001562 YY_BREAK
1563case 40:
1564YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001565#line 180 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001566return IVEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001567 YY_BREAK
1568case 41:
1569YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001570#line 181 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001571return VEC2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001572 YY_BREAK
1573case 42:
1574YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001575#line 182 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001576return VEC3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001577 YY_BREAK
1578case 43:
1579YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001580#line 183 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001581return VEC4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001582 YY_BREAK
1583case 44:
1584YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001585#line 184 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001586return MAT2X2;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001587 YY_BREAK
1588case 45:
1589YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001590#line 185 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001591return MAT3X3;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001592 YY_BREAK
1593case 46:
1594YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001595#line 186 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001596return MAT4X4;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001597 YY_BREAK
1598case 47:
1599YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001600#line 187 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001601TOKEN_OR_IDENTIFIER(120, MAT2X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001602 YY_BREAK
1603case 48:
1604YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001605#line 188 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001606TOKEN_OR_IDENTIFIER(120, MAT2X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001607 YY_BREAK
1608case 49:
1609YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001610#line 189 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001611TOKEN_OR_IDENTIFIER(120, MAT2X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001612 YY_BREAK
1613case 50:
1614YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001615#line 190 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001616TOKEN_OR_IDENTIFIER(120, MAT3X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001617 YY_BREAK
1618case 51:
1619YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001620#line 191 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001621TOKEN_OR_IDENTIFIER(120, MAT3X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001622 YY_BREAK
1623case 52:
1624YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001625#line 192 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001626TOKEN_OR_IDENTIFIER(120, MAT3X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001627 YY_BREAK
1628case 53:
1629YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001630#line 193 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001631TOKEN_OR_IDENTIFIER(120, MAT4X2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001632 YY_BREAK
1633case 54:
1634YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001635#line 194 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001636TOKEN_OR_IDENTIFIER(120, MAT4X3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001637 YY_BREAK
1638case 55:
1639YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001640#line 195 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001641TOKEN_OR_IDENTIFIER(120, MAT4X4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001642 YY_BREAK
1643case 56:
1644YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001645#line 197 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001646return IN_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001647 YY_BREAK
1648case 57:
1649YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001650#line 198 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001651return OUT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001652 YY_BREAK
1653case 58:
1654YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001655#line 199 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001656return INOUT_TOK;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001657 YY_BREAK
1658case 59:
1659YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001660#line 200 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001661return UNIFORM;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001662 YY_BREAK
1663case 60:
1664YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001665#line 201 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001666return VARYING;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001667 YY_BREAK
1668case 61:
1669YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001670#line 202 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001671TOKEN_OR_IDENTIFIER(120, CENTROID);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001672 YY_BREAK
1673case 62:
1674YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001675#line 203 "glsl_lexer.lpp"
1676TOKEN_OR_IDENTIFIER_ES(120, INVARIANT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001677 YY_BREAK
1678case 63:
1679YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001680#line 205 "glsl_lexer.lpp"
1681TOKEN_OR_IDENTIFIER_ES(130, FLAT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001682 YY_BREAK
1683case 64:
1684YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001685#line 206 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001686TOKEN_OR_IDENTIFIER(130, SMOOTH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001687 YY_BREAK
1688case 65:
1689YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001690#line 207 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001691TOKEN_OR_IDENTIFIER(130, NOPERSPECTIVE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001692 YY_BREAK
1693case 66:
1694YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001695#line 209 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001696return SAMPLER1D;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001697 YY_BREAK
1698case 67:
1699YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001700#line 210 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001701return SAMPLER2D;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001702 YY_BREAK
1703case 68:
1704YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001705#line 211 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001706return SAMPLER3D;
1707 YY_BREAK
1708case 69:
1709YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001710#line 212 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001711return SAMPLERCUBE;
1712 YY_BREAK
1713case 70:
1714YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001715#line 213 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001716return SAMPLER1DSHADOW;
1717 YY_BREAK
1718case 71:
1719YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001720#line 214 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001721return SAMPLER2DSHADOW;
1722 YY_BREAK
1723case 72:
1724YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001725#line 216 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001726return STRUCT;
1727 YY_BREAK
1728case 73:
1729YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001730#line 217 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001731return VOID_TOK;
1732 YY_BREAK
1733case 74:
1734YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001735#line 219 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001736{
1737 if ((yyextra->language_version >= 140)
1738 || (yyextra->ARB_fragment_coord_conventions_enable)){
1739 return LAYOUT_TOK;
1740 } else {
1741 yylval->identifier = strdup(yytext);
1742 return IDENTIFIER;
1743 }
1744 }
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001745 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001746case 75:
1747YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001748#line 229 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001749return INC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001750 YY_BREAK
1751case 76:
1752YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001753#line 230 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001754return DEC_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001755 YY_BREAK
1756case 77:
1757YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001758#line 231 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001759return LE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001760 YY_BREAK
1761case 78:
1762YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001763#line 232 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001764return GE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001765 YY_BREAK
1766case 79:
1767YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001768#line 233 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001769return EQ_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001770 YY_BREAK
1771case 80:
1772YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001773#line 234 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001774return NE_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001775 YY_BREAK
1776case 81:
1777YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001778#line 235 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001779return AND_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001780 YY_BREAK
1781case 82:
1782YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001783#line 236 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001784return OR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001785 YY_BREAK
1786case 83:
1787YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001788#line 237 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001789return XOR_OP;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001790 YY_BREAK
1791case 84:
1792YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001793#line 239 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001794return MUL_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001795 YY_BREAK
1796case 85:
1797YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001798#line 240 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001799return DIV_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001800 YY_BREAK
1801case 86:
1802YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001803#line 241 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001804return ADD_ASSIGN;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001805 YY_BREAK
1806case 87:
1807YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001808#line 242 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001809return MOD_ASSIGN;
Ian Romanickf50f0652010-06-30 17:30:03 -07001810 YY_BREAK
1811case 88:
1812YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001813#line 243 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001814return LEFT_ASSIGN;
1815 YY_BREAK
1816case 89:
1817YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001818#line 244 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001819return RIGHT_ASSIGN;
1820 YY_BREAK
1821case 90:
1822YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001823#line 245 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001824return AND_ASSIGN;
1825 YY_BREAK
1826case 91:
1827YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001828#line 246 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001829return XOR_ASSIGN;
1830 YY_BREAK
1831case 92:
1832YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001833#line 247 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001834return OR_ASSIGN;
1835 YY_BREAK
1836case 93:
1837YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001838#line 248 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001839return SUB_ASSIGN;
1840 YY_BREAK
1841case 94:
1842YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001843#line 250 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001844{
1845 yylval->n = strtol(yytext, NULL, 10);
1846 return INTCONSTANT;
1847 }
1848 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001849case 95:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001850YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001851#line 254 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001852{
1853 yylval->n = strtol(yytext + 2, NULL, 16);
1854 return INTCONSTANT;
1855 }
1856 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001857case 96:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001858YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001859#line 258 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001860{
1861 yylval->n = strtol(yytext, NULL, 8);
1862 return INTCONSTANT;
1863 }
1864 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001865case 97:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001866YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001867#line 263 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001868{
1869 yylval->real = strtod(yytext, NULL);
1870 return FLOATCONSTANT;
1871 }
1872 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001873case 98:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001874YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001875#line 267 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001876{
1877 yylval->real = strtod(yytext, NULL);
1878 return FLOATCONSTANT;
1879 }
1880 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001881case 99:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001882YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001883#line 271 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001884{
1885 yylval->real = strtod(yytext, NULL);
1886 return FLOATCONSTANT;
1887 }
1888 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001889case 100:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001890YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001891#line 275 "glsl_lexer.lpp"
Ian Romanickf50f0652010-06-30 17:30:03 -07001892{
1893 yylval->real = strtod(yytext, NULL);
1894 return FLOATCONSTANT;
1895 }
1896 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001897case 101:
Ian Romanickf50f0652010-06-30 17:30:03 -07001898YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001899#line 279 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001900{
Eric Anholt47f3f222010-08-02 11:26:43 -07001901 yylval->real = strtod(yytext, NULL);
1902 return FLOATCONSTANT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001903 }
1904 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001905case 102:
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001906YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001907#line 284 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001908{
Eric Anholt47f3f222010-08-02 11:26:43 -07001909 yylval->n = 1;
1910 return BOOLCONSTANT;
1911 }
1912 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07001913case 103:
Eric Anholt47f3f222010-08-02 11:26:43 -07001914YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001915#line 288 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07001916{
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001917 yylval->n = 0;
1918 return BOOLCONSTANT;
1919 }
1920 YY_BREAK
1921/* Reserved words in GLSL 1.10. */
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001922case 104:
1923YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001924#line 295 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001925RESERVED_WORD(999, ASM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001926 YY_BREAK
1927case 105:
1928YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001929#line 296 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001930RESERVED_WORD(999, CLASS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001931 YY_BREAK
1932case 106:
1933YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001934#line 297 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001935RESERVED_WORD(999, UNION);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001936 YY_BREAK
1937case 107:
1938YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001939#line 298 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001940RESERVED_WORD(999, ENUM);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001941 YY_BREAK
1942case 108:
1943YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001944#line 299 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001945RESERVED_WORD(999, TYPEDEF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001946 YY_BREAK
1947case 109:
1948YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001949#line 300 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001950RESERVED_WORD(999, TEMPLATE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001951 YY_BREAK
1952case 110:
1953YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001954#line 301 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001955RESERVED_WORD(999, THIS);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001956 YY_BREAK
1957case 111:
1958YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001959#line 302 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001960RESERVED_WORD(999, PACKED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001961 YY_BREAK
1962case 112:
1963YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001964#line 303 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001965RESERVED_WORD(999, GOTO);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001966 YY_BREAK
1967case 113:
1968YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001969#line 304 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001970RESERVED_WORD(130, SWITCH);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001971 YY_BREAK
1972case 114:
1973YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001974#line 305 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001975RESERVED_WORD(130, DEFAULT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001976 YY_BREAK
1977case 115:
1978YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001979#line 306 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001980RESERVED_WORD(999, INLINE_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001981 YY_BREAK
1982case 116:
1983YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001984#line 307 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001985RESERVED_WORD(999, NOINLINE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001986 YY_BREAK
1987case 117:
1988YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001989#line 308 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001990RESERVED_WORD(999, VOLATILE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001991 YY_BREAK
1992case 118:
1993YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001994#line 309 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07001995RESERVED_WORD(999, PUBLIC_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07001996 YY_BREAK
1997case 119:
1998YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07001999#line 310 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002000RESERVED_WORD(999, STATIC);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002001 YY_BREAK
2002case 120:
2003YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002004#line 311 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002005RESERVED_WORD(999, EXTERN);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002006 YY_BREAK
2007case 121:
2008YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002009#line 312 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002010RESERVED_WORD(999, EXTERNAL);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002011 YY_BREAK
2012case 122:
2013YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002014#line 313 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002015RESERVED_WORD(999, INTERFACE);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002016 YY_BREAK
2017case 123:
2018YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002019#line 314 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002020RESERVED_WORD(999, LONG_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002021 YY_BREAK
2022case 124:
2023YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002024#line 315 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002025RESERVED_WORD(999, SHORT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002026 YY_BREAK
2027case 125:
2028YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002029#line 316 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002030RESERVED_WORD(999, DOUBLE_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002031 YY_BREAK
2032case 126:
2033YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002034#line 317 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002035RESERVED_WORD(999, HALF);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002036 YY_BREAK
2037case 127:
2038YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002039#line 318 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002040RESERVED_WORD(999, FIXED_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002041 YY_BREAK
2042case 128:
2043YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002044#line 319 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002045RESERVED_WORD(999, UNSIGNED);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002046 YY_BREAK
2047case 129:
2048YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002049#line 320 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002050RESERVED_WORD(999, INPUT_TOK);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002051 YY_BREAK
2052case 130:
2053YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002054#line 321 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002055RESERVED_WORD(999, OUTPUT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002056 YY_BREAK
2057case 131:
2058YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002059#line 322 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002060RESERVED_WORD(999, HVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002061 YY_BREAK
2062case 132:
2063YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002064#line 323 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002065RESERVED_WORD(999, HVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002066 YY_BREAK
2067case 133:
2068YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002069#line 324 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002070RESERVED_WORD(999, HVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002071 YY_BREAK
2072case 134:
2073YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002074#line 325 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002075RESERVED_WORD(999, DVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002076 YY_BREAK
2077case 135:
2078YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002079#line 326 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002080RESERVED_WORD(999, DVEC3);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002081 YY_BREAK
2082case 136:
2083YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002084#line 327 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002085RESERVED_WORD(999, DVEC4);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002086 YY_BREAK
2087case 137:
2088YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002089#line 328 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002090RESERVED_WORD(999, FVEC2);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002091 YY_BREAK
2092case 138:
2093YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002094#line 329 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002095RESERVED_WORD(999, FVEC3);
Ian Romanickf50f0652010-06-30 17:30:03 -07002096 YY_BREAK
2097case 139:
2098YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002099#line 330 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002100RESERVED_WORD(999, FVEC4);
Eric Anholt47f3f222010-08-02 11:26:43 -07002101 YY_BREAK
2102case 140:
2103YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002104#line 331 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002105return SAMPLER2DRECT;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002106 YY_BREAK
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002107case 141:
2108YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002109#line 332 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002110RESERVED_WORD(999, SAMPLER3DRECT);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002111 YY_BREAK
2112case 142:
2113YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002114#line 333 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002115return SAMPLER2DRECTSHADOW;
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002116 YY_BREAK
2117case 143:
2118YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002119#line 334 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002120RESERVED_WORD(999, SIZEOF);
Ian Romanickf50f0652010-06-30 17:30:03 -07002121 YY_BREAK
2122case 144:
2123YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002124#line 335 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002125RESERVED_WORD(999, CAST);
Eric Anholt47f3f222010-08-02 11:26:43 -07002126 YY_BREAK
2127case 145:
2128YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002129#line 336 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002130RESERVED_WORD(999, NAMESPACE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002131 YY_BREAK
2132case 146:
2133YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002134#line 337 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002135RESERVED_WORD(999, USING);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002136 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002137/* Additional reserved words in GLSL 1.20. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002138case 147:
2139YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002140#line 340 "glsl_lexer.lpp"
2141TOKEN_OR_IDENTIFIER_ES(120, LOWP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002142 YY_BREAK
2143case 148:
2144YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002145#line 341 "glsl_lexer.lpp"
2146TOKEN_OR_IDENTIFIER_ES(120, MEDIUMP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002147 YY_BREAK
2148case 149:
2149YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002150#line 342 "glsl_lexer.lpp"
2151TOKEN_OR_IDENTIFIER_ES(120, HIGHP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002152 YY_BREAK
2153case 150:
2154YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002155#line 343 "glsl_lexer.lpp"
2156TOKEN_OR_IDENTIFIER_ES(120, PRECISION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002157 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002158/* Additional reserved words in GLSL 1.30. */
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002159case 151:
2160YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002161#line 346 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002162TOKEN_OR_IDENTIFIER(130, COMMON);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002163 YY_BREAK
2164case 152:
2165YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002166#line 347 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002167TOKEN_OR_IDENTIFIER(130, PARTITION);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002168 YY_BREAK
2169case 153:
2170YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002171#line 348 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002172TOKEN_OR_IDENTIFIER(130, ACTIVE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002173 YY_BREAK
2174case 154:
2175YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002176#line 349 "glsl_lexer.lpp"
2177TOKEN_OR_IDENTIFIER_ES(130, SUPERP);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002178 YY_BREAK
2179case 155:
2180YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002181#line 350 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002182TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002183 YY_BREAK
2184case 156:
2185YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002186#line 351 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002187TOKEN_OR_IDENTIFIER(130, FILTER);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002188 YY_BREAK
2189case 157:
2190YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002191#line 352 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002192TOKEN_OR_IDENTIFIER(130, IMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002193 YY_BREAK
2194case 158:
2195YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002196#line 353 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002197TOKEN_OR_IDENTIFIER(130, IMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002198 YY_BREAK
2199case 159:
2200YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002201#line 354 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002202TOKEN_OR_IDENTIFIER(130, IMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002203 YY_BREAK
2204case 160:
2205YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002206#line 355 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002207TOKEN_OR_IDENTIFIER(130, IMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002208 YY_BREAK
2209case 161:
2210YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002211#line 356 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002212TOKEN_OR_IDENTIFIER(130, IIMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002213 YY_BREAK
2214case 162:
2215YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002216#line 357 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002217TOKEN_OR_IDENTIFIER(130, IIMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002218 YY_BREAK
2219case 163:
2220YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002221#line 358 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002222TOKEN_OR_IDENTIFIER(130, IIMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002223 YY_BREAK
2224case 164:
2225YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002226#line 359 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002227TOKEN_OR_IDENTIFIER(130, IIMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002228 YY_BREAK
2229case 165:
2230YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002231#line 360 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002232TOKEN_OR_IDENTIFIER(130, UIMAGE1D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002233 YY_BREAK
2234case 166:
2235YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002236#line 361 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002237TOKEN_OR_IDENTIFIER(130, UIMAGE2D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002238 YY_BREAK
2239case 167:
2240YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002241#line 362 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002242TOKEN_OR_IDENTIFIER(130, UIMAGE3D);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002243 YY_BREAK
2244case 168:
2245YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002246#line 363 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002247TOKEN_OR_IDENTIFIER(130, UIMAGECUBE);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002248 YY_BREAK
2249case 169:
2250YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002251#line 364 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002252TOKEN_OR_IDENTIFIER(130, IMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002253 YY_BREAK
2254case 170:
2255YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002256#line 365 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002257TOKEN_OR_IDENTIFIER(130, IMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002258 YY_BREAK
2259case 171:
2260YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002261#line 366 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002262TOKEN_OR_IDENTIFIER(130, IIMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002263 YY_BREAK
2264case 172:
2265YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002266#line 367 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002267TOKEN_OR_IDENTIFIER(130, IIMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002268 YY_BREAK
2269case 173:
2270YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002271#line 368 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002272TOKEN_OR_IDENTIFIER(130, UIMAGE1DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002273 YY_BREAK
2274case 174:
2275YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002276#line 369 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002277TOKEN_OR_IDENTIFIER(130, UIMAGE2DARRAY);
Kenneth Graunkeb7e63c32010-08-07 00:50:08 -07002278 YY_BREAK
2279case 175:
2280YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002281#line 370 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002282TOKEN_OR_IDENTIFIER(130, IMAGE1DSHADOW);
2283 YY_BREAK
2284case 176:
2285YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002286#line 371 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002287TOKEN_OR_IDENTIFIER(130, IMAGE2DSHADOW);
2288 YY_BREAK
2289case 177:
2290YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002291#line 372 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002292TOKEN_OR_IDENTIFIER(130, IMAGEBUFFER);
2293 YY_BREAK
2294case 178:
2295YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002296#line 373 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002297TOKEN_OR_IDENTIFIER(130, IIMAGEBUFFER);
2298 YY_BREAK
2299case 179:
2300YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002301#line 374 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002302TOKEN_OR_IDENTIFIER(130, UIMAGEBUFFER);
2303 YY_BREAK
2304case 180:
2305YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002306#line 375 "glsl_lexer.lpp"
Ian Romanick33fe3642010-08-30 11:59:48 -07002307TOKEN_OR_IDENTIFIER(130, ROW_MAJOR);
2308 YY_BREAK
2309case 181:
2310YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002311#line 377 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002312{
2313 struct _mesa_glsl_parse_state *state = yyextra;
2314 void *ctx = state;
2315 yylval->identifier = talloc_strdup(ctx, yytext);
2316 return IDENTIFIER;
2317 }
2318 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002319case 182:
Ian Romanickf50f0652010-06-30 17:30:03 -07002320YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002321#line 384 "glsl_lexer.lpp"
Eric Anholt47f3f222010-08-02 11:26:43 -07002322{ return yytext[0]; }
2323 YY_BREAK
Ian Romanick33fe3642010-08-30 11:59:48 -07002324case 183:
Eric Anholt47f3f222010-08-02 11:26:43 -07002325YY_RULE_SETUP
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002326#line 386 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002327ECHO;
2328 YY_BREAK
Kenneth Graunkec5e74872010-09-05 01:32:32 -07002329#line 2330 "glsl_lexer.cpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002330case YY_STATE_EOF(INITIAL):
2331case YY_STATE_EOF(PP):
Ian Romanick33fe3642010-08-30 11:59:48 -07002332case YY_STATE_EOF(PRAGMA):
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002333 yyterminate();
2334
2335 case YY_END_OF_BUFFER:
2336 {
2337 /* Amount of text matched not including the EOB char. */
2338 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2339
2340 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2341 *yy_cp = yyg->yy_hold_char;
2342 YY_RESTORE_YY_MORE_OFFSET
2343
2344 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2345 {
2346 /* We're scanning a new file or input source. It's
2347 * possible that this happened because the user
2348 * just pointed yyin at a new source and called
2349 * _mesa_glsl_lex(). If so, then we have to assure
2350 * consistency between YY_CURRENT_BUFFER and our
2351 * globals. Here is the right place to do so, because
2352 * this is the first action (other than possibly a
2353 * back-up) that will match for the new input source.
2354 */
2355 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2356 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2357 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2358 }
2359
2360 /* Note that here we test for yy_c_buf_p "<=" to the position
2361 * of the first EOB in the buffer, since yy_c_buf_p will
2362 * already have been incremented past the NUL character
2363 * (since all states make transitions on EOB to the
2364 * end-of-buffer state). Contrast this with the test
2365 * in input().
2366 */
2367 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2368 { /* This was really a NUL. */
2369 yy_state_type yy_next_state;
2370
2371 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2372
2373 yy_current_state = yy_get_previous_state( yyscanner );
2374
2375 /* Okay, we're now positioned to make the NUL
2376 * transition. We couldn't have
2377 * yy_get_previous_state() go ahead and do it
2378 * for us because it doesn't know how to deal
2379 * with the possibility of jamming (and we don't
2380 * want to build jamming into it because then it
2381 * will run more slowly).
2382 */
2383
2384 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2385
2386 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2387
2388 if ( yy_next_state )
2389 {
2390 /* Consume the NUL. */
2391 yy_cp = ++yyg->yy_c_buf_p;
2392 yy_current_state = yy_next_state;
2393 goto yy_match;
2394 }
2395
2396 else
2397 {
2398 yy_cp = yyg->yy_last_accepting_cpos;
2399 yy_current_state = yyg->yy_last_accepting_state;
2400 goto yy_find_action;
2401 }
2402 }
2403
2404 else switch ( yy_get_next_buffer( yyscanner ) )
2405 {
2406 case EOB_ACT_END_OF_FILE:
2407 {
2408 yyg->yy_did_buffer_switch_on_eof = 0;
2409
2410 if ( _mesa_glsl_wrap(yyscanner ) )
2411 {
2412 /* Note: because we've taken care in
2413 * yy_get_next_buffer() to have set up
2414 * yytext, we can now set up
2415 * yy_c_buf_p so that if some total
2416 * hoser (like flex itself) wants to
2417 * call the scanner after we return the
2418 * YY_NULL, it'll still work - another
2419 * YY_NULL will get returned.
2420 */
2421 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2422
2423 yy_act = YY_STATE_EOF(YY_START);
2424 goto do_action;
2425 }
2426
2427 else
2428 {
2429 if ( ! yyg->yy_did_buffer_switch_on_eof )
2430 YY_NEW_FILE;
2431 }
2432 break;
2433 }
2434
2435 case EOB_ACT_CONTINUE_SCAN:
2436 yyg->yy_c_buf_p =
2437 yyg->yytext_ptr + yy_amount_of_matched_text;
2438
2439 yy_current_state = yy_get_previous_state( yyscanner );
2440
2441 yy_cp = yyg->yy_c_buf_p;
2442 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2443 goto yy_match;
2444
2445 case EOB_ACT_LAST_MATCH:
2446 yyg->yy_c_buf_p =
2447 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2448
2449 yy_current_state = yy_get_previous_state( yyscanner );
2450
2451 yy_cp = yyg->yy_c_buf_p;
2452 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2453 goto yy_find_action;
2454 }
2455 break;
2456 }
2457
2458 default:
2459 YY_FATAL_ERROR(
2460 "fatal flex scanner internal error--no action found" );
2461 } /* end of action switch */
2462 } /* end of scanning one token */
2463} /* end of _mesa_glsl_lex */
2464
2465/* yy_get_next_buffer - try to read in a new buffer
2466 *
2467 * Returns a code representing an action:
2468 * EOB_ACT_LAST_MATCH -
2469 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2470 * EOB_ACT_END_OF_FILE - end of file
2471 */
2472static int yy_get_next_buffer (yyscan_t yyscanner)
2473{
2474 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2475 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2476 register char *source = yyg->yytext_ptr;
2477 register int number_to_move, i;
2478 int ret_val;
2479
2480 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2481 YY_FATAL_ERROR(
2482 "fatal flex scanner internal error--end of buffer missed" );
2483
2484 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2485 { /* Don't try to fill the buffer, so this is an EOF. */
2486 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2487 {
2488 /* We matched a single character, the EOB, so
2489 * treat this as a final EOF.
2490 */
2491 return EOB_ACT_END_OF_FILE;
2492 }
2493
2494 else
2495 {
2496 /* We matched some text prior to the EOB, first
2497 * process it.
2498 */
2499 return EOB_ACT_LAST_MATCH;
2500 }
2501 }
2502
2503 /* Try to read more data. */
2504
2505 /* First move last chars to start of buffer. */
2506 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2507
2508 for ( i = 0; i < number_to_move; ++i )
2509 *(dest++) = *(source++);
2510
2511 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2512 /* don't do the read, it's not guaranteed to return an EOF,
2513 * just force an EOF
2514 */
2515 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2516
2517 else
2518 {
2519 int num_to_read =
2520 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2521
2522 while ( num_to_read <= 0 )
2523 { /* Not enough room in the buffer - grow it. */
2524
2525 /* just a shorter name for the current buffer */
2526 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2527
2528 int yy_c_buf_p_offset =
2529 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2530
2531 if ( b->yy_is_our_buffer )
2532 {
2533 int new_size = b->yy_buf_size * 2;
2534
2535 if ( new_size <= 0 )
2536 b->yy_buf_size += b->yy_buf_size / 8;
2537 else
2538 b->yy_buf_size *= 2;
2539
2540 b->yy_ch_buf = (char *)
2541 /* Include room in for 2 EOB chars. */
2542 _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2543 }
2544 else
2545 /* Can't grow it, we don't own it. */
2546 b->yy_ch_buf = 0;
2547
2548 if ( ! b->yy_ch_buf )
2549 YY_FATAL_ERROR(
2550 "fatal error - scanner input buffer overflow" );
2551
2552 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2553
2554 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2555 number_to_move - 1;
2556
2557 }
2558
2559 if ( num_to_read > YY_READ_BUF_SIZE )
2560 num_to_read = YY_READ_BUF_SIZE;
2561
2562 /* Read in more data. */
2563 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2564 yyg->yy_n_chars, (size_t) num_to_read );
2565
2566 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2567 }
2568
2569 if ( yyg->yy_n_chars == 0 )
2570 {
2571 if ( number_to_move == YY_MORE_ADJ )
2572 {
2573 ret_val = EOB_ACT_END_OF_FILE;
2574 _mesa_glsl_restart(yyin ,yyscanner);
2575 }
2576
2577 else
2578 {
2579 ret_val = EOB_ACT_LAST_MATCH;
2580 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2581 YY_BUFFER_EOF_PENDING;
2582 }
2583 }
2584
2585 else
2586 ret_val = EOB_ACT_CONTINUE_SCAN;
2587
2588 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2589 /* Extend the array by 50%, plus the number we really need. */
2590 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2591 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2592 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2593 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2594 }
2595
2596 yyg->yy_n_chars += number_to_move;
2597 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2598 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2599
2600 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2601
2602 return ret_val;
2603}
2604
2605/* yy_get_previous_state - get the state just before the EOB char was reached */
2606
2607 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2608{
2609 register yy_state_type yy_current_state;
2610 register char *yy_cp;
2611 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2612
2613 yy_current_state = yyg->yy_start;
2614 yy_current_state += YY_AT_BOL();
2615
2616 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2617 {
2618 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2619 if ( yy_accept[yy_current_state] )
2620 {
2621 yyg->yy_last_accepting_state = yy_current_state;
2622 yyg->yy_last_accepting_cpos = yy_cp;
2623 }
2624 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2625 {
2626 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07002627 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002628 yy_c = yy_meta[(unsigned int) yy_c];
2629 }
2630 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2631 }
2632
2633 return yy_current_state;
2634}
2635
2636/* yy_try_NUL_trans - try to make a transition on the NUL character
2637 *
2638 * synopsis
2639 * next_state = yy_try_NUL_trans( current_state );
2640 */
2641 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2642{
2643 register int yy_is_jam;
2644 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2645 register char *yy_cp = yyg->yy_c_buf_p;
2646
2647 register YY_CHAR yy_c = 1;
2648 if ( yy_accept[yy_current_state] )
2649 {
2650 yyg->yy_last_accepting_state = yy_current_state;
2651 yyg->yy_last_accepting_cpos = yy_cp;
2652 }
2653 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2654 {
2655 yy_current_state = (int) yy_def[yy_current_state];
Ian Romanick33fe3642010-08-30 11:59:48 -07002656 if ( yy_current_state >= 708 )
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002657 yy_c = yy_meta[(unsigned int) yy_c];
2658 }
2659 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Ian Romanick33fe3642010-08-30 11:59:48 -07002660 yy_is_jam = (yy_current_state == 707);
Carl Worthe8a8f0f2010-07-28 12:27:33 -07002661
2662 return yy_is_jam ? 0 : yy_current_state;
2663}
2664
2665#ifndef YY_NO_INPUT
2666#ifdef __cplusplus
2667 static int yyinput (yyscan_t yyscanner)
2668#else
2669 static int input (yyscan_t yyscanner)
2670#endif
2671
2672{
2673 int c;
2674 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2675
2676 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2677
2678 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2679 {
2680 /* yy_c_buf_p now points to the character we want to return.
2681 * If this occurs *before* the EOB characters, then it's a
2682 * valid NUL; if not, then we've hit the end of the buffer.
2683 */
2684 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2685 /* This was really a NUL. */
2686 *yyg->yy_c_buf_p = '\0';
2687
2688 else
2689 { /* need more input */
2690 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2691 ++yyg->yy_c_buf_p;
2692
2693 switch ( yy_get_next_buffer( yyscanner ) )
2694 {
2695 case EOB_ACT_LAST_MATCH:
2696 /* This happens because yy_g_n_b()
2697 * sees that we've accumulated a
2698 * token and flags that we need to
2699 * try matching the token before
2700 * proceeding. But for input(),
2701 * there's no matching to consider.
2702 * So convert the EOB_ACT_LAST_MATCH
2703 * to EOB_ACT_END_OF_FILE.
2704 */
2705
2706 /* Reset buffer status. */
2707 _mesa_glsl_restart(yyin ,yyscanner);
2708
2709 /*FALLTHROUGH*/
2710
2711 case EOB_ACT_END_OF_FILE:
2712 {
2713 if ( _mesa_glsl_wrap(yyscanner ) )
2714 return EOF;
2715
2716 if ( ! yyg->yy_did_buffer_switch_on_eof )
2717 YY_NEW_FILE;
2718#ifdef __cplusplus
2719 return yyinput(yyscanner);
2720#else
2721 return input(yyscanner);
2722#endif
2723 }
2724
2725 case EOB_ACT_CONTINUE_SCAN:
2726 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2727 break;
2728 }
2729 }
2730 }
2731
2732 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2733 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2734 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2735
2736 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2737
2738 return c;
2739}
2740#endif /* ifndef YY_NO_INPUT */
2741
2742/** Immediately switch to a different input stream.
2743 * @param input_file A readable stream.
2744 * @param yyscanner The scanner object.
2745 * @note This function does not reset the start condition to @c INITIAL .
2746 */
2747 void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner)
2748{
2749 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2750
2751 if ( ! YY_CURRENT_BUFFER ){
2752 _mesa_glsl_ensure_buffer_stack (yyscanner);
2753 YY_CURRENT_BUFFER_LVALUE =
2754 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2755 }
2756
2757 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2758 _mesa_glsl__load_buffer_state(yyscanner );
2759}
2760
2761/** Switch to a different input buffer.
2762 * @param new_buffer The new input buffer.
2763 * @param yyscanner The scanner object.
2764 */
2765 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2766{
2767 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2768
2769 /* TODO. We should be able to replace this entire function body
2770 * with
2771 * _mesa_glsl_pop_buffer_state();
2772 * _mesa_glsl_push_buffer_state(new_buffer);
2773 */
2774 _mesa_glsl_ensure_buffer_stack (yyscanner);
2775 if ( YY_CURRENT_BUFFER == new_buffer )
2776 return;
2777
2778 if ( YY_CURRENT_BUFFER )
2779 {
2780 /* Flush out information for old buffer. */
2781 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2782 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2783 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2784 }
2785
2786 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2787 _mesa_glsl__load_buffer_state(yyscanner );
2788
2789 /* We don't actually know whether we did this switch during
2790 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2791 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2792 * to go ahead and always set it.
2793 */
2794 yyg->yy_did_buffer_switch_on_eof = 1;
2795}
2796
2797static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner)
2798{
2799 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2800 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2801 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2802 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2803 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2804}
2805
2806/** Allocate and initialize an input buffer state.
2807 * @param file A readable stream.
2808 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2809 * @param yyscanner The scanner object.
2810 * @return the allocated buffer state.
2811 */
2812 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner)
2813{
2814 YY_BUFFER_STATE b;
2815
2816 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2817 if ( ! b )
2818 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2819
2820 b->yy_buf_size = size;
2821
2822 /* yy_ch_buf has to be 2 characters longer than the size given because
2823 * we need to put in 2 end-of-buffer characters.
2824 */
2825 b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner );
2826 if ( ! b->yy_ch_buf )
2827 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2828
2829 b->yy_is_our_buffer = 1;
2830
2831 _mesa_glsl__init_buffer(b,file ,yyscanner);
2832
2833 return b;
2834}
2835
2836/** Destroy the buffer.
2837 * @param b a buffer created with _mesa_glsl__create_buffer()
2838 * @param yyscanner The scanner object.
2839 */
2840 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2841{
2842 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2843
2844 if ( ! b )
2845 return;
2846
2847 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2848 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2849
2850 if ( b->yy_is_our_buffer )
2851 _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner );
2852
2853 _mesa_glsl_free((void *) b ,yyscanner );
2854}
2855
2856/* Initializes or reinitializes a buffer.
2857 * This function is sometimes called more than once on the same buffer,
2858 * such as during a _mesa_glsl_restart() or at EOF.
2859 */
2860 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2861
2862{
2863 int oerrno = errno;
2864 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2865
2866 _mesa_glsl__flush_buffer(b ,yyscanner);
2867
2868 b->yy_input_file = file;
2869 b->yy_fill_buffer = 1;
2870
2871 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
2872 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
2873 * In that case, we don't want to reset the lineno or column.
2874 */
2875 if (b != YY_CURRENT_BUFFER){
2876 b->yy_bs_lineno = 1;
2877 b->yy_bs_column = 0;
2878 }
2879
2880 b->yy_is_interactive = 0;
2881
2882 errno = oerrno;
2883}
2884
2885/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2886 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2887 * @param yyscanner The scanner object.
2888 */
2889 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2890{
2891 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2892 if ( ! b )
2893 return;
2894
2895 b->yy_n_chars = 0;
2896
2897 /* We always need two end-of-buffer characters. The first causes
2898 * a transition to the end-of-buffer state. The second causes
2899 * a jam in that state.
2900 */
2901 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2902 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2903
2904 b->yy_buf_pos = &b->yy_ch_buf[0];
2905
2906 b->yy_at_bol = 1;
2907 b->yy_buffer_status = YY_BUFFER_NEW;
2908
2909 if ( b == YY_CURRENT_BUFFER )
2910 _mesa_glsl__load_buffer_state(yyscanner );
2911}
2912
2913/** Pushes the new state onto the stack. The new state becomes
2914 * the current state. This function will allocate the stack
2915 * if necessary.
2916 * @param new_buffer The new state.
2917 * @param yyscanner The scanner object.
2918 */
2919void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2920{
2921 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2922 if (new_buffer == NULL)
2923 return;
2924
2925 _mesa_glsl_ensure_buffer_stack(yyscanner);
2926
2927 /* This block is copied from _mesa_glsl__switch_to_buffer. */
2928 if ( YY_CURRENT_BUFFER )
2929 {
2930 /* Flush out information for old buffer. */
2931 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2932 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2933 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2934 }
2935
2936 /* Only push if top exists. Otherwise, replace top. */
2937 if (YY_CURRENT_BUFFER)
2938 yyg->yy_buffer_stack_top++;
2939 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2940
2941 /* copied from _mesa_glsl__switch_to_buffer. */
2942 _mesa_glsl__load_buffer_state(yyscanner );
2943 yyg->yy_did_buffer_switch_on_eof = 1;
2944}
2945
2946/** Removes and deletes the top of the stack, if present.
2947 * The next element becomes the new top.
2948 * @param yyscanner The scanner object.
2949 */
2950void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner)
2951{
2952 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2953 if (!YY_CURRENT_BUFFER)
2954 return;
2955
2956 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2957 YY_CURRENT_BUFFER_LVALUE = NULL;
2958 if (yyg->yy_buffer_stack_top > 0)
2959 --yyg->yy_buffer_stack_top;
2960
2961 if (YY_CURRENT_BUFFER) {
2962 _mesa_glsl__load_buffer_state(yyscanner );
2963 yyg->yy_did_buffer_switch_on_eof = 1;
2964 }
2965}
2966
2967/* Allocates the stack if it does not exist.
2968 * Guarantees space for at least one push.
2969 */
2970static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner)
2971{
2972 int num_to_alloc;
2973 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2974
2975 if (!yyg->yy_buffer_stack) {
2976
2977 /* First allocation is just for 2 elements, since we don't know if this
2978 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2979 * immediate realloc on the next call.
2980 */
2981 num_to_alloc = 1;
2982 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc
2983 (num_to_alloc * sizeof(struct yy_buffer_state*)
2984 , yyscanner);
2985 if ( ! yyg->yy_buffer_stack )
2986 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
2987
2988 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2989
2990 yyg->yy_buffer_stack_max = num_to_alloc;
2991 yyg->yy_buffer_stack_top = 0;
2992 return;
2993 }
2994
2995 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2996
2997 /* Increase the buffer to prepare for a possible push. */
2998 int grow_size = 8 /* arbitrary grow size */;
2999
3000 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3001 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc
3002 (yyg->yy_buffer_stack,
3003 num_to_alloc * sizeof(struct yy_buffer_state*)
3004 , yyscanner);
3005 if ( ! yyg->yy_buffer_stack )
3006 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3007
3008 /* zero only the new slots.*/
3009 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3010 yyg->yy_buffer_stack_max = num_to_alloc;
3011 }
3012}
3013
3014/** Setup the input buffer state to scan directly from a user-specified character buffer.
3015 * @param base the character buffer
3016 * @param size the size in bytes of the character buffer
3017 * @param yyscanner The scanner object.
3018 * @return the newly allocated buffer state object.
3019 */
3020YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3021{
3022 YY_BUFFER_STATE b;
3023
3024 if ( size < 2 ||
3025 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3026 base[size-1] != YY_END_OF_BUFFER_CHAR )
3027 /* They forgot to leave room for the EOB's. */
3028 return 0;
3029
3030 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3031 if ( ! b )
3032 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3033
3034 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3035 b->yy_buf_pos = b->yy_ch_buf = base;
3036 b->yy_is_our_buffer = 0;
3037 b->yy_input_file = 0;
3038 b->yy_n_chars = b->yy_buf_size;
3039 b->yy_is_interactive = 0;
3040 b->yy_at_bol = 1;
3041 b->yy_fill_buffer = 0;
3042 b->yy_buffer_status = YY_BUFFER_NEW;
3043
3044 _mesa_glsl__switch_to_buffer(b ,yyscanner );
3045
3046 return b;
3047}
3048
3049/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3050 * scan from a @e copy of @a str.
3051 * @param yystr a NUL-terminated string to scan
3052 * @param yyscanner The scanner object.
3053 * @return the newly allocated buffer state object.
3054 * @note If you want to scan bytes that may contain NUL values, then use
3055 * _mesa_glsl__scan_bytes() instead.
3056 */
3057YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner)
3058{
3059
3060 return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner);
3061}
3062
3063/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3064 * scan from a @e copy of @a bytes.
Kenneth Graunkec5e74872010-09-05 01:32:32 -07003065 * @param bytes the byte buffer to scan
3066 * @param len the number of bytes in the buffer pointed to by @a bytes.
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003067 * @param yyscanner The scanner object.
3068 * @return the newly allocated buffer state object.
3069 */
3070YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3071{
3072 YY_BUFFER_STATE b;
3073 char *buf;
3074 yy_size_t n;
3075 int i;
3076
3077 /* Get memory for full buffer, including space for trailing EOB's. */
3078 n = _yybytes_len + 2;
3079 buf = (char *) _mesa_glsl_alloc(n ,yyscanner );
3080 if ( ! buf )
3081 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3082
3083 for ( i = 0; i < _yybytes_len; ++i )
3084 buf[i] = yybytes[i];
3085
3086 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3087
3088 b = _mesa_glsl__scan_buffer(buf,n ,yyscanner);
3089 if ( ! b )
3090 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3091
3092 /* It's okay to grow etc. this buffer, and we should throw it
3093 * away when we're done.
3094 */
3095 b->yy_is_our_buffer = 1;
3096
3097 return b;
3098}
3099
3100#ifndef YY_EXIT_FAILURE
3101#define YY_EXIT_FAILURE 2
3102#endif
3103
3104static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3105{
3106 (void) fprintf( stderr, "%s\n", msg );
3107 exit( YY_EXIT_FAILURE );
3108}
3109
3110/* Redefine yyless() so it works in section 3 code. */
3111
3112#undef yyless
3113#define yyless(n) \
3114 do \
3115 { \
3116 /* Undo effects of setting up yytext. */ \
3117 int yyless_macro_arg = (n); \
3118 YY_LESS_LINENO(yyless_macro_arg);\
3119 yytext[yyleng] = yyg->yy_hold_char; \
3120 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3121 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3122 *yyg->yy_c_buf_p = '\0'; \
3123 yyleng = yyless_macro_arg; \
3124 } \
3125 while ( 0 )
3126
3127/* Accessor methods (get/set functions) to struct members. */
3128
3129/** Get the user-defined data for this scanner.
3130 * @param yyscanner The scanner object.
3131 */
3132YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner)
3133{
3134 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3135 return yyextra;
3136}
3137
3138/** Get the current line number.
3139 * @param yyscanner The scanner object.
3140 */
3141int _mesa_glsl_get_lineno (yyscan_t yyscanner)
3142{
3143 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3144
3145 if (! YY_CURRENT_BUFFER)
3146 return 0;
3147
3148 return yylineno;
3149}
3150
3151/** Get the current column number.
3152 * @param yyscanner The scanner object.
3153 */
3154int _mesa_glsl_get_column (yyscan_t yyscanner)
3155{
3156 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3157
3158 if (! YY_CURRENT_BUFFER)
3159 return 0;
3160
3161 return yycolumn;
3162}
3163
3164/** Get the input stream.
3165 * @param yyscanner The scanner object.
3166 */
3167FILE *_mesa_glsl_get_in (yyscan_t yyscanner)
3168{
3169 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3170 return yyin;
3171}
3172
3173/** Get the output stream.
3174 * @param yyscanner The scanner object.
3175 */
3176FILE *_mesa_glsl_get_out (yyscan_t yyscanner)
3177{
3178 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3179 return yyout;
3180}
3181
3182/** Get the length of the current token.
3183 * @param yyscanner The scanner object.
3184 */
3185int _mesa_glsl_get_leng (yyscan_t yyscanner)
3186{
3187 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3188 return yyleng;
3189}
3190
3191/** Get the current token.
3192 * @param yyscanner The scanner object.
3193 */
3194
3195char *_mesa_glsl_get_text (yyscan_t yyscanner)
3196{
3197 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3198 return yytext;
3199}
3200
3201/** Set the user-defined data. This data is never touched by the scanner.
3202 * @param user_defined The data to be associated with this scanner.
3203 * @param yyscanner The scanner object.
3204 */
3205void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3206{
3207 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3208 yyextra = user_defined ;
3209}
3210
3211/** Set the current line number.
3212 * @param line_number
3213 * @param yyscanner The scanner object.
3214 */
3215void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner)
3216{
3217 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3218
3219 /* lineno is only valid if an input buffer exists. */
3220 if (! YY_CURRENT_BUFFER )
3221 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner);
3222
3223 yylineno = line_number;
3224}
3225
3226/** Set the current column.
3227 * @param line_number
3228 * @param yyscanner The scanner object.
3229 */
3230void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner)
3231{
3232 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3233
3234 /* column is only valid if an input buffer exists. */
3235 if (! YY_CURRENT_BUFFER )
3236 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner);
3237
3238 yycolumn = column_no;
3239}
3240
3241/** Set the input stream. This does not discard the current
3242 * input buffer.
3243 * @param in_str A readable stream.
3244 * @param yyscanner The scanner object.
3245 * @see _mesa_glsl__switch_to_buffer
3246 */
3247void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner)
3248{
3249 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3250 yyin = in_str ;
3251}
3252
3253void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner)
3254{
3255 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3256 yyout = out_str ;
3257}
3258
3259int _mesa_glsl_get_debug (yyscan_t yyscanner)
3260{
3261 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3262 return yy_flex_debug;
3263}
3264
3265void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner)
3266{
3267 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3268 yy_flex_debug = bdebug ;
3269}
3270
3271/* Accessor methods for yylval and yylloc */
3272
3273YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner)
3274{
3275 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3276 return yylval;
3277}
3278
3279void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3280{
3281 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3282 yylval = yylval_param;
3283}
3284
3285YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner)
3286{
3287 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3288 return yylloc;
3289}
3290
3291void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3292{
3293 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3294 yylloc = yylloc_param;
3295}
3296
3297/* User-visible API */
3298
3299/* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3300 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3301 * That's why we explicitly handle the declaration, instead of using our macros.
3302 */
3303
3304int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals)
3305
3306{
3307 if (ptr_yy_globals == NULL){
3308 errno = EINVAL;
3309 return 1;
3310 }
3311
3312 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL );
3313
3314 if (*ptr_yy_globals == NULL){
3315 errno = ENOMEM;
3316 return 1;
3317 }
3318
3319 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3320 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3321
3322 return yy_init_globals ( *ptr_yy_globals );
3323}
3324
3325/* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3326 * convention of taking the scanner as the last argument. Note however, that
3327 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3328 * is the reason, too, why this function also must handle its own declaration).
3329 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3330 * the yyextra field.
3331 */
3332
3333int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3334
3335{
3336 struct yyguts_t dummy_yyguts;
3337
3338 _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts);
3339
3340 if (ptr_yy_globals == NULL){
3341 errno = EINVAL;
3342 return 1;
3343 }
3344
3345 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3346
3347 if (*ptr_yy_globals == NULL){
3348 errno = ENOMEM;
3349 return 1;
3350 }
3351
3352 /* By setting to 0xAA, we expose bugs in
3353 yy_init_globals. Leave at 0x00 for releases. */
3354 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3355
3356 _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals);
3357
3358 return yy_init_globals ( *ptr_yy_globals );
3359}
3360
3361static int yy_init_globals (yyscan_t yyscanner)
3362{
3363 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3364 /* Initialization is the same as for the non-reentrant scanner.
3365 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3366 */
3367
3368 yyg->yy_buffer_stack = 0;
3369 yyg->yy_buffer_stack_top = 0;
3370 yyg->yy_buffer_stack_max = 0;
3371 yyg->yy_c_buf_p = (char *) 0;
3372 yyg->yy_init = 0;
3373 yyg->yy_start = 0;
3374
3375 yyg->yy_start_stack_ptr = 0;
3376 yyg->yy_start_stack_depth = 0;
3377 yyg->yy_start_stack = NULL;
3378
3379/* Defined in main.c */
3380#ifdef YY_STDINIT
3381 yyin = stdin;
3382 yyout = stdout;
3383#else
3384 yyin = (FILE *) 0;
3385 yyout = (FILE *) 0;
3386#endif
3387
3388 /* For future reference: Set errno on error, since we are called by
3389 * _mesa_glsl_lex_init()
3390 */
3391 return 0;
3392}
3393
3394/* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3395int _mesa_glsl_lex_destroy (yyscan_t yyscanner)
3396{
3397 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3398
3399 /* Pop the buffer stack, destroying each element. */
3400 while(YY_CURRENT_BUFFER){
3401 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3402 YY_CURRENT_BUFFER_LVALUE = NULL;
3403 _mesa_glsl_pop_buffer_state(yyscanner);
3404 }
3405
3406 /* Destroy the stack itself. */
3407 _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner);
3408 yyg->yy_buffer_stack = NULL;
3409
3410 /* Destroy the start condition stack. */
3411 _mesa_glsl_free(yyg->yy_start_stack ,yyscanner );
3412 yyg->yy_start_stack = NULL;
3413
3414 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3415 * _mesa_glsl_lex() is called, initialization will occur. */
3416 yy_init_globals( yyscanner);
3417
3418 /* Destroy the main struct (reentrant only). */
3419 _mesa_glsl_free ( yyscanner , yyscanner );
3420 yyscanner = NULL;
3421 return 0;
3422}
3423
3424/*
3425 * Internal utility routines.
3426 */
3427
3428#ifndef yytext_ptr
3429static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3430{
3431 register int i;
3432 for ( i = 0; i < n; ++i )
3433 s1[i] = s2[i];
3434}
3435#endif
3436
3437#ifdef YY_NEED_STRLEN
3438static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3439{
3440 register int n;
3441 for ( n = 0; s[n]; ++n )
3442 ;
3443
3444 return n;
3445}
3446#endif
3447
3448void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner)
3449{
3450 return (void *) malloc( size );
3451}
3452
3453void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3454{
3455 /* The cast to (char *) in the following accommodates both
3456 * implementations that use char* generic pointers, and those
3457 * that use void* generic pointers. It works with the latter
3458 * because both ANSI C and C++ allow castless assignment from
3459 * any pointer type to void*, and deal with argument conversions
3460 * as though doing an assignment.
3461 */
3462 return (void *) realloc( (char *) ptr, size );
3463}
3464
3465void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
3466{
3467 free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */
3468}
3469
3470#define YYTABLES_NAME "yytables"
3471
Kenneth Graunkec5e74872010-09-05 01:32:32 -07003472#line 386 "glsl_lexer.lpp"
Carl Worthe8a8f0f2010-07-28 12:27:33 -07003473
3474
3475
3476void
3477_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
3478{
3479 _mesa_glsl_lex_init_extra(state,& state->scanner);
3480 _mesa_glsl__scan_string(string,state->scanner);
3481}
3482
3483void
3484_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
3485{
3486 _mesa_glsl_lex_destroy(state->scanner);
3487}
3488