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 */
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
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
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
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
;
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
;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
89 #endif /* ! FLEXINT_H */
93 /* The "const" storage-class-modifier is valid. */
96 #else /* ! __cplusplus */
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
103 #endif /* defined (__STDC__) */
104 #endif /* ! __cplusplus */
107 #define yyconst const
112 /* Returned upon end-of-file. */
115 /* Promotes a possibly negative, possibly signed char to an unsigned
116 * integer for use as an array index. If the signed char is negative,
117 * we want to instead treat it as an 8-bit unsigned char, hence the
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
122 /* An opaque pointer. */
123 #ifndef YY_TYPEDEF_YY_SCANNER_T
124 #define YY_TYPEDEF_YY_SCANNER_T
125 typedef void* yyscan_t
;
128 /* For convenience, these vars (plus the bison vars far below)
129 are macros in the reentrant scanner. */
130 #define yyin yyg->yyin_r
131 #define yyout yyg->yyout_r
132 #define yyextra yyg->yyextra_r
133 #define yyleng yyg->yyleng_r
134 #define yytext yyg->yytext_r
135 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
136 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
137 #define yy_flex_debug yyg->yy_flex_debug_r
139 /* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
143 #define BEGIN yyg->yy_start = 1 + 2 *
145 /* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
149 #define YY_START ((yyg->yy_start - 1) / 2)
150 #define YYSTATE YY_START
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE _mesa_glsl_restart(yyin ,yyscanner )
158 #define YY_END_OF_BUFFER_CHAR 0
160 /* Size of default input buffer. */
163 /* On IA-64, the buffer size is 16k, not 8k.
164 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
165 * Ditto for the __ia64__ case accordingly.
167 #define YY_BUF_SIZE 32768
169 #define YY_BUF_SIZE 16384
170 #endif /* __ia64__ */
173 /* The state buf must be large enough to hold one state per character in the main buffer.
175 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
177 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
178 #define YY_TYPEDEF_YY_BUFFER_STATE
179 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
182 #define EOB_ACT_CONTINUE_SCAN 0
183 #define EOB_ACT_END_OF_FILE 1
184 #define EOB_ACT_LAST_MATCH 2
186 #define YY_LESS_LINENO(n)
188 /* Return all but the first "n" matched characters back to the input stream. */
192 /* Undo effects of setting up yytext. */ \
193 int yyless_macro_arg = (n); \
194 YY_LESS_LINENO(yyless_macro_arg);\
195 *yy_cp = yyg->yy_hold_char; \
196 YY_RESTORE_YY_MORE_OFFSET \
197 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
202 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
204 #ifndef YY_TYPEDEF_YY_SIZE_T
205 #define YY_TYPEDEF_YY_SIZE_T
206 typedef size_t yy_size_t
;
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
215 char *yy_ch_buf
; /* input buffer */
216 char *yy_buf_pos
; /* current position in input buffer */
218 /* Size of input buffer in bytes, not including room for EOB
221 yy_size_t yy_buf_size
;
223 /* Number of characters read into yy_ch_buf, not including EOB
228 /* Whether we "own" the buffer - i.e., we know we created it,
229 * and can realloc() it to grow it, and should free() it to
232 int yy_is_our_buffer
;
234 /* Whether this is an "interactive" input source; if so, and
235 * if we're using stdio for input, then we want to use getc()
236 * instead of fread(), to make sure we stop fetching input after
239 int yy_is_interactive
;
241 /* Whether we're considered to be at the beginning of a line.
242 * If so, '^' rules will be active on the next match, otherwise
247 int yy_bs_lineno
; /**< The line count. */
248 int yy_bs_column
; /**< The column count. */
250 /* Whether to try to fill the input buffer when we reach the
255 int yy_buffer_status
;
257 #define YY_BUFFER_NEW 0
258 #define YY_BUFFER_NORMAL 1
259 /* When an EOF's been seen but there's still some text to process
260 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261 * shouldn't try reading from the input source any more. We might
262 * still have a bunch of tokens to match, though, because of
263 * possible backing-up.
265 * When we actually see the EOF, we change the status to "new"
266 * (via _mesa_glsl_restart()), so that the user can continue scanning by
267 * just pointing yyin at a new input file.
269 #define YY_BUFFER_EOF_PENDING 2
272 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
274 /* We provide macros for accessing buffer states in case in the
275 * future we want to put the buffer states in a more general
278 * Returns the top of the stack, or NULL.
280 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
281 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
284 /* Same as previous macro, but useful when we know that the buffer stack is not
285 * NULL or when we need an lvalue. For internal use only.
287 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
289 void _mesa_glsl_restart (FILE *input_file
,yyscan_t yyscanner
);
290 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
291 YY_BUFFER_STATE
_mesa_glsl__create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
292 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
293 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
294 void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
295 void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner
);
297 static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner
);
298 static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner
);
299 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
301 #define YY_FLUSH_BUFFER _mesa_glsl__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
303 YY_BUFFER_STATE
_mesa_glsl__scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
304 YY_BUFFER_STATE
_mesa_glsl__scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
305 YY_BUFFER_STATE
_mesa_glsl__scan_bytes (yyconst
char *bytes
,int len
,yyscan_t yyscanner
);
307 void *_mesa_glsl_alloc (yy_size_t
,yyscan_t yyscanner
);
308 void *_mesa_glsl_realloc (void *,yy_size_t
,yyscan_t yyscanner
);
309 void _mesa_glsl_free (void * ,yyscan_t yyscanner
);
311 #define yy_new_buffer _mesa_glsl__create_buffer
313 #define yy_set_interactive(is_interactive) \
315 if ( ! YY_CURRENT_BUFFER ){ \
316 _mesa_glsl_ensure_buffer_stack (yyscanner); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
320 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
323 #define yy_set_bol(at_bol) \
325 if ( ! YY_CURRENT_BUFFER ){\
326 _mesa_glsl_ensure_buffer_stack (yyscanner); \
327 YY_CURRENT_BUFFER_LVALUE = \
328 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
330 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
333 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
335 /* Begin user sect3 */
337 #define _mesa_glsl_wrap(n) 1
338 #define YY_SKIP_YYWRAP
340 typedef unsigned char YY_CHAR
;
342 typedef int yy_state_type
;
344 #define yytext_ptr yytext_r
346 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
347 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
348 static int yy_get_next_buffer (yyscan_t yyscanner
);
349 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
351 /* Done after the current pattern has been matched and before the
352 * corresponding action - sets up yytext.
354 #define YY_DO_BEFORE_ACTION \
355 yyg->yytext_ptr = yy_bp; \
356 yyleng = (size_t) (yy_cp - yy_bp); \
357 yyg->yy_hold_char = *yy_cp; \
359 yyg->yy_c_buf_p = yy_cp;
361 #define YY_NUM_RULES 189
362 #define YY_END_OF_BUFFER 190
363 /* This struct is not used in this scanner,
364 but its presence is necessary. */
367 flex_int32_t yy_verify
;
370 static yyconst flex_int16_t yy_accept
[716] =
372 0, 0, 15, 15, 0, 0, 190, 188, 1, 20,
373 188, 188, 188, 188, 188, 188, 188, 188, 102, 100,
374 188, 188, 188, 187, 188, 187, 187, 187, 187, 187,
375 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
376 187, 187, 187, 187, 187, 188, 1, 188, 189, 15,
377 19, 189, 18, 16, 17, 13, 12, 1, 84, 93,
378 85, 96, 90, 79, 92, 80, 99, 104, 91, 105,
379 102, 0, 0, 107, 0, 100, 88, 81, 83, 82,
380 89, 187, 97, 87, 187, 187, 187, 187, 187, 187,
381 187, 187, 187, 187, 187, 187, 29, 187, 187, 187,
383 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
384 33, 187, 187, 60, 187, 187, 187, 187, 187, 187,
385 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
386 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
387 187, 187, 187, 187, 187, 187, 98, 86, 1, 0,
388 0, 2, 0, 0, 0, 0, 15, 14, 18, 17,
389 0, 104, 103, 0, 105, 0, 106, 101, 94, 95,
390 187, 110, 187, 187, 187, 187, 187, 187, 187, 187,
391 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
392 187, 187, 187, 32, 187, 187, 187, 187, 187, 187,
394 187, 187, 187, 187, 25, 187, 187, 187, 187, 187,
395 187, 187, 187, 187, 187, 61, 187, 187, 187, 187,
396 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
397 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
398 187, 187, 187, 187, 187, 0, 0, 0, 0, 14,
399 0, 104, 0, 103, 0, 105, 106, 187, 187, 23,
400 187, 187, 150, 187, 187, 187, 187, 187, 187, 187,
401 187, 187, 31, 113, 187, 187, 187, 187, 67, 187,
402 187, 118, 132, 187, 187, 187, 187, 187, 187, 187,
403 187, 187, 187, 187, 129, 153, 48, 49, 50, 187,
405 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
406 187, 187, 187, 187, 187, 187, 187, 187, 187, 116,
407 108, 187, 187, 26, 187, 187, 187, 187, 187, 187,
408 45, 46, 47, 77, 187, 187, 0, 0, 0, 0,
409 0, 103, 187, 187, 27, 36, 37, 38, 187, 111,
410 187, 22, 187, 187, 187, 187, 140, 141, 142, 187,
411 109, 187, 133, 24, 143, 144, 145, 155, 137, 138,
412 139, 187, 187, 187, 62, 135, 187, 187, 39, 40,
413 41, 187, 187, 187, 187, 187, 187, 187, 187, 187,
414 187, 187, 187, 187, 187, 187, 187, 130, 187, 187,
416 187, 187, 187, 187, 187, 187, 187, 187, 112, 187,
417 152, 42, 43, 44, 187, 187, 30, 0, 0, 0,
418 0, 159, 187, 187, 157, 187, 187, 187, 131, 126,
419 162, 187, 187, 187, 187, 187, 187, 121, 187, 187,
420 78, 51, 52, 53, 54, 55, 56, 57, 58, 59,
421 187, 187, 187, 187, 136, 117, 187, 187, 124, 35,
422 187, 187, 149, 68, 125, 76, 160, 119, 187, 187,
423 187, 187, 187, 187, 187, 0, 0, 0, 0, 187,
424 187, 187, 120, 34, 187, 187, 187, 187, 187, 187,
425 163, 164, 165, 187, 187, 187, 187, 154, 187, 187,
427 187, 187, 187, 187, 187, 187, 114, 187, 187, 187,
428 187, 187, 63, 187, 64, 187, 0, 0, 0, 0,
429 0, 187, 65, 28, 127, 167, 168, 169, 187, 187,
430 187, 187, 187, 187, 187, 187, 187, 187, 187, 122,
431 187, 187, 187, 187, 187, 187, 187, 187, 187, 115,
432 171, 172, 173, 187, 187, 134, 123, 0, 0, 6,
433 0, 0, 0, 11, 3, 21, 187, 187, 187, 187,
434 187, 187, 187, 187, 187, 166, 128, 66, 151, 187,
435 158, 156, 186, 70, 71, 72, 187, 187, 187, 187,
436 187, 187, 0, 0, 0, 0, 0, 0, 187, 187,
438 187, 170, 187, 187, 187, 187, 187, 187, 187, 187,
439 187, 187, 187, 187, 187, 187, 187, 174, 4, 0,
440 5, 0, 0, 0, 0, 0, 187, 187, 187, 187,
441 187, 187, 187, 183, 187, 187, 187, 187, 187, 187,
442 73, 187, 187, 187, 0, 0, 0, 187, 187, 184,
443 175, 187, 176, 187, 187, 187, 187, 187, 187, 187,
444 187, 187, 185, 0, 0, 177, 178, 181, 182, 69,
445 187, 146, 187, 147, 161, 179, 180, 0, 0, 187,
446 187, 187, 0, 0, 0, 74, 187, 75, 0, 0,
447 0, 187, 0, 0, 0, 187, 0, 0, 7, 0,
449 0, 187, 0, 8, 0, 0, 148, 0, 0, 0,
453 static yyconst flex_int32_t yy_ec
[256] =
455 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
456 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
459 10, 11, 12, 1, 13, 14, 15, 16, 17, 18,
460 19, 20, 21, 21, 21, 22, 22, 23, 1, 24,
461 25, 26, 1, 1, 27, 28, 29, 30, 31, 32,
462 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
463 33, 34, 35, 33, 33, 33, 33, 36, 33, 33,
464 1, 1, 1, 37, 38, 1, 39, 40, 41, 42,
466 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
467 53, 54, 33, 55, 56, 57, 58, 59, 60, 61,
468 62, 63, 1, 64, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
485 static yyconst flex_int32_t yy_meta
[65] =
487 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
488 1, 1, 1, 1, 1, 4, 4, 4, 4, 4,
489 4, 5, 1, 1, 1, 1, 6, 6, 6, 6,
490 5, 5, 7, 7, 7, 8, 1, 7, 6, 6,
491 6, 6, 5, 5, 7, 7, 7, 7, 7, 7,
492 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
496 static yyconst flex_int16_t yy_base
[727] =
498 0, 63, 69, 0, 1083, 1082, 1084, 1087, 64, 1087,
499 1058, 1057, 126, 1056, 123, 124, 122, 1055, 138, 186,
500 121, 1054, 136, 0, 128, 122, 113, 134, 133, 133,
501 162, 1025, 151, 172, 97, 128, 136, 1019, 156, 179,
502 187, 193, 190, 211, 1030, 163, 254, 238, 1087, 189,
503 1087, 1060, 249, 1087, 0, 1087, 1087, 249, 1087, 1087,
504 1087, 1087, 1087, 1087, 1087, 1087, 1087, 230, 1087, 246,
505 221, 284, 301, 1087, 0, 0, 1049, 1087, 1087, 1087,
506 1048, 0, 1087, 1087, 1015, 1020, 1013, 1016, 1025, 1024,
507 1010, 1013, 1025, 145, 1019, 1006, 1003, 1017, 1003, 1000,
509 1000, 1006, 202, 233, 1000, 1011, 996, 1002, 1006, 1007,
510 0, 998, 1009, 226, 1004, 984, 168, 988, 1002, 992,
511 237, 985, 252, 998, 1000, 982, 978, 986, 983, 972,
512 981, 204, 979, 985, 980, 983, 971, 974, 243, 240,
513 980, 983, 970, 983, 261, 976, 1087, 1087, 327, 307,
514 322, 1087, 961, 974, 965, 976, 328, 0, 318, 0,
515 366, 1087, 310, 377, 1087, 327, 384, 0, 1087, 1087,
516 971, 0, 962, 966, 976, 973, 956, 955, 955, 959,
517 295, 970, 967, 967, 965, 962, 953, 960, 946, 944,
518 957, 942, 959, 0, 956, 943, 951, 948, 952, 953,
520 946, 943, 931, 930, 944, 947, 944, 931, 938, 928,
521 340, 934, 937, 927, 935, 923, 927, 918, 933, 923,
522 914, 933, 916, 914, 925, 914, 909, 907, 921, 906,
523 908, 905, 917, 916, 919, 900, 311, 909, 903, 913,
524 891, 349, 910, 912, 900, 892, 896, 908, 891, 0,
525 391, 401, 418, 1087, 430, 437, 1087, 886, 897, 0,
526 894, 355, 0, 887, 885, 887, 882, 891, 879, 897,
527 885, 406, 0, 0, 879, 890, 889, 889, 0, 873,
528 423, 0, 0, 875, 442, 883, 884, 874, 868, 867,
529 868, 867, 445, 863, 0, 0, 859, 858, 857, 859,
531 860, 865, 859, 855, 869, 864, 863, 862, 853, 856,
532 856, 848, 851, 846, 855, 860, 845, 858, 848, 0,
533 0, 855, 851, 0, 842, 842, 848, 847, 448, 844,
534 0, 0, 0, 0, 833, 846, 845, 844, 841, 829,
535 454, 466, 841, 843, 0, 0, 0, 0, 829, 0,
536 829, 0, 828, 829, 823, 834, 0, 0, 0, 824,
537 0, 820, 0, 0, 0, 0, 0, 0, 0, 0,
538 0, 831, 461, 830, 0, 0, 828, 824, 0, 0,
539 0, 813, 473, 476, 481, 818, 814, 820, 810, 808,
540 822, 806, 806, 820, 808, 820, 815, 0, 813, 810,
542 814, 797, 799, 806, 812, 807, 806, 793, 0, 795,
543 0, 0, 0, 0, 794, 798, 0, 792, 841, 791,
544 794, 0, 782, 792, 0, 780, 780, 794, 0, 796,
545 0, 485, 804, 803, 802, 773, 772, 0, 790, 789,
546 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
547 773, 787, 773, 770, 0, 0, 776, 775, 0, 0,
548 773, 765, 0, 0, 0, 0, 0, 0, 762, 774,
549 488, 766, 773, 770, 764, 757, 506, 773, 758, 753,
550 767, 765, 0, 0, 757, 776, 775, 774, 745, 744,
551 335, 336, 0, 757, 760, 758, 746, 0, 756, 753,
553 752, 741, 740, 739, 501, 748, 0, 760, 759, 758,
554 729, 728, 0, 743, 0, 741, 736, 509, 530, 780,
555 729, 737, 0, 0, 0, 752, 751, 0, 733, 736,
556 720, 728, 718, 726, 727, 727, 726, 711, 724, 0,
557 725, 713, 712, 708, 732, 731, 730, 701, 700, 0,
558 730, 729, 0, 711, 714, 0, 0, 700, 537, 1087,
559 558, 0, 564, 560, 1087, 0, 697, 696, 706, 706,
560 693, 708, 691, 706, 701, 0, 0, 0, 0, 686,
561 0, 0, 0, 707, 357, 707, 696, 699, 683, 682,
562 692, 692, 682, 532, 587, 412, 690, 678, 676, 675,
564 686, 0, 689, 685, 687, 683, 669, 676, 676, 678,
565 674, 676, 674, 674, 661, 660, 671, 0, 1087, 534,
566 1087, 598, 0, 608, 673, 655, 672, 671, 654, 646,
567 654, 644, 652, 0, 645, 664, 661, 658, 655, 652,
568 0, 648, 647, 630, 539, 618, 600, 584, 583, 0,
569 0, 579, 0, 578, 594, 580, 564, 527, 506, 489,
570 453, 447, 0, 452, 426, 0, 0, 0, 0, 0,
571 391, 397, 376, 0, 0, 0, 0, 529, 380, 320,
572 331, 296, 562, 273, 249, 0, 260, 0, 519, 521,
573 192, 183, 169, 585, 589, 111, 586, 610, 1087, 590,
575 541, 87, 621, 1087, 595, 588, 0, 23, 631, 632,
576 633, 1087, 634, 1087, 1087, 648, 653, 658, 663, 665,
577 667, 673, 680, 685, 690, 695
580 static yyconst flex_int16_t yy_def
[727] =
582 715, 1, 715, 3, 716, 716, 715, 715, 715, 715,
583 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
584 715, 715, 715, 717, 715, 717, 717, 717, 717, 717,
585 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
586 717, 717, 717, 717, 717, 715, 715, 715, 715, 715,
587 715, 715, 715, 715, 718, 715, 715, 715, 715, 715,
588 715, 715, 715, 715, 715, 715, 715, 719, 715, 720,
589 19, 715, 715, 715, 721, 20, 715, 715, 715, 715,
590 715, 717, 715, 715, 717, 717, 717, 717, 717, 717,
591 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
593 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
594 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
595 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
596 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
597 717, 717, 717, 717, 717, 717, 715, 715, 715, 715,
598 715, 715, 715, 715, 715, 715, 715, 722, 715, 718,
599 715, 715, 720, 715, 715, 715, 715, 721, 715, 715,
600 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
601 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
602 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
604 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
605 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
606 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
607 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
608 717, 717, 717, 717, 717, 715, 715, 715, 715, 722,
609 715, 715, 715, 715, 715, 715, 715, 717, 717, 717,
610 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
611 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
612 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
613 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
615 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
616 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
617 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
618 717, 717, 717, 717, 717, 717, 715, 715, 715, 715,
619 715, 715, 717, 717, 717, 717, 717, 717, 717, 717,
620 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
621 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
622 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
623 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
624 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
626 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
627 717, 717, 717, 717, 717, 717, 717, 715, 715, 715,
628 715, 717, 717, 717, 717, 717, 717, 717, 717, 717,
629 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
630 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
631 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
632 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
633 717, 717, 717, 717, 717, 715, 715, 715, 715, 717,
634 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
635 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
637 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
638 717, 717, 717, 717, 717, 717, 715, 723, 715, 715,
639 715, 717, 717, 717, 717, 717, 717, 717, 717, 717,
640 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
641 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
642 717, 717, 717, 717, 717, 717, 717, 715, 715, 715,
643 715, 724, 715, 715, 715, 717, 717, 717, 717, 717,
644 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
645 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
646 717, 717, 715, 725, 715, 724, 715, 715, 717, 717,
648 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
649 717, 717, 717, 717, 717, 717, 717, 717, 715, 715,
650 715, 715, 726, 715, 715, 715, 717, 717, 717, 717,
651 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
652 717, 717, 717, 717, 726, 715, 715, 717, 717, 717,
653 717, 717, 717, 717, 717, 717, 717, 717, 717, 717,
654 717, 717, 717, 715, 715, 717, 717, 717, 717, 717,
655 717, 717, 717, 717, 717, 717, 717, 715, 715, 717,
656 717, 717, 715, 715, 715, 717, 717, 717, 715, 715,
657 715, 717, 715, 715, 715, 717, 715, 715, 715, 715,
659 715, 717, 715, 715, 715, 715, 717, 715, 715, 715,
660 715, 715, 715, 715, 0, 715, 715, 715, 715, 715,
661 715, 715, 715, 715, 715, 715
664 static yyconst flex_int16_t yy_nxt
[1152] =
666 8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
667 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
668 20, 20, 8, 21, 22, 23, 24, 24, 24, 24,
669 24, 24, 24, 24, 24, 24, 25, 24, 26, 27,
670 28, 29, 30, 31, 32, 33, 34, 24, 24, 35,
671 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
672 24, 24, 24, 46, 47, 58, 710, 58, 48, 49,
673 50, 51, 50, 49, 49, 49, 49, 49, 49, 49,
674 49, 49, 49, 52, 49, 53, 53, 53, 53, 53,
675 53, 54, 49, 49, 49, 55, 55, 55, 55, 55,
677 55, 55, 55, 55, 55, 49, 55, 55, 55, 55,
678 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
679 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
680 55, 55, 49, 61, 64, 116, 66, 68, 68, 68,
681 68, 68, 68, 68, 77, 78, 707, 65, 67, 117,
682 62, 70, 83, 71, 71, 71, 71, 71, 71, 72,
683 80, 81, 85, 702, 84, 88, 118, 89, 73, 74,
684 119, 90, 91, 75, 120, 95, 92, 86, 87, 96,
685 73, 74, 99, 93, 100, 97, 94, 147, 121, 108,
686 157, 98, 157, 101, 123, 180, 181, 109, 75, 70,
688 102, 76, 76, 76, 76, 76, 76, 76, 103, 110,
689 124, 104, 697, 125, 105, 111, 73, 74, 112, 209,
690 106, 126, 113, 114, 696, 128, 148, 210, 73, 74,
691 115, 127, 129, 130, 695, 135, 139, 131, 136, 151,
692 152, 140, 227, 132, 133, 141, 134, 137, 142, 143,
693 58, 190, 58, 144, 138, 149, 715, 58, 228, 150,
694 161, 162, 191, 145, 159, 159, 159, 159, 159, 159,
695 159, 192, 161, 162, 689, 202, 164, 165, 203, 204,
696 153, 715, 205, 214, 206, 193, 237, 154, 164, 165,
697 215, 155, 217, 235, 236, 238, 156, 70, 692, 72,
699 72, 72, 72, 72, 72, 72, 218, 243, 151, 152,
700 244, 691, 166, 166, 73, 74, 167, 167, 167, 167,
701 167, 167, 167, 151, 152, 690, 73, 74, 149, 157,
702 58, 157, 150, 159, 159, 159, 159, 159, 159, 159,
703 253, 254, 167, 167, 167, 167, 167, 167, 167, 153,
704 267, 268, 253, 254, 325, 688, 154, 297, 298, 299,
705 155, 531, 533, 326, 153, 156, 331, 332, 333, 532,
706 534, 154, 346, 347, 348, 155, 687, 251, 251, 686,
707 156, 252, 252, 252, 252, 252, 252, 252, 255, 255,
708 610, 611, 256, 256, 256, 256, 256, 256, 256, 167,
710 167, 167, 167, 167, 167, 167, 252, 252, 252, 252,
711 252, 252, 252, 559, 560, 257, 252, 252, 252, 252,
712 252, 252, 252, 357, 358, 359, 685, 257, 682, 341,
713 341, 681, 162, 342, 342, 342, 342, 342, 342, 342,
714 365, 366, 367, 680, 162, 256, 256, 256, 256, 256,
715 256, 256, 256, 256, 256, 256, 256, 256, 256, 369,
716 370, 371, 379, 380, 381, 412, 413, 414, 165, 342,
717 342, 342, 342, 342, 342, 342, 679, 433, 434, 435,
718 165, 342, 342, 342, 342, 342, 342, 342, 436, 437,
719 442, 443, 444, 445, 446, 447, 678, 254, 448, 449,
721 450, 486, 487, 488, 508, 509, 510, 477, 677, 254,
722 559, 560, 489, 490, 676, 511, 512, 545, 546, 547,
723 689, 518, 519, 519, 519, 519, 519, 519, 548, 549,
724 683, 559, 560, 620, 621, 620, 621, 684, 559, 560,
725 620, 621, 705, 675, 562, 563, 563, 563, 563, 563,
726 563, 563, 594, 595, 595, 595, 595, 595, 595, 559,
727 560, 564, 674, 683, 693, 559, 560, 623, 673, 562,
728 684, 690, 694, 561, 561, 561, 561, 561, 561, 563,
729 563, 563, 563, 563, 563, 563, 698, 703, 620, 621,
730 700, 700, 623, 706, 699, 704, 705, 701, 701, 620,
732 621, 597, 624, 624, 624, 624, 624, 624, 624, 620,
733 621, 698, 598, 622, 622, 622, 622, 622, 622, 699,
734 672, 671, 703, 624, 624, 624, 624, 624, 624, 624,
735 704, 708, 711, 713, 711, 713, 670, 669, 668, 709,
736 712, 714, 712, 714, 667, 666, 665, 706, 56, 56,
737 56, 56, 56, 56, 56, 56, 82, 82, 82, 82,
738 82, 160, 160, 160, 160, 160, 68, 68, 163, 163,
739 168, 168, 168, 250, 250, 664, 250, 250, 250, 250,
740 250, 561, 561, 561, 663, 662, 661, 561, 596, 596,
741 596, 622, 622, 622, 660, 659, 658, 622, 645, 645,
743 645, 657, 656, 655, 654, 653, 652, 651, 650, 649,
744 648, 647, 646, 644, 643, 642, 641, 640, 639, 638,
745 637, 636, 635, 634, 633, 632, 631, 630, 629, 628,
746 627, 626, 625, 619, 618, 617, 616, 615, 614, 613,
747 612, 609, 608, 607, 606, 605, 604, 603, 602, 601,
748 600, 599, 593, 592, 591, 590, 589, 588, 587, 586,
749 585, 584, 583, 582, 581, 580, 579, 578, 577, 576,
750 575, 574, 573, 572, 571, 570, 569, 568, 567, 566,
751 565, 564, 558, 557, 556, 555, 554, 553, 552, 551,
752 550, 544, 543, 542, 541, 540, 539, 538, 537, 536,
754 535, 530, 529, 528, 527, 526, 525, 524, 523, 522,
755 521, 520, 517, 516, 515, 514, 513, 507, 506, 505,
756 504, 503, 502, 501, 500, 499, 498, 497, 496, 495,
757 494, 493, 492, 491, 485, 484, 483, 482, 481, 480,
758 479, 478, 477, 476, 475, 474, 473, 472, 471, 470,
759 469, 468, 467, 466, 465, 464, 463, 462, 461, 460,
760 459, 458, 457, 456, 455, 454, 453, 452, 451, 441,
761 440, 439, 438, 432, 431, 430, 429, 428, 427, 426,
762 425, 424, 423, 422, 421, 420, 419, 418, 417, 416,
763 415, 411, 410, 409, 408, 407, 406, 405, 404, 403,
765 402, 401, 400, 399, 398, 397, 396, 395, 394, 393,
766 392, 391, 390, 389, 388, 387, 386, 385, 384, 383,
767 382, 378, 377, 376, 375, 374, 373, 372, 368, 364,
768 363, 362, 361, 360, 356, 355, 354, 353, 352, 351,
769 350, 349, 345, 344, 343, 340, 339, 338, 337, 336,
770 335, 334, 330, 329, 328, 327, 324, 323, 322, 321,
771 320, 319, 318, 317, 316, 315, 314, 313, 312, 311,
772 310, 309, 308, 307, 306, 305, 304, 303, 302, 301,
773 300, 296, 295, 294, 293, 292, 291, 290, 289, 288,
774 287, 286, 285, 284, 283, 282, 281, 280, 279, 278,
776 277, 276, 275, 274, 273, 272, 271, 270, 269, 266,
777 265, 264, 263, 262, 261, 260, 259, 258, 249, 248,
778 247, 246, 245, 242, 241, 240, 239, 234, 233, 232,
779 231, 230, 229, 226, 225, 224, 223, 222, 221, 220,
780 219, 216, 213, 212, 211, 208, 207, 201, 200, 199,
781 198, 197, 196, 195, 194, 189, 188, 187, 186, 185,
782 184, 183, 182, 179, 178, 177, 176, 175, 174, 173,
783 172, 171, 170, 169, 158, 146, 122, 107, 79, 69,
784 63, 60, 59, 715, 57, 57, 7, 715, 715, 715,
785 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
787 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
788 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
789 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
790 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
791 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
795 static yyconst flex_int16_t yy_chk
[1152] =
797 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
798 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
799 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
800 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
801 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
802 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
803 1, 1, 1, 1, 2, 9, 708, 9, 2, 3,
804 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
805 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
806 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
808 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
809 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
810 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
811 3, 3, 3, 13, 15, 35, 16, 17, 17, 17,
812 17, 17, 17, 17, 21, 21, 702, 15, 16, 35,
813 13, 19, 25, 19, 19, 19, 19, 19, 19, 19,
814 23, 23, 26, 696, 25, 27, 36, 27, 19, 19,
815 36, 27, 28, 19, 37, 29, 28, 26, 26, 29,
816 19, 19, 30, 28, 30, 29, 28, 46, 37, 33,
817 50, 29, 50, 30, 39, 94, 94, 33, 19, 20,
819 31, 20, 20, 20, 20, 20, 20, 20, 31, 33,
820 39, 31, 693, 39, 31, 34, 20, 20, 34, 117,
821 31, 40, 34, 34, 692, 41, 46, 117, 20, 20,
822 34, 40, 41, 41, 691, 42, 43, 41, 42, 48,
823 48, 43, 132, 41, 41, 43, 41, 42, 43, 44,
824 58, 103, 58, 44, 42, 47, 71, 47, 132, 47,
825 68, 68, 103, 44, 53, 53, 53, 53, 53, 53,
826 53, 104, 68, 68, 684, 114, 70, 70, 114, 114,
827 48, 71, 114, 121, 114, 104, 140, 48, 70, 70,
828 121, 48, 123, 139, 139, 140, 48, 72, 687, 72,
830 72, 72, 72, 72, 72, 72, 123, 145, 150, 150,
831 145, 685, 73, 73, 72, 72, 73, 73, 73, 73,
832 73, 73, 73, 151, 151, 684, 72, 72, 149, 157,
833 149, 157, 149, 159, 159, 159, 159, 159, 159, 159,
834 163, 163, 166, 166, 166, 166, 166, 166, 166, 150,
835 181, 181, 163, 163, 237, 682, 150, 211, 211, 211,
836 150, 491, 492, 237, 151, 150, 242, 242, 242, 491,
837 492, 151, 262, 262, 262, 151, 681, 161, 161, 680,
838 151, 161, 161, 161, 161, 161, 161, 161, 164, 164,
839 585, 585, 164, 164, 164, 164, 164, 164, 164, 167,
841 167, 167, 167, 167, 167, 167, 251, 251, 251, 251,
842 251, 251, 251, 596, 596, 167, 252, 252, 252, 252,
843 252, 252, 252, 272, 272, 272, 679, 167, 673, 253,
844 253, 672, 252, 253, 253, 253, 253, 253, 253, 253,
845 281, 281, 281, 671, 252, 255, 255, 255, 255, 255,
846 255, 255, 256, 256, 256, 256, 256, 256, 256, 285,
847 285, 285, 293, 293, 293, 329, 329, 329, 256, 341,
848 341, 341, 341, 341, 341, 341, 665, 373, 373, 373,
849 256, 342, 342, 342, 342, 342, 342, 342, 373, 373,
850 383, 383, 383, 384, 384, 384, 664, 342, 385, 385,
852 385, 432, 432, 432, 471, 471, 471, 477, 662, 342,
853 518, 518, 432, 432, 661, 471, 471, 505, 505, 505,
854 689, 477, 477, 477, 477, 477, 477, 477, 505, 505,
855 678, 519, 519, 594, 594, 620, 620, 678, 559, 559,
856 645, 645, 701, 660, 518, 519, 519, 519, 519, 519,
857 519, 519, 559, 559, 559, 559, 559, 559, 559, 561,
858 561, 564, 659, 683, 690, 563, 563, 594, 658, 518,
859 683, 689, 690, 561, 561, 561, 561, 561, 561, 563,
860 563, 563, 563, 563, 563, 563, 694, 697, 595, 595,
861 695, 700, 594, 701, 694, 697, 705, 695, 700, 622,
863 622, 564, 595, 595, 595, 595, 595, 595, 595, 624,
864 624, 698, 564, 622, 622, 622, 622, 622, 622, 698,
865 657, 656, 703, 624, 624, 624, 624, 624, 624, 624,
866 703, 706, 709, 710, 711, 713, 655, 654, 652, 706,
867 709, 710, 711, 713, 649, 648, 647, 705, 716, 716,
868 716, 716, 716, 716, 716, 716, 717, 717, 717, 717,
869 717, 718, 718, 718, 718, 718, 719, 719, 720, 720,
870 721, 721, 721, 722, 722, 646, 722, 722, 722, 722,
871 722, 723, 723, 723, 644, 643, 642, 723, 724, 724,
872 724, 725, 725, 725, 640, 639, 638, 725, 726, 726,
874 726, 637, 636, 635, 633, 632, 631, 630, 629, 628,
875 627, 626, 625, 617, 616, 615, 614, 613, 612, 611,
876 610, 609, 608, 607, 606, 605, 604, 603, 601, 600,
877 599, 598, 597, 593, 592, 591, 590, 589, 588, 587,
878 586, 584, 580, 575, 574, 573, 572, 571, 570, 569,
879 568, 567, 558, 555, 554, 552, 551, 549, 548, 547,
880 546, 545, 544, 543, 542, 541, 539, 538, 537, 536,
881 535, 534, 533, 532, 531, 530, 529, 527, 526, 522,
882 521, 520, 517, 516, 514, 512, 511, 510, 509, 508,
883 506, 504, 503, 502, 501, 500, 499, 497, 496, 495,
885 494, 490, 489, 488, 487, 486, 485, 482, 481, 480,
886 479, 478, 476, 475, 474, 473, 472, 470, 469, 462,
887 461, 458, 457, 454, 453, 452, 451, 440, 439, 437,
888 436, 435, 434, 433, 430, 428, 427, 426, 424, 423,
889 421, 420, 419, 418, 416, 415, 410, 408, 407, 406,
890 405, 404, 403, 402, 401, 400, 399, 397, 396, 395,
891 394, 393, 392, 391, 390, 389, 388, 387, 386, 382,
892 378, 377, 374, 372, 362, 360, 356, 355, 354, 353,
893 351, 349, 344, 343, 340, 339, 338, 337, 336, 335,
894 330, 328, 327, 326, 325, 323, 322, 319, 318, 317,
896 316, 315, 314, 313, 312, 311, 310, 309, 308, 307,
897 306, 305, 304, 303, 302, 301, 300, 299, 298, 297,
898 294, 292, 291, 290, 289, 288, 287, 286, 284, 280,
899 278, 277, 276, 275, 271, 270, 269, 268, 267, 266,
900 265, 264, 261, 259, 258, 249, 248, 247, 246, 245,
901 244, 243, 241, 240, 239, 238, 236, 235, 234, 233,
902 232, 231, 230, 229, 228, 227, 226, 225, 224, 223,
903 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
904 212, 210, 209, 208, 207, 206, 205, 204, 203, 202,
905 201, 200, 199, 198, 197, 196, 195, 193, 192, 191,
907 190, 189, 188, 187, 186, 185, 184, 183, 182, 180,
908 179, 178, 177, 176, 175, 174, 173, 171, 156, 155,
909 154, 153, 146, 144, 143, 142, 141, 138, 137, 136,
910 135, 134, 133, 131, 130, 129, 128, 127, 126, 125,
911 124, 122, 120, 119, 118, 116, 115, 113, 112, 110,
912 109, 108, 107, 106, 105, 102, 101, 100, 99, 98,
913 97, 96, 95, 93, 92, 91, 90, 89, 88, 87,
914 86, 85, 81, 77, 52, 45, 38, 32, 22, 18,
915 14, 12, 11, 7, 6, 5, 715, 715, 715, 715,
916 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
918 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
919 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
920 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
921 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
922 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
926 /* The intent behind this definition is that it'll catch
927 * any uses of REJECT which flex missed.
929 #define REJECT reject_used_but_not_detected
930 #define yymore() yymore_used_but_not_detected
931 #define YY_MORE_ADJ 0
932 #define YY_RESTORE_YY_MORE_OFFSET
933 #line 1 "glsl_lexer.lpp"
934 #line 2 "glsl_lexer.lpp"
936 * Copyright © 2008, 2009 Intel Corporation
938 * Permission is hereby granted, free of charge, to any person obtaining a
939 * copy of this software and associated documentation files (the "Software"),
940 * to deal in the Software without restriction, including without limitation
941 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
942 * and/or sell copies of the Software, and to permit persons to whom the
943 * Software is furnished to do so, subject to the following conditions:
945 * The above copyright notice and this permission notice (including the next
946 * paragraph) shall be included in all copies or substantial portions of the
949 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
950 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
951 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
952 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
953 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
954 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
955 * DEALINGS IN THE SOFTWARE.
959 #include "glsl_parser_extras.h"
960 #include "glsl_parser.h"
962 #define YY_USER_ACTION \
964 yylloc->source = 0; \
965 yylloc->first_column = yycolumn + 1; \
966 yylloc->first_line = yylineno + 1; \
967 yycolumn += yyleng; \
970 #define YY_USER_INIT yylineno = 0; yycolumn = 0;
972 #define TOKEN_OR_IDENTIFIER(version, token) \
974 if (yyextra->language_version >= version) { \
977 yylval->identifier = strdup(yytext); \
982 /* Handle reserved words in GLSL ES (version 100) */
983 #define TOKEN_OR_IDENTIFIER_ES(version, token) \
985 if (yyextra->es_shader) { \
988 TOKEN_OR_IDENTIFIER(version, token); \
992 #define RESERVED_WORD(version, token) \
994 if (yyextra->language_version >= version) { \
997 _mesa_glsl_error(yylloc, yyextra, \
998 "Illegal use of reserved word `%s'", yytext); \
1003 #line 1004 "glsl_lexer.cpp"
1009 #define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
1011 /* Holds the entire state of the reentrant scanner. */
1015 /* User-defined. Not touched by flex. */
1016 YY_EXTRA_TYPE yyextra_r
;
1018 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1019 FILE *yyin_r
, *yyout_r
;
1020 size_t yy_buffer_stack_top
; /**< index of top of stack. */
1021 size_t yy_buffer_stack_max
; /**< capacity of stack. */
1022 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
1029 int yy_did_buffer_switch_on_eof
;
1030 int yy_start_stack_ptr
;
1031 int yy_start_stack_depth
;
1032 int *yy_start_stack
;
1033 yy_state_type yy_last_accepting_state
;
1034 char* yy_last_accepting_cpos
;
1037 int yy_flex_debug_r
;
1047 }; /* end struct yyguts_t */
1049 static int yy_init_globals (yyscan_t yyscanner
);
1051 /* This must go here because YYSTYPE and YYLTYPE are included
1052 * from bison output in section 1.*/
1053 # define yylval yyg->yylval_r
1055 # define yylloc yyg->yylloc_r
1057 int _mesa_glsl_lex_init (yyscan_t
* scanner
);
1059 int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
1061 /* Accessor methods to globals.
1062 These are made visible to non-reentrant scanners for convenience. */
1064 int _mesa_glsl_lex_destroy (yyscan_t yyscanner
);
1066 int _mesa_glsl_get_debug (yyscan_t yyscanner
);
1068 void _mesa_glsl_set_debug (int debug_flag
,yyscan_t yyscanner
);
1070 YY_EXTRA_TYPE
_mesa_glsl_get_extra (yyscan_t yyscanner
);
1072 void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
1074 FILE *_mesa_glsl_get_in (yyscan_t yyscanner
);
1076 void _mesa_glsl_set_in (FILE * in_str
,yyscan_t yyscanner
);
1078 FILE *_mesa_glsl_get_out (yyscan_t yyscanner
);
1080 void _mesa_glsl_set_out (FILE * out_str
,yyscan_t yyscanner
);
1082 int _mesa_glsl_get_leng (yyscan_t yyscanner
);
1084 char *_mesa_glsl_get_text (yyscan_t yyscanner
);
1086 int _mesa_glsl_get_lineno (yyscan_t yyscanner
);
1088 void _mesa_glsl_set_lineno (int line_number
,yyscan_t yyscanner
);
1090 YYSTYPE
* _mesa_glsl_get_lval (yyscan_t yyscanner
);
1092 void _mesa_glsl_set_lval (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
1094 YYLTYPE
*_mesa_glsl_get_lloc (yyscan_t yyscanner
);
1096 void _mesa_glsl_set_lloc (YYLTYPE
* yylloc_param
,yyscan_t yyscanner
);
1098 /* Macros after this point can all be overridden by user definitions in
1102 #ifndef YY_SKIP_YYWRAP
1104 extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner
);
1106 extern int _mesa_glsl_wrap (yyscan_t yyscanner
);
1111 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
1114 #ifdef YY_NEED_STRLEN
1115 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
1121 static int yyinput (yyscan_t yyscanner
);
1123 static int input (yyscan_t yyscanner
);
1128 /* Amount of stuff to slurp up with each read. */
1129 #ifndef YY_READ_BUF_SIZE
1131 /* On IA-64, the buffer size is 16k, not 8k */
1132 #define YY_READ_BUF_SIZE 16384
1134 #define YY_READ_BUF_SIZE 8192
1135 #endif /* __ia64__ */
1138 /* Copy whatever the last rule matched to the standard output. */
1140 /* This used to be an fputs(), but since the string might contain NUL's,
1141 * we now use fwrite().
1143 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1146 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1147 * is returned in "result".
1150 #define YY_INPUT(buf,result,max_size) \
1151 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1155 for ( n = 0; n < max_size && \
1156 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1157 buf[n] = (char) c; \
1159 buf[n++] = (char) c; \
1160 if ( c == EOF && ferror( yyin ) ) \
1161 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1167 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1169 if( errno != EINTR) \
1171 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1182 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1183 * we don't want an extra ';' after the "return" because that will cause
1184 * some compilers to complain about unreachable statements.
1187 #define yyterminate() return YY_NULL
1190 /* Number of entries by which start-condition stack grows. */
1191 #ifndef YY_START_STACK_INCR
1192 #define YY_START_STACK_INCR 25
1195 /* Report a fatal error. */
1196 #ifndef YY_FATAL_ERROR
1197 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1200 /* end tables serialization structures and prototypes */
1202 /* Default declaration of generated scanner - a define so the user can
1203 * easily add parameters.
1206 #define YY_DECL_IS_OURS 1
1208 extern int _mesa_glsl_lex \
1209 (YYSTYPE
* yylval_param
,YYLTYPE
* yylloc_param
,yyscan_t yyscanner
);
1211 #define YY_DECL int _mesa_glsl_lex \
1212 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1213 #endif /* !YY_DECL */
1215 /* Code executed at the beginning of each rule, after yytext and yyleng
1218 #ifndef YY_USER_ACTION
1219 #define YY_USER_ACTION
1222 /* Code executed at the end of each rule. */
1224 #define YY_BREAK break;
1227 #define YY_RULE_SETUP \
1229 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1230 (yytext[yyleng - 1] == '\n'); \
1233 /** The main scanner function which does all the work.
1237 register yy_state_type yy_current_state
;
1238 register char *yy_cp
, *yy_bp
;
1239 register int yy_act
;
1240 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1242 #line 86 "glsl_lexer.lpp"
1245 #line 1246 "glsl_lexer.cpp"
1247 yylval
= yylval_param
;
1249 yylloc
= yylloc_param
;
1251 if ( !yyg
->yy_init
)
1259 if ( ! yyg
->yy_start
)
1260 yyg
->yy_start
= 1; /* first start state */
1268 if ( ! YY_CURRENT_BUFFER
) {
1269 _mesa_glsl_ensure_buffer_stack (yyscanner
);
1270 YY_CURRENT_BUFFER_LVALUE
=
1271 _mesa_glsl__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1274 _mesa_glsl__load_buffer_state(yyscanner
);
1277 while ( 1 ) /* loops until end-of-file is reached */
1279 yy_cp
= yyg
->yy_c_buf_p
;
1281 /* Support of yytext. */
1282 *yy_cp
= yyg
->yy_hold_char
;
1284 /* yy_bp points to the position in yy_ch_buf of the start of
1289 yy_current_state
= yyg
->yy_start
;
1290 yy_current_state
+= YY_AT_BOL();
1294 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1295 if ( yy_accept
[yy_current_state
] )
1297 yyg
->yy_last_accepting_state
= yy_current_state
;
1298 yyg
->yy_last_accepting_cpos
= yy_cp
;
1300 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1302 yy_current_state
= (int) yy_def
[yy_current_state
];
1303 if ( yy_current_state
>= 716 )
1304 yy_c
= yy_meta
[(unsigned int) yy_c
];
1306 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1309 while ( yy_current_state
!= 715 );
1310 yy_cp
= yyg
->yy_last_accepting_cpos
;
1311 yy_current_state
= yyg
->yy_last_accepting_state
;
1314 yy_act
= yy_accept
[yy_current_state
];
1316 YY_DO_BEFORE_ACTION
;
1318 do_action
: /* This label is used only to access EOF actions. */
1321 { /* beginning of action switch */
1322 case 0: /* must back up */
1323 /* undo the effects of YY_DO_BEFORE_ACTION */
1324 *yy_cp
= yyg
->yy_hold_char
;
1325 yy_cp
= yyg
->yy_last_accepting_cpos
;
1326 yy_current_state
= yyg
->yy_last_accepting_state
;
1327 goto yy_find_action
;
1331 #line 88 "glsl_lexer.lpp"
1334 /* Preprocessor tokens. */
1336 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1337 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1338 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1340 #line 91 "glsl_lexer.lpp"
1345 #line 92 "glsl_lexer.lpp"
1346 { BEGIN PP
; return VERSION
; }
1350 #line 93 "glsl_lexer.lpp"
1351 { BEGIN PP
; return EXTENSION
; }
1354 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1355 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1356 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1358 #line 94 "glsl_lexer.lpp"
1360 /* Eat characters until the first digit is
1364 while (!isdigit(*ptr
))
1367 /* Subtract one from the line number because
1368 * yylineno is zero-based instead of
1371 yylineno
= strtol(ptr
, &ptr
, 0) - 1;
1372 yylloc
->source
= strtol(ptr
, NULL
, 0);
1376 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1377 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1378 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1380 #line 109 "glsl_lexer.lpp"
1382 /* Eat characters until the first digit is
1386 while (!isdigit(*ptr
))
1389 /* Subtract one from the line number because
1390 * yylineno is zero-based instead of
1393 yylineno
= strtol(ptr
, &ptr
, 0) - 1;
1398 #line 123 "glsl_lexer.lpp"
1401 return PRAGMA_DEBUG_ON
;
1406 #line 127 "glsl_lexer.lpp"
1409 return PRAGMA_DEBUG_OFF
;
1414 #line 131 "glsl_lexer.lpp"
1417 return PRAGMA_OPTIMIZE_ON
;
1422 #line 135 "glsl_lexer.lpp"
1425 return PRAGMA_OPTIMIZE_OFF
;
1430 #line 139 "glsl_lexer.lpp"
1434 /* rule 12 can match eol */
1436 #line 141 "glsl_lexer.lpp"
1437 { BEGIN
0; yylineno
++; yycolumn
= 0; }
1441 #line 142 "glsl_lexer.lpp"
1446 #line 144 "glsl_lexer.lpp"
1451 #line 145 "glsl_lexer.lpp"
1456 #line 146 "glsl_lexer.lpp"
1461 #line 147 "glsl_lexer.lpp"
1463 yylval
->identifier
= strdup(yytext
);
1469 #line 151 "glsl_lexer.lpp"
1471 yylval
->n
= strtol(yytext
, NULL
, 10);
1476 /* rule 19 can match eol */
1478 #line 155 "glsl_lexer.lpp"
1479 { BEGIN
0; yylineno
++; yycolumn
= 0; return EOL
; }
1482 /* rule 20 can match eol */
1484 #line 157 "glsl_lexer.lpp"
1485 { yylineno
++; yycolumn
= 0; }
1489 #line 159 "glsl_lexer.lpp"
1494 #line 160 "glsl_lexer.lpp"
1499 #line 161 "glsl_lexer.lpp"
1504 #line 162 "glsl_lexer.lpp"
1509 #line 163 "glsl_lexer.lpp"
1514 #line 164 "glsl_lexer.lpp"
1515 TOKEN_OR_IDENTIFIER(130, UINT_TOK
);
1519 #line 166 "glsl_lexer.lpp"
1524 #line 167 "glsl_lexer.lpp"
1529 #line 168 "glsl_lexer.lpp"
1534 #line 169 "glsl_lexer.lpp"
1539 #line 170 "glsl_lexer.lpp"
1544 #line 171 "glsl_lexer.lpp"
1549 #line 172 "glsl_lexer.lpp"
1554 #line 173 "glsl_lexer.lpp"
1559 #line 174 "glsl_lexer.lpp"
1564 #line 176 "glsl_lexer.lpp"
1569 #line 177 "glsl_lexer.lpp"
1574 #line 178 "glsl_lexer.lpp"
1579 #line 179 "glsl_lexer.lpp"
1584 #line 180 "glsl_lexer.lpp"
1589 #line 181 "glsl_lexer.lpp"
1594 #line 182 "glsl_lexer.lpp"
1595 TOKEN_OR_IDENTIFIER(130, UVEC2
);
1599 #line 183 "glsl_lexer.lpp"
1600 TOKEN_OR_IDENTIFIER(130, UVEC3
);
1604 #line 184 "glsl_lexer.lpp"
1605 TOKEN_OR_IDENTIFIER(130, UVEC4
);
1609 #line 185 "glsl_lexer.lpp"
1614 #line 186 "glsl_lexer.lpp"
1619 #line 187 "glsl_lexer.lpp"
1624 #line 188 "glsl_lexer.lpp"
1629 #line 189 "glsl_lexer.lpp"
1634 #line 190 "glsl_lexer.lpp"
1639 #line 191 "glsl_lexer.lpp"
1640 TOKEN_OR_IDENTIFIER(120, MAT2X2
);
1644 #line 192 "glsl_lexer.lpp"
1645 TOKEN_OR_IDENTIFIER(120, MAT2X3
);
1649 #line 193 "glsl_lexer.lpp"
1650 TOKEN_OR_IDENTIFIER(120, MAT2X4
);
1654 #line 194 "glsl_lexer.lpp"
1655 TOKEN_OR_IDENTIFIER(120, MAT3X2
);
1659 #line 195 "glsl_lexer.lpp"
1660 TOKEN_OR_IDENTIFIER(120, MAT3X3
);
1664 #line 196 "glsl_lexer.lpp"
1665 TOKEN_OR_IDENTIFIER(120, MAT3X4
);
1669 #line 197 "glsl_lexer.lpp"
1670 TOKEN_OR_IDENTIFIER(120, MAT4X2
);
1674 #line 198 "glsl_lexer.lpp"
1675 TOKEN_OR_IDENTIFIER(120, MAT4X3
);
1679 #line 199 "glsl_lexer.lpp"
1680 TOKEN_OR_IDENTIFIER(120, MAT4X4
);
1684 #line 201 "glsl_lexer.lpp"
1689 #line 202 "glsl_lexer.lpp"
1694 #line 203 "glsl_lexer.lpp"
1699 #line 204 "glsl_lexer.lpp"
1704 #line 205 "glsl_lexer.lpp"
1709 #line 206 "glsl_lexer.lpp"
1710 TOKEN_OR_IDENTIFIER(120, CENTROID
);
1714 #line 207 "glsl_lexer.lpp"
1715 TOKEN_OR_IDENTIFIER_ES(120, INVARIANT
);
1719 #line 209 "glsl_lexer.lpp"
1720 TOKEN_OR_IDENTIFIER_ES(130, FLAT
);
1724 #line 210 "glsl_lexer.lpp"
1725 TOKEN_OR_IDENTIFIER(130, SMOOTH
);
1729 #line 211 "glsl_lexer.lpp"
1730 TOKEN_OR_IDENTIFIER(130, NOPERSPECTIVE
);
1734 #line 213 "glsl_lexer.lpp"
1739 #line 214 "glsl_lexer.lpp"
1744 #line 215 "glsl_lexer.lpp"
1749 #line 216 "glsl_lexer.lpp"
1754 #line 217 "glsl_lexer.lpp"
1755 return SAMPLER1DSHADOW
;
1759 #line 218 "glsl_lexer.lpp"
1760 return SAMPLER2DSHADOW
;
1764 #line 220 "glsl_lexer.lpp"
1769 #line 221 "glsl_lexer.lpp"
1774 #line 223 "glsl_lexer.lpp"
1776 if ((yyextra
->language_version
>= 140)
1777 || yyextra
->ARB_explicit_attrib_location_enable
1778 || (yyextra
->ARB_fragment_coord_conventions_enable
)){
1781 yylval
->identifier
= strdup(yytext
);
1788 #line 234 "glsl_lexer.lpp"
1793 #line 235 "glsl_lexer.lpp"
1798 #line 236 "glsl_lexer.lpp"
1803 #line 237 "glsl_lexer.lpp"
1808 #line 238 "glsl_lexer.lpp"
1813 #line 239 "glsl_lexer.lpp"
1818 #line 240 "glsl_lexer.lpp"
1823 #line 241 "glsl_lexer.lpp"
1828 #line 242 "glsl_lexer.lpp"
1833 #line 243 "glsl_lexer.lpp"
1838 #line 244 "glsl_lexer.lpp"
1843 #line 246 "glsl_lexer.lpp"
1848 #line 247 "glsl_lexer.lpp"
1853 #line 248 "glsl_lexer.lpp"
1858 #line 249 "glsl_lexer.lpp"
1863 #line 250 "glsl_lexer.lpp"
1868 #line 251 "glsl_lexer.lpp"
1869 return RIGHT_ASSIGN
;
1873 #line 252 "glsl_lexer.lpp"
1878 #line 253 "glsl_lexer.lpp"
1883 #line 254 "glsl_lexer.lpp"
1888 #line 255 "glsl_lexer.lpp"
1893 #line 257 "glsl_lexer.lpp"
1895 yylval
->n
= strtol(yytext
, NULL
, 10);
1901 #line 261 "glsl_lexer.lpp"
1903 yylval
->n
= strtol(yytext
+ 2, NULL
, 16);
1909 #line 265 "glsl_lexer.lpp"
1911 yylval
->n
= strtol(yytext
, NULL
, 8);
1917 #line 270 "glsl_lexer.lpp"
1919 yylval
->real
= strtod(yytext
, NULL
);
1920 return FLOATCONSTANT
;
1925 #line 274 "glsl_lexer.lpp"
1927 yylval
->real
= strtod(yytext
, NULL
);
1928 return FLOATCONSTANT
;
1933 #line 278 "glsl_lexer.lpp"
1935 yylval
->real
= strtod(yytext
, NULL
);
1936 return FLOATCONSTANT
;
1941 #line 282 "glsl_lexer.lpp"
1943 yylval
->real
= strtod(yytext
, NULL
);
1944 return FLOATCONSTANT
;
1949 #line 286 "glsl_lexer.lpp"
1951 yylval
->real
= strtod(yytext
, NULL
);
1952 return FLOATCONSTANT
;
1957 #line 291 "glsl_lexer.lpp"
1960 return BOOLCONSTANT
;
1965 #line 295 "glsl_lexer.lpp"
1968 return BOOLCONSTANT
;
1971 /* Reserved words in GLSL 1.10. */
1974 #line 302 "glsl_lexer.lpp"
1975 RESERVED_WORD(999, ASM
);
1979 #line 303 "glsl_lexer.lpp"
1980 RESERVED_WORD(999, CLASS
);
1984 #line 304 "glsl_lexer.lpp"
1985 RESERVED_WORD(999, UNION
);
1989 #line 305 "glsl_lexer.lpp"
1990 RESERVED_WORD(999, ENUM
);
1994 #line 306 "glsl_lexer.lpp"
1995 RESERVED_WORD(999, TYPEDEF
);
1999 #line 307 "glsl_lexer.lpp"
2000 RESERVED_WORD(999, TEMPLATE
);
2004 #line 308 "glsl_lexer.lpp"
2005 RESERVED_WORD(999, THIS
);
2009 #line 309 "glsl_lexer.lpp"
2010 RESERVED_WORD(999, PACKED_TOK
);
2014 #line 310 "glsl_lexer.lpp"
2015 RESERVED_WORD(999, GOTO
);
2019 #line 311 "glsl_lexer.lpp"
2020 RESERVED_WORD(130, SWITCH
);
2024 #line 312 "glsl_lexer.lpp"
2025 RESERVED_WORD(130, DEFAULT
);
2029 #line 313 "glsl_lexer.lpp"
2030 RESERVED_WORD(999, INLINE_TOK
);
2034 #line 314 "glsl_lexer.lpp"
2035 RESERVED_WORD(999, NOINLINE
);
2039 #line 315 "glsl_lexer.lpp"
2040 RESERVED_WORD(999, VOLATILE
);
2044 #line 316 "glsl_lexer.lpp"
2045 RESERVED_WORD(999, PUBLIC_TOK
);
2049 #line 317 "glsl_lexer.lpp"
2050 RESERVED_WORD(999, STATIC
);
2054 #line 318 "glsl_lexer.lpp"
2055 RESERVED_WORD(999, EXTERN
);
2059 #line 319 "glsl_lexer.lpp"
2060 RESERVED_WORD(999, EXTERNAL
);
2064 #line 320 "glsl_lexer.lpp"
2065 RESERVED_WORD(999, INTERFACE
);
2069 #line 321 "glsl_lexer.lpp"
2070 RESERVED_WORD(999, LONG_TOK
);
2074 #line 322 "glsl_lexer.lpp"
2075 RESERVED_WORD(999, SHORT_TOK
);
2079 #line 323 "glsl_lexer.lpp"
2080 RESERVED_WORD(999, DOUBLE_TOK
);
2084 #line 324 "glsl_lexer.lpp"
2085 RESERVED_WORD(999, HALF
);
2089 #line 325 "glsl_lexer.lpp"
2090 RESERVED_WORD(999, FIXED_TOK
);
2094 #line 326 "glsl_lexer.lpp"
2095 RESERVED_WORD(999, UNSIGNED
);
2099 #line 327 "glsl_lexer.lpp"
2100 RESERVED_WORD(999, INPUT_TOK
);
2104 #line 328 "glsl_lexer.lpp"
2105 RESERVED_WORD(999, OUTPUT
);
2109 #line 329 "glsl_lexer.lpp"
2110 RESERVED_WORD(999, HVEC2
);
2114 #line 330 "glsl_lexer.lpp"
2115 RESERVED_WORD(999, HVEC3
);
2119 #line 331 "glsl_lexer.lpp"
2120 RESERVED_WORD(999, HVEC4
);
2124 #line 332 "glsl_lexer.lpp"
2125 RESERVED_WORD(999, DVEC2
);
2129 #line 333 "glsl_lexer.lpp"
2130 RESERVED_WORD(999, DVEC3
);
2134 #line 334 "glsl_lexer.lpp"
2135 RESERVED_WORD(999, DVEC4
);
2139 #line 335 "glsl_lexer.lpp"
2140 RESERVED_WORD(999, FVEC2
);
2144 #line 336 "glsl_lexer.lpp"
2145 RESERVED_WORD(999, FVEC3
);
2149 #line 337 "glsl_lexer.lpp"
2150 RESERVED_WORD(999, FVEC4
);
2154 #line 338 "glsl_lexer.lpp"
2155 return SAMPLER2DRECT
;
2159 #line 339 "glsl_lexer.lpp"
2160 RESERVED_WORD(999, SAMPLER3DRECT
);
2164 #line 340 "glsl_lexer.lpp"
2165 return SAMPLER2DRECTSHADOW
;
2169 #line 341 "glsl_lexer.lpp"
2170 RESERVED_WORD(999, SIZEOF
);
2174 #line 342 "glsl_lexer.lpp"
2175 RESERVED_WORD(999, CAST
);
2179 #line 343 "glsl_lexer.lpp"
2180 RESERVED_WORD(999, NAMESPACE
);
2184 #line 344 "glsl_lexer.lpp"
2185 RESERVED_WORD(999, USING
);
2187 /* Additional reserved words in GLSL 1.20. */
2190 #line 347 "glsl_lexer.lpp"
2191 TOKEN_OR_IDENTIFIER_ES(120, LOWP
);
2195 #line 348 "glsl_lexer.lpp"
2196 TOKEN_OR_IDENTIFIER_ES(120, MEDIUMP
);
2200 #line 349 "glsl_lexer.lpp"
2201 TOKEN_OR_IDENTIFIER_ES(120, HIGHP
);
2205 #line 350 "glsl_lexer.lpp"
2206 TOKEN_OR_IDENTIFIER_ES(120, PRECISION
);
2208 /* Additional reserved words in GLSL 1.30. */
2211 #line 353 "glsl_lexer.lpp"
2212 TOKEN_OR_IDENTIFIER(130, COMMON
);
2216 #line 354 "glsl_lexer.lpp"
2217 TOKEN_OR_IDENTIFIER(130, PARTITION
);
2221 #line 355 "glsl_lexer.lpp"
2222 TOKEN_OR_IDENTIFIER(130, ACTIVE
);
2226 #line 356 "glsl_lexer.lpp"
2227 TOKEN_OR_IDENTIFIER_ES(130, SUPERP
);
2231 #line 357 "glsl_lexer.lpp"
2232 TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER
);
2236 #line 358 "glsl_lexer.lpp"
2237 TOKEN_OR_IDENTIFIER(130, FILTER
);
2241 #line 359 "glsl_lexer.lpp"
2242 TOKEN_OR_IDENTIFIER(130, IMAGE1D
);
2246 #line 360 "glsl_lexer.lpp"
2247 TOKEN_OR_IDENTIFIER(130, IMAGE2D
);
2251 #line 361 "glsl_lexer.lpp"
2252 TOKEN_OR_IDENTIFIER(130, IMAGE3D
);
2256 #line 362 "glsl_lexer.lpp"
2257 TOKEN_OR_IDENTIFIER(130, IMAGECUBE
);
2261 #line 363 "glsl_lexer.lpp"
2262 TOKEN_OR_IDENTIFIER(130, IIMAGE1D
);
2266 #line 364 "glsl_lexer.lpp"
2267 TOKEN_OR_IDENTIFIER(130, IIMAGE2D
);
2271 #line 365 "glsl_lexer.lpp"
2272 TOKEN_OR_IDENTIFIER(130, IIMAGE3D
);
2276 #line 366 "glsl_lexer.lpp"
2277 TOKEN_OR_IDENTIFIER(130, IIMAGECUBE
);
2281 #line 367 "glsl_lexer.lpp"
2282 TOKEN_OR_IDENTIFIER(130, UIMAGE1D
);
2286 #line 368 "glsl_lexer.lpp"
2287 TOKEN_OR_IDENTIFIER(130, UIMAGE2D
);
2291 #line 369 "glsl_lexer.lpp"
2292 TOKEN_OR_IDENTIFIER(130, UIMAGE3D
);
2296 #line 370 "glsl_lexer.lpp"
2297 TOKEN_OR_IDENTIFIER(130, UIMAGECUBE
);
2301 #line 371 "glsl_lexer.lpp"
2302 TOKEN_OR_IDENTIFIER(130, IMAGE1DARRAY
);
2306 #line 372 "glsl_lexer.lpp"
2307 TOKEN_OR_IDENTIFIER(130, IMAGE2DARRAY
);
2311 #line 373 "glsl_lexer.lpp"
2312 TOKEN_OR_IDENTIFIER(130, IIMAGE1DARRAY
);
2316 #line 374 "glsl_lexer.lpp"
2317 TOKEN_OR_IDENTIFIER(130, IIMAGE2DARRAY
);
2321 #line 375 "glsl_lexer.lpp"
2322 TOKEN_OR_IDENTIFIER(130, UIMAGE1DARRAY
);
2326 #line 376 "glsl_lexer.lpp"
2327 TOKEN_OR_IDENTIFIER(130, UIMAGE2DARRAY
);
2331 #line 377 "glsl_lexer.lpp"
2332 TOKEN_OR_IDENTIFIER(130, IMAGE1DSHADOW
);
2336 #line 378 "glsl_lexer.lpp"
2337 TOKEN_OR_IDENTIFIER(130, IMAGE2DSHADOW
);
2341 #line 379 "glsl_lexer.lpp"
2342 TOKEN_OR_IDENTIFIER(130, IMAGEBUFFER
);
2346 #line 380 "glsl_lexer.lpp"
2347 TOKEN_OR_IDENTIFIER(130, IIMAGEBUFFER
);
2351 #line 381 "glsl_lexer.lpp"
2352 TOKEN_OR_IDENTIFIER(130, UIMAGEBUFFER
);
2356 #line 382 "glsl_lexer.lpp"
2357 TOKEN_OR_IDENTIFIER(130, ROW_MAJOR
);
2361 #line 384 "glsl_lexer.lpp"
2363 struct _mesa_glsl_parse_state
*state
= yyextra
;
2365 yylval
->identifier
= talloc_strdup(ctx
, yytext
);
2371 #line 391 "glsl_lexer.lpp"
2372 { return yytext
[0]; }
2376 #line 393 "glsl_lexer.lpp"
2379 #line 2380 "glsl_lexer.cpp"
2380 case YY_STATE_EOF(INITIAL
):
2381 case YY_STATE_EOF(PP
):
2382 case YY_STATE_EOF(PRAGMA
):
2385 case YY_END_OF_BUFFER
:
2387 /* Amount of text matched not including the EOB char. */
2388 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
2390 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2391 *yy_cp
= yyg
->yy_hold_char
;
2392 YY_RESTORE_YY_MORE_OFFSET
2394 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
2396 /* We're scanning a new file or input source. It's
2397 * possible that this happened because the user
2398 * just pointed yyin at a new source and called
2399 * _mesa_glsl_lex(). If so, then we have to assure
2400 * consistency between YY_CURRENT_BUFFER and our
2401 * globals. Here is the right place to do so, because
2402 * this is the first action (other than possibly a
2403 * back-up) that will match for the new input source.
2405 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
2406 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
2407 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2410 /* Note that here we test for yy_c_buf_p "<=" to the position
2411 * of the first EOB in the buffer, since yy_c_buf_p will
2412 * already have been incremented past the NUL character
2413 * (since all states make transitions on EOB to the
2414 * end-of-buffer state). Contrast this with the test
2417 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
2418 { /* This was really a NUL. */
2419 yy_state_type yy_next_state
;
2421 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
2423 yy_current_state
= yy_get_previous_state( yyscanner
);
2425 /* Okay, we're now positioned to make the NUL
2426 * transition. We couldn't have
2427 * yy_get_previous_state() go ahead and do it
2428 * for us because it doesn't know how to deal
2429 * with the possibility of jamming (and we don't
2430 * want to build jamming into it because then it
2431 * will run more slowly).
2434 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
2436 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2438 if ( yy_next_state
)
2440 /* Consume the NUL. */
2441 yy_cp
= ++yyg
->yy_c_buf_p
;
2442 yy_current_state
= yy_next_state
;
2448 yy_cp
= yyg
->yy_last_accepting_cpos
;
2449 yy_current_state
= yyg
->yy_last_accepting_state
;
2450 goto yy_find_action
;
2454 else switch ( yy_get_next_buffer( yyscanner
) )
2456 case EOB_ACT_END_OF_FILE
:
2458 yyg
->yy_did_buffer_switch_on_eof
= 0;
2460 if ( _mesa_glsl_wrap(yyscanner
) )
2462 /* Note: because we've taken care in
2463 * yy_get_next_buffer() to have set up
2464 * yytext, we can now set up
2465 * yy_c_buf_p so that if some total
2466 * hoser (like flex itself) wants to
2467 * call the scanner after we return the
2468 * YY_NULL, it'll still work - another
2469 * YY_NULL will get returned.
2471 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2473 yy_act
= YY_STATE_EOF(YY_START
);
2479 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
2485 case EOB_ACT_CONTINUE_SCAN
:
2487 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
2489 yy_current_state
= yy_get_previous_state( yyscanner
);
2491 yy_cp
= yyg
->yy_c_buf_p
;
2492 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2495 case EOB_ACT_LAST_MATCH
:
2497 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
2499 yy_current_state
= yy_get_previous_state( yyscanner
);
2501 yy_cp
= yyg
->yy_c_buf_p
;
2502 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2503 goto yy_find_action
;
2510 "fatal flex scanner internal error--no action found" );
2511 } /* end of action switch */
2512 } /* end of scanning one token */
2513 } /* end of _mesa_glsl_lex */
2515 /* yy_get_next_buffer - try to read in a new buffer
2517 * Returns a code representing an action:
2518 * EOB_ACT_LAST_MATCH -
2519 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2520 * EOB_ACT_END_OF_FILE - end of file
2522 static int yy_get_next_buffer (yyscan_t yyscanner
)
2524 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2525 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
2526 register char *source
= yyg
->yytext_ptr
;
2527 register int number_to_move
, i
;
2530 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
2532 "fatal flex scanner internal error--end of buffer missed" );
2534 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
2535 { /* Don't try to fill the buffer, so this is an EOF. */
2536 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
2538 /* We matched a single character, the EOB, so
2539 * treat this as a final EOF.
2541 return EOB_ACT_END_OF_FILE
;
2546 /* We matched some text prior to the EOB, first
2549 return EOB_ACT_LAST_MATCH
;
2553 /* Try to read more data. */
2555 /* First move last chars to start of buffer. */
2556 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
2558 for ( i
= 0; i
< number_to_move
; ++i
)
2559 *(dest
++) = *(source
++);
2561 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2562 /* don't do the read, it's not guaranteed to return an EOF,
2565 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
2570 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
2572 while ( num_to_read
<= 0 )
2573 { /* Not enough room in the buffer - grow it. */
2575 /* just a shorter name for the current buffer */
2576 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
2578 int yy_c_buf_p_offset
=
2579 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
2581 if ( b
->yy_is_our_buffer
)
2583 int new_size
= b
->yy_buf_size
* 2;
2585 if ( new_size
<= 0 )
2586 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2588 b
->yy_buf_size
*= 2;
2590 b
->yy_ch_buf
= (char *)
2591 /* Include room in for 2 EOB chars. */
2592 _mesa_glsl_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
2595 /* Can't grow it, we don't own it. */
2598 if ( ! b
->yy_ch_buf
)
2600 "fatal error - scanner input buffer overflow" );
2602 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2604 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
2609 if ( num_to_read
> YY_READ_BUF_SIZE
)
2610 num_to_read
= YY_READ_BUF_SIZE
;
2612 /* Read in more data. */
2613 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
2614 yyg
->yy_n_chars
, (size_t) num_to_read
);
2616 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2619 if ( yyg
->yy_n_chars
== 0 )
2621 if ( number_to_move
== YY_MORE_ADJ
)
2623 ret_val
= EOB_ACT_END_OF_FILE
;
2624 _mesa_glsl_restart(yyin
,yyscanner
);
2629 ret_val
= EOB_ACT_LAST_MATCH
;
2630 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
2631 YY_BUFFER_EOF_PENDING
;
2636 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2638 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
2639 /* Extend the array by 50%, plus the number we really need. */
2640 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
2641 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
2642 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
2643 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2646 yyg
->yy_n_chars
+= number_to_move
;
2647 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2648 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2650 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
2655 /* yy_get_previous_state - get the state just before the EOB char was reached */
2657 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
2659 register yy_state_type yy_current_state
;
2660 register char *yy_cp
;
2661 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2663 yy_current_state
= yyg
->yy_start
;
2664 yy_current_state
+= YY_AT_BOL();
2666 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
2668 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2669 if ( yy_accept
[yy_current_state
] )
2671 yyg
->yy_last_accepting_state
= yy_current_state
;
2672 yyg
->yy_last_accepting_cpos
= yy_cp
;
2674 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2676 yy_current_state
= (int) yy_def
[yy_current_state
];
2677 if ( yy_current_state
>= 716 )
2678 yy_c
= yy_meta
[(unsigned int) yy_c
];
2680 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2683 return yy_current_state
;
2686 /* yy_try_NUL_trans - try to make a transition on the NUL character
2689 * next_state = yy_try_NUL_trans( current_state );
2691 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
2693 register int yy_is_jam
;
2694 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
2695 register char *yy_cp
= yyg
->yy_c_buf_p
;
2697 register YY_CHAR yy_c
= 1;
2698 if ( yy_accept
[yy_current_state
] )
2700 yyg
->yy_last_accepting_state
= yy_current_state
;
2701 yyg
->yy_last_accepting_cpos
= yy_cp
;
2703 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2705 yy_current_state
= (int) yy_def
[yy_current_state
];
2706 if ( yy_current_state
>= 716 )
2707 yy_c
= yy_meta
[(unsigned int) yy_c
];
2709 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2710 yy_is_jam
= (yy_current_state
== 715);
2712 return yy_is_jam
? 0 : yy_current_state
;
2717 static int yyinput (yyscan_t yyscanner
)
2719 static int input (yyscan_t yyscanner
)
2724 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2726 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2728 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2730 /* yy_c_buf_p now points to the character we want to return.
2731 * If this occurs *before* the EOB characters, then it's a
2732 * valid NUL; if not, then we've hit the end of the buffer.
2734 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
2735 /* This was really a NUL. */
2736 *yyg
->yy_c_buf_p
= '\0';
2739 { /* need more input */
2740 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
2743 switch ( yy_get_next_buffer( yyscanner
) )
2745 case EOB_ACT_LAST_MATCH
:
2746 /* This happens because yy_g_n_b()
2747 * sees that we've accumulated a
2748 * token and flags that we need to
2749 * try matching the token before
2750 * proceeding. But for input(),
2751 * there's no matching to consider.
2752 * So convert the EOB_ACT_LAST_MATCH
2753 * to EOB_ACT_END_OF_FILE.
2756 /* Reset buffer status. */
2757 _mesa_glsl_restart(yyin
,yyscanner
);
2761 case EOB_ACT_END_OF_FILE
:
2763 if ( _mesa_glsl_wrap(yyscanner
) )
2766 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
2769 return yyinput(yyscanner
);
2771 return input(yyscanner
);
2775 case EOB_ACT_CONTINUE_SCAN
:
2776 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
2782 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
2783 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
2784 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
2786 YY_CURRENT_BUFFER_LVALUE
->yy_at_bol
= (c
== '\n');
2790 #endif /* ifndef YY_NO_INPUT */
2792 /** Immediately switch to a different input stream.
2793 * @param input_file A readable stream.
2794 * @param yyscanner The scanner object.
2795 * @note This function does not reset the start condition to @c INITIAL .
2797 void _mesa_glsl_restart (FILE * input_file
, yyscan_t yyscanner
)
2799 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2801 if ( ! YY_CURRENT_BUFFER
){
2802 _mesa_glsl_ensure_buffer_stack (yyscanner
);
2803 YY_CURRENT_BUFFER_LVALUE
=
2804 _mesa_glsl__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
2807 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
2808 _mesa_glsl__load_buffer_state(yyscanner
);
2811 /** Switch to a different input buffer.
2812 * @param new_buffer The new input buffer.
2813 * @param yyscanner The scanner object.
2815 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
2817 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2819 /* TODO. We should be able to replace this entire function body
2821 * _mesa_glsl_pop_buffer_state();
2822 * _mesa_glsl_push_buffer_state(new_buffer);
2824 _mesa_glsl_ensure_buffer_stack (yyscanner
);
2825 if ( YY_CURRENT_BUFFER
== new_buffer
)
2828 if ( YY_CURRENT_BUFFER
)
2830 /* Flush out information for old buffer. */
2831 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2832 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
2833 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2836 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2837 _mesa_glsl__load_buffer_state(yyscanner
);
2839 /* We don't actually know whether we did this switch during
2840 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2841 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2842 * to go ahead and always set it.
2844 yyg
->yy_did_buffer_switch_on_eof
= 1;
2847 static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner
)
2849 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2850 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
2851 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
2852 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
2853 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
2856 /** Allocate and initialize an input buffer state.
2857 * @param file A readable stream.
2858 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2859 * @param yyscanner The scanner object.
2860 * @return the allocated buffer state.
2862 YY_BUFFER_STATE
_mesa_glsl__create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
2866 b
= (YY_BUFFER_STATE
) _mesa_glsl_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
2868 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2870 b
->yy_buf_size
= size
;
2872 /* yy_ch_buf has to be 2 characters longer than the size given because
2873 * we need to put in 2 end-of-buffer characters.
2875 b
->yy_ch_buf
= (char *) _mesa_glsl_alloc(b
->yy_buf_size
+ 2 ,yyscanner
);
2876 if ( ! b
->yy_ch_buf
)
2877 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2879 b
->yy_is_our_buffer
= 1;
2881 _mesa_glsl__init_buffer(b
,file
,yyscanner
);
2886 /** Destroy the buffer.
2887 * @param b a buffer created with _mesa_glsl__create_buffer()
2888 * @param yyscanner The scanner object.
2890 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
2892 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2897 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
2898 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
2900 if ( b
->yy_is_our_buffer
)
2901 _mesa_glsl_free((void *) b
->yy_ch_buf
,yyscanner
);
2903 _mesa_glsl_free((void *) b
,yyscanner
);
2906 /* Initializes or reinitializes a buffer.
2907 * This function is sometimes called more than once on the same buffer,
2908 * such as during a _mesa_glsl_restart() or at EOF.
2910 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
2914 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2916 _mesa_glsl__flush_buffer(b
,yyscanner
);
2918 b
->yy_input_file
= file
;
2919 b
->yy_fill_buffer
= 1;
2921 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
2922 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
2923 * In that case, we don't want to reset the lineno or column.
2925 if (b
!= YY_CURRENT_BUFFER
){
2926 b
->yy_bs_lineno
= 1;
2927 b
->yy_bs_column
= 0;
2930 b
->yy_is_interactive
= 0;
2935 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2936 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2937 * @param yyscanner The scanner object.
2939 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
2941 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2947 /* We always need two end-of-buffer characters. The first causes
2948 * a transition to the end-of-buffer state. The second causes
2949 * a jam in that state.
2951 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2952 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2954 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2957 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2959 if ( b
== YY_CURRENT_BUFFER
)
2960 _mesa_glsl__load_buffer_state(yyscanner
);
2963 /** Pushes the new state onto the stack. The new state becomes
2964 * the current state. This function will allocate the stack
2966 * @param new_buffer The new state.
2967 * @param yyscanner The scanner object.
2969 void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
2971 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2972 if (new_buffer
== NULL
)
2975 _mesa_glsl_ensure_buffer_stack(yyscanner
);
2977 /* This block is copied from _mesa_glsl__switch_to_buffer. */
2978 if ( YY_CURRENT_BUFFER
)
2980 /* Flush out information for old buffer. */
2981 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2982 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
2983 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2986 /* Only push if top exists. Otherwise, replace top. */
2987 if (YY_CURRENT_BUFFER
)
2988 yyg
->yy_buffer_stack_top
++;
2989 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2991 /* copied from _mesa_glsl__switch_to_buffer. */
2992 _mesa_glsl__load_buffer_state(yyscanner
);
2993 yyg
->yy_did_buffer_switch_on_eof
= 1;
2996 /** Removes and deletes the top of the stack, if present.
2997 * The next element becomes the new top.
2998 * @param yyscanner The scanner object.
3000 void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner
)
3002 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3003 if (!YY_CURRENT_BUFFER
)
3006 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
3007 YY_CURRENT_BUFFER_LVALUE
= NULL
;
3008 if (yyg
->yy_buffer_stack_top
> 0)
3009 --yyg
->yy_buffer_stack_top
;
3011 if (YY_CURRENT_BUFFER
) {
3012 _mesa_glsl__load_buffer_state(yyscanner
);
3013 yyg
->yy_did_buffer_switch_on_eof
= 1;
3017 /* Allocates the stack if it does not exist.
3018 * Guarantees space for at least one push.
3020 static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner
)
3023 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3025 if (!yyg
->yy_buffer_stack
) {
3027 /* First allocation is just for 2 elements, since we don't know if this
3028 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3029 * immediate realloc on the next call.
3032 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_mesa_glsl_alloc
3033 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
3035 if ( ! yyg
->yy_buffer_stack
)
3036 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3038 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
3040 yyg
->yy_buffer_stack_max
= num_to_alloc
;
3041 yyg
->yy_buffer_stack_top
= 0;
3045 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
3047 /* Increase the buffer to prepare for a possible push. */
3048 int grow_size
= 8 /* arbitrary grow size */;
3050 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
3051 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_mesa_glsl_realloc
3052 (yyg
->yy_buffer_stack
,
3053 num_to_alloc
* sizeof(struct yy_buffer_state
*)
3055 if ( ! yyg
->yy_buffer_stack
)
3056 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3058 /* zero only the new slots.*/
3059 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
3060 yyg
->yy_buffer_stack_max
= num_to_alloc
;
3064 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3065 * @param base the character buffer
3066 * @param size the size in bytes of the character buffer
3067 * @param yyscanner The scanner object.
3068 * @return the newly allocated buffer state object.
3070 YY_BUFFER_STATE
_mesa_glsl__scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
3075 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
3076 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
3077 /* They forgot to leave room for the EOB's. */
3080 b
= (YY_BUFFER_STATE
) _mesa_glsl_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
3082 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3084 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
3085 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
3086 b
->yy_is_our_buffer
= 0;
3087 b
->yy_input_file
= 0;
3088 b
->yy_n_chars
= b
->yy_buf_size
;
3089 b
->yy_is_interactive
= 0;
3091 b
->yy_fill_buffer
= 0;
3092 b
->yy_buffer_status
= YY_BUFFER_NEW
;
3094 _mesa_glsl__switch_to_buffer(b
,yyscanner
);
3099 /** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3100 * scan from a @e copy of @a str.
3101 * @param yystr a NUL-terminated string to scan
3102 * @param yyscanner The scanner object.
3103 * @return the newly allocated buffer state object.
3104 * @note If you want to scan bytes that may contain NUL values, then use
3105 * _mesa_glsl__scan_bytes() instead.
3107 YY_BUFFER_STATE
_mesa_glsl__scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
3110 return _mesa_glsl__scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
3113 /** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3114 * scan from a @e copy of @a bytes.
3115 * @param yybytes the byte buffer to scan
3116 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
3117 * @param yyscanner The scanner object.
3118 * @return the newly allocated buffer state object.
3120 YY_BUFFER_STATE
_mesa_glsl__scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
3127 /* Get memory for full buffer, including space for trailing EOB's. */
3128 n
= _yybytes_len
+ 2;
3129 buf
= (char *) _mesa_glsl_alloc(n
,yyscanner
);
3131 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3133 for ( i
= 0; i
< _yybytes_len
; ++i
)
3134 buf
[i
] = yybytes
[i
];
3136 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
3138 b
= _mesa_glsl__scan_buffer(buf
,n
,yyscanner
);
3140 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3142 /* It's okay to grow etc. this buffer, and we should throw it
3143 * away when we're done.
3145 b
->yy_is_our_buffer
= 1;
3150 #ifndef YY_EXIT_FAILURE
3151 #define YY_EXIT_FAILURE 2
3154 static void yy_fatal_error (yyconst
char* msg
, yyscan_t yyscanner
)
3156 (void) fprintf( stderr
, "%s\n", msg
);
3157 exit( YY_EXIT_FAILURE
);
3160 /* Redefine yyless() so it works in section 3 code. */
3166 /* Undo effects of setting up yytext. */ \
3167 int yyless_macro_arg = (n); \
3168 YY_LESS_LINENO(yyless_macro_arg);\
3169 yytext[yyleng] = yyg->yy_hold_char; \
3170 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3171 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3172 *yyg->yy_c_buf_p = '\0'; \
3173 yyleng = yyless_macro_arg; \
3177 /* Accessor methods (get/set functions) to struct members. */
3179 /** Get the user-defined data for this scanner.
3180 * @param yyscanner The scanner object.
3182 YY_EXTRA_TYPE
_mesa_glsl_get_extra (yyscan_t yyscanner
)
3184 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3188 /** Get the current line number.
3189 * @param yyscanner The scanner object.
3191 int _mesa_glsl_get_lineno (yyscan_t yyscanner
)
3193 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3195 if (! YY_CURRENT_BUFFER
)
3201 /** Get the current column number.
3202 * @param yyscanner The scanner object.
3204 int _mesa_glsl_get_column (yyscan_t yyscanner
)
3206 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3208 if (! YY_CURRENT_BUFFER
)
3214 /** Get the input stream.
3215 * @param yyscanner The scanner object.
3217 FILE *_mesa_glsl_get_in (yyscan_t yyscanner
)
3219 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3223 /** Get the output stream.
3224 * @param yyscanner The scanner object.
3226 FILE *_mesa_glsl_get_out (yyscan_t yyscanner
)
3228 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3232 /** Get the length of the current token.
3233 * @param yyscanner The scanner object.
3235 int _mesa_glsl_get_leng (yyscan_t yyscanner
)
3237 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3241 /** Get the current token.
3242 * @param yyscanner The scanner object.
3245 char *_mesa_glsl_get_text (yyscan_t yyscanner
)
3247 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3251 /** Set the user-defined data. This data is never touched by the scanner.
3252 * @param user_defined The data to be associated with this scanner.
3253 * @param yyscanner The scanner object.
3255 void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
3257 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3258 yyextra
= user_defined
;
3261 /** Set the current line number.
3262 * @param line_number
3263 * @param yyscanner The scanner object.
3265 void _mesa_glsl_set_lineno (int line_number
, yyscan_t yyscanner
)
3267 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3269 /* lineno is only valid if an input buffer exists. */
3270 if (! YY_CURRENT_BUFFER
)
3271 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner
);
3273 yylineno
= line_number
;
3276 /** Set the current column.
3277 * @param line_number
3278 * @param yyscanner The scanner object.
3280 void _mesa_glsl_set_column (int column_no
, yyscan_t yyscanner
)
3282 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3284 /* column is only valid if an input buffer exists. */
3285 if (! YY_CURRENT_BUFFER
)
3286 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner
);
3288 yycolumn
= column_no
;
3291 /** Set the input stream. This does not discard the current
3293 * @param in_str A readable stream.
3294 * @param yyscanner The scanner object.
3295 * @see _mesa_glsl__switch_to_buffer
3297 void _mesa_glsl_set_in (FILE * in_str
, yyscan_t yyscanner
)
3299 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3303 void _mesa_glsl_set_out (FILE * out_str
, yyscan_t yyscanner
)
3305 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3309 int _mesa_glsl_get_debug (yyscan_t yyscanner
)
3311 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3312 return yy_flex_debug
;
3315 void _mesa_glsl_set_debug (int bdebug
, yyscan_t yyscanner
)
3317 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3318 yy_flex_debug
= bdebug
;
3321 /* Accessor methods for yylval and yylloc */
3323 YYSTYPE
* _mesa_glsl_get_lval (yyscan_t yyscanner
)
3325 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3329 void _mesa_glsl_set_lval (YYSTYPE
* yylval_param
, yyscan_t yyscanner
)
3331 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3332 yylval
= yylval_param
;
3335 YYLTYPE
*_mesa_glsl_get_lloc (yyscan_t yyscanner
)
3337 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3341 void _mesa_glsl_set_lloc (YYLTYPE
* yylloc_param
, yyscan_t yyscanner
)
3343 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3344 yylloc
= yylloc_param
;
3347 /* User-visible API */
3349 /* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3350 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3351 * That's why we explicitly handle the declaration, instead of using our macros.
3354 int _mesa_glsl_lex_init(yyscan_t
* ptr_yy_globals
)
3357 if (ptr_yy_globals
== NULL
){
3362 *ptr_yy_globals
= (yyscan_t
) _mesa_glsl_alloc ( sizeof( struct yyguts_t
), NULL
);
3364 if (*ptr_yy_globals
== NULL
){
3369 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3370 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
3372 return yy_init_globals ( *ptr_yy_globals
);
3375 /* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3376 * convention of taking the scanner as the last argument. Note however, that
3377 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3378 * is the reason, too, why this function also must handle its own declaration).
3379 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3380 * the yyextra field.
3383 int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined
,yyscan_t
* ptr_yy_globals
)
3386 struct yyguts_t dummy_yyguts
;
3388 _mesa_glsl_set_extra (yy_user_defined
, &dummy_yyguts
);
3390 if (ptr_yy_globals
== NULL
){
3395 *ptr_yy_globals
= (yyscan_t
) _mesa_glsl_alloc ( sizeof( struct yyguts_t
), &dummy_yyguts
);
3397 if (*ptr_yy_globals
== NULL
){
3402 /* By setting to 0xAA, we expose bugs in
3403 yy_init_globals. Leave at 0x00 for releases. */
3404 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
3406 _mesa_glsl_set_extra (yy_user_defined
, *ptr_yy_globals
);
3408 return yy_init_globals ( *ptr_yy_globals
);
3411 static int yy_init_globals (yyscan_t yyscanner
)
3413 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3414 /* Initialization is the same as for the non-reentrant scanner.
3415 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3418 yyg
->yy_buffer_stack
= 0;
3419 yyg
->yy_buffer_stack_top
= 0;
3420 yyg
->yy_buffer_stack_max
= 0;
3421 yyg
->yy_c_buf_p
= (char *) 0;
3425 yyg
->yy_start_stack_ptr
= 0;
3426 yyg
->yy_start_stack_depth
= 0;
3427 yyg
->yy_start_stack
= NULL
;
3429 /* Defined in main.c */
3438 /* For future reference: Set errno on error, since we are called by
3439 * _mesa_glsl_lex_init()
3444 /* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3445 int _mesa_glsl_lex_destroy (yyscan_t yyscanner
)
3447 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3449 /* Pop the buffer stack, destroying each element. */
3450 while(YY_CURRENT_BUFFER
){
3451 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
3452 YY_CURRENT_BUFFER_LVALUE
= NULL
;
3453 _mesa_glsl_pop_buffer_state(yyscanner
);
3456 /* Destroy the stack itself. */
3457 _mesa_glsl_free(yyg
->yy_buffer_stack
,yyscanner
);
3458 yyg
->yy_buffer_stack
= NULL
;
3460 /* Destroy the start condition stack. */
3461 _mesa_glsl_free(yyg
->yy_start_stack
,yyscanner
);
3462 yyg
->yy_start_stack
= NULL
;
3464 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3465 * _mesa_glsl_lex() is called, initialization will occur. */
3466 yy_init_globals( yyscanner
);
3468 /* Destroy the main struct (reentrant only). */
3469 _mesa_glsl_free ( yyscanner
, yyscanner
);
3475 * Internal utility routines.
3479 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
3482 for ( i
= 0; i
< n
; ++i
)
3487 #ifdef YY_NEED_STRLEN
3488 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
3491 for ( n
= 0; s
[n
]; ++n
)
3498 void *_mesa_glsl_alloc (yy_size_t size
, yyscan_t yyscanner
)
3500 return (void *) malloc( size
);
3503 void *_mesa_glsl_realloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
3505 /* The cast to (char *) in the following accommodates both
3506 * implementations that use char* generic pointers, and those
3507 * that use void* generic pointers. It works with the latter
3508 * because both ANSI C and C++ allow castless assignment from
3509 * any pointer type to void*, and deal with argument conversions
3510 * as though doing an assignment.
3512 return (void *) realloc( (char *) ptr
, size
);
3515 void _mesa_glsl_free (void * ptr
, yyscan_t yyscanner
)
3517 free( (char *) ptr
); /* see _mesa_glsl_realloc() for (char *) cast */
3520 #define YYTABLES_NAME "yytables"
3522 #line 393 "glsl_lexer.lpp"
3527 _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state
*state
, const char *string
)
3529 _mesa_glsl_lex_init_extra(state
,& state
->scanner
);
3530 _mesa_glsl__scan_string(string
,state
->scanner
);
3534 _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state
*state
)
3536 _mesa_glsl_lex_destroy(state
->scanner
);