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 183
362 #define YY_END_OF_BUFFER 184
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
[708] =
372 0, 0, 15, 15, 0, 0, 184, 182, 1, 20,
373 182, 182, 182, 182, 182, 182, 182, 182, 96, 94,
374 182, 182, 182, 181, 182, 181, 181, 181, 181, 181,
375 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
376 181, 181, 181, 181, 181, 182, 1, 182, 91, 183,
377 15, 19, 183, 18, 16, 17, 13, 12, 1, 80,
378 87, 81, 90, 84, 75, 86, 76, 93, 98, 85,
379 99, 96, 0, 0, 101, 0, 94, 0, 77, 79,
380 78, 0, 181, 83, 181, 181, 181, 181, 181, 181,
381 181, 181, 181, 181, 181, 181, 28, 181, 181, 181,
383 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
384 32, 181, 181, 56, 181, 181, 181, 181, 181, 181,
385 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
386 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
387 181, 181, 181, 181, 181, 92, 82, 1, 0, 0,
388 2, 0, 0, 0, 0, 15, 14, 18, 17, 0,
389 98, 97, 0, 99, 0, 100, 95, 88, 89, 181,
390 104, 181, 181, 181, 181, 181, 181, 181, 181, 181,
391 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
392 181, 181, 31, 181, 181, 181, 181, 181, 181, 181,
394 181, 181, 181, 25, 181, 181, 181, 181, 181, 181,
395 181, 181, 181, 181, 57, 181, 181, 181, 181, 181,
396 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
397 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
398 181, 181, 0, 0, 0, 0, 14, 0, 98, 0,
399 97, 0, 99, 100, 181, 181, 23, 181, 181, 144,
400 181, 181, 181, 181, 181, 181, 181, 181, 181, 30,
401 107, 181, 181, 181, 181, 63, 181, 181, 112, 126,
402 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
403 181, 123, 147, 44, 45, 46, 181, 181, 181, 181,
405 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
406 181, 181, 181, 181, 181, 181, 110, 102, 181, 181,
407 181, 181, 181, 181, 181, 41, 42, 43, 73, 181,
408 181, 0, 0, 0, 0, 0, 97, 181, 181, 26,
409 35, 36, 37, 181, 105, 181, 22, 181, 181, 181,
410 181, 134, 135, 136, 181, 103, 181, 127, 24, 137,
411 138, 139, 149, 131, 132, 133, 181, 181, 181, 58,
412 129, 181, 181, 38, 39, 40, 181, 181, 181, 181,
413 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
414 181, 181, 124, 181, 181, 181, 181, 181, 181, 181,
416 181, 181, 181, 106, 181, 146, 181, 181, 29, 0,
417 0, 0, 0, 153, 181, 181, 151, 181, 181, 181,
418 125, 120, 156, 181, 181, 181, 181, 181, 181, 115,
419 181, 181, 74, 47, 48, 49, 50, 51, 52, 53,
420 54, 55, 181, 181, 181, 181, 130, 111, 181, 181,
421 118, 34, 181, 181, 143, 64, 119, 72, 154, 113,
422 181, 181, 181, 181, 181, 181, 181, 0, 0, 0,
423 0, 181, 181, 181, 114, 33, 181, 181, 181, 181,
424 181, 181, 157, 158, 159, 181, 181, 181, 181, 148,
425 181, 181, 181, 181, 181, 181, 181, 181, 108, 181,
427 181, 181, 181, 181, 59, 181, 60, 181, 0, 0,
428 0, 0, 0, 181, 61, 27, 121, 161, 162, 163,
429 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
430 181, 116, 181, 181, 181, 181, 181, 181, 181, 181,
431 181, 109, 165, 166, 167, 181, 181, 128, 117, 0,
432 0, 6, 0, 0, 0, 11, 3, 21, 181, 181,
433 181, 181, 181, 181, 181, 181, 181, 160, 122, 62,
434 145, 181, 152, 150, 180, 66, 67, 68, 181, 181,
435 181, 181, 181, 181, 0, 0, 0, 0, 0, 0,
436 181, 181, 181, 164, 181, 181, 181, 181, 181, 181,
438 181, 181, 181, 181, 181, 181, 181, 181, 181, 168,
439 4, 0, 5, 0, 0, 0, 0, 0, 181, 181,
440 181, 181, 181, 181, 181, 177, 181, 181, 181, 181,
441 181, 181, 69, 181, 181, 181, 0, 0, 0, 181,
442 181, 178, 169, 181, 170, 181, 181, 181, 181, 181,
443 181, 181, 181, 181, 179, 0, 0, 171, 172, 175,
444 176, 65, 181, 140, 181, 141, 155, 173, 174, 0,
445 0, 181, 181, 181, 0, 0, 0, 70, 181, 71,
446 0, 0, 0, 181, 0, 0, 0, 181, 0, 0,
447 7, 0, 0, 181, 0, 8, 0, 0, 142, 0,
452 static yyconst flex_int32_t yy_ec
[256] =
454 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
455 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
458 10, 11, 12, 1, 13, 14, 15, 16, 17, 18,
459 19, 20, 21, 21, 21, 22, 22, 23, 1, 24,
460 25, 26, 1, 1, 27, 28, 29, 30, 31, 32,
461 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
462 33, 34, 35, 33, 33, 33, 33, 36, 33, 33,
463 1, 1, 1, 37, 38, 1, 39, 40, 41, 42,
465 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
466 53, 54, 33, 55, 56, 57, 58, 59, 60, 61,
467 62, 63, 1, 64, 1, 1, 1, 1, 1, 1,
468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 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,
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 static yyconst flex_int32_t yy_meta
[65] =
486 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
487 1, 1, 1, 1, 1, 4, 4, 4, 4, 4,
488 4, 5, 1, 1, 1, 1, 6, 6, 6, 6,
489 5, 5, 7, 7, 7, 8, 1, 7, 6, 6,
490 6, 6, 5, 5, 7, 7, 7, 7, 7, 7,
491 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
495 static yyconst flex_int16_t yy_base
[719] =
497 0, 63, 88, 0, 1076, 1075, 1077, 1080, 64, 1080,
498 1051, 1050, 59, 1049, 58, 60, 58, 1048, 139, 187,
499 47, 1047, 56, 0, 1034, 121, 110, 137, 138, 134,
500 163, 1017, 173, 177, 115, 149, 140, 1011, 159, 121,
501 187, 194, 194, 172, 1022, 171, 249, 240, 1042, 1080,
502 250, 1080, 1051, 241, 1080, 0, 1080, 1080, 262, 1080,
503 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 236, 1080,
504 238, 187, 286, 303, 1080, 0, 0, 1040, 1080, 1080,
505 1080, 1039, 0, 1080, 1006, 1011, 1004, 1007, 1016, 1015,
506 1001, 1004, 1016, 35, 1010, 997, 994, 1008, 994, 991,
508 991, 997, 215, 232, 991, 1002, 987, 993, 997, 998,
509 0, 989, 1000, 234, 995, 975, 226, 979, 993, 983,
510 119, 976, 234, 989, 991, 973, 969, 977, 974, 963,
511 972, 256, 970, 976, 971, 974, 962, 965, 967, 245,
512 970, 961, 974, 227, 967, 1080, 1080, 308, 294, 324,
513 1080, 952, 965, 956, 967, 329, 0, 338, 0, 368,
514 1080, 303, 379, 1080, 386, 393, 0, 1080, 1080, 962,
515 0, 953, 957, 967, 964, 947, 946, 946, 950, 216,
516 961, 958, 958, 956, 953, 944, 951, 937, 935, 948,
517 933, 950, 0, 947, 934, 942, 939, 943, 944, 937,
519 934, 922, 921, 935, 938, 935, 922, 929, 919, 320,
520 925, 928, 918, 926, 914, 918, 909, 924, 914, 905,
521 924, 907, 905, 916, 905, 900, 898, 912, 897, 899,
522 896, 908, 907, 910, 288, 901, 895, 884, 331, 903,
523 905, 893, 885, 889, 901, 884, 0, 400, 410, 427,
524 1080, 439, 446, 1080, 879, 890, 0, 887, 343, 0,
525 880, 878, 880, 875, 884, 872, 890, 878, 346, 0,
526 0, 872, 883, 882, 882, 0, 866, 350, 0, 0,
527 868, 353, 876, 877, 867, 861, 860, 861, 860, 357,
528 856, 0, 0, 852, 851, 850, 852, 853, 858, 852,
530 848, 862, 857, 856, 855, 846, 849, 849, 841, 844,
531 839, 848, 853, 838, 851, 841, 0, 0, 848, 844,
532 835, 835, 841, 840, 837, 0, 0, 0, 0, 826,
533 839, 838, 837, 834, 822, 453, 463, 834, 836, 0,
534 0, 0, 0, 822, 0, 822, 0, 821, 822, 816,
535 827, 0, 0, 0, 817, 0, 813, 0, 0, 0,
536 0, 0, 0, 0, 0, 0, 824, 469, 823, 0,
537 0, 821, 817, 0, 0, 0, 806, 415, 432, 473,
538 811, 807, 813, 803, 801, 815, 799, 799, 813, 801,
539 813, 808, 0, 806, 803, 807, 790, 792, 799, 805,
541 800, 799, 786, 0, 788, 0, 787, 791, 0, 785,
542 834, 784, 787, 0, 775, 785, 0, 773, 773, 787,
543 0, 789, 0, 482, 797, 796, 795, 766, 765, 0,
544 783, 782, 0, 0, 0, 0, 0, 0, 0, 0,
545 0, 0, 766, 780, 766, 763, 0, 0, 769, 768,
546 0, 0, 766, 758, 0, 0, 0, 0, 0, 0,
547 755, 767, 485, 759, 766, 763, 757, 750, 503, 766,
548 751, 746, 760, 758, 0, 0, 750, 769, 768, 767,
549 738, 737, 301, 481, 0, 750, 753, 751, 739, 0,
550 749, 746, 745, 734, 733, 732, 509, 741, 0, 753,
552 752, 751, 722, 721, 0, 736, 0, 734, 729, 515,
553 527, 773, 722, 730, 0, 0, 0, 745, 744, 0,
554 726, 729, 713, 721, 711, 719, 720, 720, 719, 704,
555 717, 0, 718, 706, 705, 701, 725, 724, 723, 694,
556 693, 0, 723, 722, 0, 704, 707, 0, 0, 693,
557 537, 1080, 561, 0, 567, 340, 1080, 0, 690, 689,
558 699, 699, 686, 701, 684, 699, 694, 0, 0, 0,
559 0, 679, 0, 0, 0, 700, 389, 700, 689, 692,
560 676, 675, 685, 685, 675, 529, 589, 474, 683, 671,
561 669, 668, 679, 0, 682, 678, 680, 676, 662, 669,
563 669, 671, 667, 669, 667, 667, 654, 653, 664, 0,
564 1080, 531, 1080, 596, 0, 616, 666, 648, 665, 664,
565 647, 635, 643, 633, 634, 0, 627, 646, 635, 607,
566 604, 601, 0, 604, 603, 586, 533, 572, 580, 564,
567 563, 0, 0, 564, 0, 540, 554, 552, 516, 530,
568 505, 486, 453, 450, 0, 461, 443, 0, 0, 0,
569 0, 0, 400, 406, 385, 0, 0, 0, 0, 343,
570 389, 319, 267, 249, 487, 341, 235, 0, 200, 0,
571 507, 498, 184, 157, 150, 564, 559, 136, 565, 591,
572 1080, 593, 550, 112, 594, 1080, 569, 576, 0, 123,
574 619, 621, 637, 1080, 638, 1080, 1080, 648, 653, 658,
575 663, 665, 667, 673, 680, 685, 690, 695
578 static yyconst flex_int16_t yy_def
[719] =
580 707, 1, 707, 3, 708, 708, 707, 707, 707, 707,
581 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
582 707, 707, 707, 709, 707, 709, 709, 709, 709, 709,
583 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
584 709, 709, 709, 709, 709, 707, 707, 707, 707, 707,
585 707, 707, 707, 707, 707, 710, 707, 707, 707, 707,
586 707, 707, 707, 707, 707, 707, 707, 707, 711, 707,
587 712, 19, 707, 707, 707, 713, 20, 707, 707, 707,
588 707, 707, 709, 707, 709, 709, 709, 709, 709, 709,
589 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
591 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
592 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
593 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
594 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
595 709, 709, 709, 709, 709, 707, 707, 707, 707, 707,
596 707, 707, 707, 707, 707, 707, 714, 707, 710, 707,
597 707, 712, 707, 707, 707, 707, 713, 707, 707, 709,
598 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
599 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
600 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
602 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
603 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
604 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
605 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
606 709, 709, 707, 707, 707, 707, 714, 707, 707, 707,
607 707, 707, 707, 707, 709, 709, 709, 709, 709, 709,
608 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
609 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
610 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
611 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
613 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
614 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
615 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
616 709, 707, 707, 707, 707, 707, 707, 709, 709, 709,
617 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
618 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
619 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
620 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
621 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
622 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
624 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
625 707, 707, 707, 709, 709, 709, 709, 709, 709, 709,
626 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
627 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
628 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
629 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
630 709, 709, 709, 709, 709, 709, 709, 707, 707, 707,
631 707, 709, 709, 709, 709, 709, 709, 709, 709, 709,
632 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
633 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
635 709, 709, 709, 709, 709, 709, 709, 709, 707, 715,
636 707, 707, 707, 709, 709, 709, 709, 709, 709, 709,
637 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
638 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
639 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
640 707, 707, 707, 716, 707, 707, 707, 709, 709, 709,
641 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
642 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
643 709, 709, 709, 709, 707, 717, 707, 716, 707, 707,
644 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
646 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
647 707, 707, 707, 707, 718, 707, 707, 707, 709, 709,
648 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
649 709, 709, 709, 709, 709, 709, 718, 707, 707, 709,
650 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
651 709, 709, 709, 709, 709, 707, 707, 709, 709, 709,
652 709, 709, 709, 709, 709, 709, 709, 709, 709, 707,
653 707, 709, 709, 709, 707, 707, 707, 709, 709, 709,
654 707, 707, 707, 709, 707, 707, 707, 709, 707, 707,
655 707, 707, 707, 709, 707, 707, 707, 707, 709, 707,
657 707, 707, 707, 707, 707, 707, 0, 707, 707, 707,
658 707, 707, 707, 707, 707, 707, 707, 707
661 static yyconst flex_int16_t yy_nxt
[1145] =
663 8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
664 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
665 20, 20, 8, 21, 22, 23, 24, 24, 24, 24,
666 24, 24, 24, 24, 24, 24, 25, 24, 26, 27,
667 28, 29, 30, 31, 32, 33, 34, 24, 24, 35,
668 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
669 24, 24, 24, 46, 47, 59, 62, 59, 48, 65,
670 78, 79, 67, 69, 69, 69, 69, 69, 69, 69,
671 81, 82, 66, 63, 68, 179, 180, 49, 50, 51,
672 52, 51, 50, 50, 50, 50, 50, 50, 50, 50,
674 50, 50, 53, 50, 54, 54, 54, 54, 54, 54,
675 55, 50, 50, 50, 56, 56, 56, 56, 56, 56,
676 56, 56, 56, 56, 50, 56, 56, 56, 56, 56,
677 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
678 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
679 56, 50, 71, 116, 72, 72, 72, 72, 72, 72,
680 73, 85, 88, 126, 89, 213, 702, 117, 90, 74,
681 75, 699, 214, 127, 76, 91, 86, 87, 120, 92,
682 95, 74, 75, 99, 96, 100, 93, 118, 694, 94,
683 97, 119, 121, 689, 101, 146, 98, 123, 688, 76,
685 71, 102, 77, 77, 77, 77, 77, 77, 77, 103,
686 142, 108, 104, 124, 143, 105, 125, 74, 75, 109,
687 111, 106, 707, 112, 144, 128, 687, 113, 114, 74,
688 75, 110, 129, 130, 147, 115, 135, 131, 684, 136,
689 139, 150, 151, 132, 133, 140, 134, 707, 137, 141,
690 148, 156, 59, 156, 149, 138, 158, 158, 158, 158,
691 158, 158, 158, 59, 189, 59, 160, 161, 163, 164,
692 191, 264, 265, 240, 216, 190, 241, 208, 160, 161,
693 163, 164, 152, 201, 192, 209, 202, 203, 217, 153,
694 204, 235, 205, 154, 226, 150, 151, 683, 155, 71,
696 236, 73, 73, 73, 73, 73, 73, 73, 680, 148,
697 227, 59, 679, 149, 165, 165, 74, 75, 166, 166,
698 166, 166, 166, 166, 166, 150, 151, 523, 74, 75,
699 156, 321, 156, 250, 251, 524, 152, 294, 295, 296,
700 322, 556, 681, 153, 675, 250, 251, 154, 326, 327,
701 328, 676, 155, 158, 158, 158, 158, 158, 158, 158,
702 341, 342, 343, 352, 353, 354, 152, 360, 361, 362,
703 364, 365, 366, 153, 374, 375, 376, 154, 678, 248,
704 248, 589, 155, 249, 249, 249, 249, 249, 249, 249,
705 252, 252, 590, 682, 253, 253, 253, 253, 253, 253,
707 253, 166, 166, 166, 166, 166, 166, 166, 166, 166,
708 166, 166, 166, 166, 166, 249, 249, 249, 249, 249,
709 249, 249, 602, 603, 254, 249, 249, 249, 249, 249,
710 249, 249, 434, 435, 436, 677, 254, 674, 336, 336,
711 673, 161, 337, 337, 337, 337, 337, 337, 337, 437,
712 438, 439, 672, 161, 253, 253, 253, 253, 253, 253,
713 253, 253, 253, 253, 253, 253, 253, 253, 337, 337,
714 337, 337, 337, 337, 337, 551, 552, 164, 337, 337,
715 337, 337, 337, 337, 337, 425, 426, 427, 675, 164,
716 440, 441, 442, 671, 251, 676, 428, 429, 478, 479,
718 480, 500, 501, 502, 469, 670, 251, 525, 681, 481,
719 482, 669, 503, 504, 668, 526, 551, 552, 510, 511,
720 511, 511, 511, 511, 511, 537, 538, 539, 551, 552,
721 612, 613, 612, 613, 612, 613, 540, 541, 551, 552,
722 667, 685, 555, 555, 555, 555, 555, 555, 555, 686,
723 554, 697, 586, 587, 587, 587, 587, 587, 587, 682,
724 692, 666, 551, 552, 615, 690, 695, 693, 551, 552,
725 697, 665, 664, 691, 696, 554, 553, 553, 553, 553,
726 553, 553, 555, 555, 555, 555, 555, 555, 555, 615,
727 612, 613, 690, 663, 692, 695, 662, 612, 613, 661,
729 691, 693, 698, 696, 616, 616, 616, 616, 616, 616,
730 616, 614, 614, 614, 614, 614, 614, 612, 613, 700,
731 703, 698, 705, 660, 659, 658, 657, 701, 704, 656,
732 706, 616, 616, 616, 616, 616, 616, 616, 703, 705,
733 655, 654, 653, 652, 651, 650, 704, 706, 57, 57,
734 57, 57, 57, 57, 57, 57, 83, 83, 83, 83,
735 83, 159, 159, 159, 159, 159, 69, 69, 162, 162,
736 167, 167, 167, 247, 247, 649, 247, 247, 247, 247,
737 247, 553, 553, 553, 648, 647, 646, 553, 588, 588,
738 588, 614, 614, 614, 645, 644, 643, 614, 637, 637,
740 637, 642, 641, 640, 639, 638, 636, 635, 634, 633,
741 632, 631, 630, 629, 628, 627, 626, 625, 624, 623,
742 622, 621, 620, 619, 618, 617, 611, 610, 609, 608,
743 607, 606, 605, 604, 601, 600, 599, 598, 597, 596,
744 595, 594, 593, 592, 591, 585, 584, 583, 582, 581,
745 580, 579, 578, 577, 576, 575, 574, 573, 572, 571,
746 570, 569, 568, 567, 566, 565, 564, 563, 562, 561,
747 560, 559, 558, 557, 556, 550, 549, 548, 547, 546,
748 545, 544, 543, 542, 536, 535, 534, 533, 532, 531,
749 530, 529, 528, 527, 522, 521, 520, 519, 518, 517,
751 516, 515, 514, 513, 512, 509, 508, 507, 506, 505,
752 499, 498, 497, 496, 495, 494, 493, 492, 491, 490,
753 489, 488, 487, 486, 485, 484, 483, 477, 476, 475,
754 474, 473, 472, 471, 470, 469, 468, 467, 466, 465,
755 464, 463, 462, 461, 460, 459, 458, 457, 456, 455,
756 454, 453, 452, 451, 450, 449, 448, 447, 446, 445,
757 444, 443, 433, 432, 431, 430, 424, 423, 422, 421,
758 420, 419, 418, 417, 416, 415, 414, 413, 412, 411,
759 410, 409, 408, 407, 406, 405, 404, 403, 402, 401,
760 400, 399, 398, 397, 396, 395, 394, 393, 392, 391,
762 390, 389, 388, 387, 386, 385, 384, 383, 382, 381,
763 380, 379, 378, 377, 373, 372, 371, 370, 369, 368,
764 367, 363, 359, 358, 357, 356, 355, 351, 350, 349,
765 348, 347, 346, 345, 344, 340, 339, 338, 335, 334,
766 333, 332, 331, 330, 329, 325, 324, 323, 320, 319,
767 318, 317, 316, 315, 314, 313, 312, 311, 310, 309,
768 308, 307, 306, 305, 304, 303, 302, 301, 300, 299,
769 298, 297, 293, 292, 291, 290, 289, 288, 287, 286,
770 285, 284, 283, 282, 281, 280, 279, 278, 277, 276,
771 275, 274, 273, 272, 271, 270, 269, 268, 267, 266,
773 263, 262, 261, 260, 259, 258, 257, 256, 255, 246,
774 245, 244, 243, 242, 239, 238, 237, 234, 233, 232,
775 231, 230, 229, 228, 225, 224, 223, 222, 221, 220,
776 219, 218, 215, 212, 211, 210, 207, 206, 200, 199,
777 198, 197, 196, 195, 194, 193, 188, 187, 186, 185,
778 184, 183, 182, 181, 178, 177, 176, 175, 174, 173,
779 172, 171, 170, 169, 168, 157, 80, 145, 122, 107,
780 84, 80, 70, 64, 61, 60, 707, 58, 58, 7,
781 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
782 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
784 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
785 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
786 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
787 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
791 static yyconst flex_int16_t yy_chk
[1145] =
793 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
794 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
795 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
796 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
797 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
798 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
799 1, 1, 1, 1, 2, 9, 13, 9, 2, 15,
800 21, 21, 16, 17, 17, 17, 17, 17, 17, 17,
801 23, 23, 15, 13, 16, 94, 94, 2, 3, 3,
802 3, 3, 3, 3, 3, 3, 3, 3, 3, 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,
807 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
808 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
809 3, 3, 19, 35, 19, 19, 19, 19, 19, 19,
810 19, 26, 27, 40, 27, 121, 700, 35, 27, 19,
811 19, 694, 121, 40, 19, 28, 26, 26, 37, 28,
812 29, 19, 19, 30, 29, 30, 28, 36, 688, 28,
813 29, 36, 37, 685, 30, 46, 29, 39, 684, 19,
815 20, 31, 20, 20, 20, 20, 20, 20, 20, 31,
816 44, 33, 31, 39, 44, 31, 39, 20, 20, 33,
817 34, 31, 72, 34, 44, 41, 683, 34, 34, 20,
818 20, 33, 41, 41, 46, 34, 42, 41, 679, 42,
819 43, 48, 48, 41, 41, 43, 41, 72, 42, 43,
820 47, 51, 47, 51, 47, 42, 54, 54, 54, 54,
821 54, 54, 54, 59, 103, 59, 69, 69, 71, 71,
822 104, 180, 180, 144, 123, 103, 144, 117, 69, 69,
823 71, 71, 48, 114, 104, 117, 114, 114, 123, 48,
824 114, 140, 114, 48, 132, 149, 149, 677, 48, 73,
826 140, 73, 73, 73, 73, 73, 73, 73, 674, 148,
827 132, 148, 673, 148, 74, 74, 73, 73, 74, 74,
828 74, 74, 74, 74, 74, 150, 150, 483, 73, 73,
829 156, 235, 156, 162, 162, 483, 149, 210, 210, 210,
830 235, 556, 676, 149, 670, 162, 162, 149, 239, 239,
831 239, 670, 149, 158, 158, 158, 158, 158, 158, 158,
832 259, 259, 259, 269, 269, 269, 150, 278, 278, 278,
833 282, 282, 282, 150, 290, 290, 290, 150, 672, 160,
834 160, 556, 150, 160, 160, 160, 160, 160, 160, 160,
835 163, 163, 556, 676, 163, 163, 163, 163, 163, 163,
837 163, 165, 165, 165, 165, 165, 165, 165, 166, 166,
838 166, 166, 166, 166, 166, 248, 248, 248, 248, 248,
839 248, 248, 577, 577, 166, 249, 249, 249, 249, 249,
840 249, 249, 378, 378, 378, 671, 166, 665, 250, 250,
841 664, 249, 250, 250, 250, 250, 250, 250, 250, 379,
842 379, 379, 663, 249, 252, 252, 252, 252, 252, 252,
843 252, 253, 253, 253, 253, 253, 253, 253, 336, 336,
844 336, 336, 336, 336, 336, 588, 588, 253, 337, 337,
845 337, 337, 337, 337, 337, 368, 368, 368, 675, 253,
846 380, 380, 380, 657, 337, 675, 368, 368, 424, 424,
848 424, 463, 463, 463, 469, 656, 337, 484, 681, 424,
849 424, 654, 463, 463, 653, 484, 510, 510, 469, 469,
850 469, 469, 469, 469, 469, 497, 497, 497, 511, 511,
851 586, 586, 612, 612, 637, 637, 497, 497, 551, 551,
852 652, 682, 511, 511, 511, 511, 511, 511, 511, 682,
853 510, 693, 551, 551, 551, 551, 551, 551, 551, 681,
854 687, 651, 553, 553, 586, 686, 689, 687, 555, 555,
855 697, 650, 649, 686, 689, 510, 553, 553, 553, 553,
856 553, 553, 555, 555, 555, 555, 555, 555, 555, 586,
857 587, 587, 690, 648, 692, 695, 647, 614, 614, 646,
859 690, 692, 693, 695, 587, 587, 587, 587, 587, 587,
860 587, 614, 614, 614, 614, 614, 614, 616, 616, 698,
861 701, 697, 702, 644, 641, 640, 639, 698, 701, 638,
862 702, 616, 616, 616, 616, 616, 616, 616, 703, 705,
863 636, 635, 634, 632, 631, 630, 703, 705, 708, 708,
864 708, 708, 708, 708, 708, 708, 709, 709, 709, 709,
865 709, 710, 710, 710, 710, 710, 711, 711, 712, 712,
866 713, 713, 713, 714, 714, 629, 714, 714, 714, 714,
867 714, 715, 715, 715, 628, 627, 625, 715, 716, 716,
868 716, 717, 717, 717, 624, 623, 622, 717, 718, 718,
870 718, 621, 620, 619, 618, 617, 609, 608, 607, 606,
871 605, 604, 603, 602, 601, 600, 599, 598, 597, 596,
872 595, 593, 592, 591, 590, 589, 585, 584, 583, 582,
873 581, 580, 579, 578, 576, 572, 567, 566, 565, 564,
874 563, 562, 561, 560, 559, 550, 547, 546, 544, 543,
875 541, 540, 539, 538, 537, 536, 535, 534, 533, 531,
876 530, 529, 528, 527, 526, 525, 524, 523, 522, 521,
877 519, 518, 514, 513, 512, 509, 508, 506, 504, 503,
878 502, 501, 500, 498, 496, 495, 494, 493, 492, 491,
879 489, 488, 487, 486, 482, 481, 480, 479, 478, 477,
881 474, 473, 472, 471, 470, 468, 467, 466, 465, 464,
882 462, 461, 454, 453, 450, 449, 446, 445, 444, 443,
883 432, 431, 429, 428, 427, 426, 425, 422, 420, 419,
884 418, 416, 415, 413, 412, 411, 410, 408, 407, 405,
885 403, 402, 401, 400, 399, 398, 397, 396, 395, 394,
886 392, 391, 390, 389, 388, 387, 386, 385, 384, 383,
887 382, 381, 377, 373, 372, 369, 367, 357, 355, 351,
888 350, 349, 348, 346, 344, 339, 338, 335, 334, 333,
889 332, 331, 330, 325, 324, 323, 322, 321, 320, 319,
890 316, 315, 314, 313, 312, 311, 310, 309, 308, 307,
892 306, 305, 304, 303, 302, 301, 300, 299, 298, 297,
893 296, 295, 294, 291, 289, 288, 287, 286, 285, 284,
894 283, 281, 277, 275, 274, 273, 272, 268, 267, 266,
895 265, 264, 263, 262, 261, 258, 256, 255, 246, 245,
896 244, 243, 242, 241, 240, 238, 237, 236, 234, 233,
897 232, 231, 230, 229, 228, 227, 226, 225, 224, 223,
898 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
899 212, 211, 209, 208, 207, 206, 205, 204, 203, 202,
900 201, 200, 199, 198, 197, 196, 195, 194, 192, 191,
901 190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
903 179, 178, 177, 176, 175, 174, 173, 172, 170, 155,
904 154, 153, 152, 145, 143, 142, 141, 139, 138, 137,
905 136, 135, 134, 133, 131, 130, 129, 128, 127, 126,
906 125, 124, 122, 120, 119, 118, 116, 115, 113, 112,
907 110, 109, 108, 107, 106, 105, 102, 101, 100, 99,
908 98, 97, 96, 95, 93, 92, 91, 90, 89, 88,
909 87, 86, 85, 82, 78, 53, 49, 45, 38, 32,
910 25, 22, 18, 14, 12, 11, 7, 6, 5, 707,
911 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
912 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
914 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
915 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
916 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
917 707, 707, 707, 707, 707, 707, 707, 707, 707, 707,
921 /* The intent behind this definition is that it'll catch
922 * any uses of REJECT which flex missed.
924 #define REJECT reject_used_but_not_detected
925 #define yymore() yymore_used_but_not_detected
926 #define YY_MORE_ADJ 0
927 #define YY_RESTORE_YY_MORE_OFFSET
928 #line 1 "glsl_lexer.lpp"
929 #line 2 "glsl_lexer.lpp"
931 * Copyright © 2008, 2009 Intel Corporation
933 * Permission is hereby granted, free of charge, to any person obtaining a
934 * copy of this software and associated documentation files (the "Software"),
935 * to deal in the Software without restriction, including without limitation
936 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
937 * and/or sell copies of the Software, and to permit persons to whom the
938 * Software is furnished to do so, subject to the following conditions:
940 * The above copyright notice and this permission notice (including the next
941 * paragraph) shall be included in all copies or substantial portions of the
944 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
945 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
946 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
947 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
948 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
949 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
950 * DEALINGS IN THE SOFTWARE.
954 #include "glsl_parser_extras.h"
955 #include "glsl_parser.h"
957 #define YY_USER_ACTION \
959 yylloc->source = 0; \
960 yylloc->first_column = yycolumn + 1; \
961 yylloc->first_line = yylineno + 1; \
962 yycolumn += yyleng; \
965 #define YY_USER_INIT yylineno = 0; yycolumn = 0;
967 #define TOKEN_OR_IDENTIFIER(version, token) \
969 if (yyextra->language_version >= version) { \
972 yylval->identifier = strdup(yytext); \
977 #define RESERVED_WORD(version, token) \
979 if (yyextra->language_version >= version) { \
982 _mesa_glsl_error(yylloc, yyextra, \
983 "Illegal use of reserved word `%s'", yytext); \
988 #line 989 "glsl_lexer.cpp"
994 #define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
996 /* Holds the entire state of the reentrant scanner. */
1000 /* User-defined. Not touched by flex. */
1001 YY_EXTRA_TYPE yyextra_r
;
1003 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1004 FILE *yyin_r
, *yyout_r
;
1005 size_t yy_buffer_stack_top
; /**< index of top of stack. */
1006 size_t yy_buffer_stack_max
; /**< capacity of stack. */
1007 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
1014 int yy_did_buffer_switch_on_eof
;
1015 int yy_start_stack_ptr
;
1016 int yy_start_stack_depth
;
1017 int *yy_start_stack
;
1018 yy_state_type yy_last_accepting_state
;
1019 char* yy_last_accepting_cpos
;
1022 int yy_flex_debug_r
;
1032 }; /* end struct yyguts_t */
1034 static int yy_init_globals (yyscan_t yyscanner
);
1036 /* This must go here because YYSTYPE and YYLTYPE are included
1037 * from bison output in section 1.*/
1038 # define yylval yyg->yylval_r
1040 # define yylloc yyg->yylloc_r
1042 int _mesa_glsl_lex_init (yyscan_t
* scanner
);
1044 int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
1046 /* Accessor methods to globals.
1047 These are made visible to non-reentrant scanners for convenience. */
1049 int _mesa_glsl_lex_destroy (yyscan_t yyscanner
);
1051 int _mesa_glsl_get_debug (yyscan_t yyscanner
);
1053 void _mesa_glsl_set_debug (int debug_flag
,yyscan_t yyscanner
);
1055 YY_EXTRA_TYPE
_mesa_glsl_get_extra (yyscan_t yyscanner
);
1057 void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
1059 FILE *_mesa_glsl_get_in (yyscan_t yyscanner
);
1061 void _mesa_glsl_set_in (FILE * in_str
,yyscan_t yyscanner
);
1063 FILE *_mesa_glsl_get_out (yyscan_t yyscanner
);
1065 void _mesa_glsl_set_out (FILE * out_str
,yyscan_t yyscanner
);
1067 int _mesa_glsl_get_leng (yyscan_t yyscanner
);
1069 char *_mesa_glsl_get_text (yyscan_t yyscanner
);
1071 int _mesa_glsl_get_lineno (yyscan_t yyscanner
);
1073 void _mesa_glsl_set_lineno (int line_number
,yyscan_t yyscanner
);
1075 YYSTYPE
* _mesa_glsl_get_lval (yyscan_t yyscanner
);
1077 void _mesa_glsl_set_lval (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
1079 YYLTYPE
*_mesa_glsl_get_lloc (yyscan_t yyscanner
);
1081 void _mesa_glsl_set_lloc (YYLTYPE
* yylloc_param
,yyscan_t yyscanner
);
1083 /* Macros after this point can all be overridden by user definitions in
1087 #ifndef YY_SKIP_YYWRAP
1089 extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner
);
1091 extern int _mesa_glsl_wrap (yyscan_t yyscanner
);
1096 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
1099 #ifdef YY_NEED_STRLEN
1100 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
1106 static int yyinput (yyscan_t yyscanner
);
1108 static int input (yyscan_t yyscanner
);
1113 /* Amount of stuff to slurp up with each read. */
1114 #ifndef YY_READ_BUF_SIZE
1116 /* On IA-64, the buffer size is 16k, not 8k */
1117 #define YY_READ_BUF_SIZE 16384
1119 #define YY_READ_BUF_SIZE 8192
1120 #endif /* __ia64__ */
1123 /* Copy whatever the last rule matched to the standard output. */
1125 /* This used to be an fputs(), but since the string might contain NUL's,
1126 * we now use fwrite().
1128 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1131 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1132 * is returned in "result".
1135 #define YY_INPUT(buf,result,max_size) \
1136 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1140 for ( n = 0; n < max_size && \
1141 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1142 buf[n] = (char) c; \
1144 buf[n++] = (char) c; \
1145 if ( c == EOF && ferror( yyin ) ) \
1146 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1152 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1154 if( errno != EINTR) \
1156 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1167 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1168 * we don't want an extra ';' after the "return" because that will cause
1169 * some compilers to complain about unreachable statements.
1172 #define yyterminate() return YY_NULL
1175 /* Number of entries by which start-condition stack grows. */
1176 #ifndef YY_START_STACK_INCR
1177 #define YY_START_STACK_INCR 25
1180 /* Report a fatal error. */
1181 #ifndef YY_FATAL_ERROR
1182 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1185 /* end tables serialization structures and prototypes */
1187 /* Default declaration of generated scanner - a define so the user can
1188 * easily add parameters.
1191 #define YY_DECL_IS_OURS 1
1193 extern int _mesa_glsl_lex \
1194 (YYSTYPE
* yylval_param
,YYLTYPE
* yylloc_param
,yyscan_t yyscanner
);
1196 #define YY_DECL int _mesa_glsl_lex \
1197 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1198 #endif /* !YY_DECL */
1200 /* Code executed at the beginning of each rule, after yytext and yyleng
1203 #ifndef YY_USER_ACTION
1204 #define YY_USER_ACTION
1207 /* Code executed at the end of each rule. */
1209 #define YY_BREAK break;
1212 #define YY_RULE_SETUP \
1214 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1215 (yytext[yyleng - 1] == '\n'); \
1218 /** The main scanner function which does all the work.
1222 register yy_state_type yy_current_state
;
1223 register char *yy_cp
, *yy_bp
;
1224 register int yy_act
;
1225 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1227 #line 76 "glsl_lexer.lpp"
1230 #line 1231 "glsl_lexer.cpp"
1232 yylval
= yylval_param
;
1234 yylloc
= yylloc_param
;
1236 if ( !yyg
->yy_init
)
1244 if ( ! yyg
->yy_start
)
1245 yyg
->yy_start
= 1; /* first start state */
1253 if ( ! YY_CURRENT_BUFFER
) {
1254 _mesa_glsl_ensure_buffer_stack (yyscanner
);
1255 YY_CURRENT_BUFFER_LVALUE
=
1256 _mesa_glsl__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1259 _mesa_glsl__load_buffer_state(yyscanner
);
1262 while ( 1 ) /* loops until end-of-file is reached */
1264 yy_cp
= yyg
->yy_c_buf_p
;
1266 /* Support of yytext. */
1267 *yy_cp
= yyg
->yy_hold_char
;
1269 /* yy_bp points to the position in yy_ch_buf of the start of
1274 yy_current_state
= yyg
->yy_start
;
1275 yy_current_state
+= YY_AT_BOL();
1279 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1280 if ( yy_accept
[yy_current_state
] )
1282 yyg
->yy_last_accepting_state
= yy_current_state
;
1283 yyg
->yy_last_accepting_cpos
= yy_cp
;
1285 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1287 yy_current_state
= (int) yy_def
[yy_current_state
];
1288 if ( yy_current_state
>= 708 )
1289 yy_c
= yy_meta
[(unsigned int) yy_c
];
1291 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1294 while ( yy_current_state
!= 707 );
1295 yy_cp
= yyg
->yy_last_accepting_cpos
;
1296 yy_current_state
= yyg
->yy_last_accepting_state
;
1299 yy_act
= yy_accept
[yy_current_state
];
1301 YY_DO_BEFORE_ACTION
;
1303 do_action
: /* This label is used only to access EOF actions. */
1306 { /* beginning of action switch */
1307 case 0: /* must back up */
1308 /* undo the effects of YY_DO_BEFORE_ACTION */
1309 *yy_cp
= yyg
->yy_hold_char
;
1310 yy_cp
= yyg
->yy_last_accepting_cpos
;
1311 yy_current_state
= yyg
->yy_last_accepting_state
;
1312 goto yy_find_action
;
1316 #line 78 "glsl_lexer.lpp"
1319 /* Preprocessor tokens. */
1321 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1322 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1323 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1325 #line 81 "glsl_lexer.lpp"
1330 #line 82 "glsl_lexer.lpp"
1331 { BEGIN PP
; return VERSION
; }
1335 #line 83 "glsl_lexer.lpp"
1336 { BEGIN PP
; return EXTENSION
; }
1339 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1340 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1341 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1343 #line 84 "glsl_lexer.lpp"
1345 /* Eat characters until the first digit is
1349 while (!isdigit(*ptr
))
1352 /* Subtract one from the line number because
1353 * yylineno is zero-based instead of
1356 yylineno
= strtol(ptr
, &ptr
, 0) - 1;
1357 yylloc
->source
= strtol(ptr
, NULL
, 0);
1361 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1362 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1363 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1365 #line 99 "glsl_lexer.lpp"
1367 /* Eat characters until the first digit is
1371 while (!isdigit(*ptr
))
1374 /* Subtract one from the line number because
1375 * yylineno is zero-based instead of
1378 yylineno
= strtol(ptr
, &ptr
, 0) - 1;
1383 #line 113 "glsl_lexer.lpp"
1386 return PRAGMA_DEBUG_ON
;
1391 #line 117 "glsl_lexer.lpp"
1394 return PRAGMA_DEBUG_OFF
;
1399 #line 121 "glsl_lexer.lpp"
1402 return PRAGMA_OPTIMIZE_ON
;
1407 #line 125 "glsl_lexer.lpp"
1410 return PRAGMA_OPTIMIZE_OFF
;
1415 #line 129 "glsl_lexer.lpp"
1419 /* rule 12 can match eol */
1421 #line 131 "glsl_lexer.lpp"
1422 { BEGIN
0; yylineno
++; yycolumn
= 0; }
1426 #line 132 "glsl_lexer.lpp"
1431 #line 134 "glsl_lexer.lpp"
1436 #line 135 "glsl_lexer.lpp"
1441 #line 136 "glsl_lexer.lpp"
1446 #line 137 "glsl_lexer.lpp"
1448 yylval
->identifier
= strdup(yytext
);
1454 #line 141 "glsl_lexer.lpp"
1456 yylval
->n
= strtol(yytext
, NULL
, 10);
1461 /* rule 19 can match eol */
1463 #line 145 "glsl_lexer.lpp"
1464 { BEGIN
0; yylineno
++; yycolumn
= 0; return EOL
; }
1467 /* rule 20 can match eol */
1469 #line 147 "glsl_lexer.lpp"
1470 { yylineno
++; yycolumn
= 0; }
1474 #line 149 "glsl_lexer.lpp"
1479 #line 150 "glsl_lexer.lpp"
1484 #line 151 "glsl_lexer.lpp"
1489 #line 152 "glsl_lexer.lpp"
1494 #line 153 "glsl_lexer.lpp"
1499 #line 155 "glsl_lexer.lpp"
1504 #line 156 "glsl_lexer.lpp"
1509 #line 157 "glsl_lexer.lpp"
1514 #line 158 "glsl_lexer.lpp"
1519 #line 159 "glsl_lexer.lpp"
1524 #line 160 "glsl_lexer.lpp"
1529 #line 161 "glsl_lexer.lpp"
1534 #line 162 "glsl_lexer.lpp"
1539 #line 163 "glsl_lexer.lpp"
1544 #line 165 "glsl_lexer.lpp"
1549 #line 166 "glsl_lexer.lpp"
1554 #line 167 "glsl_lexer.lpp"
1559 #line 168 "glsl_lexer.lpp"
1564 #line 169 "glsl_lexer.lpp"
1569 #line 170 "glsl_lexer.lpp"
1574 #line 171 "glsl_lexer.lpp"
1579 #line 172 "glsl_lexer.lpp"
1584 #line 173 "glsl_lexer.lpp"
1589 #line 174 "glsl_lexer.lpp"
1594 #line 175 "glsl_lexer.lpp"
1599 #line 176 "glsl_lexer.lpp"
1604 #line 177 "glsl_lexer.lpp"
1605 TOKEN_OR_IDENTIFIER(120, MAT2X2
);
1609 #line 178 "glsl_lexer.lpp"
1610 TOKEN_OR_IDENTIFIER(120, MAT2X3
);
1614 #line 179 "glsl_lexer.lpp"
1615 TOKEN_OR_IDENTIFIER(120, MAT2X4
);
1619 #line 180 "glsl_lexer.lpp"
1620 TOKEN_OR_IDENTIFIER(120, MAT3X2
);
1624 #line 181 "glsl_lexer.lpp"
1625 TOKEN_OR_IDENTIFIER(120, MAT3X3
);
1629 #line 182 "glsl_lexer.lpp"
1630 TOKEN_OR_IDENTIFIER(120, MAT3X4
);
1634 #line 183 "glsl_lexer.lpp"
1635 TOKEN_OR_IDENTIFIER(120, MAT4X2
);
1639 #line 184 "glsl_lexer.lpp"
1640 TOKEN_OR_IDENTIFIER(120, MAT4X3
);
1644 #line 185 "glsl_lexer.lpp"
1645 TOKEN_OR_IDENTIFIER(120, MAT4X4
);
1649 #line 187 "glsl_lexer.lpp"
1654 #line 188 "glsl_lexer.lpp"
1659 #line 189 "glsl_lexer.lpp"
1664 #line 190 "glsl_lexer.lpp"
1669 #line 191 "glsl_lexer.lpp"
1674 #line 192 "glsl_lexer.lpp"
1675 TOKEN_OR_IDENTIFIER(120, CENTROID
);
1679 #line 193 "glsl_lexer.lpp"
1680 TOKEN_OR_IDENTIFIER(120, INVARIANT
);
1684 #line 195 "glsl_lexer.lpp"
1685 TOKEN_OR_IDENTIFIER(130, FLAT
);
1689 #line 196 "glsl_lexer.lpp"
1690 TOKEN_OR_IDENTIFIER(130, SMOOTH
);
1694 #line 197 "glsl_lexer.lpp"
1695 TOKEN_OR_IDENTIFIER(130, NOPERSPECTIVE
);
1699 #line 199 "glsl_lexer.lpp"
1704 #line 200 "glsl_lexer.lpp"
1709 #line 201 "glsl_lexer.lpp"
1714 #line 202 "glsl_lexer.lpp"
1719 #line 203 "glsl_lexer.lpp"
1720 return SAMPLER1DSHADOW
;
1724 #line 204 "glsl_lexer.lpp"
1725 return SAMPLER2DSHADOW
;
1729 #line 206 "glsl_lexer.lpp"
1734 #line 207 "glsl_lexer.lpp"
1739 #line 209 "glsl_lexer.lpp"
1741 if ((yyextra
->language_version
>= 140)
1742 || (yyextra
->ARB_fragment_coord_conventions_enable
)){
1745 yylval
->identifier
= strdup(yytext
);
1752 #line 219 "glsl_lexer.lpp"
1757 #line 220 "glsl_lexer.lpp"
1762 #line 221 "glsl_lexer.lpp"
1767 #line 222 "glsl_lexer.lpp"
1772 #line 223 "glsl_lexer.lpp"
1777 #line 224 "glsl_lexer.lpp"
1782 #line 225 "glsl_lexer.lpp"
1787 #line 226 "glsl_lexer.lpp"
1792 #line 227 "glsl_lexer.lpp"
1797 #line 229 "glsl_lexer.lpp"
1802 #line 230 "glsl_lexer.lpp"
1807 #line 231 "glsl_lexer.lpp"
1812 #line 232 "glsl_lexer.lpp"
1817 #line 233 "glsl_lexer.lpp"
1822 #line 234 "glsl_lexer.lpp"
1823 return RIGHT_ASSIGN
;
1827 #line 235 "glsl_lexer.lpp"
1832 #line 236 "glsl_lexer.lpp"
1837 #line 237 "glsl_lexer.lpp"
1842 #line 238 "glsl_lexer.lpp"
1847 #line 240 "glsl_lexer.lpp"
1849 yylval
->n
= strtol(yytext
, NULL
, 10);
1855 #line 244 "glsl_lexer.lpp"
1857 yylval
->n
= strtol(yytext
+ 2, NULL
, 16);
1863 #line 248 "glsl_lexer.lpp"
1865 yylval
->n
= strtol(yytext
, NULL
, 8);
1871 #line 253 "glsl_lexer.lpp"
1873 yylval
->real
= strtod(yytext
, NULL
);
1874 return FLOATCONSTANT
;
1879 #line 257 "glsl_lexer.lpp"
1881 yylval
->real
= strtod(yytext
, NULL
);
1882 return FLOATCONSTANT
;
1887 #line 261 "glsl_lexer.lpp"
1889 yylval
->real
= strtod(yytext
, NULL
);
1890 return FLOATCONSTANT
;
1895 #line 265 "glsl_lexer.lpp"
1897 yylval
->real
= strtod(yytext
, NULL
);
1898 return FLOATCONSTANT
;
1903 #line 269 "glsl_lexer.lpp"
1905 yylval
->real
= strtod(yytext
, NULL
);
1906 return FLOATCONSTANT
;
1911 #line 274 "glsl_lexer.lpp"
1914 return BOOLCONSTANT
;
1919 #line 278 "glsl_lexer.lpp"
1922 return BOOLCONSTANT
;
1925 /* Reserved words in GLSL 1.10. */
1928 #line 285 "glsl_lexer.lpp"
1929 RESERVED_WORD(999, ASM
);
1933 #line 286 "glsl_lexer.lpp"
1934 RESERVED_WORD(999, CLASS
);
1938 #line 287 "glsl_lexer.lpp"
1939 RESERVED_WORD(999, UNION
);
1943 #line 288 "glsl_lexer.lpp"
1944 RESERVED_WORD(999, ENUM
);
1948 #line 289 "glsl_lexer.lpp"
1949 RESERVED_WORD(999, TYPEDEF
);
1953 #line 290 "glsl_lexer.lpp"
1954 RESERVED_WORD(999, TEMPLATE
);
1958 #line 291 "glsl_lexer.lpp"
1959 RESERVED_WORD(999, THIS
);
1963 #line 292 "glsl_lexer.lpp"
1964 RESERVED_WORD(999, PACKED_TOK
);
1968 #line 293 "glsl_lexer.lpp"
1969 RESERVED_WORD(999, GOTO
);
1973 #line 294 "glsl_lexer.lpp"
1974 RESERVED_WORD(130, SWITCH
);
1978 #line 295 "glsl_lexer.lpp"
1979 RESERVED_WORD(130, DEFAULT
);
1983 #line 296 "glsl_lexer.lpp"
1984 RESERVED_WORD(999, INLINE_TOK
);
1988 #line 297 "glsl_lexer.lpp"
1989 RESERVED_WORD(999, NOINLINE
);
1993 #line 298 "glsl_lexer.lpp"
1994 RESERVED_WORD(999, VOLATILE
);
1998 #line 299 "glsl_lexer.lpp"
1999 RESERVED_WORD(999, PUBLIC_TOK
);
2003 #line 300 "glsl_lexer.lpp"
2004 RESERVED_WORD(999, STATIC
);
2008 #line 301 "glsl_lexer.lpp"
2009 RESERVED_WORD(999, EXTERN
);
2013 #line 302 "glsl_lexer.lpp"
2014 RESERVED_WORD(999, EXTERNAL
);
2018 #line 303 "glsl_lexer.lpp"
2019 RESERVED_WORD(999, INTERFACE
);
2023 #line 304 "glsl_lexer.lpp"
2024 RESERVED_WORD(999, LONG_TOK
);
2028 #line 305 "glsl_lexer.lpp"
2029 RESERVED_WORD(999, SHORT_TOK
);
2033 #line 306 "glsl_lexer.lpp"
2034 RESERVED_WORD(999, DOUBLE_TOK
);
2038 #line 307 "glsl_lexer.lpp"
2039 RESERVED_WORD(999, HALF
);
2043 #line 308 "glsl_lexer.lpp"
2044 RESERVED_WORD(999, FIXED_TOK
);
2048 #line 309 "glsl_lexer.lpp"
2049 RESERVED_WORD(999, UNSIGNED
);
2053 #line 310 "glsl_lexer.lpp"
2054 RESERVED_WORD(999, INPUT_TOK
);
2058 #line 311 "glsl_lexer.lpp"
2059 RESERVED_WORD(999, OUTPUT
);
2063 #line 312 "glsl_lexer.lpp"
2064 RESERVED_WORD(999, HVEC2
);
2068 #line 313 "glsl_lexer.lpp"
2069 RESERVED_WORD(999, HVEC3
);
2073 #line 314 "glsl_lexer.lpp"
2074 RESERVED_WORD(999, HVEC4
);
2078 #line 315 "glsl_lexer.lpp"
2079 RESERVED_WORD(999, DVEC2
);
2083 #line 316 "glsl_lexer.lpp"
2084 RESERVED_WORD(999, DVEC3
);
2088 #line 317 "glsl_lexer.lpp"
2089 RESERVED_WORD(999, DVEC4
);
2093 #line 318 "glsl_lexer.lpp"
2094 RESERVED_WORD(999, FVEC2
);
2098 #line 319 "glsl_lexer.lpp"
2099 RESERVED_WORD(999, FVEC3
);
2103 #line 320 "glsl_lexer.lpp"
2104 RESERVED_WORD(999, FVEC4
);
2108 #line 321 "glsl_lexer.lpp"
2109 return SAMPLER2DRECT
;
2113 #line 322 "glsl_lexer.lpp"
2114 RESERVED_WORD(999, SAMPLER3DRECT
);
2118 #line 323 "glsl_lexer.lpp"
2119 return SAMPLER2DRECTSHADOW
;
2123 #line 324 "glsl_lexer.lpp"
2124 RESERVED_WORD(999, SIZEOF
);
2128 #line 325 "glsl_lexer.lpp"
2129 RESERVED_WORD(999, CAST
);
2133 #line 326 "glsl_lexer.lpp"
2134 RESERVED_WORD(999, NAMESPACE
);
2138 #line 327 "glsl_lexer.lpp"
2139 RESERVED_WORD(999, USING
);
2141 /* Additional reserved words in GLSL 1.20. */
2144 #line 330 "glsl_lexer.lpp"
2145 TOKEN_OR_IDENTIFIER(120, LOWP
);
2149 #line 331 "glsl_lexer.lpp"
2150 TOKEN_OR_IDENTIFIER(120, MEDIUMP
);
2154 #line 332 "glsl_lexer.lpp"
2155 TOKEN_OR_IDENTIFIER(120, HIGHP
);
2159 #line 333 "glsl_lexer.lpp"
2160 TOKEN_OR_IDENTIFIER(120, PRECISION
);
2162 /* Additional reserved words in GLSL 1.30. */
2165 #line 336 "glsl_lexer.lpp"
2166 TOKEN_OR_IDENTIFIER(130, COMMON
);
2170 #line 337 "glsl_lexer.lpp"
2171 TOKEN_OR_IDENTIFIER(130, PARTITION
);
2175 #line 338 "glsl_lexer.lpp"
2176 TOKEN_OR_IDENTIFIER(130, ACTIVE
);
2180 #line 339 "glsl_lexer.lpp"
2181 TOKEN_OR_IDENTIFIER(130, SUPERP
);
2185 #line 340 "glsl_lexer.lpp"
2186 TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER
);
2190 #line 341 "glsl_lexer.lpp"
2191 TOKEN_OR_IDENTIFIER(130, FILTER
);
2195 #line 342 "glsl_lexer.lpp"
2196 TOKEN_OR_IDENTIFIER(130, IMAGE1D
);
2200 #line 343 "glsl_lexer.lpp"
2201 TOKEN_OR_IDENTIFIER(130, IMAGE2D
);
2205 #line 344 "glsl_lexer.lpp"
2206 TOKEN_OR_IDENTIFIER(130, IMAGE3D
);
2210 #line 345 "glsl_lexer.lpp"
2211 TOKEN_OR_IDENTIFIER(130, IMAGECUBE
);
2215 #line 346 "glsl_lexer.lpp"
2216 TOKEN_OR_IDENTIFIER(130, IIMAGE1D
);
2220 #line 347 "glsl_lexer.lpp"
2221 TOKEN_OR_IDENTIFIER(130, IIMAGE2D
);
2225 #line 348 "glsl_lexer.lpp"
2226 TOKEN_OR_IDENTIFIER(130, IIMAGE3D
);
2230 #line 349 "glsl_lexer.lpp"
2231 TOKEN_OR_IDENTIFIER(130, IIMAGECUBE
);
2235 #line 350 "glsl_lexer.lpp"
2236 TOKEN_OR_IDENTIFIER(130, UIMAGE1D
);
2240 #line 351 "glsl_lexer.lpp"
2241 TOKEN_OR_IDENTIFIER(130, UIMAGE2D
);
2245 #line 352 "glsl_lexer.lpp"
2246 TOKEN_OR_IDENTIFIER(130, UIMAGE3D
);
2250 #line 353 "glsl_lexer.lpp"
2251 TOKEN_OR_IDENTIFIER(130, UIMAGECUBE
);
2255 #line 354 "glsl_lexer.lpp"
2256 TOKEN_OR_IDENTIFIER(130, IMAGE1DARRAY
);
2260 #line 355 "glsl_lexer.lpp"
2261 TOKEN_OR_IDENTIFIER(130, IMAGE2DARRAY
);
2265 #line 356 "glsl_lexer.lpp"
2266 TOKEN_OR_IDENTIFIER(130, IIMAGE1DARRAY
);
2270 #line 357 "glsl_lexer.lpp"
2271 TOKEN_OR_IDENTIFIER(130, IIMAGE2DARRAY
);
2275 #line 358 "glsl_lexer.lpp"
2276 TOKEN_OR_IDENTIFIER(130, UIMAGE1DARRAY
);
2280 #line 359 "glsl_lexer.lpp"
2281 TOKEN_OR_IDENTIFIER(130, UIMAGE2DARRAY
);
2285 #line 360 "glsl_lexer.lpp"
2286 TOKEN_OR_IDENTIFIER(130, IMAGE1DSHADOW
);
2290 #line 361 "glsl_lexer.lpp"
2291 TOKEN_OR_IDENTIFIER(130, IMAGE2DSHADOW
);
2295 #line 362 "glsl_lexer.lpp"
2296 TOKEN_OR_IDENTIFIER(130, IMAGEBUFFER
);
2300 #line 363 "glsl_lexer.lpp"
2301 TOKEN_OR_IDENTIFIER(130, IIMAGEBUFFER
);
2305 #line 364 "glsl_lexer.lpp"
2306 TOKEN_OR_IDENTIFIER(130, UIMAGEBUFFER
);
2310 #line 365 "glsl_lexer.lpp"
2311 TOKEN_OR_IDENTIFIER(130, ROW_MAJOR
);
2315 #line 367 "glsl_lexer.lpp"
2317 struct _mesa_glsl_parse_state
*state
= yyextra
;
2319 yylval
->identifier
= talloc_strdup(ctx
, yytext
);
2325 #line 374 "glsl_lexer.lpp"
2326 { return yytext
[0]; }
2330 #line 376 "glsl_lexer.lpp"
2333 #line 2334 "glsl_lexer.cpp"
2334 case YY_STATE_EOF(INITIAL
):
2335 case YY_STATE_EOF(PP
):
2336 case YY_STATE_EOF(PRAGMA
):
2339 case YY_END_OF_BUFFER
:
2341 /* Amount of text matched not including the EOB char. */
2342 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
2344 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2345 *yy_cp
= yyg
->yy_hold_char
;
2346 YY_RESTORE_YY_MORE_OFFSET
2348 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
2350 /* We're scanning a new file or input source. It's
2351 * possible that this happened because the user
2352 * just pointed yyin at a new source and called
2353 * _mesa_glsl_lex(). If so, then we have to assure
2354 * consistency between YY_CURRENT_BUFFER and our
2355 * globals. Here is the right place to do so, because
2356 * this is the first action (other than possibly a
2357 * back-up) that will match for the new input source.
2359 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
2360 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
2361 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2364 /* Note that here we test for yy_c_buf_p "<=" to the position
2365 * of the first EOB in the buffer, since yy_c_buf_p will
2366 * already have been incremented past the NUL character
2367 * (since all states make transitions on EOB to the
2368 * end-of-buffer state). Contrast this with the test
2371 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
2372 { /* This was really a NUL. */
2373 yy_state_type yy_next_state
;
2375 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
2377 yy_current_state
= yy_get_previous_state( yyscanner
);
2379 /* Okay, we're now positioned to make the NUL
2380 * transition. We couldn't have
2381 * yy_get_previous_state() go ahead and do it
2382 * for us because it doesn't know how to deal
2383 * with the possibility of jamming (and we don't
2384 * want to build jamming into it because then it
2385 * will run more slowly).
2388 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
2390 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2392 if ( yy_next_state
)
2394 /* Consume the NUL. */
2395 yy_cp
= ++yyg
->yy_c_buf_p
;
2396 yy_current_state
= yy_next_state
;
2402 yy_cp
= yyg
->yy_last_accepting_cpos
;
2403 yy_current_state
= yyg
->yy_last_accepting_state
;
2404 goto yy_find_action
;
2408 else switch ( yy_get_next_buffer( yyscanner
) )
2410 case EOB_ACT_END_OF_FILE
:
2412 yyg
->yy_did_buffer_switch_on_eof
= 0;
2414 if ( _mesa_glsl_wrap(yyscanner
) )
2416 /* Note: because we've taken care in
2417 * yy_get_next_buffer() to have set up
2418 * yytext, we can now set up
2419 * yy_c_buf_p so that if some total
2420 * hoser (like flex itself) wants to
2421 * call the scanner after we return the
2422 * YY_NULL, it'll still work - another
2423 * YY_NULL will get returned.
2425 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2427 yy_act
= YY_STATE_EOF(YY_START
);
2433 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
2439 case EOB_ACT_CONTINUE_SCAN
:
2441 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
2443 yy_current_state
= yy_get_previous_state( yyscanner
);
2445 yy_cp
= yyg
->yy_c_buf_p
;
2446 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2449 case EOB_ACT_LAST_MATCH
:
2451 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
2453 yy_current_state
= yy_get_previous_state( yyscanner
);
2455 yy_cp
= yyg
->yy_c_buf_p
;
2456 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2457 goto yy_find_action
;
2464 "fatal flex scanner internal error--no action found" );
2465 } /* end of action switch */
2466 } /* end of scanning one token */
2467 } /* end of _mesa_glsl_lex */
2469 /* yy_get_next_buffer - try to read in a new buffer
2471 * Returns a code representing an action:
2472 * EOB_ACT_LAST_MATCH -
2473 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2474 * EOB_ACT_END_OF_FILE - end of file
2476 static int yy_get_next_buffer (yyscan_t yyscanner
)
2478 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2479 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
2480 register char *source
= yyg
->yytext_ptr
;
2481 register int number_to_move
, i
;
2484 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
2486 "fatal flex scanner internal error--end of buffer missed" );
2488 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
2489 { /* Don't try to fill the buffer, so this is an EOF. */
2490 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
2492 /* We matched a single character, the EOB, so
2493 * treat this as a final EOF.
2495 return EOB_ACT_END_OF_FILE
;
2500 /* We matched some text prior to the EOB, first
2503 return EOB_ACT_LAST_MATCH
;
2507 /* Try to read more data. */
2509 /* First move last chars to start of buffer. */
2510 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
2512 for ( i
= 0; i
< number_to_move
; ++i
)
2513 *(dest
++) = *(source
++);
2515 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2516 /* don't do the read, it's not guaranteed to return an EOF,
2519 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
2524 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
2526 while ( num_to_read
<= 0 )
2527 { /* Not enough room in the buffer - grow it. */
2529 /* just a shorter name for the current buffer */
2530 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
2532 int yy_c_buf_p_offset
=
2533 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
2535 if ( b
->yy_is_our_buffer
)
2537 int new_size
= b
->yy_buf_size
* 2;
2539 if ( new_size
<= 0 )
2540 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2542 b
->yy_buf_size
*= 2;
2544 b
->yy_ch_buf
= (char *)
2545 /* Include room in for 2 EOB chars. */
2546 _mesa_glsl_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
2549 /* Can't grow it, we don't own it. */
2552 if ( ! b
->yy_ch_buf
)
2554 "fatal error - scanner input buffer overflow" );
2556 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2558 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
2563 if ( num_to_read
> YY_READ_BUF_SIZE
)
2564 num_to_read
= YY_READ_BUF_SIZE
;
2566 /* Read in more data. */
2567 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
2568 yyg
->yy_n_chars
, (size_t) num_to_read
);
2570 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2573 if ( yyg
->yy_n_chars
== 0 )
2575 if ( number_to_move
== YY_MORE_ADJ
)
2577 ret_val
= EOB_ACT_END_OF_FILE
;
2578 _mesa_glsl_restart(yyin
,yyscanner
);
2583 ret_val
= EOB_ACT_LAST_MATCH
;
2584 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
2585 YY_BUFFER_EOF_PENDING
;
2590 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2592 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
2593 /* Extend the array by 50%, plus the number we really need. */
2594 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
2595 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
2596 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
2597 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2600 yyg
->yy_n_chars
+= number_to_move
;
2601 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2602 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2604 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
2609 /* yy_get_previous_state - get the state just before the EOB char was reached */
2611 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
2613 register yy_state_type yy_current_state
;
2614 register char *yy_cp
;
2615 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2617 yy_current_state
= yyg
->yy_start
;
2618 yy_current_state
+= YY_AT_BOL();
2620 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
2622 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2623 if ( yy_accept
[yy_current_state
] )
2625 yyg
->yy_last_accepting_state
= yy_current_state
;
2626 yyg
->yy_last_accepting_cpos
= yy_cp
;
2628 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2630 yy_current_state
= (int) yy_def
[yy_current_state
];
2631 if ( yy_current_state
>= 708 )
2632 yy_c
= yy_meta
[(unsigned int) yy_c
];
2634 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2637 return yy_current_state
;
2640 /* yy_try_NUL_trans - try to make a transition on the NUL character
2643 * next_state = yy_try_NUL_trans( current_state );
2645 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
2647 register int yy_is_jam
;
2648 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
2649 register char *yy_cp
= yyg
->yy_c_buf_p
;
2651 register YY_CHAR yy_c
= 1;
2652 if ( yy_accept
[yy_current_state
] )
2654 yyg
->yy_last_accepting_state
= yy_current_state
;
2655 yyg
->yy_last_accepting_cpos
= yy_cp
;
2657 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2659 yy_current_state
= (int) yy_def
[yy_current_state
];
2660 if ( yy_current_state
>= 708 )
2661 yy_c
= yy_meta
[(unsigned int) yy_c
];
2663 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2664 yy_is_jam
= (yy_current_state
== 707);
2666 return yy_is_jam
? 0 : yy_current_state
;
2671 static int yyinput (yyscan_t yyscanner
)
2673 static int input (yyscan_t yyscanner
)
2678 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2680 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2682 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2684 /* yy_c_buf_p now points to the character we want to return.
2685 * If this occurs *before* the EOB characters, then it's a
2686 * valid NUL; if not, then we've hit the end of the buffer.
2688 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
2689 /* This was really a NUL. */
2690 *yyg
->yy_c_buf_p
= '\0';
2693 { /* need more input */
2694 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
2697 switch ( yy_get_next_buffer( yyscanner
) )
2699 case EOB_ACT_LAST_MATCH
:
2700 /* This happens because yy_g_n_b()
2701 * sees that we've accumulated a
2702 * token and flags that we need to
2703 * try matching the token before
2704 * proceeding. But for input(),
2705 * there's no matching to consider.
2706 * So convert the EOB_ACT_LAST_MATCH
2707 * to EOB_ACT_END_OF_FILE.
2710 /* Reset buffer status. */
2711 _mesa_glsl_restart(yyin
,yyscanner
);
2715 case EOB_ACT_END_OF_FILE
:
2717 if ( _mesa_glsl_wrap(yyscanner
) )
2720 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
2723 return yyinput(yyscanner
);
2725 return input(yyscanner
);
2729 case EOB_ACT_CONTINUE_SCAN
:
2730 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
2736 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
2737 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
2738 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
2740 YY_CURRENT_BUFFER_LVALUE
->yy_at_bol
= (c
== '\n');
2744 #endif /* ifndef YY_NO_INPUT */
2746 /** Immediately switch to a different input stream.
2747 * @param input_file A readable stream.
2748 * @param yyscanner The scanner object.
2749 * @note This function does not reset the start condition to @c INITIAL .
2751 void _mesa_glsl_restart (FILE * input_file
, yyscan_t yyscanner
)
2753 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2755 if ( ! YY_CURRENT_BUFFER
){
2756 _mesa_glsl_ensure_buffer_stack (yyscanner
);
2757 YY_CURRENT_BUFFER_LVALUE
=
2758 _mesa_glsl__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
2761 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
2762 _mesa_glsl__load_buffer_state(yyscanner
);
2765 /** Switch to a different input buffer.
2766 * @param new_buffer The new input buffer.
2767 * @param yyscanner The scanner object.
2769 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
2771 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2773 /* TODO. We should be able to replace this entire function body
2775 * _mesa_glsl_pop_buffer_state();
2776 * _mesa_glsl_push_buffer_state(new_buffer);
2778 _mesa_glsl_ensure_buffer_stack (yyscanner
);
2779 if ( YY_CURRENT_BUFFER
== new_buffer
)
2782 if ( YY_CURRENT_BUFFER
)
2784 /* Flush out information for old buffer. */
2785 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2786 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
2787 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2790 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2791 _mesa_glsl__load_buffer_state(yyscanner
);
2793 /* We don't actually know whether we did this switch during
2794 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2795 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2796 * to go ahead and always set it.
2798 yyg
->yy_did_buffer_switch_on_eof
= 1;
2801 static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner
)
2803 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2804 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
2805 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
2806 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
2807 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
2810 /** Allocate and initialize an input buffer state.
2811 * @param file A readable stream.
2812 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2813 * @param yyscanner The scanner object.
2814 * @return the allocated buffer state.
2816 YY_BUFFER_STATE
_mesa_glsl__create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
2820 b
= (YY_BUFFER_STATE
) _mesa_glsl_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
2822 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2824 b
->yy_buf_size
= size
;
2826 /* yy_ch_buf has to be 2 characters longer than the size given because
2827 * we need to put in 2 end-of-buffer characters.
2829 b
->yy_ch_buf
= (char *) _mesa_glsl_alloc(b
->yy_buf_size
+ 2 ,yyscanner
);
2830 if ( ! b
->yy_ch_buf
)
2831 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
2833 b
->yy_is_our_buffer
= 1;
2835 _mesa_glsl__init_buffer(b
,file
,yyscanner
);
2840 /** Destroy the buffer.
2841 * @param b a buffer created with _mesa_glsl__create_buffer()
2842 * @param yyscanner The scanner object.
2844 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
2846 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2851 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
2852 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
2854 if ( b
->yy_is_our_buffer
)
2855 _mesa_glsl_free((void *) b
->yy_ch_buf
,yyscanner
);
2857 _mesa_glsl_free((void *) b
,yyscanner
);
2860 /* Initializes or reinitializes a buffer.
2861 * This function is sometimes called more than once on the same buffer,
2862 * such as during a _mesa_glsl_restart() or at EOF.
2864 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
2868 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2870 _mesa_glsl__flush_buffer(b
,yyscanner
);
2872 b
->yy_input_file
= file
;
2873 b
->yy_fill_buffer
= 1;
2875 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
2876 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
2877 * In that case, we don't want to reset the lineno or column.
2879 if (b
!= YY_CURRENT_BUFFER
){
2880 b
->yy_bs_lineno
= 1;
2881 b
->yy_bs_column
= 0;
2884 b
->yy_is_interactive
= 0;
2889 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2890 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2891 * @param yyscanner The scanner object.
2893 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
2895 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2901 /* We always need two end-of-buffer characters. The first causes
2902 * a transition to the end-of-buffer state. The second causes
2903 * a jam in that state.
2905 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2906 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2908 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2911 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2913 if ( b
== YY_CURRENT_BUFFER
)
2914 _mesa_glsl__load_buffer_state(yyscanner
);
2917 /** Pushes the new state onto the stack. The new state becomes
2918 * the current state. This function will allocate the stack
2920 * @param new_buffer The new state.
2921 * @param yyscanner The scanner object.
2923 void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
2925 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2926 if (new_buffer
== NULL
)
2929 _mesa_glsl_ensure_buffer_stack(yyscanner
);
2931 /* This block is copied from _mesa_glsl__switch_to_buffer. */
2932 if ( YY_CURRENT_BUFFER
)
2934 /* Flush out information for old buffer. */
2935 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2936 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
2937 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2940 /* Only push if top exists. Otherwise, replace top. */
2941 if (YY_CURRENT_BUFFER
)
2942 yyg
->yy_buffer_stack_top
++;
2943 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2945 /* copied from _mesa_glsl__switch_to_buffer. */
2946 _mesa_glsl__load_buffer_state(yyscanner
);
2947 yyg
->yy_did_buffer_switch_on_eof
= 1;
2950 /** Removes and deletes the top of the stack, if present.
2951 * The next element becomes the new top.
2952 * @param yyscanner The scanner object.
2954 void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner
)
2956 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2957 if (!YY_CURRENT_BUFFER
)
2960 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
2961 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2962 if (yyg
->yy_buffer_stack_top
> 0)
2963 --yyg
->yy_buffer_stack_top
;
2965 if (YY_CURRENT_BUFFER
) {
2966 _mesa_glsl__load_buffer_state(yyscanner
);
2967 yyg
->yy_did_buffer_switch_on_eof
= 1;
2971 /* Allocates the stack if it does not exist.
2972 * Guarantees space for at least one push.
2974 static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner
)
2977 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2979 if (!yyg
->yy_buffer_stack
) {
2981 /* First allocation is just for 2 elements, since we don't know if this
2982 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2983 * immediate realloc on the next call.
2986 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_mesa_glsl_alloc
2987 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
2989 if ( ! yyg
->yy_buffer_stack
)
2990 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
2992 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
2994 yyg
->yy_buffer_stack_max
= num_to_alloc
;
2995 yyg
->yy_buffer_stack_top
= 0;
2999 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
3001 /* Increase the buffer to prepare for a possible push. */
3002 int grow_size
= 8 /* arbitrary grow size */;
3004 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
3005 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_mesa_glsl_realloc
3006 (yyg
->yy_buffer_stack
,
3007 num_to_alloc
* sizeof(struct yy_buffer_state
*)
3009 if ( ! yyg
->yy_buffer_stack
)
3010 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3012 /* zero only the new slots.*/
3013 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
3014 yyg
->yy_buffer_stack_max
= num_to_alloc
;
3018 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3019 * @param base the character buffer
3020 * @param size the size in bytes of the character buffer
3021 * @param yyscanner The scanner object.
3022 * @return the newly allocated buffer state object.
3024 YY_BUFFER_STATE
_mesa_glsl__scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
3029 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
3030 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
3031 /* They forgot to leave room for the EOB's. */
3034 b
= (YY_BUFFER_STATE
) _mesa_glsl_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
3036 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3038 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
3039 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
3040 b
->yy_is_our_buffer
= 0;
3041 b
->yy_input_file
= 0;
3042 b
->yy_n_chars
= b
->yy_buf_size
;
3043 b
->yy_is_interactive
= 0;
3045 b
->yy_fill_buffer
= 0;
3046 b
->yy_buffer_status
= YY_BUFFER_NEW
;
3048 _mesa_glsl__switch_to_buffer(b
,yyscanner
);
3053 /** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3054 * scan from a @e copy of @a str.
3055 * @param yystr a NUL-terminated string to scan
3056 * @param yyscanner The scanner object.
3057 * @return the newly allocated buffer state object.
3058 * @note If you want to scan bytes that may contain NUL values, then use
3059 * _mesa_glsl__scan_bytes() instead.
3061 YY_BUFFER_STATE
_mesa_glsl__scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
3064 return _mesa_glsl__scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
3067 /** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3068 * scan from a @e copy of @a bytes.
3069 * @param yybytes the byte buffer to scan
3070 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
3071 * @param yyscanner The scanner object.
3072 * @return the newly allocated buffer state object.
3074 YY_BUFFER_STATE
_mesa_glsl__scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
3081 /* Get memory for full buffer, including space for trailing EOB's. */
3082 n
= _yybytes_len
+ 2;
3083 buf
= (char *) _mesa_glsl_alloc(n
,yyscanner
);
3085 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3087 for ( i
= 0; i
< _yybytes_len
; ++i
)
3088 buf
[i
] = yybytes
[i
];
3090 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
3092 b
= _mesa_glsl__scan_buffer(buf
,n
,yyscanner
);
3094 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3096 /* It's okay to grow etc. this buffer, and we should throw it
3097 * away when we're done.
3099 b
->yy_is_our_buffer
= 1;
3104 #ifndef YY_EXIT_FAILURE
3105 #define YY_EXIT_FAILURE 2
3108 static void yy_fatal_error (yyconst
char* msg
, yyscan_t yyscanner
)
3110 (void) fprintf( stderr
, "%s\n", msg
);
3111 exit( YY_EXIT_FAILURE
);
3114 /* Redefine yyless() so it works in section 3 code. */
3120 /* Undo effects of setting up yytext. */ \
3121 int yyless_macro_arg = (n); \
3122 YY_LESS_LINENO(yyless_macro_arg);\
3123 yytext[yyleng] = yyg->yy_hold_char; \
3124 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3125 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3126 *yyg->yy_c_buf_p = '\0'; \
3127 yyleng = yyless_macro_arg; \
3131 /* Accessor methods (get/set functions) to struct members. */
3133 /** Get the user-defined data for this scanner.
3134 * @param yyscanner The scanner object.
3136 YY_EXTRA_TYPE
_mesa_glsl_get_extra (yyscan_t yyscanner
)
3138 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3142 /** Get the current line number.
3143 * @param yyscanner The scanner object.
3145 int _mesa_glsl_get_lineno (yyscan_t yyscanner
)
3147 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3149 if (! YY_CURRENT_BUFFER
)
3155 /** Get the current column number.
3156 * @param yyscanner The scanner object.
3158 int _mesa_glsl_get_column (yyscan_t yyscanner
)
3160 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3162 if (! YY_CURRENT_BUFFER
)
3168 /** Get the input stream.
3169 * @param yyscanner The scanner object.
3171 FILE *_mesa_glsl_get_in (yyscan_t yyscanner
)
3173 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3177 /** Get the output stream.
3178 * @param yyscanner The scanner object.
3180 FILE *_mesa_glsl_get_out (yyscan_t yyscanner
)
3182 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3186 /** Get the length of the current token.
3187 * @param yyscanner The scanner object.
3189 int _mesa_glsl_get_leng (yyscan_t yyscanner
)
3191 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3195 /** Get the current token.
3196 * @param yyscanner The scanner object.
3199 char *_mesa_glsl_get_text (yyscan_t yyscanner
)
3201 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3205 /** Set the user-defined data. This data is never touched by the scanner.
3206 * @param user_defined The data to be associated with this scanner.
3207 * @param yyscanner The scanner object.
3209 void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
3211 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3212 yyextra
= user_defined
;
3215 /** Set the current line number.
3216 * @param line_number
3217 * @param yyscanner The scanner object.
3219 void _mesa_glsl_set_lineno (int line_number
, yyscan_t yyscanner
)
3221 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3223 /* lineno is only valid if an input buffer exists. */
3224 if (! YY_CURRENT_BUFFER
)
3225 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner
);
3227 yylineno
= line_number
;
3230 /** Set the current column.
3231 * @param line_number
3232 * @param yyscanner The scanner object.
3234 void _mesa_glsl_set_column (int column_no
, yyscan_t yyscanner
)
3236 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3238 /* column is only valid if an input buffer exists. */
3239 if (! YY_CURRENT_BUFFER
)
3240 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner
);
3242 yycolumn
= column_no
;
3245 /** Set the input stream. This does not discard the current
3247 * @param in_str A readable stream.
3248 * @param yyscanner The scanner object.
3249 * @see _mesa_glsl__switch_to_buffer
3251 void _mesa_glsl_set_in (FILE * in_str
, yyscan_t yyscanner
)
3253 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3257 void _mesa_glsl_set_out (FILE * out_str
, yyscan_t yyscanner
)
3259 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3263 int _mesa_glsl_get_debug (yyscan_t yyscanner
)
3265 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3266 return yy_flex_debug
;
3269 void _mesa_glsl_set_debug (int bdebug
, yyscan_t yyscanner
)
3271 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3272 yy_flex_debug
= bdebug
;
3275 /* Accessor methods for yylval and yylloc */
3277 YYSTYPE
* _mesa_glsl_get_lval (yyscan_t yyscanner
)
3279 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3283 void _mesa_glsl_set_lval (YYSTYPE
* yylval_param
, yyscan_t yyscanner
)
3285 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3286 yylval
= yylval_param
;
3289 YYLTYPE
*_mesa_glsl_get_lloc (yyscan_t yyscanner
)
3291 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3295 void _mesa_glsl_set_lloc (YYLTYPE
* yylloc_param
, yyscan_t yyscanner
)
3297 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3298 yylloc
= yylloc_param
;
3301 /* User-visible API */
3303 /* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3304 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3305 * That's why we explicitly handle the declaration, instead of using our macros.
3308 int _mesa_glsl_lex_init(yyscan_t
* ptr_yy_globals
)
3311 if (ptr_yy_globals
== NULL
){
3316 *ptr_yy_globals
= (yyscan_t
) _mesa_glsl_alloc ( sizeof( struct yyguts_t
), NULL
);
3318 if (*ptr_yy_globals
== NULL
){
3323 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3324 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
3326 return yy_init_globals ( *ptr_yy_globals
);
3329 /* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3330 * convention of taking the scanner as the last argument. Note however, that
3331 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3332 * is the reason, too, why this function also must handle its own declaration).
3333 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3334 * the yyextra field.
3337 int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined
,yyscan_t
* ptr_yy_globals
)
3340 struct yyguts_t dummy_yyguts
;
3342 _mesa_glsl_set_extra (yy_user_defined
, &dummy_yyguts
);
3344 if (ptr_yy_globals
== NULL
){
3349 *ptr_yy_globals
= (yyscan_t
) _mesa_glsl_alloc ( sizeof( struct yyguts_t
), &dummy_yyguts
);
3351 if (*ptr_yy_globals
== NULL
){
3356 /* By setting to 0xAA, we expose bugs in
3357 yy_init_globals. Leave at 0x00 for releases. */
3358 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
3360 _mesa_glsl_set_extra (yy_user_defined
, *ptr_yy_globals
);
3362 return yy_init_globals ( *ptr_yy_globals
);
3365 static int yy_init_globals (yyscan_t yyscanner
)
3367 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3368 /* Initialization is the same as for the non-reentrant scanner.
3369 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3372 yyg
->yy_buffer_stack
= 0;
3373 yyg
->yy_buffer_stack_top
= 0;
3374 yyg
->yy_buffer_stack_max
= 0;
3375 yyg
->yy_c_buf_p
= (char *) 0;
3379 yyg
->yy_start_stack_ptr
= 0;
3380 yyg
->yy_start_stack_depth
= 0;
3381 yyg
->yy_start_stack
= NULL
;
3383 /* Defined in main.c */
3392 /* For future reference: Set errno on error, since we are called by
3393 * _mesa_glsl_lex_init()
3398 /* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3399 int _mesa_glsl_lex_destroy (yyscan_t yyscanner
)
3401 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3403 /* Pop the buffer stack, destroying each element. */
3404 while(YY_CURRENT_BUFFER
){
3405 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
3406 YY_CURRENT_BUFFER_LVALUE
= NULL
;
3407 _mesa_glsl_pop_buffer_state(yyscanner
);
3410 /* Destroy the stack itself. */
3411 _mesa_glsl_free(yyg
->yy_buffer_stack
,yyscanner
);
3412 yyg
->yy_buffer_stack
= NULL
;
3414 /* Destroy the start condition stack. */
3415 _mesa_glsl_free(yyg
->yy_start_stack
,yyscanner
);
3416 yyg
->yy_start_stack
= NULL
;
3418 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3419 * _mesa_glsl_lex() is called, initialization will occur. */
3420 yy_init_globals( yyscanner
);
3422 /* Destroy the main struct (reentrant only). */
3423 _mesa_glsl_free ( yyscanner
, yyscanner
);
3429 * Internal utility routines.
3433 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
3436 for ( i
= 0; i
< n
; ++i
)
3441 #ifdef YY_NEED_STRLEN
3442 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
3445 for ( n
= 0; s
[n
]; ++n
)
3452 void *_mesa_glsl_alloc (yy_size_t size
, yyscan_t yyscanner
)
3454 return (void *) malloc( size
);
3457 void *_mesa_glsl_realloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
3459 /* The cast to (char *) in the following accommodates both
3460 * implementations that use char* generic pointers, and those
3461 * that use void* generic pointers. It works with the latter
3462 * because both ANSI C and C++ allow castless assignment from
3463 * any pointer type to void*, and deal with argument conversions
3464 * as though doing an assignment.
3466 return (void *) realloc( (char *) ptr
, size
);
3469 void _mesa_glsl_free (void * ptr
, yyscan_t yyscanner
)
3471 free( (char *) ptr
); /* see _mesa_glsl_realloc() for (char *) cast */
3474 #define YYTABLES_NAME "yytables"
3476 #line 376 "glsl_lexer.lpp"
3481 _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state
*state
, const char *string
)
3483 _mesa_glsl_lex_init_extra(state
,& state
->scanner
);
3484 _mesa_glsl__scan_string(string
,state
->scanner
);
3488 _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state
*state
)
3490 _mesa_glsl_lex_destroy(state
->scanner
);