revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / glsl / glsl_lexer.cpp
blob3982dba2656ab65747f13a379770cc1fc98b9e39
1 #line 2 "glsl_lexer.cpp"
3 #line 4 "glsl_lexer.cpp"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
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
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
25 /* end standard C headers. */
27 /* flex integer type definitions */
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
41 #endif
43 #include <inttypes.h>
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
50 #else
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
57 #endif /* ! C99 */
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
88 #endif /* ! FLEXINT_H */
90 #ifdef __cplusplus
92 /* The "const" storage-class-modifier is valid. */
93 #define YY_USE_CONST
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
100 #define YY_USE_CONST
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
105 #ifdef YY_USE_CONST
106 #define yyconst const
107 #else
108 #define yyconst
109 #endif
111 /* Returned upon end-of-file. */
112 #define YY_NULL 0
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.
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121 /* An opaque pointer. */
122 #ifndef YY_TYPEDEF_YY_SCANNER_T
123 #define YY_TYPEDEF_YY_SCANNER_T
124 typedef void* yyscan_t;
125 #endif
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
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.
142 #define BEGIN yyg->yy_start = 1 + 2 *
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.
148 #define YY_START ((yyg->yy_start - 1) / 2)
149 #define YYSTATE YY_START
151 /* Action number for EOF rule of a given start state. */
152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154 /* Special action meaning "start processing a new file". */
155 #define YY_NEW_FILE _mesa_glsl_restart(yyin ,yyscanner )
157 #define YY_END_OF_BUFFER_CHAR 0
159 /* Size of default input buffer. */
160 #ifndef YY_BUF_SIZE
161 #define YY_BUF_SIZE 16384
162 #endif
164 /* The state buf must be large enough to hold one state per character in the main buffer.
166 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
169 #define YY_TYPEDEF_YY_BUFFER_STATE
170 typedef struct yy_buffer_state *YY_BUFFER_STATE;
171 #endif
173 #define EOB_ACT_CONTINUE_SCAN 0
174 #define EOB_ACT_END_OF_FILE 1
175 #define EOB_ACT_LAST_MATCH 2
177 #define YY_LESS_LINENO(n)
179 /* Return all but the first "n" matched characters back to the input stream. */
180 #define yyless(n) \
181 do \
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 */ \
191 while ( 0 )
193 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
195 #ifndef YY_TYPEDEF_YY_SIZE_T
196 #define YY_TYPEDEF_YY_SIZE_T
197 typedef size_t yy_size_t;
198 #endif
200 #ifndef YY_STRUCT_YY_BUFFER_STATE
201 #define YY_STRUCT_YY_BUFFER_STATE
202 struct yy_buffer_state
204 FILE *yy_input_file;
206 char *yy_ch_buf; /* input buffer */
207 char *yy_buf_pos; /* current position in input buffer */
209 /* Size of input buffer in bytes, not including room for EOB
210 * characters.
212 yy_size_t yy_buf_size;
214 /* Number of characters read into yy_ch_buf, not including EOB
215 * characters.
217 int yy_n_chars;
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.
223 int yy_is_our_buffer;
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.
230 int yy_is_interactive;
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.
236 int yy_at_bol;
238 int yy_bs_lineno; /**< The line count. */
239 int yy_bs_column; /**< The column count. */
241 /* Whether to try to fill the input buffer when we reach the
242 * end of it.
244 int yy_fill_buffer;
246 int yy_buffer_status;
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.
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.
260 #define YY_BUFFER_EOF_PENDING 2
263 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
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".
269 * Returns the top of the stack, or NULL.
271 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
272 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
273 : NULL)
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.
278 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
280 void _mesa_glsl_restart (FILE *input_file ,yyscan_t yyscanner );
281 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
282 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
283 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
284 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
285 void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
286 void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner );
288 static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner );
289 static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner );
290 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
292 #define YY_FLUSH_BUFFER _mesa_glsl__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
294 YY_BUFFER_STATE _mesa_glsl__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
295 YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
296 YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
298 void *_mesa_glsl_alloc (yy_size_t ,yyscan_t yyscanner );
299 void *_mesa_glsl_realloc (void *,yy_size_t ,yyscan_t yyscanner );
300 void _mesa_glsl_free (void * ,yyscan_t yyscanner );
302 #define yy_new_buffer _mesa_glsl__create_buffer
304 #define yy_set_interactive(is_interactive) \
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); \
311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
314 #define yy_set_bol(at_bol) \
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); \
321 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
324 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
326 /* Begin user sect3 */
328 #define _mesa_glsl_wrap(n) 1
329 #define YY_SKIP_YYWRAP
331 typedef unsigned char YY_CHAR;
333 typedef int yy_state_type;
335 #define yytext_ptr yytext_r
337 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
338 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
339 static int yy_get_next_buffer (yyscan_t yyscanner );
340 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
342 /* Done after the current pattern has been matched and before the
343 * corresponding action - sets up yytext.
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;
352 #define YY_NUM_RULES 210
353 #define YY_END_OF_BUFFER 211
354 /* This struct is not used in this scanner,
355 but its presence is necessary. */
356 struct yy_trans_info
358 flex_int32_t yy_verify;
359 flex_int32_t yy_nxt;
361 static yyconst flex_int16_t yy_accept[836] =
362 { 0,
363 0, 0, 16, 16, 0, 0, 211, 209, 1, 21,
364 209, 209, 209, 209, 209, 209, 209, 209, 120, 118,
365 209, 209, 209, 208, 209, 208, 208, 208, 208, 208,
366 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
367 208, 208, 208, 208, 208, 209, 1, 209, 210, 16,
368 20, 210, 19, 17, 18, 14, 13, 1, 102, 111,
369 103, 114, 108, 97, 110, 98, 117, 122, 109, 123,
370 120, 0, 0, 125, 120, 0, 118, 118, 106, 99,
371 101, 100, 107, 208, 115, 105, 208, 208, 208, 208,
372 208, 208, 208, 208, 208, 208, 208, 208, 30, 208,
374 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
375 208, 208, 34, 208, 208, 61, 208, 208, 208, 208,
376 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
377 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
378 208, 208, 208, 208, 208, 208, 208, 208, 208, 116,
379 104, 1, 0, 0, 2, 0, 0, 0, 0, 16,
380 15, 19, 18, 0, 122, 121, 0, 123, 0, 124,
381 119, 112, 113, 208, 128, 208, 208, 208, 208, 208,
382 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
383 208, 208, 208, 208, 208, 208, 33, 208, 208, 208,
385 208, 208, 208, 208, 208, 208, 208, 26, 208, 208,
386 208, 208, 208, 208, 208, 208, 208, 208, 208, 62,
387 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
388 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
389 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
390 0, 0, 0, 0, 15, 0, 122, 0, 121, 0,
391 123, 124, 119, 208, 208, 24, 208, 208, 175, 168,
392 208, 208, 208, 208, 208, 208, 208, 208, 208, 32,
393 131, 208, 208, 208, 208, 68, 208, 208, 136, 150,
394 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
396 208, 208, 147, 171, 49, 50, 51, 208, 208, 208,
397 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
398 208, 208, 208, 208, 208, 208, 208, 134, 126, 208,
399 208, 27, 208, 208, 208, 208, 208, 208, 208, 46,
400 47, 48, 95, 208, 208, 0, 0, 0, 0, 0,
401 121, 208, 208, 28, 37, 38, 39, 208, 129, 208,
402 23, 208, 208, 208, 208, 158, 159, 160, 208, 127,
403 208, 151, 25, 161, 162, 163, 173, 155, 156, 157,
404 208, 208, 208, 63, 153, 208, 208, 208, 40, 41,
405 42, 208, 208, 208, 208, 208, 208, 208, 208, 208,
407 208, 208, 208, 208, 208, 208, 208, 148, 208, 208,
408 208, 208, 208, 208, 208, 208, 208, 208, 130, 208,
409 208, 170, 43, 44, 45, 208, 208, 31, 0, 0,
410 0, 0, 178, 208, 208, 176, 208, 208, 208, 149,
411 144, 181, 208, 208, 208, 208, 208, 208, 139, 208,
412 208, 208, 96, 52, 53, 54, 55, 56, 57, 58,
413 59, 60, 208, 208, 208, 208, 154, 135, 208, 208,
414 142, 36, 208, 208, 167, 69, 143, 94, 179, 137,
415 208, 208, 208, 208, 208, 208, 208, 208, 0, 0,
416 0, 0, 208, 208, 208, 138, 35, 208, 208, 208,
418 208, 208, 208, 182, 183, 184, 208, 208, 208, 208,
419 208, 172, 208, 208, 208, 208, 208, 208, 208, 208,
420 132, 208, 208, 208, 208, 208, 64, 208, 208, 65,
421 208, 0, 0, 0, 0, 0, 208, 66, 29, 145,
422 186, 187, 188, 208, 208, 208, 208, 208, 208, 208,
423 208, 208, 208, 208, 208, 140, 208, 208, 208, 208,
424 208, 208, 208, 208, 208, 133, 190, 191, 192, 208,
425 208, 152, 208, 141, 0, 0, 6, 0, 0, 0,
426 12, 3, 22, 208, 208, 208, 208, 208, 208, 208,
427 208, 208, 185, 146, 67, 208, 208, 208, 208, 169,
429 208, 177, 174, 207, 71, 72, 73, 208, 208, 208,
430 208, 208, 208, 208, 208, 208, 208, 0, 0, 0,
431 0, 0, 0, 0, 208, 208, 208, 189, 208, 208,
432 208, 208, 208, 82, 83, 84, 208, 208, 208, 208,
433 208, 208, 208, 208, 208, 208, 208, 208, 208, 193,
434 88, 89, 90, 208, 4, 0, 5, 0, 0, 0,
435 0, 0, 0, 208, 208, 208, 208, 208, 208, 208,
436 204, 208, 208, 208, 208, 208, 208, 208, 208, 208,
437 208, 208, 74, 208, 208, 208, 208, 208, 208, 0,
438 0, 0, 0, 208, 208, 205, 194, 208, 195, 208,
440 208, 208, 85, 208, 208, 208, 208, 208, 208, 208,
441 208, 208, 208, 208, 206, 208, 208, 91, 0, 0,
442 0, 196, 197, 208, 200, 208, 201, 208, 208, 70,
443 208, 208, 208, 164, 208, 165, 180, 208, 198, 199,
444 208, 208, 0, 0, 0, 208, 208, 208, 208, 75,
445 208, 76, 208, 208, 208, 208, 208, 0, 0, 0,
446 0, 208, 208, 86, 87, 208, 77, 208, 208, 78,
447 208, 92, 93, 0, 0, 0, 0, 208, 208, 208,
448 208, 208, 208, 0, 0, 0, 0, 208, 208, 208,
449 208, 208, 79, 0, 0, 0, 7, 0, 0, 202,
451 203, 208, 208, 208, 0, 0, 8, 0, 0, 208,
452 208, 166, 0, 0, 0, 80, 81, 0, 0, 0,
453 9, 0, 0, 10, 0, 0, 0, 0, 0, 0,
454 0, 0, 0, 11, 0
457 static yyconst flex_int32_t yy_ec[256] =
458 { 0,
459 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
460 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
461 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
463 10, 11, 12, 1, 13, 14, 15, 16, 17, 18,
464 19, 20, 21, 21, 21, 22, 22, 23, 1, 24,
465 25, 26, 1, 1, 27, 28, 29, 30, 31, 32,
466 33, 34, 34, 34, 34, 35, 34, 34, 34, 34,
467 34, 36, 37, 38, 39, 34, 34, 40, 34, 34,
468 1, 1, 1, 41, 42, 1, 43, 44, 45, 46,
470 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
471 57, 58, 34, 59, 60, 61, 62, 63, 64, 65,
472 66, 67, 1, 68, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
486 1, 1, 1, 1, 1
489 static yyconst flex_int32_t yy_meta[69] =
490 { 0,
491 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
492 1, 1, 1, 1, 1, 3, 3, 3, 3, 3,
493 3, 3, 1, 1, 1, 1, 4, 4, 4, 4,
494 3, 3, 5, 5, 5, 5, 5, 5, 5, 5,
495 1, 5, 4, 4, 4, 4, 3, 3, 5, 5,
496 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
497 5, 5, 5, 5, 5, 5, 5, 1
500 static yyconst flex_int16_t yy_base[845] =
501 { 0,
502 0, 67, 73, 0, 1210, 1209, 1211, 1214, 68, 1214,
503 1185, 1184, 134, 1183, 131, 132, 130, 1182, 146, 198,
504 129, 1181, 144, 0, 130, 113, 124, 141, 150, 126,
505 181, 1148, 159, 192, 118, 129, 146, 1142, 147, 174,
506 206, 192, 203, 222, 1153, 203, 221, 231, 1214, 260,
507 1214, 1187, 279, 1214, 0, 1214, 1214, 270, 1214, 1214,
508 1214, 1214, 1214, 1214, 1214, 1214, 1214, 244, 1214, 255,
509 139, 290, 307, 1214, 1214, 0, 0, 1214, 1176, 1214,
510 1214, 1214, 1175, 0, 1214, 1214, 1138, 1143, 1136, 1139,
511 1148, 1147, 1133, 1136, 1148, 144, 1142, 1129, 1126, 1140,
513 1126, 1123, 1123, 1129, 219, 193, 1123, 1134, 1119, 1125,
514 1129, 1130, 0, 1121, 1132, 278, 1131, 1126, 1106, 224,
515 1110, 1124, 1114, 232, 1107, 271, 1120, 1122, 1104, 1100,
516 1108, 1105, 1094, 1103, 234, 1101, 1107, 1102, 1105, 1093,
517 1096, 226, 145, 262, 1106, 1093, 1106, 263, 1099, 1214,
518 1214, 338, 331, 343, 1214, 1084, 1097, 1088, 1099, 345,
519 0, 334, 0, 345, 1214, 328, 391, 1214, 352, 398,
520 338, 1214, 1214, 1094, 0, 1085, 1089, 1099, 1096, 332,
521 1079, 1079, 1083, 320, 1094, 1091, 1091, 1089, 1086, 1077,
522 1084, 1070, 1068, 1081, 1066, 1083, 0, 1080, 1067, 1075,
524 1072, 1076, 1077, 1070, 1067, 1055, 1054, 1068, 1071, 1058,
525 1067, 1054, 1061, 1051, 364, 1057, 1060, 1050, 1058, 1046,
526 1050, 1041, 1056, 1046, 1037, 1056, 1039, 1037, 1048, 1037,
527 1032, 1030, 1044, 1029, 1031, 1028, 1040, 1039, 1042, 1023,
528 338, 1032, 1027, 1025, 1035, 1013, 403, 1032, 1034, 1022,
529 1014, 1018, 1030, 1013, 0, 415, 422, 439, 1214, 446,
530 455, 1214, 1214, 1008, 1019, 0, 1016, 406, 0, 0,
531 1009, 1007, 1009, 1004, 1013, 1001, 1019, 1007, 409, 0,
532 0, 1001, 1012, 1011, 1011, 0, 995, 429, 0, 0,
533 997, 460, 1005, 1006, 996, 990, 989, 990, 989, 989,
535 463, 984, 0, 0, 980, 979, 978, 980, 981, 986,
536 980, 976, 990, 985, 984, 983, 974, 977, 977, 969,
537 972, 967, 976, 981, 966, 979, 969, 0, 0, 976,
538 972, 0, 963, 963, 969, 959, 967, 466, 964, 0,
539 0, 0, 0, 953, 966, 965, 964, 961, 949, 472,
540 479, 961, 963, 0, 0, 0, 0, 949, 0, 949,
541 0, 948, 949, 943, 954, 0, 0, 0, 944, 0,
542 940, 0, 0, 0, 0, 0, 0, 0, 0, 0,
543 951, 487, 950, 0, 0, 948, 944, 940, 0, 0,
544 0, 932, 489, 494, 499, 937, 933, 939, 929, 927,
546 941, 925, 925, 939, 927, 939, 934, 0, 932, 929,
547 933, 916, 918, 925, 931, 926, 925, 912, 0, 914,
548 915, 0, 0, 0, 0, 912, 916, 0, 910, 963,
549 909, 912, 0, 900, 910, 0, 898, 898, 912, 0,
550 914, 0, 503, 926, 925, 924, 891, 890, 0, 908,
551 907, 902, 0, 0, 0, 0, 0, 0, 0, 0,
552 0, 0, 890, 904, 890, 887, 0, 0, 893, 892,
553 0, 0, 890, 882, 0, 0, 0, 0, 0, 0,
554 879, 891, 506, 883, 890, 889, 886, 880, 873, 524,
555 889, 874, 869, 883, 881, 0, 0, 873, 896, 895,
557 894, 861, 860, 361, 365, 0, 873, 876, 874, 862,
558 858, 0, 871, 868, 867, 856, 855, 854, 519, 863,
559 0, 879, 878, 877, 844, 843, 0, 858, 844, 0,
560 855, 850, 547, 553, 898, 843, 851, 0, 0, 0,
561 870, 869, 0, 847, 850, 834, 842, 832, 840, 841,
562 841, 840, 825, 559, 838, 0, 839, 827, 826, 822,
563 850, 849, 848, 815, 814, 0, 848, 847, 0, 825,
564 828, 0, 562, 0, 814, 580, 1214, 587, 0, 607,
565 584, 1214, 0, 811, 810, 820, 820, 807, 822, 805,
566 820, 815, 0, 0, 0, 831, 830, 829, 796, 0,
568 796, 0, 0, 0, 502, 524, 820, 807, 810, 794,
569 793, 803, 803, 819, 818, 817, 784, 789, 615, 640,
570 550, 806, 796, 784, 782, 781, 792, 0, 795, 791,
571 793, 789, 775, 806, 805, 0, 787, 779, 770, 778,
572 768, 779, 775, 777, 775, 775, 762, 761, 772, 0,
573 791, 790, 0, 772, 1214, 555, 1214, 647, 0, 667,
574 785, 770, 752, 769, 768, 751, 743, 751, 741, 749,
575 0, 746, 745, 756, 739, 742, 757, 740, 753, 754,
576 751, 748, 757, 750, 749, 732, 731, 730, 741, 582,
577 754, 724, 734, 718, 717, 0, 745, 717, 743, 715,
579 719, 718, 0, 729, 732, 728, 730, 711, 725, 709,
580 710, 718, 701, 700, 0, 706, 705, 0, 728, 713,
581 706, 0, 0, 710, 0, 709, 0, 715, 714, 0,
582 690, 698, 688, 716, 695, 0, 0, 708, 0, 0,
583 707, 706, 746, 611, 696, 703, 702, 678, 677, 705,
584 677, 703, 689, 674, 691, 670, 669, 190, 613, 557,
585 667, 687, 686, 0, 0, 681, 0, 680, 686, 0,
586 671, 0, 0, 671, 590, 343, 672, 645, 644, 654,
587 635, 631, 612, 612, 604, 443, 635, 576, 575, 549,
588 25, 87, 0, 183, 500, 552, 1214, 636, 591, 0,
590 0, 196, 258, 254, 272, 609, 1214, 614, 598, 279,
591 284, 0, 336, 348, 671, 0, 0, 362, 672, 688,
592 1214, 394, 689, 1214, 408, 670, 691, 649, 651, 474,
593 476, 693, 694, 1214, 1214, 704, 707, 710, 530, 591,
594 713, 717, 720, 722
597 static yyconst flex_int16_t yy_def[845] =
598 { 0,
599 835, 1, 835, 3, 836, 836, 835, 835, 835, 835,
600 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
601 835, 835, 835, 837, 835, 837, 837, 837, 837, 837,
602 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
603 837, 837, 837, 837, 837, 835, 835, 835, 835, 835,
604 835, 835, 835, 835, 838, 835, 835, 835, 835, 835,
605 835, 835, 835, 835, 835, 835, 835, 839, 835, 840,
606 19, 835, 835, 835, 835, 841, 20, 835, 835, 835,
607 835, 835, 835, 837, 835, 835, 837, 837, 837, 837,
608 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
610 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
611 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
612 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
613 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
614 837, 837, 837, 837, 837, 837, 837, 837, 837, 835,
615 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
616 842, 835, 838, 835, 835, 840, 835, 835, 835, 835,
617 841, 835, 835, 837, 837, 837, 837, 837, 837, 837,
618 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
619 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
621 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
622 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
623 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
624 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
625 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
626 835, 835, 835, 835, 842, 835, 835, 835, 835, 835,
627 835, 835, 835, 837, 837, 837, 837, 837, 837, 837,
628 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
629 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
630 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
632 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
633 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
634 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
635 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
636 837, 837, 837, 837, 837, 835, 835, 835, 835, 835,
637 835, 837, 837, 837, 837, 837, 837, 837, 837, 837,
638 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
639 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
640 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
641 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
643 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
644 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
645 837, 837, 837, 837, 837, 837, 837, 837, 835, 835,
646 835, 835, 837, 837, 837, 837, 837, 837, 837, 837,
647 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
648 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
649 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
650 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
651 837, 837, 837, 837, 837, 837, 837, 837, 835, 835,
652 835, 835, 837, 837, 837, 837, 837, 837, 837, 837,
654 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
655 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
656 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
657 837, 835, 835, 835, 835, 835, 837, 837, 837, 837,
658 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
659 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
660 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
661 837, 837, 837, 837, 835, 835, 835, 835, 843, 835,
662 835, 835, 837, 837, 837, 837, 837, 837, 837, 837,
663 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
665 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
666 837, 837, 837, 837, 837, 837, 837, 835, 835, 835,
667 843, 835, 835, 835, 837, 837, 837, 837, 837, 837,
668 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
669 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
670 837, 837, 837, 837, 835, 835, 835, 835, 844, 835,
671 835, 835, 835, 837, 837, 837, 837, 837, 837, 837,
672 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
673 837, 837, 837, 837, 837, 837, 837, 837, 837, 844,
674 835, 835, 835, 837, 837, 837, 837, 837, 837, 837,
676 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
677 837, 837, 837, 837, 837, 837, 837, 837, 835, 835,
678 835, 837, 837, 837, 837, 837, 837, 837, 837, 837,
679 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
680 837, 837, 835, 835, 835, 837, 837, 837, 837, 837,
681 837, 837, 837, 837, 837, 837, 837, 835, 835, 835,
682 835, 837, 837, 837, 837, 837, 837, 837, 837, 837,
683 837, 837, 837, 835, 835, 835, 835, 837, 837, 837,
684 837, 837, 837, 835, 835, 835, 835, 837, 837, 837,
685 837, 837, 837, 835, 835, 835, 835, 835, 835, 837,
687 837, 837, 837, 837, 835, 835, 835, 835, 835, 837,
688 837, 837, 835, 835, 835, 837, 837, 835, 835, 835,
689 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
690 835, 835, 835, 835, 0, 835, 835, 835, 835, 835,
691 835, 835, 835, 835
694 static yyconst flex_int16_t yy_nxt[1283] =
695 { 0,
696 8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
697 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
698 20, 20, 8, 21, 22, 23, 24, 24, 24, 24,
699 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
700 25, 24, 26, 27, 28, 29, 30, 31, 32, 33,
701 34, 24, 24, 35, 36, 37, 38, 39, 40, 41,
702 42, 43, 44, 45, 24, 24, 24, 46, 47, 58,
703 803, 58, 48, 49, 50, 51, 50, 49, 49, 49,
704 49, 49, 49, 49, 49, 49, 49, 52, 49, 53,
705 53, 53, 53, 53, 53, 54, 49, 49, 49, 55,
707 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
708 55, 55, 55, 49, 55, 55, 55, 55, 55, 55,
709 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
710 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
711 49, 61, 64, 804, 66, 68, 68, 68, 68, 68,
712 68, 68, 79, 80, 85, 65, 67, 87, 62, 70,
713 119, 71, 71, 71, 71, 71, 71, 72, 82, 83,
714 86, 121, 88, 89, 120, 122, 73, 74, 835, 101,
715 90, 102, 91, 93, 75, 76, 92, 94, 123, 126,
716 103, 758, 73, 74, 95, 241, 97, 96, 183, 184,
718 98, 110, 124, 835, 242, 127, 99, 75, 128, 111,
719 76, 70, 100, 77, 77, 77, 77, 77, 77, 77,
720 129, 112, 152, 104, 58, 805, 153, 150, 73, 74,
721 130, 105, 154, 155, 106, 195, 78, 107, 138, 113,
722 774, 139, 114, 108, 73, 74, 115, 116, 131, 196,
723 140, 117, 810, 142, 118, 132, 133, 141, 143, 78,
724 134, 160, 144, 160, 146, 145, 135, 136, 147, 137,
725 151, 58, 193, 58, 164, 165, 231, 156, 148, 213,
726 239, 240, 218, 194, 157, 167, 168, 214, 158, 219,
727 164, 165, 232, 159, 162, 162, 162, 162, 162, 162,
729 162, 167, 168, 70, 243, 72, 72, 72, 72, 72,
730 72, 72, 244, 248, 811, 221, 249, 812, 169, 169,
731 73, 74, 170, 170, 170, 170, 170, 170, 170, 222,
732 813, 205, 154, 155, 206, 207, 73, 74, 208, 152,
733 209, 58, 816, 153, 154, 155, 160, 817, 160, 162,
734 162, 162, 162, 162, 162, 162, 256, 256, 258, 259,
735 257, 257, 257, 257, 257, 257, 257, 170, 170, 170,
736 170, 170, 170, 170, 258, 259, 263, 156, 269, 274,
737 275, 305, 306, 307, 157, 333, 818, 546, 158, 156,
738 785, 548, 270, 159, 334, 819, 157, 547, 786, 263,
740 158, 549, 260, 260, 822, 159, 261, 261, 261, 261,
741 261, 261, 261, 170, 170, 170, 170, 170, 170, 170,
742 340, 341, 342, 355, 356, 357, 366, 367, 368, 262,
743 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
744 257, 257, 257, 257, 796, 262, 374, 375, 376, 825,
745 350, 350, 797, 165, 351, 351, 351, 351, 351, 351,
746 351, 261, 261, 261, 261, 261, 261, 261, 826, 165,
747 261, 261, 261, 261, 261, 261, 261, 378, 379, 380,
748 389, 390, 391, 423, 424, 425, 168, 351, 351, 351,
749 351, 351, 351, 351, 351, 351, 351, 351, 351, 351,
751 351, 806, 168, 444, 445, 446, 454, 455, 456, 807,
752 259, 457, 458, 459, 447, 448, 460, 461, 462, 499,
753 500, 501, 522, 523, 524, 490, 259, 831, 639, 832,
754 502, 503, 68, 525, 526, 561, 562, 563, 640, 533,
755 534, 534, 534, 534, 534, 534, 564, 565, 576, 577,
756 641, 576, 577, 796, 576, 577, 656, 657, 775, 642,
757 643, 797, 578, 578, 578, 578, 578, 578, 580, 580,
758 580, 580, 580, 580, 580, 596, 597, 598, 614, 615,
759 616, 576, 577, 656, 657, 581, 579, 599, 576, 577,
760 617, 775, 808, 166, 802, 619, 620, 620, 620, 620,
762 620, 620, 578, 578, 578, 578, 578, 578, 576, 577,
763 806, 579, 759, 776, 759, 808, 656, 657, 807, 760,
764 622, 760, 580, 580, 580, 580, 580, 580, 580, 623,
765 658, 658, 658, 658, 658, 658, 798, 798, 801, 800,
766 624, 656, 657, 799, 799, 814, 776, 809, 656, 657,
767 829, 795, 829, 815, 659, 660, 660, 660, 660, 660,
768 660, 660, 658, 658, 658, 658, 658, 658, 656, 657,
769 809, 827, 820, 823, 794, 793, 792, 791, 828, 659,
770 821, 824, 660, 660, 660, 660, 660, 660, 660, 820,
771 823, 830, 827, 830, 833, 833, 790, 821, 824, 828,
773 789, 788, 834, 834, 56, 56, 56, 56, 56, 84,
774 84, 84, 163, 163, 163, 171, 171, 255, 787, 255,
775 255, 255, 621, 621, 690, 690, 784, 783, 782, 781,
776 780, 779, 778, 777, 773, 772, 771, 770, 769, 768,
777 767, 766, 765, 764, 763, 762, 761, 758, 757, 756,
778 755, 754, 753, 752, 751, 750, 749, 748, 747, 746,
779 745, 744, 743, 742, 741, 740, 739, 738, 737, 736,
780 735, 734, 733, 732, 731, 730, 729, 728, 727, 726,
781 725, 724, 723, 722, 721, 720, 719, 718, 717, 716,
782 715, 714, 713, 712, 711, 710, 709, 708, 707, 706,
784 705, 704, 703, 702, 701, 700, 699, 698, 697, 696,
785 695, 694, 693, 692, 691, 689, 688, 687, 686, 685,
786 684, 683, 682, 681, 680, 679, 678, 677, 676, 675,
787 674, 673, 672, 671, 670, 669, 668, 667, 666, 665,
788 664, 663, 662, 661, 655, 654, 653, 652, 651, 650,
789 649, 648, 647, 646, 645, 644, 638, 637, 636, 635,
790 634, 633, 632, 631, 630, 629, 628, 627, 626, 625,
791 618, 613, 612, 611, 610, 609, 608, 607, 606, 605,
792 604, 603, 602, 601, 600, 595, 594, 593, 592, 591,
793 590, 589, 588, 587, 586, 585, 584, 583, 582, 581,
795 575, 574, 573, 572, 571, 570, 569, 568, 567, 566,
796 560, 559, 558, 557, 556, 555, 554, 553, 552, 551,
797 550, 545, 544, 543, 542, 541, 540, 539, 538, 537,
798 536, 535, 532, 531, 530, 529, 528, 527, 521, 520,
799 519, 518, 517, 516, 515, 514, 513, 512, 511, 510,
800 509, 508, 507, 506, 505, 504, 498, 497, 496, 495,
801 494, 493, 492, 491, 490, 489, 488, 487, 486, 485,
802 484, 483, 482, 481, 480, 479, 478, 477, 476, 475,
803 474, 473, 472, 471, 470, 469, 468, 467, 466, 465,
804 464, 463, 453, 452, 451, 450, 449, 443, 442, 441,
806 440, 439, 438, 437, 436, 435, 434, 433, 432, 431,
807 430, 429, 428, 427, 426, 422, 421, 420, 419, 418,
808 417, 416, 415, 414, 413, 412, 411, 410, 409, 408,
809 407, 406, 405, 404, 403, 402, 401, 400, 399, 398,
810 397, 396, 395, 394, 393, 392, 388, 387, 386, 385,
811 384, 383, 382, 381, 377, 373, 372, 371, 370, 369,
812 365, 364, 363, 362, 361, 360, 359, 358, 354, 353,
813 352, 349, 348, 347, 346, 345, 344, 343, 339, 338,
814 337, 336, 335, 332, 331, 330, 329, 328, 327, 326,
815 325, 324, 323, 322, 321, 320, 319, 318, 317, 316,
817 315, 314, 313, 312, 311, 310, 309, 308, 304, 303,
818 302, 301, 300, 299, 298, 297, 296, 295, 294, 293,
819 292, 291, 290, 289, 288, 287, 286, 285, 284, 283,
820 282, 281, 280, 279, 278, 277, 276, 273, 272, 271,
821 268, 267, 266, 265, 264, 254, 253, 252, 251, 250,
822 247, 246, 245, 238, 237, 236, 235, 234, 233, 230,
823 229, 228, 227, 226, 225, 224, 223, 220, 217, 216,
824 215, 212, 211, 210, 204, 203, 202, 201, 200, 199,
825 198, 197, 192, 191, 190, 189, 188, 187, 186, 185,
826 182, 181, 180, 179, 178, 177, 176, 175, 174, 173,
828 172, 161, 149, 125, 109, 81, 69, 63, 60, 59,
829 835, 57, 57, 7, 835, 835, 835, 835, 835, 835,
830 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
831 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
832 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
833 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
834 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
835 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
836 835, 835
839 static yyconst flex_int16_t yy_chk[1283] =
840 { 0,
841 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
842 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
843 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
844 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
845 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
846 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
847 1, 1, 1, 1, 1, 1, 1, 1, 2, 9,
848 791, 9, 2, 3, 3, 3, 3, 3, 3, 3,
849 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
850 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
852 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
853 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
854 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
855 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
856 3, 13, 15, 792, 16, 17, 17, 17, 17, 17,
857 17, 17, 21, 21, 25, 15, 16, 26, 13, 19,
858 35, 19, 19, 19, 19, 19, 19, 19, 23, 23,
859 25, 36, 26, 26, 35, 36, 19, 19, 71, 30,
860 27, 30, 27, 28, 19, 19, 27, 28, 37, 39,
861 30, 758, 19, 19, 28, 143, 29, 28, 96, 96,
863 29, 33, 37, 71, 143, 39, 29, 19, 39, 33,
864 19, 20, 29, 20, 20, 20, 20, 20, 20, 20,
865 40, 33, 47, 31, 47, 794, 47, 46, 20, 20,
866 40, 31, 48, 48, 31, 106, 20, 31, 42, 34,
867 758, 42, 34, 31, 20, 20, 34, 34, 41, 106,
868 42, 34, 802, 43, 34, 41, 41, 42, 43, 20,
869 41, 50, 43, 50, 44, 43, 41, 41, 44, 41,
870 46, 58, 105, 58, 68, 68, 135, 48, 44, 120,
871 142, 142, 124, 105, 48, 70, 70, 120, 48, 124,
872 68, 68, 135, 48, 53, 53, 53, 53, 53, 53,
874 53, 70, 70, 72, 144, 72, 72, 72, 72, 72,
875 72, 72, 144, 148, 803, 126, 148, 804, 73, 73,
876 72, 72, 73, 73, 73, 73, 73, 73, 73, 126,
877 805, 116, 153, 153, 116, 116, 72, 72, 116, 152,
878 116, 152, 810, 152, 154, 154, 160, 811, 160, 162,
879 162, 162, 162, 162, 162, 162, 164, 164, 166, 166,
880 164, 164, 164, 164, 164, 164, 164, 169, 169, 169,
881 169, 169, 169, 169, 166, 166, 171, 153, 180, 184,
882 184, 215, 215, 215, 153, 241, 813, 504, 153, 154,
883 776, 505, 180, 153, 241, 814, 154, 504, 776, 171,
885 154, 505, 167, 167, 818, 154, 167, 167, 167, 167,
886 167, 167, 167, 170, 170, 170, 170, 170, 170, 170,
887 247, 247, 247, 268, 268, 268, 279, 279, 279, 170,
888 256, 256, 256, 256, 256, 256, 256, 257, 257, 257,
889 257, 257, 257, 257, 786, 170, 288, 288, 288, 822,
890 258, 258, 786, 257, 258, 258, 258, 258, 258, 258,
891 258, 260, 260, 260, 260, 260, 260, 260, 825, 257,
892 261, 261, 261, 261, 261, 261, 261, 292, 292, 292,
893 301, 301, 301, 338, 338, 338, 261, 350, 350, 350,
894 350, 350, 350, 350, 351, 351, 351, 351, 351, 351,
896 351, 795, 261, 382, 382, 382, 393, 393, 393, 795,
897 351, 394, 394, 394, 382, 382, 395, 395, 395, 443,
898 443, 443, 483, 483, 483, 490, 351, 830, 605, 831,
899 443, 443, 839, 483, 483, 519, 519, 519, 605, 490,
900 490, 490, 490, 490, 490, 490, 519, 519, 533, 533,
901 606, 621, 621, 796, 534, 534, 656, 656, 760, 606,
902 606, 796, 533, 533, 533, 533, 533, 533, 534, 534,
903 534, 534, 534, 534, 534, 554, 554, 554, 573, 573,
904 573, 576, 576, 690, 690, 581, 533, 554, 578, 578,
905 573, 775, 799, 840, 790, 576, 576, 576, 576, 576,
907 576, 576, 578, 578, 578, 578, 578, 578, 580, 580,
908 806, 533, 744, 760, 759, 808, 619, 619, 806, 744,
909 581, 759, 580, 580, 580, 580, 580, 580, 580, 581,
910 619, 619, 619, 619, 619, 619, 787, 798, 789, 788,
911 581, 620, 620, 787, 798, 809, 775, 799, 658, 658,
912 828, 785, 829, 809, 619, 620, 620, 620, 620, 620,
913 620, 620, 658, 658, 658, 658, 658, 658, 660, 660,
914 808, 826, 815, 819, 784, 783, 782, 781, 826, 619,
915 815, 819, 660, 660, 660, 660, 660, 660, 660, 820,
916 823, 828, 827, 829, 832, 833, 780, 820, 823, 827,
918 779, 778, 832, 833, 836, 836, 836, 836, 836, 837,
919 837, 837, 838, 838, 838, 841, 841, 842, 777, 842,
920 842, 842, 843, 843, 844, 844, 774, 771, 769, 768,
921 766, 763, 762, 761, 757, 756, 755, 754, 753, 752,
922 751, 750, 749, 748, 747, 746, 745, 743, 742, 741,
923 738, 735, 734, 733, 732, 731, 729, 728, 726, 724,
924 721, 720, 719, 717, 716, 714, 713, 712, 711, 710,
925 709, 708, 707, 706, 705, 704, 702, 701, 700, 699,
926 698, 697, 695, 694, 693, 692, 691, 689, 688, 687,
927 686, 685, 684, 683, 682, 681, 680, 679, 678, 677,
929 676, 675, 674, 673, 672, 670, 669, 668, 667, 666,
930 665, 664, 663, 662, 661, 654, 652, 651, 649, 648,
931 647, 646, 645, 644, 643, 642, 641, 640, 639, 638,
932 637, 635, 634, 633, 632, 631, 630, 629, 627, 626,
933 625, 624, 623, 622, 618, 617, 616, 615, 614, 613,
934 612, 611, 610, 609, 608, 607, 601, 599, 598, 597,
935 596, 592, 591, 590, 589, 588, 587, 586, 585, 584,
936 575, 571, 570, 568, 567, 565, 564, 563, 562, 561,
937 560, 559, 558, 557, 555, 553, 552, 551, 550, 549,
938 548, 547, 546, 545, 544, 542, 541, 537, 536, 535,
940 532, 531, 529, 528, 526, 525, 524, 523, 522, 520,
941 518, 517, 516, 515, 514, 513, 511, 510, 509, 508,
942 507, 503, 502, 501, 500, 499, 498, 495, 494, 493,
943 492, 491, 489, 488, 487, 486, 485, 484, 482, 481,
944 474, 473, 470, 469, 466, 465, 464, 463, 452, 451,
945 450, 448, 447, 446, 445, 444, 441, 439, 438, 437,
946 435, 434, 432, 431, 430, 429, 427, 426, 421, 420,
947 418, 417, 416, 415, 414, 413, 412, 411, 410, 409,
948 407, 406, 405, 404, 403, 402, 401, 400, 399, 398,
949 397, 396, 392, 388, 387, 386, 383, 381, 371, 369,
951 365, 364, 363, 362, 360, 358, 353, 352, 349, 348,
952 347, 346, 345, 344, 339, 337, 336, 335, 334, 333,
953 331, 330, 327, 326, 325, 324, 323, 322, 321, 320,
954 319, 318, 317, 316, 315, 314, 313, 312, 311, 310,
955 309, 308, 307, 306, 305, 302, 300, 299, 298, 297,
956 296, 295, 294, 293, 291, 287, 285, 284, 283, 282,
957 278, 277, 276, 275, 274, 273, 272, 271, 267, 265,
958 264, 254, 253, 252, 251, 250, 249, 248, 246, 245,
959 244, 243, 242, 240, 239, 238, 237, 236, 235, 234,
960 233, 232, 231, 230, 229, 228, 227, 226, 225, 224,
962 223, 222, 221, 220, 219, 218, 217, 216, 214, 213,
963 212, 211, 210, 209, 208, 207, 206, 205, 204, 203,
964 202, 201, 200, 199, 198, 196, 195, 194, 193, 192,
965 191, 190, 189, 188, 187, 186, 185, 183, 182, 181,
966 179, 178, 177, 176, 174, 159, 158, 157, 156, 149,
967 147, 146, 145, 141, 140, 139, 138, 137, 136, 134,
968 133, 132, 131, 130, 129, 128, 127, 125, 123, 122,
969 121, 119, 118, 117, 115, 114, 112, 111, 110, 109,
970 108, 107, 104, 103, 102, 101, 100, 99, 98, 97,
971 95, 94, 93, 92, 91, 90, 89, 88, 87, 83,
973 79, 52, 45, 38, 32, 22, 18, 14, 12, 11,
974 7, 6, 5, 835, 835, 835, 835, 835, 835, 835,
975 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
976 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
977 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
978 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
979 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
980 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
981 835, 835
984 /* The intent behind this definition is that it'll catch
985 * any uses of REJECT which flex missed.
987 #define REJECT reject_used_but_not_detected
988 #define yymore() yymore_used_but_not_detected
989 #define YY_MORE_ADJ 0
990 #define YY_RESTORE_YY_MORE_OFFSET
991 #line 1 "glsl_lexer.ll"
992 #line 2 "glsl_lexer.ll"
994 * Copyright © 2008, 2009 Intel Corporation
996 * Permission is hereby granted, free of charge, to any person obtaining a
997 * copy of this software and associated documentation files (the "Software"),
998 * to deal in the Software without restriction, including without limitation
999 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1000 * and/or sell copies of the Software, and to permit persons to whom the
1001 * Software is furnished to do so, subject to the following conditions:
1003 * The above copyright notice and this permission notice (including the next
1004 * paragraph) shall be included in all copies or substantial portions of the
1005 * Software.
1007 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1008 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1009 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1010 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1011 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1012 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1013 * DEALINGS IN THE SOFTWARE.
1015 #include <ctype.h>
1016 #include "strtod.h"
1017 #include "ast.h"
1018 #include "glsl_parser_extras.h"
1019 #include "glsl_parser.h"
1021 static int classify_identifier(struct _mesa_glsl_parse_state *, const char *);
1023 #ifdef _MSC_VER
1024 #define YY_NO_UNISTD_H
1025 #endif
1027 #define YY_USER_ACTION \
1028 do { \
1029 yylloc->source = 0; \
1030 yylloc->first_column = yycolumn + 1; \
1031 yylloc->first_line = yylineno + 1; \
1032 yycolumn += yyleng; \
1033 } while(0);
1035 #define YY_USER_INIT yylineno = 0; yycolumn = 0;
1037 #define IS_UINT (yytext[yyleng - 1] == 'u' || yytext[yyleng - 1] == 'U')
1039 /* A macro for handling reserved words and keywords across language versions.
1041 * Certain words start out as identifiers, become reserved words in
1042 * later language revisions, and finally become language keywords.
1044 * For example, consider the following lexer rule:
1045 * samplerBuffer KEYWORD(130, 140, SAMPLERBUFFER)
1047 * This means that "samplerBuffer" will be treated as:
1048 * - a keyword (SAMPLERBUFFER token) ...in GLSL >= 1.40
1049 * - a reserved word - error ...in GLSL >= 1.30
1050 * - an identifier ...in GLSL < 1.30
1052 #define KEYWORD(reserved_version, allowed_version, token) \
1053 do { \
1054 if (yyextra->language_version >= allowed_version) { \
1055 return token; \
1056 } else if (yyextra->language_version >= reserved_version) { \
1057 _mesa_glsl_error(yylloc, yyextra, \
1058 "Illegal use of reserved word `%s'", yytext); \
1059 return ERROR_TOK; \
1060 } else { \
1061 yylval->identifier = strdup(yytext); \
1062 return classify_identifier(yyextra, yytext); \
1064 } while (0)
1066 /* The ES macro can be used in KEYWORD checks:
1068 * word KEYWORD(110 || ES, 400, TOKEN)
1069 * ...means the word is reserved in GLSL ES 1.00, while
1071 * word KEYWORD(110, 130 || ES, TOKEN)
1072 * ...means the word is a legal keyword in GLSL ES 1.00.
1074 #define ES yyextra->es_shader
1076 #line 1077 "glsl_lexer.cpp"
1078 #define INITIAL 0
1079 #define PP 1
1080 #define PRAGMA 2
1082 #define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
1084 /* Holds the entire state of the reentrant scanner. */
1085 struct yyguts_t
1088 /* User-defined. Not touched by flex. */
1089 YY_EXTRA_TYPE yyextra_r;
1091 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1092 FILE *yyin_r, *yyout_r;
1093 size_t yy_buffer_stack_top; /**< index of top of stack. */
1094 size_t yy_buffer_stack_max; /**< capacity of stack. */
1095 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1096 char yy_hold_char;
1097 int yy_n_chars;
1098 int yyleng_r;
1099 char *yy_c_buf_p;
1100 int yy_init;
1101 int yy_start;
1102 int yy_did_buffer_switch_on_eof;
1103 int yy_start_stack_ptr;
1104 int yy_start_stack_depth;
1105 int *yy_start_stack;
1106 yy_state_type yy_last_accepting_state;
1107 char* yy_last_accepting_cpos;
1109 int yylineno_r;
1110 int yy_flex_debug_r;
1112 char *yytext_r;
1113 int yy_more_flag;
1114 int yy_more_len;
1116 YYSTYPE * yylval_r;
1118 YYLTYPE * yylloc_r;
1120 }; /* end struct yyguts_t */
1122 static int yy_init_globals (yyscan_t yyscanner );
1124 /* This must go here because YYSTYPE and YYLTYPE are included
1125 * from bison output in section 1.*/
1126 # define yylval yyg->yylval_r
1128 # define yylloc yyg->yylloc_r
1130 int _mesa_glsl_lex_init (yyscan_t* scanner);
1132 int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1134 /* Accessor methods to globals.
1135 These are made visible to non-reentrant scanners for convenience. */
1137 int _mesa_glsl_lex_destroy (yyscan_t yyscanner );
1139 int _mesa_glsl_get_debug (yyscan_t yyscanner );
1141 void _mesa_glsl_set_debug (int debug_flag ,yyscan_t yyscanner );
1143 YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner );
1145 void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1147 FILE *_mesa_glsl_get_in (yyscan_t yyscanner );
1149 void _mesa_glsl_set_in (FILE * in_str ,yyscan_t yyscanner );
1151 FILE *_mesa_glsl_get_out (yyscan_t yyscanner );
1153 void _mesa_glsl_set_out (FILE * out_str ,yyscan_t yyscanner );
1155 int _mesa_glsl_get_leng (yyscan_t yyscanner );
1157 char *_mesa_glsl_get_text (yyscan_t yyscanner );
1159 int _mesa_glsl_get_lineno (yyscan_t yyscanner );
1161 void _mesa_glsl_set_lineno (int line_number ,yyscan_t yyscanner );
1163 int _mesa_glsl_get_column (yyscan_t yyscanner );
1165 void _mesa_glsl_set_column (int column_no ,yyscan_t yyscanner );
1167 YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner );
1169 void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1171 YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner );
1173 void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
1175 /* Macros after this point can all be overridden by user definitions in
1176 * section 1.
1179 #ifndef YY_SKIP_YYWRAP
1180 #ifdef __cplusplus
1181 extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner );
1182 #else
1183 extern int _mesa_glsl_wrap (yyscan_t yyscanner );
1184 #endif
1185 #endif
1187 #ifndef yytext_ptr
1188 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1189 #endif
1191 #ifdef YY_NEED_STRLEN
1192 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1193 #endif
1195 #ifndef YY_NO_INPUT
1197 #ifdef __cplusplus
1198 static int yyinput (yyscan_t yyscanner );
1199 #else
1200 static int input (yyscan_t yyscanner );
1201 #endif
1203 #endif
1205 /* Amount of stuff to slurp up with each read. */
1206 #ifndef YY_READ_BUF_SIZE
1207 #define YY_READ_BUF_SIZE 8192
1208 #endif
1210 /* Copy whatever the last rule matched to the standard output. */
1211 #ifndef ECHO
1212 /* This used to be an fputs(), but since the string might contain NUL's,
1213 * we now use fwrite().
1215 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1216 #endif
1218 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1219 * is returned in "result".
1221 #ifndef YY_INPUT
1222 #define YY_INPUT(buf,result,max_size) \
1223 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1225 int c = '*'; \
1226 unsigned n; \
1227 for ( n = 0; n < max_size && \
1228 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1229 buf[n] = (char) c; \
1230 if ( c == '\n' ) \
1231 buf[n++] = (char) c; \
1232 if ( c == EOF && ferror( yyin ) ) \
1233 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1234 result = n; \
1236 else \
1238 errno=0; \
1239 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1241 if( errno != EINTR) \
1243 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1244 break; \
1246 errno=0; \
1247 clearerr(yyin); \
1252 #endif
1254 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1255 * we don't want an extra ';' after the "return" because that will cause
1256 * some compilers to complain about unreachable statements.
1258 #ifndef yyterminate
1259 #define yyterminate() return YY_NULL
1260 #endif
1262 /* Number of entries by which start-condition stack grows. */
1263 #ifndef YY_START_STACK_INCR
1264 #define YY_START_STACK_INCR 25
1265 #endif
1267 /* Report a fatal error. */
1268 #ifndef YY_FATAL_ERROR
1269 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1270 #endif
1272 /* end tables serialization structures and prototypes */
1274 /* Default declaration of generated scanner - a define so the user can
1275 * easily add parameters.
1277 #ifndef YY_DECL
1278 #define YY_DECL_IS_OURS 1
1280 extern int _mesa_glsl_lex \
1281 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1283 #define YY_DECL int _mesa_glsl_lex \
1284 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1285 #endif /* !YY_DECL */
1287 /* Code executed at the beginning of each rule, after yytext and yyleng
1288 * have been set up.
1290 #ifndef YY_USER_ACTION
1291 #define YY_USER_ACTION
1292 #endif
1294 /* Code executed at the end of each rule. */
1295 #ifndef YY_BREAK
1296 #define YY_BREAK break;
1297 #endif
1299 #define YY_RULE_SETUP \
1300 if ( yyleng > 0 ) \
1301 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1302 (yytext[yyleng - 1] == '\n'); \
1303 YY_USER_ACTION
1305 /** The main scanner function which does all the work.
1307 YY_DECL
1309 register yy_state_type yy_current_state;
1310 register char *yy_cp, *yy_bp;
1311 register int yy_act;
1312 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1314 #line 101 "glsl_lexer.ll"
1317 #line 1318 "glsl_lexer.cpp"
1319 yylval = yylval_param;
1321 yylloc = yylloc_param;
1323 if ( !yyg->yy_init )
1325 yyg->yy_init = 1;
1327 #ifdef YY_USER_INIT
1328 YY_USER_INIT;
1329 #endif
1331 if ( ! yyg->yy_start )
1332 yyg->yy_start = 1; /* first start state */
1334 if ( ! yyin )
1335 yyin = stdin;
1337 if ( ! yyout )
1338 yyout = stdout;
1340 if ( ! YY_CURRENT_BUFFER ) {
1341 _mesa_glsl_ensure_buffer_stack (yyscanner);
1342 YY_CURRENT_BUFFER_LVALUE =
1343 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1346 _mesa_glsl__load_buffer_state(yyscanner );
1349 while ( 1 ) /* loops until end-of-file is reached */
1351 yy_cp = yyg->yy_c_buf_p;
1353 /* Support of yytext. */
1354 *yy_cp = yyg->yy_hold_char;
1356 /* yy_bp points to the position in yy_ch_buf of the start of
1357 * the current run.
1359 yy_bp = yy_cp;
1361 yy_current_state = yyg->yy_start;
1362 yy_current_state += YY_AT_BOL();
1363 yy_match:
1366 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1367 if ( yy_accept[yy_current_state] )
1369 yyg->yy_last_accepting_state = yy_current_state;
1370 yyg->yy_last_accepting_cpos = yy_cp;
1372 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1374 yy_current_state = (int) yy_def[yy_current_state];
1375 if ( yy_current_state >= 836 )
1376 yy_c = yy_meta[(unsigned int) yy_c];
1378 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1379 ++yy_cp;
1381 while ( yy_current_state != 835 );
1382 yy_cp = yyg->yy_last_accepting_cpos;
1383 yy_current_state = yyg->yy_last_accepting_state;
1385 yy_find_action:
1386 yy_act = yy_accept[yy_current_state];
1388 YY_DO_BEFORE_ACTION;
1390 do_action: /* This label is used only to access EOF actions. */
1392 switch ( yy_act )
1393 { /* beginning of action switch */
1394 case 0: /* must back up */
1395 /* undo the effects of YY_DO_BEFORE_ACTION */
1396 *yy_cp = yyg->yy_hold_char;
1397 yy_cp = yyg->yy_last_accepting_cpos;
1398 yy_current_state = yyg->yy_last_accepting_state;
1399 goto yy_find_action;
1401 case 1:
1402 YY_RULE_SETUP
1403 #line 103 "glsl_lexer.ll"
1405 YY_BREAK
1406 /* Preprocessor tokens. */
1407 case 2:
1408 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1409 yyg->yy_c_buf_p = yy_cp -= 1;
1410 YY_DO_BEFORE_ACTION; /* set up yytext again */
1411 YY_RULE_SETUP
1412 #line 106 "glsl_lexer.ll"
1414 YY_BREAK
1415 case 3:
1416 YY_RULE_SETUP
1417 #line 107 "glsl_lexer.ll"
1418 { BEGIN PP; return VERSION; }
1419 YY_BREAK
1420 case 4:
1421 YY_RULE_SETUP
1422 #line 108 "glsl_lexer.ll"
1423 { BEGIN PP; return EXTENSION; }
1424 YY_BREAK
1425 case 5:
1426 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1427 yyg->yy_c_buf_p = yy_cp -= 1;
1428 YY_DO_BEFORE_ACTION; /* set up yytext again */
1429 YY_RULE_SETUP
1430 #line 109 "glsl_lexer.ll"
1432 /* Eat characters until the first digit is
1433 * encountered
1435 char *ptr = yytext;
1436 while (!isdigit(*ptr))
1437 ptr++;
1439 /* Subtract one from the line number because
1440 * yylineno is zero-based instead of
1441 * one-based.
1443 yylineno = strtol(ptr, &ptr, 0) - 1;
1444 yylloc->source = strtol(ptr, NULL, 0);
1446 YY_BREAK
1447 case 6:
1448 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1449 yyg->yy_c_buf_p = yy_cp -= 1;
1450 YY_DO_BEFORE_ACTION; /* set up yytext again */
1451 YY_RULE_SETUP
1452 #line 124 "glsl_lexer.ll"
1454 /* Eat characters until the first digit is
1455 * encountered
1457 char *ptr = yytext;
1458 while (!isdigit(*ptr))
1459 ptr++;
1461 /* Subtract one from the line number because
1462 * yylineno is zero-based instead of
1463 * one-based.
1465 yylineno = strtol(ptr, &ptr, 0) - 1;
1467 YY_BREAK
1468 case 7:
1469 YY_RULE_SETUP
1470 #line 138 "glsl_lexer.ll"
1472 BEGIN PP;
1473 return PRAGMA_DEBUG_ON;
1475 YY_BREAK
1476 case 8:
1477 YY_RULE_SETUP
1478 #line 142 "glsl_lexer.ll"
1480 BEGIN PP;
1481 return PRAGMA_DEBUG_OFF;
1483 YY_BREAK
1484 case 9:
1485 YY_RULE_SETUP
1486 #line 146 "glsl_lexer.ll"
1488 BEGIN PP;
1489 return PRAGMA_OPTIMIZE_ON;
1491 YY_BREAK
1492 case 10:
1493 YY_RULE_SETUP
1494 #line 150 "glsl_lexer.ll"
1496 BEGIN PP;
1497 return PRAGMA_OPTIMIZE_OFF;
1499 YY_BREAK
1500 case 11:
1501 YY_RULE_SETUP
1502 #line 154 "glsl_lexer.ll"
1504 BEGIN PP;
1505 return PRAGMA_INVARIANT_ALL;
1507 YY_BREAK
1508 case 12:
1509 YY_RULE_SETUP
1510 #line 158 "glsl_lexer.ll"
1511 { BEGIN PRAGMA; }
1512 YY_BREAK
1513 case 13:
1514 /* rule 13 can match eol */
1515 YY_RULE_SETUP
1516 #line 160 "glsl_lexer.ll"
1517 { BEGIN 0; yylineno++; yycolumn = 0; }
1518 YY_BREAK
1519 case 14:
1520 YY_RULE_SETUP
1521 #line 161 "glsl_lexer.ll"
1523 YY_BREAK
1524 case 15:
1525 YY_RULE_SETUP
1526 #line 163 "glsl_lexer.ll"
1528 YY_BREAK
1529 case 16:
1530 YY_RULE_SETUP
1531 #line 164 "glsl_lexer.ll"
1533 YY_BREAK
1534 case 17:
1535 YY_RULE_SETUP
1536 #line 165 "glsl_lexer.ll"
1537 return COLON;
1538 YY_BREAK
1539 case 18:
1540 YY_RULE_SETUP
1541 #line 166 "glsl_lexer.ll"
1543 yylval->identifier = strdup(yytext);
1544 return IDENTIFIER;
1546 YY_BREAK
1547 case 19:
1548 YY_RULE_SETUP
1549 #line 170 "glsl_lexer.ll"
1551 yylval->n = strtol(yytext, NULL, 10);
1552 return INTCONSTANT;
1554 YY_BREAK
1555 case 20:
1556 /* rule 20 can match eol */
1557 YY_RULE_SETUP
1558 #line 174 "glsl_lexer.ll"
1559 { BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
1560 YY_BREAK
1561 case 21:
1562 /* rule 21 can match eol */
1563 YY_RULE_SETUP
1564 #line 176 "glsl_lexer.ll"
1565 { yylineno++; yycolumn = 0; }
1566 YY_BREAK
1567 case 22:
1568 YY_RULE_SETUP
1569 #line 178 "glsl_lexer.ll"
1570 return ATTRIBUTE;
1571 YY_BREAK
1572 case 23:
1573 YY_RULE_SETUP
1574 #line 179 "glsl_lexer.ll"
1575 return CONST_TOK;
1576 YY_BREAK
1577 case 24:
1578 YY_RULE_SETUP
1579 #line 180 "glsl_lexer.ll"
1580 return BOOL_TOK;
1581 YY_BREAK
1582 case 25:
1583 YY_RULE_SETUP
1584 #line 181 "glsl_lexer.ll"
1585 return FLOAT_TOK;
1586 YY_BREAK
1587 case 26:
1588 YY_RULE_SETUP
1589 #line 182 "glsl_lexer.ll"
1590 return INT_TOK;
1591 YY_BREAK
1592 case 27:
1593 YY_RULE_SETUP
1594 #line 183 "glsl_lexer.ll"
1595 KEYWORD(130, 130, UINT_TOK);
1596 YY_BREAK
1597 case 28:
1598 YY_RULE_SETUP
1599 #line 185 "glsl_lexer.ll"
1600 return BREAK;
1601 YY_BREAK
1602 case 29:
1603 YY_RULE_SETUP
1604 #line 186 "glsl_lexer.ll"
1605 return CONTINUE;
1606 YY_BREAK
1607 case 30:
1608 YY_RULE_SETUP
1609 #line 187 "glsl_lexer.ll"
1610 return DO;
1611 YY_BREAK
1612 case 31:
1613 YY_RULE_SETUP
1614 #line 188 "glsl_lexer.ll"
1615 return WHILE;
1616 YY_BREAK
1617 case 32:
1618 YY_RULE_SETUP
1619 #line 189 "glsl_lexer.ll"
1620 return ELSE;
1621 YY_BREAK
1622 case 33:
1623 YY_RULE_SETUP
1624 #line 190 "glsl_lexer.ll"
1625 return FOR;
1626 YY_BREAK
1627 case 34:
1628 YY_RULE_SETUP
1629 #line 191 "glsl_lexer.ll"
1630 return IF;
1631 YY_BREAK
1632 case 35:
1633 YY_RULE_SETUP
1634 #line 192 "glsl_lexer.ll"
1635 return DISCARD;
1636 YY_BREAK
1637 case 36:
1638 YY_RULE_SETUP
1639 #line 193 "glsl_lexer.ll"
1640 return RETURN;
1641 YY_BREAK
1642 case 37:
1643 YY_RULE_SETUP
1644 #line 195 "glsl_lexer.ll"
1645 return BVEC2;
1646 YY_BREAK
1647 case 38:
1648 YY_RULE_SETUP
1649 #line 196 "glsl_lexer.ll"
1650 return BVEC3;
1651 YY_BREAK
1652 case 39:
1653 YY_RULE_SETUP
1654 #line 197 "glsl_lexer.ll"
1655 return BVEC4;
1656 YY_BREAK
1657 case 40:
1658 YY_RULE_SETUP
1659 #line 198 "glsl_lexer.ll"
1660 return IVEC2;
1661 YY_BREAK
1662 case 41:
1663 YY_RULE_SETUP
1664 #line 199 "glsl_lexer.ll"
1665 return IVEC3;
1666 YY_BREAK
1667 case 42:
1668 YY_RULE_SETUP
1669 #line 200 "glsl_lexer.ll"
1670 return IVEC4;
1671 YY_BREAK
1672 case 43:
1673 YY_RULE_SETUP
1674 #line 201 "glsl_lexer.ll"
1675 KEYWORD(130, 130, UVEC2);
1676 YY_BREAK
1677 case 44:
1678 YY_RULE_SETUP
1679 #line 202 "glsl_lexer.ll"
1680 KEYWORD(130, 130, UVEC3);
1681 YY_BREAK
1682 case 45:
1683 YY_RULE_SETUP
1684 #line 203 "glsl_lexer.ll"
1685 KEYWORD(130, 130, UVEC4);
1686 YY_BREAK
1687 case 46:
1688 YY_RULE_SETUP
1689 #line 204 "glsl_lexer.ll"
1690 return VEC2;
1691 YY_BREAK
1692 case 47:
1693 YY_RULE_SETUP
1694 #line 205 "glsl_lexer.ll"
1695 return VEC3;
1696 YY_BREAK
1697 case 48:
1698 YY_RULE_SETUP
1699 #line 206 "glsl_lexer.ll"
1700 return VEC4;
1701 YY_BREAK
1702 case 49:
1703 YY_RULE_SETUP
1704 #line 207 "glsl_lexer.ll"
1705 return MAT2X2;
1706 YY_BREAK
1707 case 50:
1708 YY_RULE_SETUP
1709 #line 208 "glsl_lexer.ll"
1710 return MAT3X3;
1711 YY_BREAK
1712 case 51:
1713 YY_RULE_SETUP
1714 #line 209 "glsl_lexer.ll"
1715 return MAT4X4;
1716 YY_BREAK
1717 case 52:
1718 YY_RULE_SETUP
1719 #line 210 "glsl_lexer.ll"
1720 KEYWORD(120, 120, MAT2X2);
1721 YY_BREAK
1722 case 53:
1723 YY_RULE_SETUP
1724 #line 211 "glsl_lexer.ll"
1725 KEYWORD(120, 120, MAT2X3);
1726 YY_BREAK
1727 case 54:
1728 YY_RULE_SETUP
1729 #line 212 "glsl_lexer.ll"
1730 KEYWORD(120, 120, MAT2X4);
1731 YY_BREAK
1732 case 55:
1733 YY_RULE_SETUP
1734 #line 213 "glsl_lexer.ll"
1735 KEYWORD(120, 120, MAT3X2);
1736 YY_BREAK
1737 case 56:
1738 YY_RULE_SETUP
1739 #line 214 "glsl_lexer.ll"
1740 KEYWORD(120, 120, MAT3X3);
1741 YY_BREAK
1742 case 57:
1743 YY_RULE_SETUP
1744 #line 215 "glsl_lexer.ll"
1745 KEYWORD(120, 120, MAT3X4);
1746 YY_BREAK
1747 case 58:
1748 YY_RULE_SETUP
1749 #line 216 "glsl_lexer.ll"
1750 KEYWORD(120, 120, MAT4X2);
1751 YY_BREAK
1752 case 59:
1753 YY_RULE_SETUP
1754 #line 217 "glsl_lexer.ll"
1755 KEYWORD(120, 120, MAT4X3);
1756 YY_BREAK
1757 case 60:
1758 YY_RULE_SETUP
1759 #line 218 "glsl_lexer.ll"
1760 KEYWORD(120, 120, MAT4X4);
1761 YY_BREAK
1762 case 61:
1763 YY_RULE_SETUP
1764 #line 220 "glsl_lexer.ll"
1765 return IN_TOK;
1766 YY_BREAK
1767 case 62:
1768 YY_RULE_SETUP
1769 #line 221 "glsl_lexer.ll"
1770 return OUT_TOK;
1771 YY_BREAK
1772 case 63:
1773 YY_RULE_SETUP
1774 #line 222 "glsl_lexer.ll"
1775 return INOUT_TOK;
1776 YY_BREAK
1777 case 64:
1778 YY_RULE_SETUP
1779 #line 223 "glsl_lexer.ll"
1780 return UNIFORM;
1781 YY_BREAK
1782 case 65:
1783 YY_RULE_SETUP
1784 #line 224 "glsl_lexer.ll"
1785 return VARYING;
1786 YY_BREAK
1787 case 66:
1788 YY_RULE_SETUP
1789 #line 225 "glsl_lexer.ll"
1790 KEYWORD(120, 120, CENTROID);
1791 YY_BREAK
1792 case 67:
1793 YY_RULE_SETUP
1794 #line 226 "glsl_lexer.ll"
1795 KEYWORD(120 || ES, 120 || ES, INVARIANT);
1796 YY_BREAK
1797 case 68:
1798 YY_RULE_SETUP
1799 #line 227 "glsl_lexer.ll"
1800 KEYWORD(130 || ES, 130, FLAT);
1801 YY_BREAK
1802 case 69:
1803 YY_RULE_SETUP
1804 #line 228 "glsl_lexer.ll"
1805 KEYWORD(130, 130, SMOOTH);
1806 YY_BREAK
1807 case 70:
1808 YY_RULE_SETUP
1809 #line 229 "glsl_lexer.ll"
1810 KEYWORD(130, 130, NOPERSPECTIVE);
1811 YY_BREAK
1812 case 71:
1813 YY_RULE_SETUP
1814 #line 231 "glsl_lexer.ll"
1815 return SAMPLER1D;
1816 YY_BREAK
1817 case 72:
1818 YY_RULE_SETUP
1819 #line 232 "glsl_lexer.ll"
1820 return SAMPLER2D;
1821 YY_BREAK
1822 case 73:
1823 YY_RULE_SETUP
1824 #line 233 "glsl_lexer.ll"
1825 return SAMPLER3D;
1826 YY_BREAK
1827 case 74:
1828 YY_RULE_SETUP
1829 #line 234 "glsl_lexer.ll"
1830 return SAMPLERCUBE;
1831 YY_BREAK
1832 case 75:
1833 YY_RULE_SETUP
1834 #line 235 "glsl_lexer.ll"
1835 KEYWORD(130, 130, SAMPLER1DARRAY);
1836 YY_BREAK
1837 case 76:
1838 YY_RULE_SETUP
1839 #line 236 "glsl_lexer.ll"
1840 KEYWORD(130, 130, SAMPLER2DARRAY);
1841 YY_BREAK
1842 case 77:
1843 YY_RULE_SETUP
1844 #line 237 "glsl_lexer.ll"
1845 return SAMPLER1DSHADOW;
1846 YY_BREAK
1847 case 78:
1848 YY_RULE_SETUP
1849 #line 238 "glsl_lexer.ll"
1850 return SAMPLER2DSHADOW;
1851 YY_BREAK
1852 case 79:
1853 YY_RULE_SETUP
1854 #line 239 "glsl_lexer.ll"
1855 KEYWORD(130, 130, SAMPLERCUBESHADOW);
1856 YY_BREAK
1857 case 80:
1858 YY_RULE_SETUP
1859 #line 240 "glsl_lexer.ll"
1860 KEYWORD(130, 130, SAMPLER1DARRAYSHADOW);
1861 YY_BREAK
1862 case 81:
1863 YY_RULE_SETUP
1864 #line 241 "glsl_lexer.ll"
1865 KEYWORD(130, 130, SAMPLER2DARRAYSHADOW);
1866 YY_BREAK
1867 case 82:
1868 YY_RULE_SETUP
1869 #line 242 "glsl_lexer.ll"
1870 KEYWORD(130, 130, ISAMPLER1D);
1871 YY_BREAK
1872 case 83:
1873 YY_RULE_SETUP
1874 #line 243 "glsl_lexer.ll"
1875 KEYWORD(130, 130, ISAMPLER2D);
1876 YY_BREAK
1877 case 84:
1878 YY_RULE_SETUP
1879 #line 244 "glsl_lexer.ll"
1880 KEYWORD(130, 130, ISAMPLER3D);
1881 YY_BREAK
1882 case 85:
1883 YY_RULE_SETUP
1884 #line 245 "glsl_lexer.ll"
1885 KEYWORD(130, 130, ISAMPLERCUBE);
1886 YY_BREAK
1887 case 86:
1888 YY_RULE_SETUP
1889 #line 246 "glsl_lexer.ll"
1890 KEYWORD(130, 130, ISAMPLER1DARRAY);
1891 YY_BREAK
1892 case 87:
1893 YY_RULE_SETUP
1894 #line 247 "glsl_lexer.ll"
1895 KEYWORD(130, 130, ISAMPLER2DARRAY);
1896 YY_BREAK
1897 case 88:
1898 YY_RULE_SETUP
1899 #line 248 "glsl_lexer.ll"
1900 KEYWORD(130, 130, USAMPLER1D);
1901 YY_BREAK
1902 case 89:
1903 YY_RULE_SETUP
1904 #line 249 "glsl_lexer.ll"
1905 KEYWORD(130, 130, USAMPLER2D);
1906 YY_BREAK
1907 case 90:
1908 YY_RULE_SETUP
1909 #line 250 "glsl_lexer.ll"
1910 KEYWORD(130, 130, USAMPLER3D);
1911 YY_BREAK
1912 case 91:
1913 YY_RULE_SETUP
1914 #line 251 "glsl_lexer.ll"
1915 KEYWORD(130, 130, USAMPLERCUBE);
1916 YY_BREAK
1917 case 92:
1918 YY_RULE_SETUP
1919 #line 252 "glsl_lexer.ll"
1920 KEYWORD(130, 130, USAMPLER1DARRAY);
1921 YY_BREAK
1922 case 93:
1923 YY_RULE_SETUP
1924 #line 253 "glsl_lexer.ll"
1925 KEYWORD(130, 130, USAMPLER2DARRAY);
1926 YY_BREAK
1927 case 94:
1928 YY_RULE_SETUP
1929 #line 256 "glsl_lexer.ll"
1930 return STRUCT;
1931 YY_BREAK
1932 case 95:
1933 YY_RULE_SETUP
1934 #line 257 "glsl_lexer.ll"
1935 return VOID_TOK;
1936 YY_BREAK
1937 case 96:
1938 YY_RULE_SETUP
1939 #line 259 "glsl_lexer.ll"
1941 if ((yyextra->language_version >= 140)
1942 || yyextra->AMD_conservative_depth_enable
1943 || yyextra->ARB_explicit_attrib_location_enable
1944 || yyextra->ARB_fragment_coord_conventions_enable) {
1945 return LAYOUT_TOK;
1946 } else {
1947 yylval->identifier = strdup(yytext);
1948 return IDENTIFIER;
1951 YY_BREAK
1952 case 97:
1953 YY_RULE_SETUP
1954 #line 271 "glsl_lexer.ll"
1955 return INC_OP;
1956 YY_BREAK
1957 case 98:
1958 YY_RULE_SETUP
1959 #line 272 "glsl_lexer.ll"
1960 return DEC_OP;
1961 YY_BREAK
1962 case 99:
1963 YY_RULE_SETUP
1964 #line 273 "glsl_lexer.ll"
1965 return LE_OP;
1966 YY_BREAK
1967 case 100:
1968 YY_RULE_SETUP
1969 #line 274 "glsl_lexer.ll"
1970 return GE_OP;
1971 YY_BREAK
1972 case 101:
1973 YY_RULE_SETUP
1974 #line 275 "glsl_lexer.ll"
1975 return EQ_OP;
1976 YY_BREAK
1977 case 102:
1978 YY_RULE_SETUP
1979 #line 276 "glsl_lexer.ll"
1980 return NE_OP;
1981 YY_BREAK
1982 case 103:
1983 YY_RULE_SETUP
1984 #line 277 "glsl_lexer.ll"
1985 return AND_OP;
1986 YY_BREAK
1987 case 104:
1988 YY_RULE_SETUP
1989 #line 278 "glsl_lexer.ll"
1990 return OR_OP;
1991 YY_BREAK
1992 case 105:
1993 YY_RULE_SETUP
1994 #line 279 "glsl_lexer.ll"
1995 return XOR_OP;
1996 YY_BREAK
1997 case 106:
1998 YY_RULE_SETUP
1999 #line 280 "glsl_lexer.ll"
2000 return LEFT_OP;
2001 YY_BREAK
2002 case 107:
2003 YY_RULE_SETUP
2004 #line 281 "glsl_lexer.ll"
2005 return RIGHT_OP;
2006 YY_BREAK
2007 case 108:
2008 YY_RULE_SETUP
2009 #line 283 "glsl_lexer.ll"
2010 return MUL_ASSIGN;
2011 YY_BREAK
2012 case 109:
2013 YY_RULE_SETUP
2014 #line 284 "glsl_lexer.ll"
2015 return DIV_ASSIGN;
2016 YY_BREAK
2017 case 110:
2018 YY_RULE_SETUP
2019 #line 285 "glsl_lexer.ll"
2020 return ADD_ASSIGN;
2021 YY_BREAK
2022 case 111:
2023 YY_RULE_SETUP
2024 #line 286 "glsl_lexer.ll"
2025 return MOD_ASSIGN;
2026 YY_BREAK
2027 case 112:
2028 YY_RULE_SETUP
2029 #line 287 "glsl_lexer.ll"
2030 return LEFT_ASSIGN;
2031 YY_BREAK
2032 case 113:
2033 YY_RULE_SETUP
2034 #line 288 "glsl_lexer.ll"
2035 return RIGHT_ASSIGN;
2036 YY_BREAK
2037 case 114:
2038 YY_RULE_SETUP
2039 #line 289 "glsl_lexer.ll"
2040 return AND_ASSIGN;
2041 YY_BREAK
2042 case 115:
2043 YY_RULE_SETUP
2044 #line 290 "glsl_lexer.ll"
2045 return XOR_ASSIGN;
2046 YY_BREAK
2047 case 116:
2048 YY_RULE_SETUP
2049 #line 291 "glsl_lexer.ll"
2050 return OR_ASSIGN;
2051 YY_BREAK
2052 case 117:
2053 YY_RULE_SETUP
2054 #line 292 "glsl_lexer.ll"
2055 return SUB_ASSIGN;
2056 YY_BREAK
2057 case 118:
2058 YY_RULE_SETUP
2059 #line 294 "glsl_lexer.ll"
2061 yylval->n = strtol(yytext, NULL, 10);
2062 return IS_UINT ? UINTCONSTANT : INTCONSTANT;
2064 YY_BREAK
2065 case 119:
2066 YY_RULE_SETUP
2067 #line 298 "glsl_lexer.ll"
2069 yylval->n = strtol(yytext + 2, NULL, 16);
2070 return IS_UINT ? UINTCONSTANT : INTCONSTANT;
2072 YY_BREAK
2073 case 120:
2074 YY_RULE_SETUP
2075 #line 302 "glsl_lexer.ll"
2077 yylval->n = strtol(yytext, NULL, 8);
2078 return IS_UINT ? UINTCONSTANT : INTCONSTANT;
2080 YY_BREAK
2081 case 121:
2082 YY_RULE_SETUP
2083 #line 307 "glsl_lexer.ll"
2085 yylval->real = glsl_strtod(yytext, NULL);
2086 return FLOATCONSTANT;
2088 YY_BREAK
2089 case 122:
2090 YY_RULE_SETUP
2091 #line 311 "glsl_lexer.ll"
2093 yylval->real = glsl_strtod(yytext, NULL);
2094 return FLOATCONSTANT;
2096 YY_BREAK
2097 case 123:
2098 YY_RULE_SETUP
2099 #line 315 "glsl_lexer.ll"
2101 yylval->real = glsl_strtod(yytext, NULL);
2102 return FLOATCONSTANT;
2104 YY_BREAK
2105 case 124:
2106 YY_RULE_SETUP
2107 #line 319 "glsl_lexer.ll"
2109 yylval->real = glsl_strtod(yytext, NULL);
2110 return FLOATCONSTANT;
2112 YY_BREAK
2113 case 125:
2114 YY_RULE_SETUP
2115 #line 323 "glsl_lexer.ll"
2117 yylval->real = glsl_strtod(yytext, NULL);
2118 return FLOATCONSTANT;
2120 YY_BREAK
2121 case 126:
2122 YY_RULE_SETUP
2123 #line 328 "glsl_lexer.ll"
2125 yylval->n = 1;
2126 return BOOLCONSTANT;
2128 YY_BREAK
2129 case 127:
2130 YY_RULE_SETUP
2131 #line 332 "glsl_lexer.ll"
2133 yylval->n = 0;
2134 return BOOLCONSTANT;
2136 YY_BREAK
2137 /* Reserved words in GLSL 1.10. */
2138 case 128:
2139 YY_RULE_SETUP
2140 #line 339 "glsl_lexer.ll"
2141 KEYWORD(110 || ES, 999, ASM);
2142 YY_BREAK
2143 case 129:
2144 YY_RULE_SETUP
2145 #line 340 "glsl_lexer.ll"
2146 KEYWORD(110 || ES, 999, CLASS);
2147 YY_BREAK
2148 case 130:
2149 YY_RULE_SETUP
2150 #line 341 "glsl_lexer.ll"
2151 KEYWORD(110 || ES, 999, UNION);
2152 YY_BREAK
2153 case 131:
2154 YY_RULE_SETUP
2155 #line 342 "glsl_lexer.ll"
2156 KEYWORD(110 || ES, 999, ENUM);
2157 YY_BREAK
2158 case 132:
2159 YY_RULE_SETUP
2160 #line 343 "glsl_lexer.ll"
2161 KEYWORD(110 || ES, 999, TYPEDEF);
2162 YY_BREAK
2163 case 133:
2164 YY_RULE_SETUP
2165 #line 344 "glsl_lexer.ll"
2166 KEYWORD(110 || ES, 999, TEMPLATE);
2167 YY_BREAK
2168 case 134:
2169 YY_RULE_SETUP
2170 #line 345 "glsl_lexer.ll"
2171 KEYWORD(110 || ES, 999, THIS);
2172 YY_BREAK
2173 case 135:
2174 YY_RULE_SETUP
2175 #line 346 "glsl_lexer.ll"
2176 KEYWORD(110 || ES, 999, PACKED_TOK);
2177 YY_BREAK
2178 case 136:
2179 YY_RULE_SETUP
2180 #line 347 "glsl_lexer.ll"
2181 KEYWORD(110 || ES, 999, GOTO);
2182 YY_BREAK
2183 case 137:
2184 YY_RULE_SETUP
2185 #line 348 "glsl_lexer.ll"
2186 KEYWORD(110 || ES, 130, SWITCH);
2187 YY_BREAK
2188 case 138:
2189 YY_RULE_SETUP
2190 #line 349 "glsl_lexer.ll"
2191 KEYWORD(110 || ES, 130, DEFAULT);
2192 YY_BREAK
2193 case 139:
2194 YY_RULE_SETUP
2195 #line 350 "glsl_lexer.ll"
2196 KEYWORD(110 || ES, 999, INLINE_TOK);
2197 YY_BREAK
2198 case 140:
2199 YY_RULE_SETUP
2200 #line 351 "glsl_lexer.ll"
2201 KEYWORD(110 || ES, 999, NOINLINE);
2202 YY_BREAK
2203 case 141:
2204 YY_RULE_SETUP
2205 #line 352 "glsl_lexer.ll"
2206 KEYWORD(110 || ES, 999, VOLATILE);
2207 YY_BREAK
2208 case 142:
2209 YY_RULE_SETUP
2210 #line 353 "glsl_lexer.ll"
2211 KEYWORD(110 || ES, 999, PUBLIC_TOK);
2212 YY_BREAK
2213 case 143:
2214 YY_RULE_SETUP
2215 #line 354 "glsl_lexer.ll"
2216 KEYWORD(110 || ES, 999, STATIC);
2217 YY_BREAK
2218 case 144:
2219 YY_RULE_SETUP
2220 #line 355 "glsl_lexer.ll"
2221 KEYWORD(110 || ES, 999, EXTERN);
2222 YY_BREAK
2223 case 145:
2224 YY_RULE_SETUP
2225 #line 356 "glsl_lexer.ll"
2226 KEYWORD(110 || ES, 999, EXTERNAL);
2227 YY_BREAK
2228 case 146:
2229 YY_RULE_SETUP
2230 #line 357 "glsl_lexer.ll"
2231 KEYWORD(110 || ES, 999, INTERFACE);
2232 YY_BREAK
2233 case 147:
2234 YY_RULE_SETUP
2235 #line 358 "glsl_lexer.ll"
2236 KEYWORD(110 || ES, 999, LONG_TOK);
2237 YY_BREAK
2238 case 148:
2239 YY_RULE_SETUP
2240 #line 359 "glsl_lexer.ll"
2241 KEYWORD(110 || ES, 999, SHORT_TOK);
2242 YY_BREAK
2243 case 149:
2244 YY_RULE_SETUP
2245 #line 360 "glsl_lexer.ll"
2246 KEYWORD(110 || ES, 400, DOUBLE_TOK);
2247 YY_BREAK
2248 case 150:
2249 YY_RULE_SETUP
2250 #line 361 "glsl_lexer.ll"
2251 KEYWORD(110 || ES, 999, HALF);
2252 YY_BREAK
2253 case 151:
2254 YY_RULE_SETUP
2255 #line 362 "glsl_lexer.ll"
2256 KEYWORD(110 || ES, 999, FIXED_TOK);
2257 YY_BREAK
2258 case 152:
2259 YY_RULE_SETUP
2260 #line 363 "glsl_lexer.ll"
2261 KEYWORD(110 || ES, 999, UNSIGNED);
2262 YY_BREAK
2263 case 153:
2264 YY_RULE_SETUP
2265 #line 364 "glsl_lexer.ll"
2266 KEYWORD(110 || ES, 999, INPUT_TOK);
2267 YY_BREAK
2268 case 154:
2269 YY_RULE_SETUP
2270 #line 365 "glsl_lexer.ll"
2271 KEYWORD(110 || ES, 999, OUTPUT);
2272 YY_BREAK
2273 case 155:
2274 YY_RULE_SETUP
2275 #line 366 "glsl_lexer.ll"
2276 KEYWORD(110 || ES, 999, HVEC2);
2277 YY_BREAK
2278 case 156:
2279 YY_RULE_SETUP
2280 #line 367 "glsl_lexer.ll"
2281 KEYWORD(110 || ES, 999, HVEC3);
2282 YY_BREAK
2283 case 157:
2284 YY_RULE_SETUP
2285 #line 368 "glsl_lexer.ll"
2286 KEYWORD(110 || ES, 999, HVEC4);
2287 YY_BREAK
2288 case 158:
2289 YY_RULE_SETUP
2290 #line 369 "glsl_lexer.ll"
2291 KEYWORD(110 || ES, 400, DVEC2);
2292 YY_BREAK
2293 case 159:
2294 YY_RULE_SETUP
2295 #line 370 "glsl_lexer.ll"
2296 KEYWORD(110 || ES, 400, DVEC3);
2297 YY_BREAK
2298 case 160:
2299 YY_RULE_SETUP
2300 #line 371 "glsl_lexer.ll"
2301 KEYWORD(110 || ES, 400, DVEC4);
2302 YY_BREAK
2303 case 161:
2304 YY_RULE_SETUP
2305 #line 372 "glsl_lexer.ll"
2306 KEYWORD(110 || ES, 999, FVEC2);
2307 YY_BREAK
2308 case 162:
2309 YY_RULE_SETUP
2310 #line 373 "glsl_lexer.ll"
2311 KEYWORD(110 || ES, 999, FVEC3);
2312 YY_BREAK
2313 case 163:
2314 YY_RULE_SETUP
2315 #line 374 "glsl_lexer.ll"
2316 KEYWORD(110 || ES, 999, FVEC4);
2317 YY_BREAK
2318 case 164:
2319 YY_RULE_SETUP
2320 #line 375 "glsl_lexer.ll"
2321 return SAMPLER2DRECT;
2322 YY_BREAK
2323 case 165:
2324 YY_RULE_SETUP
2325 #line 376 "glsl_lexer.ll"
2326 KEYWORD(110 || ES, 999, SAMPLER3DRECT);
2327 YY_BREAK
2328 case 166:
2329 YY_RULE_SETUP
2330 #line 377 "glsl_lexer.ll"
2331 return SAMPLER2DRECTSHADOW;
2332 YY_BREAK
2333 case 167:
2334 YY_RULE_SETUP
2335 #line 378 "glsl_lexer.ll"
2336 KEYWORD(110 || ES, 999, SIZEOF);
2337 YY_BREAK
2338 case 168:
2339 YY_RULE_SETUP
2340 #line 379 "glsl_lexer.ll"
2341 KEYWORD(110 || ES, 999, CAST);
2342 YY_BREAK
2343 case 169:
2344 YY_RULE_SETUP
2345 #line 380 "glsl_lexer.ll"
2346 KEYWORD(110 || ES, 999, NAMESPACE);
2347 YY_BREAK
2348 case 170:
2349 YY_RULE_SETUP
2350 #line 381 "glsl_lexer.ll"
2351 KEYWORD(110 || ES, 999, USING);
2352 YY_BREAK
2353 /* Additional reserved words in GLSL 1.20. */
2354 case 171:
2355 YY_RULE_SETUP
2356 #line 384 "glsl_lexer.ll"
2357 KEYWORD(120, 130 || ES, LOWP);
2358 YY_BREAK
2359 case 172:
2360 YY_RULE_SETUP
2361 #line 385 "glsl_lexer.ll"
2362 KEYWORD(120, 130 || ES, MEDIUMP);
2363 YY_BREAK
2364 case 173:
2365 YY_RULE_SETUP
2366 #line 386 "glsl_lexer.ll"
2367 KEYWORD(120, 130 || ES, HIGHP);
2368 YY_BREAK
2369 case 174:
2370 YY_RULE_SETUP
2371 #line 387 "glsl_lexer.ll"
2372 KEYWORD(120, 130 || ES, PRECISION);
2373 YY_BREAK
2374 /* Additional reserved words in GLSL 1.30. */
2375 case 175:
2376 YY_RULE_SETUP
2377 #line 390 "glsl_lexer.ll"
2378 KEYWORD(130, 130, CASE);
2379 YY_BREAK
2380 case 176:
2381 YY_RULE_SETUP
2382 #line 391 "glsl_lexer.ll"
2383 KEYWORD(130, 999, COMMON);
2384 YY_BREAK
2385 case 177:
2386 YY_RULE_SETUP
2387 #line 392 "glsl_lexer.ll"
2388 KEYWORD(130, 999, PARTITION);
2389 YY_BREAK
2390 case 178:
2391 YY_RULE_SETUP
2392 #line 393 "glsl_lexer.ll"
2393 KEYWORD(130, 999, ACTIVE);
2394 YY_BREAK
2395 case 179:
2396 YY_RULE_SETUP
2397 #line 394 "glsl_lexer.ll"
2398 KEYWORD(130 || ES, 999, SUPERP);
2399 YY_BREAK
2400 case 180:
2401 YY_RULE_SETUP
2402 #line 395 "glsl_lexer.ll"
2403 KEYWORD(130, 140, SAMPLERBUFFER);
2404 YY_BREAK
2405 case 181:
2406 YY_RULE_SETUP
2407 #line 396 "glsl_lexer.ll"
2408 KEYWORD(130, 999, FILTER);
2409 YY_BREAK
2410 case 182:
2411 YY_RULE_SETUP
2412 #line 397 "glsl_lexer.ll"
2413 KEYWORD(130, 999, IMAGE1D);
2414 YY_BREAK
2415 case 183:
2416 YY_RULE_SETUP
2417 #line 398 "glsl_lexer.ll"
2418 KEYWORD(130, 999, IMAGE2D);
2419 YY_BREAK
2420 case 184:
2421 YY_RULE_SETUP
2422 #line 399 "glsl_lexer.ll"
2423 KEYWORD(130, 999, IMAGE3D);
2424 YY_BREAK
2425 case 185:
2426 YY_RULE_SETUP
2427 #line 400 "glsl_lexer.ll"
2428 KEYWORD(130, 999, IMAGECUBE);
2429 YY_BREAK
2430 case 186:
2431 YY_RULE_SETUP
2432 #line 401 "glsl_lexer.ll"
2433 KEYWORD(130, 999, IIMAGE1D);
2434 YY_BREAK
2435 case 187:
2436 YY_RULE_SETUP
2437 #line 402 "glsl_lexer.ll"
2438 KEYWORD(130, 999, IIMAGE2D);
2439 YY_BREAK
2440 case 188:
2441 YY_RULE_SETUP
2442 #line 403 "glsl_lexer.ll"
2443 KEYWORD(130, 999, IIMAGE3D);
2444 YY_BREAK
2445 case 189:
2446 YY_RULE_SETUP
2447 #line 404 "glsl_lexer.ll"
2448 KEYWORD(130, 999, IIMAGECUBE);
2449 YY_BREAK
2450 case 190:
2451 YY_RULE_SETUP
2452 #line 405 "glsl_lexer.ll"
2453 KEYWORD(130, 999, UIMAGE1D);
2454 YY_BREAK
2455 case 191:
2456 YY_RULE_SETUP
2457 #line 406 "glsl_lexer.ll"
2458 KEYWORD(130, 999, UIMAGE2D);
2459 YY_BREAK
2460 case 192:
2461 YY_RULE_SETUP
2462 #line 407 "glsl_lexer.ll"
2463 KEYWORD(130, 999, UIMAGE3D);
2464 YY_BREAK
2465 case 193:
2466 YY_RULE_SETUP
2467 #line 408 "glsl_lexer.ll"
2468 KEYWORD(130, 999, UIMAGECUBE);
2469 YY_BREAK
2470 case 194:
2471 YY_RULE_SETUP
2472 #line 409 "glsl_lexer.ll"
2473 KEYWORD(130, 999, IMAGE1DARRAY);
2474 YY_BREAK
2475 case 195:
2476 YY_RULE_SETUP
2477 #line 410 "glsl_lexer.ll"
2478 KEYWORD(130, 999, IMAGE2DARRAY);
2479 YY_BREAK
2480 case 196:
2481 YY_RULE_SETUP
2482 #line 411 "glsl_lexer.ll"
2483 KEYWORD(130, 999, IIMAGE1DARRAY);
2484 YY_BREAK
2485 case 197:
2486 YY_RULE_SETUP
2487 #line 412 "glsl_lexer.ll"
2488 KEYWORD(130, 999, IIMAGE2DARRAY);
2489 YY_BREAK
2490 case 198:
2491 YY_RULE_SETUP
2492 #line 413 "glsl_lexer.ll"
2493 KEYWORD(130, 999, UIMAGE1DARRAY);
2494 YY_BREAK
2495 case 199:
2496 YY_RULE_SETUP
2497 #line 414 "glsl_lexer.ll"
2498 KEYWORD(130, 999, UIMAGE2DARRAY);
2499 YY_BREAK
2500 case 200:
2501 YY_RULE_SETUP
2502 #line 415 "glsl_lexer.ll"
2503 KEYWORD(130, 999, IMAGE1DSHADOW);
2504 YY_BREAK
2505 case 201:
2506 YY_RULE_SETUP
2507 #line 416 "glsl_lexer.ll"
2508 KEYWORD(130, 999, IMAGE2DSHADOW);
2509 YY_BREAK
2510 case 202:
2511 YY_RULE_SETUP
2512 #line 417 "glsl_lexer.ll"
2513 KEYWORD(130, 999, IMAGE1DARRAYSHADOW);
2514 YY_BREAK
2515 case 203:
2516 YY_RULE_SETUP
2517 #line 418 "glsl_lexer.ll"
2518 KEYWORD(130, 999, IMAGE2DARRAYSHADOW);
2519 YY_BREAK
2520 case 204:
2521 YY_RULE_SETUP
2522 #line 419 "glsl_lexer.ll"
2523 KEYWORD(130, 999, IMAGEBUFFER);
2524 YY_BREAK
2525 case 205:
2526 YY_RULE_SETUP
2527 #line 420 "glsl_lexer.ll"
2528 KEYWORD(130, 999, IIMAGEBUFFER);
2529 YY_BREAK
2530 case 206:
2531 YY_RULE_SETUP
2532 #line 421 "glsl_lexer.ll"
2533 KEYWORD(130, 999, UIMAGEBUFFER);
2534 YY_BREAK
2535 case 207:
2536 YY_RULE_SETUP
2537 #line 422 "glsl_lexer.ll"
2538 KEYWORD(130, 999, ROW_MAJOR);
2539 YY_BREAK
2540 case 208:
2541 YY_RULE_SETUP
2542 #line 424 "glsl_lexer.ll"
2544 struct _mesa_glsl_parse_state *state = yyextra;
2545 void *ctx = state;
2546 yylval->identifier = ralloc_strdup(ctx, yytext);
2547 return classify_identifier(state, yytext);
2549 YY_BREAK
2550 case 209:
2551 YY_RULE_SETUP
2552 #line 431 "glsl_lexer.ll"
2553 { return yytext[0]; }
2554 YY_BREAK
2555 case 210:
2556 YY_RULE_SETUP
2557 #line 433 "glsl_lexer.ll"
2558 ECHO;
2559 YY_BREAK
2560 #line 2561 "glsl_lexer.cpp"
2561 case YY_STATE_EOF(INITIAL):
2562 case YY_STATE_EOF(PP):
2563 case YY_STATE_EOF(PRAGMA):
2564 yyterminate();
2566 case YY_END_OF_BUFFER:
2568 /* Amount of text matched not including the EOB char. */
2569 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2571 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2572 *yy_cp = yyg->yy_hold_char;
2573 YY_RESTORE_YY_MORE_OFFSET
2575 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2577 /* We're scanning a new file or input source. It's
2578 * possible that this happened because the user
2579 * just pointed yyin at a new source and called
2580 * _mesa_glsl_lex(). If so, then we have to assure
2581 * consistency between YY_CURRENT_BUFFER and our
2582 * globals. Here is the right place to do so, because
2583 * this is the first action (other than possibly a
2584 * back-up) that will match for the new input source.
2586 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2587 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2588 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2591 /* Note that here we test for yy_c_buf_p "<=" to the position
2592 * of the first EOB in the buffer, since yy_c_buf_p will
2593 * already have been incremented past the NUL character
2594 * (since all states make transitions on EOB to the
2595 * end-of-buffer state). Contrast this with the test
2596 * in input().
2598 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2599 { /* This was really a NUL. */
2600 yy_state_type yy_next_state;
2602 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2604 yy_current_state = yy_get_previous_state( yyscanner );
2606 /* Okay, we're now positioned to make the NUL
2607 * transition. We couldn't have
2608 * yy_get_previous_state() go ahead and do it
2609 * for us because it doesn't know how to deal
2610 * with the possibility of jamming (and we don't
2611 * want to build jamming into it because then it
2612 * will run more slowly).
2615 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2617 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2619 if ( yy_next_state )
2621 /* Consume the NUL. */
2622 yy_cp = ++yyg->yy_c_buf_p;
2623 yy_current_state = yy_next_state;
2624 goto yy_match;
2627 else
2629 yy_cp = yyg->yy_last_accepting_cpos;
2630 yy_current_state = yyg->yy_last_accepting_state;
2631 goto yy_find_action;
2635 else switch ( yy_get_next_buffer( yyscanner ) )
2637 case EOB_ACT_END_OF_FILE:
2639 yyg->yy_did_buffer_switch_on_eof = 0;
2641 if ( _mesa_glsl_wrap(yyscanner ) )
2643 /* Note: because we've taken care in
2644 * yy_get_next_buffer() to have set up
2645 * yytext, we can now set up
2646 * yy_c_buf_p so that if some total
2647 * hoser (like flex itself) wants to
2648 * call the scanner after we return the
2649 * YY_NULL, it'll still work - another
2650 * YY_NULL will get returned.
2652 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2654 yy_act = YY_STATE_EOF(YY_START);
2655 goto do_action;
2658 else
2660 if ( ! yyg->yy_did_buffer_switch_on_eof )
2661 YY_NEW_FILE;
2663 break;
2666 case EOB_ACT_CONTINUE_SCAN:
2667 yyg->yy_c_buf_p =
2668 yyg->yytext_ptr + yy_amount_of_matched_text;
2670 yy_current_state = yy_get_previous_state( yyscanner );
2672 yy_cp = yyg->yy_c_buf_p;
2673 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2674 goto yy_match;
2676 case EOB_ACT_LAST_MATCH:
2677 yyg->yy_c_buf_p =
2678 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2680 yy_current_state = yy_get_previous_state( yyscanner );
2682 yy_cp = yyg->yy_c_buf_p;
2683 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2684 goto yy_find_action;
2686 break;
2689 default:
2690 YY_FATAL_ERROR(
2691 "fatal flex scanner internal error--no action found" );
2692 } /* end of action switch */
2693 } /* end of scanning one token */
2694 } /* end of _mesa_glsl_lex */
2696 /* yy_get_next_buffer - try to read in a new buffer
2698 * Returns a code representing an action:
2699 * EOB_ACT_LAST_MATCH -
2700 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2701 * EOB_ACT_END_OF_FILE - end of file
2703 static int yy_get_next_buffer (yyscan_t yyscanner)
2705 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2706 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2707 register char *source = yyg->yytext_ptr;
2708 register int number_to_move, i;
2709 int ret_val;
2711 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2712 YY_FATAL_ERROR(
2713 "fatal flex scanner internal error--end of buffer missed" );
2715 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2716 { /* Don't try to fill the buffer, so this is an EOF. */
2717 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2719 /* We matched a single character, the EOB, so
2720 * treat this as a final EOF.
2722 return EOB_ACT_END_OF_FILE;
2725 else
2727 /* We matched some text prior to the EOB, first
2728 * process it.
2730 return EOB_ACT_LAST_MATCH;
2734 /* Try to read more data. */
2736 /* First move last chars to start of buffer. */
2737 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2739 for ( i = 0; i < number_to_move; ++i )
2740 *(dest++) = *(source++);
2742 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2743 /* don't do the read, it's not guaranteed to return an EOF,
2744 * just force an EOF
2746 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2748 else
2750 int num_to_read =
2751 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2753 while ( num_to_read <= 0 )
2754 { /* Not enough room in the buffer - grow it. */
2756 /* just a shorter name for the current buffer */
2757 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2759 int yy_c_buf_p_offset =
2760 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2762 if ( b->yy_is_our_buffer )
2764 int new_size = b->yy_buf_size * 2;
2766 if ( new_size <= 0 )
2767 b->yy_buf_size += b->yy_buf_size / 8;
2768 else
2769 b->yy_buf_size *= 2;
2771 b->yy_ch_buf = (char *)
2772 /* Include room in for 2 EOB chars. */
2773 _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2775 else
2776 /* Can't grow it, we don't own it. */
2777 b->yy_ch_buf = 0;
2779 if ( ! b->yy_ch_buf )
2780 YY_FATAL_ERROR(
2781 "fatal error - scanner input buffer overflow" );
2783 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2785 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2786 number_to_move - 1;
2790 if ( num_to_read > YY_READ_BUF_SIZE )
2791 num_to_read = YY_READ_BUF_SIZE;
2793 /* Read in more data. */
2794 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2795 yyg->yy_n_chars, (size_t) num_to_read );
2797 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2800 if ( yyg->yy_n_chars == 0 )
2802 if ( number_to_move == YY_MORE_ADJ )
2804 ret_val = EOB_ACT_END_OF_FILE;
2805 _mesa_glsl_restart(yyin ,yyscanner);
2808 else
2810 ret_val = EOB_ACT_LAST_MATCH;
2811 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2812 YY_BUFFER_EOF_PENDING;
2816 else
2817 ret_val = EOB_ACT_CONTINUE_SCAN;
2819 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2820 /* Extend the array by 50%, plus the number we really need. */
2821 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2822 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2823 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2824 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2827 yyg->yy_n_chars += number_to_move;
2828 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2829 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2831 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2833 return ret_val;
2836 /* yy_get_previous_state - get the state just before the EOB char was reached */
2838 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2840 register yy_state_type yy_current_state;
2841 register char *yy_cp;
2842 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2844 yy_current_state = yyg->yy_start;
2845 yy_current_state += YY_AT_BOL();
2847 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2849 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2850 if ( yy_accept[yy_current_state] )
2852 yyg->yy_last_accepting_state = yy_current_state;
2853 yyg->yy_last_accepting_cpos = yy_cp;
2855 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2857 yy_current_state = (int) yy_def[yy_current_state];
2858 if ( yy_current_state >= 836 )
2859 yy_c = yy_meta[(unsigned int) yy_c];
2861 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2864 return yy_current_state;
2867 /* yy_try_NUL_trans - try to make a transition on the NUL character
2869 * synopsis
2870 * next_state = yy_try_NUL_trans( current_state );
2872 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2874 register int yy_is_jam;
2875 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2876 register char *yy_cp = yyg->yy_c_buf_p;
2878 register YY_CHAR yy_c = 1;
2879 if ( yy_accept[yy_current_state] )
2881 yyg->yy_last_accepting_state = yy_current_state;
2882 yyg->yy_last_accepting_cpos = yy_cp;
2884 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2886 yy_current_state = (int) yy_def[yy_current_state];
2887 if ( yy_current_state >= 836 )
2888 yy_c = yy_meta[(unsigned int) yy_c];
2890 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2891 yy_is_jam = (yy_current_state == 835);
2893 return yy_is_jam ? 0 : yy_current_state;
2896 #ifndef YY_NO_INPUT
2897 #ifdef __cplusplus
2898 static int yyinput (yyscan_t yyscanner)
2899 #else
2900 static int input (yyscan_t yyscanner)
2901 #endif
2904 int c;
2905 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2907 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2909 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2911 /* yy_c_buf_p now points to the character we want to return.
2912 * If this occurs *before* the EOB characters, then it's a
2913 * valid NUL; if not, then we've hit the end of the buffer.
2915 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2916 /* This was really a NUL. */
2917 *yyg->yy_c_buf_p = '\0';
2919 else
2920 { /* need more input */
2921 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2922 ++yyg->yy_c_buf_p;
2924 switch ( yy_get_next_buffer( yyscanner ) )
2926 case EOB_ACT_LAST_MATCH:
2927 /* This happens because yy_g_n_b()
2928 * sees that we've accumulated a
2929 * token and flags that we need to
2930 * try matching the token before
2931 * proceeding. But for input(),
2932 * there's no matching to consider.
2933 * So convert the EOB_ACT_LAST_MATCH
2934 * to EOB_ACT_END_OF_FILE.
2937 /* Reset buffer status. */
2938 _mesa_glsl_restart(yyin ,yyscanner);
2940 /*FALLTHROUGH*/
2942 case EOB_ACT_END_OF_FILE:
2944 if ( _mesa_glsl_wrap(yyscanner ) )
2945 return EOF;
2947 if ( ! yyg->yy_did_buffer_switch_on_eof )
2948 YY_NEW_FILE;
2949 #ifdef __cplusplus
2950 return yyinput(yyscanner);
2951 #else
2952 return input(yyscanner);
2953 #endif
2956 case EOB_ACT_CONTINUE_SCAN:
2957 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2958 break;
2963 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2964 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2965 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2967 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2969 return c;
2971 #endif /* ifndef YY_NO_INPUT */
2973 /** Immediately switch to a different input stream.
2974 * @param input_file A readable stream.
2975 * @param yyscanner The scanner object.
2976 * @note This function does not reset the start condition to @c INITIAL .
2978 void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner)
2980 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2982 if ( ! YY_CURRENT_BUFFER ){
2983 _mesa_glsl_ensure_buffer_stack (yyscanner);
2984 YY_CURRENT_BUFFER_LVALUE =
2985 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2988 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2989 _mesa_glsl__load_buffer_state(yyscanner );
2992 /** Switch to a different input buffer.
2993 * @param new_buffer The new input buffer.
2994 * @param yyscanner The scanner object.
2996 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2998 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3000 /* TODO. We should be able to replace this entire function body
3001 * with
3002 * _mesa_glsl_pop_buffer_state();
3003 * _mesa_glsl_push_buffer_state(new_buffer);
3005 _mesa_glsl_ensure_buffer_stack (yyscanner);
3006 if ( YY_CURRENT_BUFFER == new_buffer )
3007 return;
3009 if ( YY_CURRENT_BUFFER )
3011 /* Flush out information for old buffer. */
3012 *yyg->yy_c_buf_p = yyg->yy_hold_char;
3013 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
3014 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
3017 YY_CURRENT_BUFFER_LVALUE = new_buffer;
3018 _mesa_glsl__load_buffer_state(yyscanner );
3020 /* We don't actually know whether we did this switch during
3021 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
3022 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
3023 * to go ahead and always set it.
3025 yyg->yy_did_buffer_switch_on_eof = 1;
3028 static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner)
3030 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3031 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3032 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
3033 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
3034 yyg->yy_hold_char = *yyg->yy_c_buf_p;
3037 /** Allocate and initialize an input buffer state.
3038 * @param file A readable stream.
3039 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3040 * @param yyscanner The scanner object.
3041 * @return the allocated buffer state.
3043 YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner)
3045 YY_BUFFER_STATE b;
3047 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3048 if ( ! b )
3049 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
3051 b->yy_buf_size = size;
3053 /* yy_ch_buf has to be 2 characters longer than the size given because
3054 * we need to put in 2 end-of-buffer characters.
3056 b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner );
3057 if ( ! b->yy_ch_buf )
3058 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
3060 b->yy_is_our_buffer = 1;
3062 _mesa_glsl__init_buffer(b,file ,yyscanner);
3064 return b;
3067 /** Destroy the buffer.
3068 * @param b a buffer created with _mesa_glsl__create_buffer()
3069 * @param yyscanner The scanner object.
3071 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
3073 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3075 if ( ! b )
3076 return;
3078 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3079 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3081 if ( b->yy_is_our_buffer )
3082 _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner );
3084 _mesa_glsl_free((void *) b ,yyscanner );
3087 /* Initializes or reinitializes a buffer.
3088 * This function is sometimes called more than once on the same buffer,
3089 * such as during a _mesa_glsl_restart() or at EOF.
3091 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
3094 int oerrno = errno;
3095 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3097 _mesa_glsl__flush_buffer(b ,yyscanner);
3099 b->yy_input_file = file;
3100 b->yy_fill_buffer = 1;
3102 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
3103 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
3104 * In that case, we don't want to reset the lineno or column.
3106 if (b != YY_CURRENT_BUFFER){
3107 b->yy_bs_lineno = 1;
3108 b->yy_bs_column = 0;
3111 b->yy_is_interactive = 0;
3113 errno = oerrno;
3116 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3117 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3118 * @param yyscanner The scanner object.
3120 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
3122 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3123 if ( ! b )
3124 return;
3126 b->yy_n_chars = 0;
3128 /* We always need two end-of-buffer characters. The first causes
3129 * a transition to the end-of-buffer state. The second causes
3130 * a jam in that state.
3132 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3133 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3135 b->yy_buf_pos = &b->yy_ch_buf[0];
3137 b->yy_at_bol = 1;
3138 b->yy_buffer_status = YY_BUFFER_NEW;
3140 if ( b == YY_CURRENT_BUFFER )
3141 _mesa_glsl__load_buffer_state(yyscanner );
3144 /** Pushes the new state onto the stack. The new state becomes
3145 * the current state. This function will allocate the stack
3146 * if necessary.
3147 * @param new_buffer The new state.
3148 * @param yyscanner The scanner object.
3150 void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
3152 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3153 if (new_buffer == NULL)
3154 return;
3156 _mesa_glsl_ensure_buffer_stack(yyscanner);
3158 /* This block is copied from _mesa_glsl__switch_to_buffer. */
3159 if ( YY_CURRENT_BUFFER )
3161 /* Flush out information for old buffer. */
3162 *yyg->yy_c_buf_p = yyg->yy_hold_char;
3163 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
3164 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
3167 /* Only push if top exists. Otherwise, replace top. */
3168 if (YY_CURRENT_BUFFER)
3169 yyg->yy_buffer_stack_top++;
3170 YY_CURRENT_BUFFER_LVALUE = new_buffer;
3172 /* copied from _mesa_glsl__switch_to_buffer. */
3173 _mesa_glsl__load_buffer_state(yyscanner );
3174 yyg->yy_did_buffer_switch_on_eof = 1;
3177 /** Removes and deletes the top of the stack, if present.
3178 * The next element becomes the new top.
3179 * @param yyscanner The scanner object.
3181 void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner)
3183 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3184 if (!YY_CURRENT_BUFFER)
3185 return;
3187 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
3188 YY_CURRENT_BUFFER_LVALUE = NULL;
3189 if (yyg->yy_buffer_stack_top > 0)
3190 --yyg->yy_buffer_stack_top;
3192 if (YY_CURRENT_BUFFER) {
3193 _mesa_glsl__load_buffer_state(yyscanner );
3194 yyg->yy_did_buffer_switch_on_eof = 1;
3198 /* Allocates the stack if it does not exist.
3199 * Guarantees space for at least one push.
3201 static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner)
3203 int num_to_alloc;
3204 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3206 if (!yyg->yy_buffer_stack) {
3208 /* First allocation is just for 2 elements, since we don't know if this
3209 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3210 * immediate realloc on the next call.
3212 num_to_alloc = 1;
3213 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc
3214 (num_to_alloc * sizeof(struct yy_buffer_state*)
3215 , yyscanner);
3216 if ( ! yyg->yy_buffer_stack )
3217 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3219 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3221 yyg->yy_buffer_stack_max = num_to_alloc;
3222 yyg->yy_buffer_stack_top = 0;
3223 return;
3226 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3228 /* Increase the buffer to prepare for a possible push. */
3229 int grow_size = 8 /* arbitrary grow size */;
3231 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3232 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc
3233 (yyg->yy_buffer_stack,
3234 num_to_alloc * sizeof(struct yy_buffer_state*)
3235 , yyscanner);
3236 if ( ! yyg->yy_buffer_stack )
3237 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3239 /* zero only the new slots.*/
3240 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3241 yyg->yy_buffer_stack_max = num_to_alloc;
3245 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3246 * @param base the character buffer
3247 * @param size the size in bytes of the character buffer
3248 * @param yyscanner The scanner object.
3249 * @return the newly allocated buffer state object.
3251 YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3253 YY_BUFFER_STATE b;
3255 if ( size < 2 ||
3256 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3257 base[size-1] != YY_END_OF_BUFFER_CHAR )
3258 /* They forgot to leave room for the EOB's. */
3259 return 0;
3261 b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3262 if ( ! b )
3263 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3265 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3266 b->yy_buf_pos = b->yy_ch_buf = base;
3267 b->yy_is_our_buffer = 0;
3268 b->yy_input_file = 0;
3269 b->yy_n_chars = b->yy_buf_size;
3270 b->yy_is_interactive = 0;
3271 b->yy_at_bol = 1;
3272 b->yy_fill_buffer = 0;
3273 b->yy_buffer_status = YY_BUFFER_NEW;
3275 _mesa_glsl__switch_to_buffer(b ,yyscanner );
3277 return b;
3280 /** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3281 * scan from a @e copy of @a str.
3282 * @param yystr a NUL-terminated string to scan
3283 * @param yyscanner The scanner object.
3284 * @return the newly allocated buffer state object.
3285 * @note If you want to scan bytes that may contain NUL values, then use
3286 * _mesa_glsl__scan_bytes() instead.
3288 YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner)
3291 return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner);
3294 /** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3295 * scan from a @e copy of @a bytes.
3296 * @param bytes the byte buffer to scan
3297 * @param len the number of bytes in the buffer pointed to by @a bytes.
3298 * @param yyscanner The scanner object.
3299 * @return the newly allocated buffer state object.
3301 YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3303 YY_BUFFER_STATE b;
3304 char *buf;
3305 yy_size_t n;
3306 int i;
3308 /* Get memory for full buffer, including space for trailing EOB's. */
3309 n = _yybytes_len + 2;
3310 buf = (char *) _mesa_glsl_alloc(n ,yyscanner );
3311 if ( ! buf )
3312 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3314 for ( i = 0; i < _yybytes_len; ++i )
3315 buf[i] = yybytes[i];
3317 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3319 b = _mesa_glsl__scan_buffer(buf,n ,yyscanner);
3320 if ( ! b )
3321 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3323 /* It's okay to grow etc. this buffer, and we should throw it
3324 * away when we're done.
3326 b->yy_is_our_buffer = 1;
3328 return b;
3331 #ifndef YY_EXIT_FAILURE
3332 #define YY_EXIT_FAILURE 2
3333 #endif
3335 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3337 (void) fprintf( stderr, "%s\n", msg );
3338 exit( YY_EXIT_FAILURE );
3341 /* Redefine yyless() so it works in section 3 code. */
3343 #undef yyless
3344 #define yyless(n) \
3345 do \
3347 /* Undo effects of setting up yytext. */ \
3348 int yyless_macro_arg = (n); \
3349 YY_LESS_LINENO(yyless_macro_arg);\
3350 yytext[yyleng] = yyg->yy_hold_char; \
3351 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3352 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3353 *yyg->yy_c_buf_p = '\0'; \
3354 yyleng = yyless_macro_arg; \
3356 while ( 0 )
3358 /* Accessor methods (get/set functions) to struct members. */
3360 /** Get the user-defined data for this scanner.
3361 * @param yyscanner The scanner object.
3363 YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner)
3365 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3366 return yyextra;
3369 /** Get the current line number.
3370 * @param yyscanner The scanner object.
3372 int _mesa_glsl_get_lineno (yyscan_t yyscanner)
3374 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3376 if (! YY_CURRENT_BUFFER)
3377 return 0;
3379 return yylineno;
3382 /** Get the current column number.
3383 * @param yyscanner The scanner object.
3385 int _mesa_glsl_get_column (yyscan_t yyscanner)
3387 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3389 if (! YY_CURRENT_BUFFER)
3390 return 0;
3392 return yycolumn;
3395 /** Get the input stream.
3396 * @param yyscanner The scanner object.
3398 FILE *_mesa_glsl_get_in (yyscan_t yyscanner)
3400 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3401 return yyin;
3404 /** Get the output stream.
3405 * @param yyscanner The scanner object.
3407 FILE *_mesa_glsl_get_out (yyscan_t yyscanner)
3409 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3410 return yyout;
3413 /** Get the length of the current token.
3414 * @param yyscanner The scanner object.
3416 int _mesa_glsl_get_leng (yyscan_t yyscanner)
3418 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3419 return yyleng;
3422 /** Get the current token.
3423 * @param yyscanner The scanner object.
3426 char *_mesa_glsl_get_text (yyscan_t yyscanner)
3428 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3429 return yytext;
3432 /** Set the user-defined data. This data is never touched by the scanner.
3433 * @param user_defined The data to be associated with this scanner.
3434 * @param yyscanner The scanner object.
3436 void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3438 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3439 yyextra = user_defined ;
3442 /** Set the current line number.
3443 * @param line_number
3444 * @param yyscanner The scanner object.
3446 void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner)
3448 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3450 /* lineno is only valid if an input buffer exists. */
3451 if (! YY_CURRENT_BUFFER )
3452 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner);
3454 yylineno = line_number;
3457 /** Set the current column.
3458 * @param line_number
3459 * @param yyscanner The scanner object.
3461 void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner)
3463 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3465 /* column is only valid if an input buffer exists. */
3466 if (! YY_CURRENT_BUFFER )
3467 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner);
3469 yycolumn = column_no;
3472 /** Set the input stream. This does not discard the current
3473 * input buffer.
3474 * @param in_str A readable stream.
3475 * @param yyscanner The scanner object.
3476 * @see _mesa_glsl__switch_to_buffer
3478 void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner)
3480 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3481 yyin = in_str ;
3484 void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner)
3486 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3487 yyout = out_str ;
3490 int _mesa_glsl_get_debug (yyscan_t yyscanner)
3492 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3493 return yy_flex_debug;
3496 void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner)
3498 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3499 yy_flex_debug = bdebug ;
3502 /* Accessor methods for yylval and yylloc */
3504 YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner)
3506 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3507 return yylval;
3510 void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3512 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3513 yylval = yylval_param;
3516 YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner)
3518 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3519 return yylloc;
3522 void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3524 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3525 yylloc = yylloc_param;
3528 /* User-visible API */
3530 /* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3531 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3532 * That's why we explicitly handle the declaration, instead of using our macros.
3535 int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals)
3538 if (ptr_yy_globals == NULL){
3539 errno = EINVAL;
3540 return 1;
3543 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL );
3545 if (*ptr_yy_globals == NULL){
3546 errno = ENOMEM;
3547 return 1;
3550 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3551 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3553 return yy_init_globals ( *ptr_yy_globals );
3556 /* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3557 * convention of taking the scanner as the last argument. Note however, that
3558 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3559 * is the reason, too, why this function also must handle its own declaration).
3560 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3561 * the yyextra field.
3564 int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3567 struct yyguts_t dummy_yyguts;
3569 _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts);
3571 if (ptr_yy_globals == NULL){
3572 errno = EINVAL;
3573 return 1;
3576 *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3578 if (*ptr_yy_globals == NULL){
3579 errno = ENOMEM;
3580 return 1;
3583 /* By setting to 0xAA, we expose bugs in
3584 yy_init_globals. Leave at 0x00 for releases. */
3585 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3587 _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals);
3589 return yy_init_globals ( *ptr_yy_globals );
3592 static int yy_init_globals (yyscan_t yyscanner)
3594 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3595 /* Initialization is the same as for the non-reentrant scanner.
3596 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3599 yyg->yy_buffer_stack = 0;
3600 yyg->yy_buffer_stack_top = 0;
3601 yyg->yy_buffer_stack_max = 0;
3602 yyg->yy_c_buf_p = (char *) 0;
3603 yyg->yy_init = 0;
3604 yyg->yy_start = 0;
3606 yyg->yy_start_stack_ptr = 0;
3607 yyg->yy_start_stack_depth = 0;
3608 yyg->yy_start_stack = NULL;
3610 /* Defined in main.c */
3611 #ifdef YY_STDINIT
3612 yyin = stdin;
3613 yyout = stdout;
3614 #else
3615 yyin = (FILE *) 0;
3616 yyout = (FILE *) 0;
3617 #endif
3619 /* For future reference: Set errno on error, since we are called by
3620 * _mesa_glsl_lex_init()
3622 return 0;
3625 /* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3626 int _mesa_glsl_lex_destroy (yyscan_t yyscanner)
3628 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3630 /* Pop the buffer stack, destroying each element. */
3631 while(YY_CURRENT_BUFFER){
3632 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3633 YY_CURRENT_BUFFER_LVALUE = NULL;
3634 _mesa_glsl_pop_buffer_state(yyscanner);
3637 /* Destroy the stack itself. */
3638 _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner);
3639 yyg->yy_buffer_stack = NULL;
3641 /* Destroy the start condition stack. */
3642 _mesa_glsl_free(yyg->yy_start_stack ,yyscanner );
3643 yyg->yy_start_stack = NULL;
3645 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3646 * _mesa_glsl_lex() is called, initialization will occur. */
3647 yy_init_globals( yyscanner);
3649 /* Destroy the main struct (reentrant only). */
3650 _mesa_glsl_free ( yyscanner , yyscanner );
3651 yyscanner = NULL;
3652 return 0;
3656 * Internal utility routines.
3659 #ifndef yytext_ptr
3660 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3662 register int i;
3663 for ( i = 0; i < n; ++i )
3664 s1[i] = s2[i];
3666 #endif
3668 #ifdef YY_NEED_STRLEN
3669 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3671 register int n;
3672 for ( n = 0; s[n]; ++n )
3675 return n;
3677 #endif
3679 void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner)
3681 return (void *) malloc( size );
3684 void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3686 /* The cast to (char *) in the following accommodates both
3687 * implementations that use char* generic pointers, and those
3688 * that use void* generic pointers. It works with the latter
3689 * because both ANSI C and C++ allow castless assignment from
3690 * any pointer type to void*, and deal with argument conversions
3691 * as though doing an assignment.
3693 return (void *) realloc( (char *) ptr, size );
3696 void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
3698 free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */
3701 #define YYTABLES_NAME "yytables"
3703 #line 433 "glsl_lexer.ll"
3708 classify_identifier(struct _mesa_glsl_parse_state *state, const char *name)
3710 if (state->symbols->get_variable(name) || state->symbols->get_function(name))
3711 return IDENTIFIER;
3712 else if (state->symbols->get_type(name))
3713 return TYPE_IDENTIFIER;
3714 else
3715 return NEW_IDENTIFIER;
3718 void
3719 _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
3721 _mesa_glsl_lex_init_extra(state,& state->scanner);
3722 _mesa_glsl__scan_string(string,state->scanner);
3725 void
3726 _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
3728 _mesa_glsl_lex_destroy(state->scanner);