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
;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121 /* An opaque pointer. */
122 #ifndef YY_TYPEDEF_YY_SCANNER_T
123 #define YY_TYPEDEF_YY_SCANNER_T
124 typedef void* yyscan_t
;
127 /* For convenience, these vars (plus the bison vars far below)
128 are macros in the reentrant scanner. */
129 #define yyin yyg->yyin_r
130 #define yyout yyg->yyout_r
131 #define yyextra yyg->yyextra_r
132 #define yyleng yyg->yyleng_r
133 #define yytext yyg->yytext_r
134 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136 #define yy_flex_debug yyg->yy_flex_debug_r
138 /* Enter a start condition. This macro really ought to take a parameter,
139 * but we do it the disgusting crufty way forced on us by the ()-less
140 * definition of BEGIN.
142 #define BEGIN yyg->yy_start = 1 + 2 *
144 /* Translate the current start state into a value that can be later handed
145 * to BEGIN to return to the state. The YYSTATE alias is for lex
148 #define YY_START ((yyg->yy_start - 1) / 2)
149 #define YYSTATE YY_START
151 /* Action number for EOF rule of a given start state. */
152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154 /* Special action meaning "start processing a new file". */
155 #define YY_NEW_FILE _mesa_glsl_restart(yyin ,yyscanner )
157 #define YY_END_OF_BUFFER_CHAR 0
159 /* Size of default input buffer. */
161 #define YY_BUF_SIZE 16384
164 /* The state buf must be large enough to hold one state per character in the main buffer.
166 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
169 #define YY_TYPEDEF_YY_BUFFER_STATE
170 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
173 #define EOB_ACT_CONTINUE_SCAN 0
174 #define EOB_ACT_END_OF_FILE 1
175 #define EOB_ACT_LAST_MATCH 2
177 #define YY_LESS_LINENO(n)
179 /* Return all but the first "n" matched characters back to the input stream. */
183 /* Undo effects of setting up yytext. */ \
184 int yyless_macro_arg = (n); \
185 YY_LESS_LINENO(yyless_macro_arg);\
186 *yy_cp = yyg->yy_hold_char; \
187 YY_RESTORE_YY_MORE_OFFSET \
188 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
189 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
193 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
195 #ifndef YY_TYPEDEF_YY_SIZE_T
196 #define YY_TYPEDEF_YY_SIZE_T
197 typedef size_t yy_size_t
;
200 #ifndef YY_STRUCT_YY_BUFFER_STATE
201 #define YY_STRUCT_YY_BUFFER_STATE
202 struct yy_buffer_state
206 char *yy_ch_buf
; /* input buffer */
207 char *yy_buf_pos
; /* current position in input buffer */
209 /* Size of input buffer in bytes, not including room for EOB
212 yy_size_t yy_buf_size
;
214 /* Number of characters read into yy_ch_buf, not including EOB
219 /* Whether we "own" the buffer - i.e., we know we created it,
220 * and can realloc() it to grow it, and should free() it to
223 int yy_is_our_buffer
;
225 /* Whether this is an "interactive" input source; if so, and
226 * if we're using stdio for input, then we want to use getc()
227 * instead of fread(), to make sure we stop fetching input after
230 int yy_is_interactive
;
232 /* Whether we're considered to be at the beginning of a line.
233 * If so, '^' rules will be active on the next match, otherwise
238 int yy_bs_lineno
; /**< The line count. */
239 int yy_bs_column
; /**< The column count. */
241 /* Whether to try to fill the input buffer when we reach the
246 int yy_buffer_status
;
248 #define YY_BUFFER_NEW 0
249 #define YY_BUFFER_NORMAL 1
250 /* When an EOF's been seen but there's still some text to process
251 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
252 * shouldn't try reading from the input source any more. We might
253 * still have a bunch of tokens to match, though, because of
254 * possible backing-up.
256 * When we actually see the EOF, we change the status to "new"
257 * (via _mesa_glsl_restart()), so that the user can continue scanning by
258 * just pointing yyin at a new input file.
260 #define YY_BUFFER_EOF_PENDING 2
263 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
265 /* We provide macros for accessing buffer states in case in the
266 * future we want to put the buffer states in a more general
269 * Returns the top of the stack, or NULL.
271 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
272 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
275 /* Same as previous macro, but useful when we know that the buffer stack is not
276 * NULL or when we need an lvalue. For internal use only.
278 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
280 void _mesa_glsl_restart (FILE *input_file
,yyscan_t yyscanner
);
281 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
282 YY_BUFFER_STATE
_mesa_glsl__create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
283 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
284 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
285 void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
286 void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner
);
288 static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner
);
289 static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner
);
290 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
292 #define YY_FLUSH_BUFFER _mesa_glsl__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
294 YY_BUFFER_STATE
_mesa_glsl__scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
295 YY_BUFFER_STATE
_mesa_glsl__scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
296 YY_BUFFER_STATE
_mesa_glsl__scan_bytes (yyconst
char *bytes
,int len
,yyscan_t yyscanner
);
298 void *_mesa_glsl_alloc (yy_size_t
,yyscan_t yyscanner
);
299 void *_mesa_glsl_realloc (void *,yy_size_t
,yyscan_t yyscanner
);
300 void _mesa_glsl_free (void * ,yyscan_t yyscanner
);
302 #define yy_new_buffer _mesa_glsl__create_buffer
304 #define yy_set_interactive(is_interactive) \
306 if ( ! YY_CURRENT_BUFFER ){ \
307 _mesa_glsl_ensure_buffer_stack (yyscanner); \
308 YY_CURRENT_BUFFER_LVALUE = \
309 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
314 #define yy_set_bol(at_bol) \
316 if ( ! YY_CURRENT_BUFFER ){\
317 _mesa_glsl_ensure_buffer_stack (yyscanner); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
321 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
324 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
326 /* Begin user sect3 */
328 #define _mesa_glsl_wrap(n) 1
329 #define YY_SKIP_YYWRAP
331 typedef unsigned char YY_CHAR
;
333 typedef int yy_state_type
;
335 #define yytext_ptr yytext_r
337 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
338 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
339 static int yy_get_next_buffer (yyscan_t yyscanner
);
340 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
342 /* Done after the current pattern has been matched and before the
343 * corresponding action - sets up yytext.
345 #define YY_DO_BEFORE_ACTION \
346 yyg->yytext_ptr = yy_bp; \
347 yyleng = (size_t) (yy_cp - yy_bp); \
348 yyg->yy_hold_char = *yy_cp; \
350 yyg->yy_c_buf_p = yy_cp;
352 #define YY_NUM_RULES 209
353 #define YY_END_OF_BUFFER 210
354 /* This struct is not used in this scanner,
355 but its presence is necessary. */
358 flex_int32_t yy_verify
;
361 static yyconst flex_int16_t yy_accept
[813] =
363 0, 0, 15, 15, 0, 0, 210, 208, 1, 20,
364 208, 208, 208, 208, 208, 208, 208, 208, 119, 117,
365 208, 208, 208, 207, 208, 207, 207, 207, 207, 207,
366 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
367 207, 207, 207, 207, 207, 208, 1, 208, 209, 15,
368 19, 209, 18, 16, 17, 13, 12, 1, 101, 110,
369 102, 113, 107, 96, 109, 97, 116, 121, 108, 122,
370 119, 0, 0, 124, 119, 0, 117, 117, 105, 98,
371 100, 99, 106, 207, 114, 104, 207, 207, 207, 207,
372 207, 207, 207, 207, 207, 207, 207, 207, 29, 207,
374 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
375 207, 207, 33, 207, 207, 60, 207, 207, 207, 207,
376 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
377 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
378 207, 207, 207, 207, 207, 207, 207, 207, 207, 115,
379 103, 1, 0, 0, 2, 0, 0, 0, 0, 15,
380 14, 18, 17, 0, 121, 120, 0, 122, 0, 123,
381 118, 111, 112, 207, 127, 207, 207, 207, 207, 207,
382 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
383 207, 207, 207, 207, 207, 207, 32, 207, 207, 207,
385 207, 207, 207, 207, 207, 207, 207, 25, 207, 207,
386 207, 207, 207, 207, 207, 207, 207, 207, 207, 61,
387 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
388 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
389 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
390 0, 0, 0, 0, 14, 0, 121, 0, 120, 0,
391 122, 123, 118, 207, 207, 23, 207, 207, 174, 167,
392 207, 207, 207, 207, 207, 207, 207, 207, 207, 31,
393 130, 207, 207, 207, 207, 67, 207, 207, 135, 149,
394 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
396 207, 207, 146, 170, 48, 49, 50, 207, 207, 207,
397 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
398 207, 207, 207, 207, 207, 207, 207, 133, 125, 207,
399 207, 26, 207, 207, 207, 207, 207, 207, 207, 45,
400 46, 47, 94, 207, 207, 0, 0, 0, 0, 0,
401 120, 207, 207, 27, 36, 37, 38, 207, 128, 207,
402 22, 207, 207, 207, 207, 157, 158, 159, 207, 126,
403 207, 150, 24, 160, 161, 162, 172, 154, 155, 156,
404 207, 207, 207, 62, 152, 207, 207, 207, 39, 40,
405 41, 207, 207, 207, 207, 207, 207, 207, 207, 207,
407 207, 207, 207, 207, 207, 207, 207, 147, 207, 207,
408 207, 207, 207, 207, 207, 207, 207, 207, 129, 207,
409 207, 169, 42, 43, 44, 207, 207, 30, 0, 0,
410 0, 0, 177, 207, 207, 175, 207, 207, 207, 148,
411 143, 180, 207, 207, 207, 207, 207, 207, 138, 207,
412 207, 207, 95, 51, 52, 53, 54, 55, 56, 57,
413 58, 59, 207, 207, 207, 207, 153, 134, 207, 207,
414 141, 35, 207, 207, 166, 68, 142, 93, 178, 136,
415 207, 207, 207, 207, 207, 207, 207, 207, 0, 0,
416 0, 0, 207, 207, 207, 137, 34, 207, 207, 207,
418 207, 207, 207, 181, 182, 183, 207, 207, 207, 207,
419 207, 171, 207, 207, 207, 207, 207, 207, 207, 207,
420 131, 207, 207, 207, 207, 207, 63, 207, 207, 64,
421 207, 0, 0, 0, 0, 0, 207, 65, 28, 144,
422 185, 186, 187, 207, 207, 207, 207, 207, 207, 207,
423 207, 207, 207, 207, 207, 139, 207, 207, 207, 207,
424 207, 207, 207, 207, 207, 132, 189, 190, 191, 207,
425 207, 151, 207, 140, 0, 0, 6, 0, 0, 0,
426 11, 3, 21, 207, 207, 207, 207, 207, 207, 207,
427 207, 207, 184, 145, 66, 207, 207, 207, 207, 168,
429 207, 176, 173, 206, 70, 71, 72, 207, 207, 207,
430 207, 207, 207, 207, 207, 207, 207, 0, 0, 0,
431 0, 0, 0, 207, 207, 207, 188, 207, 207, 207,
432 207, 207, 81, 82, 83, 207, 207, 207, 207, 207,
433 207, 207, 207, 207, 207, 207, 207, 207, 192, 87,
434 88, 89, 207, 4, 0, 5, 0, 0, 0, 0,
435 0, 207, 207, 207, 207, 207, 207, 207, 203, 207,
436 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
437 73, 207, 207, 207, 207, 207, 207, 0, 0, 0,
438 207, 207, 204, 193, 207, 194, 207, 207, 207, 84,
440 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
441 207, 205, 207, 207, 90, 0, 0, 195, 196, 207,
442 199, 207, 200, 207, 207, 69, 207, 207, 207, 163,
443 207, 164, 179, 207, 197, 198, 207, 207, 0, 0,
444 207, 207, 207, 207, 74, 207, 75, 207, 207, 207,
445 207, 207, 0, 0, 0, 207, 207, 85, 86, 207,
446 76, 207, 207, 77, 207, 91, 92, 0, 0, 0,
447 207, 207, 207, 207, 207, 207, 0, 0, 0, 207,
448 207, 207, 207, 207, 78, 0, 0, 7, 0, 0,
449 201, 202, 207, 207, 207, 0, 8, 0, 0, 207,
451 207, 165, 0, 0, 79, 80, 0, 0, 9, 0,
455 static yyconst flex_int32_t yy_ec
[256] =
457 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
458 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
461 10, 11, 12, 1, 13, 14, 15, 16, 17, 18,
462 19, 20, 21, 21, 21, 22, 22, 23, 1, 24,
463 25, 26, 1, 1, 27, 28, 29, 30, 31, 32,
464 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
465 33, 34, 35, 33, 36, 33, 33, 37, 33, 33,
466 1, 1, 1, 38, 39, 1, 40, 41, 42, 43,
468 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
469 54, 55, 33, 56, 57, 58, 59, 60, 61, 62,
470 63, 64, 1, 65, 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,
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 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,
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
487 static yyconst flex_int32_t yy_meta
[66] =
489 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
490 1, 1, 1, 1, 1, 4, 4, 4, 4, 4,
491 4, 5, 1, 1, 1, 1, 6, 6, 6, 6,
492 5, 5, 7, 7, 7, 7, 8, 1, 7, 6,
493 6, 6, 6, 5, 5, 7, 7, 7, 7, 7,
494 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
498 static yyconst flex_int16_t yy_base
[824] =
500 0, 64, 70, 0, 1185, 1184, 1186, 1189, 65, 1189,
501 1160, 1159, 128, 1158, 125, 126, 124, 1157, 140, 189,
502 123, 1156, 138, 0, 127, 124, 113, 135, 144, 161,
503 176, 1126, 130, 187, 140, 143, 161, 1120, 182, 174,
504 202, 199, 211, 212, 1131, 130, 263, 255, 1189, 189,
505 1189, 1162, 256, 1189, 0, 1189, 1189, 215, 1189, 1189,
506 1189, 1189, 1189, 1189, 1189, 1189, 1189, 248, 1189, 250,
507 112, 302, 319, 1189, 1189, 0, 0, 1189, 1151, 1189,
508 1189, 1189, 1150, 0, 1189, 1189, 1116, 1121, 1114, 1117,
509 1126, 1125, 1111, 1114, 1126, 144, 1120, 1107, 1104, 1118,
511 1104, 1101, 1101, 1107, 175, 191, 1101, 1112, 1097, 1103,
512 1107, 1108, 0, 1099, 1110, 247, 1109, 1104, 1084, 230,
513 1088, 1102, 1092, 241, 1085, 228, 1098, 1100, 1082, 1078,
514 1086, 1083, 1072, 1081, 173, 1079, 1085, 1080, 1083, 1071,
515 1074, 233, 240, 260, 1084, 1071, 1084, 239, 1077, 1189,
516 1189, 307, 301, 323, 1189, 1062, 1075, 1066, 1077, 249,
517 0, 368, 0, 379, 1189, 298, 390, 1189, 397, 404,
518 291, 1189, 1189, 1072, 0, 1063, 1067, 1077, 1074, 270,
519 1057, 1057, 1061, 291, 1072, 1069, 1069, 1067, 1064, 1055,
520 1062, 1048, 1046, 1059, 1044, 1061, 0, 1058, 1045, 1053,
522 1050, 1054, 1055, 1048, 1045, 1033, 1032, 1046, 1049, 1036,
523 1045, 1032, 1039, 1029, 335, 1035, 1038, 1028, 1036, 1024,
524 1028, 1019, 1034, 1024, 1015, 1034, 1017, 1015, 1026, 1015,
525 1010, 1008, 1022, 1007, 1009, 1006, 1018, 1017, 1020, 1001,
526 306, 1010, 1005, 1003, 1013, 991, 339, 1010, 1012, 1000,
527 992, 996, 1008, 991, 0, 411, 421, 438, 1189, 451,
528 458, 1189, 1189, 986, 997, 0, 994, 344, 0, 0,
529 987, 985, 987, 982, 991, 979, 997, 985, 350, 0,
530 0, 979, 990, 989, 989, 0, 973, 353, 0, 0,
531 975, 357, 983, 984, 974, 968, 967, 968, 967, 967,
533 361, 962, 0, 0, 958, 957, 956, 958, 959, 964,
534 958, 954, 968, 963, 962, 961, 952, 955, 955, 947,
535 950, 945, 954, 959, 944, 957, 947, 0, 0, 954,
536 950, 0, 941, 941, 947, 937, 945, 426, 942, 0,
537 0, 0, 0, 931, 944, 943, 942, 939, 927, 465,
538 475, 939, 941, 0, 0, 0, 0, 927, 0, 927,
539 0, 926, 927, 921, 932, 0, 0, 0, 922, 0,
540 918, 0, 0, 0, 0, 0, 0, 0, 0, 0,
541 929, 481, 928, 0, 0, 926, 922, 918, 0, 0,
542 0, 910, 443, 486, 493, 915, 911, 917, 907, 905,
544 919, 903, 903, 917, 905, 917, 912, 0, 910, 907,
545 911, 894, 896, 903, 909, 904, 903, 890, 0, 892,
546 893, 0, 0, 0, 0, 890, 894, 0, 888, 938,
547 887, 890, 0, 878, 888, 0, 876, 876, 890, 0,
548 892, 0, 497, 901, 900, 899, 869, 868, 0, 886,
549 885, 880, 0, 0, 0, 0, 0, 0, 0, 0,
550 0, 0, 868, 882, 868, 865, 0, 0, 871, 870,
551 0, 0, 868, 860, 0, 0, 0, 0, 0, 0,
552 857, 869, 500, 861, 868, 867, 864, 858, 851, 519,
553 867, 852, 847, 861, 859, 0, 0, 851, 871, 870,
555 869, 839, 838, 495, 496, 0, 851, 854, 852, 840,
556 836, 0, 849, 846, 845, 834, 833, 832, 515, 841,
557 0, 854, 853, 852, 822, 821, 0, 836, 822, 0,
558 833, 828, 543, 545, 873, 821, 829, 0, 0, 0,
559 845, 844, 0, 825, 828, 812, 820, 810, 818, 819,
560 819, 818, 803, 539, 816, 0, 817, 805, 804, 800,
561 825, 824, 823, 793, 792, 0, 823, 822, 0, 803,
562 806, 0, 552, 0, 792, 557, 1189, 580, 0, 590,
563 499, 1189, 0, 789, 788, 798, 798, 785, 800, 783,
564 798, 793, 0, 0, 0, 806, 805, 804, 774, 0,
566 774, 0, 0, 0, 559, 568, 797, 785, 788, 772,
567 771, 781, 781, 794, 793, 792, 762, 767, 552, 613,
568 363, 775, 763, 761, 760, 771, 0, 774, 770, 772,
569 768, 754, 782, 781, 0, 766, 758, 749, 757, 747,
570 758, 754, 756, 754, 754, 741, 740, 751, 0, 767,
571 766, 0, 751, 1189, 391, 1189, 620, 0, 640, 750,
572 732, 749, 748, 731, 723, 731, 721, 729, 0, 726,
573 725, 736, 719, 722, 737, 720, 733, 734, 731, 728,
574 736, 730, 729, 712, 711, 710, 721, 402, 705, 715,
575 699, 698, 0, 725, 698, 723, 696, 700, 699, 0,
577 710, 713, 709, 711, 688, 702, 686, 680, 688, 671,
578 662, 0, 640, 639, 0, 648, 641, 0, 0, 645,
579 0, 644, 0, 650, 649, 0, 625, 633, 623, 650,
580 630, 0, 0, 643, 0, 0, 642, 641, 582, 632,
581 639, 638, 614, 613, 635, 608, 633, 607, 590, 607,
582 586, 585, 611, 380, 526, 545, 544, 0, 0, 538,
583 0, 504, 510, 0, 495, 0, 0, 550, 572, 483,
584 470, 454, 462, 449, 445, 404, 419, 616, 619, 391,
585 387, 404, 392, 290, 0, 617, 642, 1189, 644, 570,
586 0, 0, 263, 258, 139, 645, 1189, 643, 618, 107,
588 77, 0, 23, 662, 0, 0, 663, 664, 1189, 665,
589 1189, 1189, 697, 702, 707, 712, 714, 716, 722, 729,
593 static yyconst flex_int16_t yy_def
[824] =
595 812, 1, 812, 3, 813, 813, 812, 812, 812, 812,
596 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
597 812, 812, 812, 814, 812, 814, 814, 814, 814, 814,
598 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
599 814, 814, 814, 814, 814, 812, 812, 812, 812, 812,
600 812, 812, 812, 812, 815, 812, 812, 812, 812, 812,
601 812, 812, 812, 812, 812, 812, 812, 816, 812, 817,
602 19, 812, 812, 812, 812, 818, 20, 812, 812, 812,
603 812, 812, 812, 814, 812, 812, 814, 814, 814, 814,
604 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
606 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
607 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
608 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
609 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
610 814, 814, 814, 814, 814, 814, 814, 814, 814, 812,
611 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
612 819, 812, 815, 812, 812, 817, 812, 812, 812, 812,
613 818, 812, 812, 814, 814, 814, 814, 814, 814, 814,
614 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
615 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
617 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
618 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
619 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
620 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
621 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
622 812, 812, 812, 812, 819, 812, 812, 812, 812, 812,
623 812, 812, 812, 814, 814, 814, 814, 814, 814, 814,
624 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
625 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
626 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
628 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
629 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
630 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
631 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
632 814, 814, 814, 814, 814, 812, 812, 812, 812, 812,
633 812, 814, 814, 814, 814, 814, 814, 814, 814, 814,
634 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
635 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
636 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
637 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
639 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
640 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
641 814, 814, 814, 814, 814, 814, 814, 814, 812, 812,
642 812, 812, 814, 814, 814, 814, 814, 814, 814, 814,
643 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
644 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
645 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
646 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
647 814, 814, 814, 814, 814, 814, 814, 814, 812, 812,
648 812, 812, 814, 814, 814, 814, 814, 814, 814, 814,
650 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
651 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
652 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
653 814, 812, 820, 812, 812, 812, 814, 814, 814, 814,
654 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
655 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
656 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
657 814, 814, 814, 814, 812, 812, 812, 812, 821, 812,
658 812, 812, 814, 814, 814, 814, 814, 814, 814, 814,
659 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
661 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
662 814, 814, 814, 814, 814, 814, 814, 812, 822, 812,
663 821, 812, 812, 814, 814, 814, 814, 814, 814, 814,
664 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
665 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
666 814, 814, 814, 812, 812, 812, 812, 823, 812, 812,
667 812, 814, 814, 814, 814, 814, 814, 814, 814, 814,
668 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
669 814, 814, 814, 814, 814, 814, 814, 823, 812, 812,
670 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
672 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
673 814, 814, 814, 814, 814, 812, 812, 814, 814, 814,
674 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
675 814, 814, 814, 814, 814, 814, 814, 814, 812, 812,
676 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
677 814, 814, 812, 812, 812, 814, 814, 814, 814, 814,
678 814, 814, 814, 814, 814, 814, 814, 812, 812, 812,
679 814, 814, 814, 814, 814, 814, 812, 812, 812, 814,
680 814, 814, 814, 814, 814, 812, 812, 812, 812, 812,
681 814, 814, 814, 814, 814, 812, 812, 812, 812, 814,
683 814, 814, 812, 812, 814, 814, 812, 812, 812, 812,
684 812, 0, 812, 812, 812, 812, 812, 812, 812, 812,
688 static yyconst flex_int16_t yy_nxt
[1255] =
690 8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
691 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
692 20, 20, 8, 21, 22, 23, 24, 24, 24, 24,
693 24, 24, 24, 24, 24, 24, 24, 25, 24, 26,
694 27, 28, 29, 30, 31, 32, 33, 34, 24, 24,
695 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
696 45, 24, 24, 24, 46, 47, 58, 807, 58, 48,
697 49, 50, 51, 50, 49, 49, 49, 49, 49, 49,
698 49, 49, 49, 49, 52, 49, 53, 53, 53, 53,
699 53, 53, 54, 49, 49, 49, 55, 55, 55, 55,
701 55, 55, 55, 55, 55, 55, 55, 49, 55, 55,
702 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
703 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
704 55, 55, 55, 55, 49, 61, 64, 806, 66, 68,
705 68, 68, 68, 68, 68, 68, 79, 80, 812, 65,
706 67, 85, 62, 70, 150, 71, 71, 71, 71, 71,
707 71, 72, 82, 83, 86, 87, 90, 805, 91, 110,
708 73, 74, 92, 812, 93, 75, 76, 111, 94, 119,
709 88, 89, 121, 73, 74, 95, 122, 97, 96, 112,
710 160, 98, 160, 120, 151, 183, 184, 99, 75, 802,
712 123, 76, 70, 100, 77, 77, 77, 77, 77, 77,
713 77, 101, 231, 102, 124, 104, 58, 129, 58, 73,
714 74, 126, 103, 105, 78, 193, 106, 130, 232, 107,
715 195, 113, 73, 74, 114, 108, 194, 127, 115, 116,
716 128, 131, 138, 117, 196, 139, 118, 78, 132, 133,
717 160, 146, 160, 134, 140, 147, 154, 155, 142, 135,
718 136, 141, 137, 143, 152, 148, 58, 144, 153, 221,
719 145, 162, 162, 162, 162, 162, 162, 162, 164, 165,
720 167, 168, 213, 222, 239, 240, 248, 241, 218, 249,
721 214, 164, 165, 167, 168, 219, 242, 205, 156, 243,
723 206, 207, 154, 155, 208, 157, 209, 244, 152, 158,
724 58, 801, 153, 269, 159, 70, 800, 72, 72, 72,
725 72, 72, 72, 72, 154, 155, 263, 270, 258, 259,
726 169, 169, 73, 74, 170, 170, 170, 170, 170, 170,
727 170, 258, 259, 795, 156, 73, 74, 274, 275, 263,
728 333, 157, 305, 306, 307, 158, 340, 341, 342, 334,
729 159, 355, 356, 357, 576, 577, 156, 366, 367, 368,
730 374, 375, 376, 157, 378, 379, 380, 158, 389, 390,
731 391, 768, 159, 162, 162, 162, 162, 162, 162, 162,
732 256, 256, 655, 656, 257, 257, 257, 257, 257, 257,
734 257, 260, 260, 655, 656, 261, 261, 261, 261, 261,
735 261, 261, 170, 170, 170, 170, 170, 170, 170, 170,
736 170, 170, 170, 170, 170, 170, 257, 257, 257, 257,
737 257, 257, 257, 769, 794, 262, 257, 257, 257, 257,
738 257, 257, 257, 423, 424, 425, 793, 792, 262, 350,
739 350, 791, 165, 351, 351, 351, 351, 351, 351, 351,
740 454, 455, 456, 786, 785, 165, 261, 261, 261, 261,
741 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
742 351, 351, 351, 351, 351, 351, 351, 784, 783, 168,
743 351, 351, 351, 351, 351, 351, 351, 444, 445, 446,
745 581, 782, 168, 457, 458, 459, 259, 781, 447, 448,
746 460, 461, 462, 499, 500, 501, 522, 523, 524, 259,
747 490, 546, 548, 780, 502, 503, 779, 525, 526, 547,
748 549, 561, 562, 563, 533, 534, 534, 534, 534, 534,
749 534, 622, 564, 565, 576, 577, 576, 577, 776, 775,
750 774, 768, 623, 655, 656, 596, 597, 598, 576, 577,
751 580, 580, 580, 580, 580, 580, 580, 599, 614, 615,
752 616, 798, 619, 620, 620, 620, 620, 620, 620, 579,
753 617, 576, 577, 753, 773, 638, 772, 771, 658, 770,
754 754, 576, 577, 639, 640, 578, 578, 578, 578, 578,
756 578, 641, 642, 769, 579, 580, 580, 580, 580, 580,
757 580, 580, 753, 658, 655, 656, 777, 787, 796, 754,
758 789, 655, 656, 799, 778, 788, 797, 790, 659, 659,
759 659, 659, 659, 659, 659, 657, 657, 657, 657, 657,
760 657, 655, 656, 787, 798, 789, 796, 767, 766, 765,
761 764, 788, 790, 763, 797, 659, 659, 659, 659, 659,
762 659, 659, 803, 808, 810, 808, 810, 762, 761, 760,
763 804, 809, 811, 809, 811, 759, 758, 757, 756, 755,
764 752, 751, 750, 749, 748, 747, 746, 745, 744, 743,
765 742, 741, 740, 739, 738, 737, 799, 56, 56, 56,
767 56, 56, 56, 56, 56, 84, 84, 84, 84, 84,
768 163, 163, 163, 163, 163, 68, 68, 166, 166, 171,
769 171, 171, 255, 255, 736, 255, 255, 255, 255, 255,
770 578, 578, 578, 735, 734, 733, 578, 621, 621, 621,
771 657, 657, 657, 732, 731, 730, 657, 688, 688, 688,
772 729, 728, 727, 726, 725, 724, 723, 722, 721, 720,
773 719, 718, 717, 716, 715, 714, 713, 712, 711, 710,
774 709, 708, 707, 706, 705, 704, 703, 702, 701, 700,
775 699, 698, 697, 696, 695, 694, 693, 692, 691, 690,
776 689, 687, 686, 685, 684, 683, 682, 681, 680, 679,
778 678, 677, 676, 675, 674, 673, 672, 671, 670, 669,
779 668, 667, 666, 665, 664, 663, 662, 661, 660, 654,
780 653, 652, 651, 650, 649, 648, 647, 646, 645, 644,
781 643, 637, 636, 635, 634, 633, 632, 631, 630, 629,
782 628, 627, 626, 625, 624, 618, 613, 612, 611, 610,
783 609, 608, 607, 606, 605, 604, 603, 602, 601, 600,
784 595, 594, 593, 592, 591, 590, 589, 588, 587, 586,
785 585, 584, 583, 582, 581, 575, 574, 573, 572, 571,
786 570, 569, 568, 567, 566, 560, 559, 558, 557, 556,
787 555, 554, 553, 552, 551, 550, 545, 544, 543, 542,
789 541, 540, 539, 538, 537, 536, 535, 532, 531, 530,
790 529, 528, 527, 521, 520, 519, 518, 517, 516, 515,
791 514, 513, 512, 511, 510, 509, 508, 507, 506, 505,
792 504, 498, 497, 496, 495, 494, 493, 492, 491, 490,
793 489, 488, 487, 486, 485, 484, 483, 482, 481, 480,
794 479, 478, 477, 476, 475, 474, 473, 472, 471, 470,
795 469, 468, 467, 466, 465, 464, 463, 453, 452, 451,
796 450, 449, 443, 442, 441, 440, 439, 438, 437, 436,
797 435, 434, 433, 432, 431, 430, 429, 428, 427, 426,
798 422, 421, 420, 419, 418, 417, 416, 415, 414, 413,
800 412, 411, 410, 409, 408, 407, 406, 405, 404, 403,
801 402, 401, 400, 399, 398, 397, 396, 395, 394, 393,
802 392, 388, 387, 386, 385, 384, 383, 382, 381, 377,
803 373, 372, 371, 370, 369, 365, 364, 363, 362, 361,
804 360, 359, 358, 354, 353, 352, 349, 348, 347, 346,
805 345, 344, 343, 339, 338, 337, 336, 335, 332, 331,
806 330, 329, 328, 327, 326, 325, 324, 323, 322, 321,
807 320, 319, 318, 317, 316, 315, 314, 313, 312, 311,
808 310, 309, 308, 304, 303, 302, 301, 300, 299, 298,
809 297, 296, 295, 294, 293, 292, 291, 290, 289, 288,
811 287, 286, 285, 284, 283, 282, 281, 280, 279, 278,
812 277, 276, 273, 272, 271, 268, 267, 266, 265, 264,
813 254, 253, 252, 251, 250, 247, 246, 245, 238, 237,
814 236, 235, 234, 233, 230, 229, 228, 227, 226, 225,
815 224, 223, 220, 217, 216, 215, 212, 211, 210, 204,
816 203, 202, 201, 200, 199, 198, 197, 192, 191, 190,
817 189, 188, 187, 186, 185, 182, 181, 180, 179, 178,
818 177, 176, 175, 174, 173, 172, 161, 149, 125, 109,
819 81, 69, 63, 60, 59, 812, 57, 57, 7, 812,
820 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
822 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
823 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
824 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
825 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
826 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
830 static yyconst flex_int16_t yy_chk
[1255] =
832 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
833 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
834 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
835 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
836 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
837 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
838 1, 1, 1, 1, 1, 2, 9, 803, 9, 2,
839 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
840 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
841 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
843 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
844 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
845 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
846 3, 3, 3, 3, 3, 13, 15, 801, 16, 17,
847 17, 17, 17, 17, 17, 17, 21, 21, 71, 15,
848 16, 25, 13, 19, 46, 19, 19, 19, 19, 19,
849 19, 19, 23, 23, 25, 26, 27, 800, 27, 33,
850 19, 19, 27, 71, 28, 19, 19, 33, 28, 35,
851 26, 26, 36, 19, 19, 28, 36, 29, 28, 33,
852 50, 29, 50, 35, 46, 96, 96, 29, 19, 795,
854 37, 19, 20, 29, 20, 20, 20, 20, 20, 20,
855 20, 30, 135, 30, 37, 31, 58, 40, 58, 20,
856 20, 39, 30, 31, 20, 105, 31, 40, 135, 31,
857 106, 34, 20, 20, 34, 31, 105, 39, 34, 34,
858 39, 41, 42, 34, 106, 42, 34, 20, 41, 41,
859 160, 44, 160, 41, 42, 44, 48, 48, 43, 41,
860 41, 42, 41, 43, 47, 44, 47, 43, 47, 126,
861 43, 53, 53, 53, 53, 53, 53, 53, 68, 68,
862 70, 70, 120, 126, 142, 142, 148, 143, 124, 148,
863 120, 68, 68, 70, 70, 124, 143, 116, 48, 144,
865 116, 116, 153, 153, 116, 48, 116, 144, 152, 48,
866 152, 794, 152, 180, 48, 72, 793, 72, 72, 72,
867 72, 72, 72, 72, 154, 154, 171, 180, 166, 166,
868 73, 73, 72, 72, 73, 73, 73, 73, 73, 73,
869 73, 166, 166, 784, 153, 72, 72, 184, 184, 171,
870 241, 153, 215, 215, 215, 153, 247, 247, 247, 241,
871 153, 268, 268, 268, 621, 621, 154, 279, 279, 279,
872 288, 288, 288, 154, 292, 292, 292, 154, 301, 301,
873 301, 754, 154, 162, 162, 162, 162, 162, 162, 162,
874 164, 164, 655, 655, 164, 164, 164, 164, 164, 164,
876 164, 167, 167, 688, 688, 167, 167, 167, 167, 167,
877 167, 167, 169, 169, 169, 169, 169, 169, 169, 170,
878 170, 170, 170, 170, 170, 170, 256, 256, 256, 256,
879 256, 256, 256, 754, 783, 170, 257, 257, 257, 257,
880 257, 257, 257, 338, 338, 338, 782, 781, 170, 258,
881 258, 780, 257, 258, 258, 258, 258, 258, 258, 258,
882 393, 393, 393, 777, 776, 257, 260, 260, 260, 260,
883 260, 260, 260, 261, 261, 261, 261, 261, 261, 261,
884 350, 350, 350, 350, 350, 350, 350, 775, 774, 261,
885 351, 351, 351, 351, 351, 351, 351, 382, 382, 382,
887 581, 773, 261, 394, 394, 394, 351, 772, 382, 382,
888 395, 395, 395, 443, 443, 443, 483, 483, 483, 351,
889 490, 504, 505, 771, 443, 443, 770, 483, 483, 504,
890 505, 519, 519, 519, 490, 490, 490, 490, 490, 490,
891 490, 581, 519, 519, 533, 533, 534, 534, 765, 763,
892 762, 768, 581, 619, 619, 554, 554, 554, 576, 576,
893 534, 534, 534, 534, 534, 534, 534, 554, 573, 573,
894 573, 790, 576, 576, 576, 576, 576, 576, 576, 533,
895 573, 578, 578, 739, 760, 605, 757, 756, 619, 755,
896 739, 580, 580, 605, 606, 578, 578, 578, 578, 578,
898 578, 606, 606, 768, 533, 580, 580, 580, 580, 580,
899 580, 580, 753, 619, 620, 620, 769, 778, 786, 753,
900 779, 657, 657, 790, 769, 778, 786, 779, 620, 620,
901 620, 620, 620, 620, 620, 657, 657, 657, 657, 657,
902 657, 659, 659, 787, 798, 789, 796, 752, 751, 750,
903 749, 787, 789, 748, 796, 659, 659, 659, 659, 659,
904 659, 659, 799, 804, 807, 808, 810, 747, 746, 745,
905 799, 804, 807, 808, 810, 744, 743, 742, 741, 740,
906 738, 737, 734, 731, 730, 729, 728, 727, 725, 724,
907 722, 720, 717, 716, 714, 713, 798, 813, 813, 813,
909 813, 813, 813, 813, 813, 814, 814, 814, 814, 814,
910 815, 815, 815, 815, 815, 816, 816, 817, 817, 818,
911 818, 818, 819, 819, 711, 819, 819, 819, 819, 819,
912 820, 820, 820, 710, 709, 708, 820, 821, 821, 821,
913 822, 822, 822, 707, 706, 705, 822, 823, 823, 823,
914 704, 703, 702, 701, 699, 698, 697, 696, 695, 694,
915 692, 691, 690, 689, 687, 686, 685, 684, 683, 682,
916 681, 680, 679, 678, 677, 676, 675, 674, 673, 672,
917 671, 670, 668, 667, 666, 665, 664, 663, 662, 661,
918 660, 653, 651, 650, 648, 647, 646, 645, 644, 643,
920 642, 641, 640, 639, 638, 637, 636, 634, 633, 632,
921 631, 630, 629, 628, 626, 625, 624, 623, 622, 618,
922 617, 616, 615, 614, 613, 612, 611, 610, 609, 608,
923 607, 601, 599, 598, 597, 596, 592, 591, 590, 589,
924 588, 587, 586, 585, 584, 575, 571, 570, 568, 567,
925 565, 564, 563, 562, 561, 560, 559, 558, 557, 555,
926 553, 552, 551, 550, 549, 548, 547, 546, 545, 544,
927 542, 541, 537, 536, 535, 532, 531, 529, 528, 526,
928 525, 524, 523, 522, 520, 518, 517, 516, 515, 514,
929 513, 511, 510, 509, 508, 507, 503, 502, 501, 500,
931 499, 498, 495, 494, 493, 492, 491, 489, 488, 487,
932 486, 485, 484, 482, 481, 474, 473, 470, 469, 466,
933 465, 464, 463, 452, 451, 450, 448, 447, 446, 445,
934 444, 441, 439, 438, 437, 435, 434, 432, 431, 430,
935 429, 427, 426, 421, 420, 418, 417, 416, 415, 414,
936 413, 412, 411, 410, 409, 407, 406, 405, 404, 403,
937 402, 401, 400, 399, 398, 397, 396, 392, 388, 387,
938 386, 383, 381, 371, 369, 365, 364, 363, 362, 360,
939 358, 353, 352, 349, 348, 347, 346, 345, 344, 339,
940 337, 336, 335, 334, 333, 331, 330, 327, 326, 325,
942 324, 323, 322, 321, 320, 319, 318, 317, 316, 315,
943 314, 313, 312, 311, 310, 309, 308, 307, 306, 305,
944 302, 300, 299, 298, 297, 296, 295, 294, 293, 291,
945 287, 285, 284, 283, 282, 278, 277, 276, 275, 274,
946 273, 272, 271, 267, 265, 264, 254, 253, 252, 251,
947 250, 249, 248, 246, 245, 244, 243, 242, 240, 239,
948 238, 237, 236, 235, 234, 233, 232, 231, 230, 229,
949 228, 227, 226, 225, 224, 223, 222, 221, 220, 219,
950 218, 217, 216, 214, 213, 212, 211, 210, 209, 208,
951 207, 206, 205, 204, 203, 202, 201, 200, 199, 198,
953 196, 195, 194, 193, 192, 191, 190, 189, 188, 187,
954 186, 185, 183, 182, 181, 179, 178, 177, 176, 174,
955 159, 158, 157, 156, 149, 147, 146, 145, 141, 140,
956 139, 138, 137, 136, 134, 133, 132, 131, 130, 129,
957 128, 127, 125, 123, 122, 121, 119, 118, 117, 115,
958 114, 112, 111, 110, 109, 108, 107, 104, 103, 102,
959 101, 100, 99, 98, 97, 95, 94, 93, 92, 91,
960 90, 89, 88, 87, 83, 79, 52, 45, 38, 32,
961 22, 18, 14, 12, 11, 7, 6, 5, 812, 812,
962 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
964 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
965 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
966 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
967 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
968 812, 812, 812, 812, 812, 812, 812, 812, 812, 812,
972 /* The intent behind this definition is that it'll catch
973 * any uses of REJECT which flex missed.
975 #define REJECT reject_used_but_not_detected
976 #define yymore() yymore_used_but_not_detected
977 #define YY_MORE_ADJ 0
978 #define YY_RESTORE_YY_MORE_OFFSET
979 #line 1 "glsl_lexer.lpp"
980 #line 2 "glsl_lexer.lpp"
982 * Copyright © 2008, 2009 Intel Corporation
984 * Permission is hereby granted, free of charge, to any person obtaining a
985 * copy of this software and associated documentation files (the "Software"),
986 * to deal in the Software without restriction, including without limitation
987 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
988 * and/or sell copies of the Software, and to permit persons to whom the
989 * Software is furnished to do so, subject to the following conditions:
991 * The above copyright notice and this permission notice (including the next
992 * paragraph) shall be included in all copies or substantial portions of the
995 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
996 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
997 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
998 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
999 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1000 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1001 * DEALINGS IN THE SOFTWARE.
1005 #include "glsl_parser_extras.h"
1006 #include "glsl_parser.h"
1008 #define YY_USER_ACTION \
1010 yylloc->source = 0; \
1011 yylloc->first_column = yycolumn + 1; \
1012 yylloc->first_line = yylineno + 1; \
1013 yycolumn += yyleng; \
1016 #define YY_USER_INIT yylineno = 0; yycolumn = 0;
1018 #define IS_UINT (yytext[yyleng - 1] == 'u' || yytext[yyleng - 1] == 'U')
1020 /* A macro for handling reserved words and keywords across language versions.
1022 * Certain words start out as identifiers, become reserved words in
1023 * later language revisions, and finally become language keywords.
1025 * For example, consider the following lexer rule:
1026 * samplerBuffer KEYWORD(130, 140, SAMPLERBUFFER)
1028 * This means that "samplerBuffer" will be treated as:
1029 * - a keyword (SAMPLERBUFFER token) ...in GLSL >= 1.40
1030 * - a reserved word - error ...in GLSL >= 1.30
1031 * - an identifier ...in GLSL < 1.30
1033 #define KEYWORD(reserved_version, allowed_version, token) \
1035 if (yyextra->language_version >= allowed_version) { \
1037 } else if (yyextra->language_version >= reserved_version) { \
1038 _mesa_glsl_error(yylloc, yyextra, \
1039 "Illegal use of reserved word `%s'", yytext); \
1042 yylval->identifier = strdup(yytext); \
1043 return IDENTIFIER; \
1047 /* The ES macro can be used in KEYWORD checks:
1049 * word KEYWORD(110 || ES, 400, TOKEN)
1050 * ...means the word is reserved in GLSL ES 1.00, while
1052 * word KEYWORD(110, 130 || ES, TOKEN)
1053 * ...means the word is a legal keyword in GLSL ES 1.00.
1055 #define ES yyextra->es_shader
1057 #line 1058 "glsl_lexer.cpp"
1063 #define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
1065 /* Holds the entire state of the reentrant scanner. */
1069 /* User-defined. Not touched by flex. */
1070 YY_EXTRA_TYPE yyextra_r
;
1072 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1073 FILE *yyin_r
, *yyout_r
;
1074 size_t yy_buffer_stack_top
; /**< index of top of stack. */
1075 size_t yy_buffer_stack_max
; /**< capacity of stack. */
1076 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
1083 int yy_did_buffer_switch_on_eof
;
1084 int yy_start_stack_ptr
;
1085 int yy_start_stack_depth
;
1086 int *yy_start_stack
;
1087 yy_state_type yy_last_accepting_state
;
1088 char* yy_last_accepting_cpos
;
1091 int yy_flex_debug_r
;
1101 }; /* end struct yyguts_t */
1103 static int yy_init_globals (yyscan_t yyscanner
);
1105 /* This must go here because YYSTYPE and YYLTYPE are included
1106 * from bison output in section 1.*/
1107 # define yylval yyg->yylval_r
1109 # define yylloc yyg->yylloc_r
1111 int _mesa_glsl_lex_init (yyscan_t
* scanner
);
1113 int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
1115 /* Accessor methods to globals.
1116 These are made visible to non-reentrant scanners for convenience. */
1118 int _mesa_glsl_lex_destroy (yyscan_t yyscanner
);
1120 int _mesa_glsl_get_debug (yyscan_t yyscanner
);
1122 void _mesa_glsl_set_debug (int debug_flag
,yyscan_t yyscanner
);
1124 YY_EXTRA_TYPE
_mesa_glsl_get_extra (yyscan_t yyscanner
);
1126 void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
1128 FILE *_mesa_glsl_get_in (yyscan_t yyscanner
);
1130 void _mesa_glsl_set_in (FILE * in_str
,yyscan_t yyscanner
);
1132 FILE *_mesa_glsl_get_out (yyscan_t yyscanner
);
1134 void _mesa_glsl_set_out (FILE * out_str
,yyscan_t yyscanner
);
1136 int _mesa_glsl_get_leng (yyscan_t yyscanner
);
1138 char *_mesa_glsl_get_text (yyscan_t yyscanner
);
1140 int _mesa_glsl_get_lineno (yyscan_t yyscanner
);
1142 void _mesa_glsl_set_lineno (int line_number
,yyscan_t yyscanner
);
1144 int _mesa_glsl_get_column (yyscan_t yyscanner
);
1146 void _mesa_glsl_set_column (int column_no
,yyscan_t yyscanner
);
1148 YYSTYPE
* _mesa_glsl_get_lval (yyscan_t yyscanner
);
1150 void _mesa_glsl_set_lval (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
1152 YYLTYPE
*_mesa_glsl_get_lloc (yyscan_t yyscanner
);
1154 void _mesa_glsl_set_lloc (YYLTYPE
* yylloc_param
,yyscan_t yyscanner
);
1156 /* Macros after this point can all be overridden by user definitions in
1160 #ifndef YY_SKIP_YYWRAP
1162 extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner
);
1164 extern int _mesa_glsl_wrap (yyscan_t yyscanner
);
1169 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
1172 #ifdef YY_NEED_STRLEN
1173 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
1179 static int yyinput (yyscan_t yyscanner
);
1181 static int input (yyscan_t yyscanner
);
1186 /* Amount of stuff to slurp up with each read. */
1187 #ifndef YY_READ_BUF_SIZE
1188 #define YY_READ_BUF_SIZE 8192
1191 /* Copy whatever the last rule matched to the standard output. */
1193 /* This used to be an fputs(), but since the string might contain NUL's,
1194 * we now use fwrite().
1196 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1199 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1200 * is returned in "result".
1203 #define YY_INPUT(buf,result,max_size) \
1204 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1208 for ( n = 0; n < max_size && \
1209 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1210 buf[n] = (char) c; \
1212 buf[n++] = (char) c; \
1213 if ( c == EOF && ferror( yyin ) ) \
1214 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1220 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1222 if( errno != EINTR) \
1224 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1235 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1236 * we don't want an extra ';' after the "return" because that will cause
1237 * some compilers to complain about unreachable statements.
1240 #define yyterminate() return YY_NULL
1243 /* Number of entries by which start-condition stack grows. */
1244 #ifndef YY_START_STACK_INCR
1245 #define YY_START_STACK_INCR 25
1248 /* Report a fatal error. */
1249 #ifndef YY_FATAL_ERROR
1250 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1253 /* end tables serialization structures and prototypes */
1255 /* Default declaration of generated scanner - a define so the user can
1256 * easily add parameters.
1259 #define YY_DECL_IS_OURS 1
1261 extern int _mesa_glsl_lex \
1262 (YYSTYPE
* yylval_param
,YYLTYPE
* yylloc_param
,yyscan_t yyscanner
);
1264 #define YY_DECL int _mesa_glsl_lex \
1265 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1266 #endif /* !YY_DECL */
1268 /* Code executed at the beginning of each rule, after yytext and yyleng
1271 #ifndef YY_USER_ACTION
1272 #define YY_USER_ACTION
1275 /* Code executed at the end of each rule. */
1277 #define YY_BREAK break;
1280 #define YY_RULE_SETUP \
1282 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1283 (yytext[yyleng - 1] == '\n'); \
1286 /** The main scanner function which does all the work.
1290 register yy_state_type yy_current_state
;
1291 register char *yy_cp
, *yy_bp
;
1292 register int yy_act
;
1293 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1295 #line 94 "glsl_lexer.lpp"
1298 #line 1299 "glsl_lexer.cpp"
1300 yylval
= yylval_param
;
1302 yylloc
= yylloc_param
;
1304 if ( !yyg
->yy_init
)
1312 if ( ! yyg
->yy_start
)
1313 yyg
->yy_start
= 1; /* first start state */
1321 if ( ! YY_CURRENT_BUFFER
) {
1322 _mesa_glsl_ensure_buffer_stack (yyscanner
);
1323 YY_CURRENT_BUFFER_LVALUE
=
1324 _mesa_glsl__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1327 _mesa_glsl__load_buffer_state(yyscanner
);
1330 while ( 1 ) /* loops until end-of-file is reached */
1332 yy_cp
= yyg
->yy_c_buf_p
;
1334 /* Support of yytext. */
1335 *yy_cp
= yyg
->yy_hold_char
;
1337 /* yy_bp points to the position in yy_ch_buf of the start of
1342 yy_current_state
= yyg
->yy_start
;
1343 yy_current_state
+= YY_AT_BOL();
1347 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1348 if ( yy_accept
[yy_current_state
] )
1350 yyg
->yy_last_accepting_state
= yy_current_state
;
1351 yyg
->yy_last_accepting_cpos
= yy_cp
;
1353 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1355 yy_current_state
= (int) yy_def
[yy_current_state
];
1356 if ( yy_current_state
>= 813 )
1357 yy_c
= yy_meta
[(unsigned int) yy_c
];
1359 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1362 while ( yy_current_state
!= 812 );
1363 yy_cp
= yyg
->yy_last_accepting_cpos
;
1364 yy_current_state
= yyg
->yy_last_accepting_state
;
1367 yy_act
= yy_accept
[yy_current_state
];
1369 YY_DO_BEFORE_ACTION
;
1371 do_action
: /* This label is used only to access EOF actions. */
1374 { /* beginning of action switch */
1375 case 0: /* must back up */
1376 /* undo the effects of YY_DO_BEFORE_ACTION */
1377 *yy_cp
= yyg
->yy_hold_char
;
1378 yy_cp
= yyg
->yy_last_accepting_cpos
;
1379 yy_current_state
= yyg
->yy_last_accepting_state
;
1380 goto yy_find_action
;
1384 #line 96 "glsl_lexer.lpp"
1387 /* Preprocessor tokens. */
1389 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1390 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1391 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1393 #line 99 "glsl_lexer.lpp"
1398 #line 100 "glsl_lexer.lpp"
1399 { BEGIN PP
; return VERSION
; }
1403 #line 101 "glsl_lexer.lpp"
1404 { BEGIN PP
; return EXTENSION
; }
1407 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1408 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1409 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1411 #line 102 "glsl_lexer.lpp"
1413 /* Eat characters until the first digit is
1417 while (!isdigit(*ptr
))
1420 /* Subtract one from the line number because
1421 * yylineno is zero-based instead of
1424 yylineno
= strtol(ptr
, &ptr
, 0) - 1;
1425 yylloc
->source
= strtol(ptr
, NULL
, 0);
1429 *yy_cp
= yyg
->yy_hold_char
; /* undo effects of setting up yytext */
1430 yyg
->yy_c_buf_p
= yy_cp
-= 1;
1431 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1433 #line 117 "glsl_lexer.lpp"
1435 /* Eat characters until the first digit is
1439 while (!isdigit(*ptr
))
1442 /* Subtract one from the line number because
1443 * yylineno is zero-based instead of
1446 yylineno
= strtol(ptr
, &ptr
, 0) - 1;
1451 #line 131 "glsl_lexer.lpp"
1454 return PRAGMA_DEBUG_ON
;
1459 #line 135 "glsl_lexer.lpp"
1462 return PRAGMA_DEBUG_OFF
;
1467 #line 139 "glsl_lexer.lpp"
1470 return PRAGMA_OPTIMIZE_ON
;
1475 #line 143 "glsl_lexer.lpp"
1478 return PRAGMA_OPTIMIZE_OFF
;
1483 #line 147 "glsl_lexer.lpp"
1487 /* rule 12 can match eol */
1489 #line 149 "glsl_lexer.lpp"
1490 { BEGIN
0; yylineno
++; yycolumn
= 0; }
1494 #line 150 "glsl_lexer.lpp"
1499 #line 152 "glsl_lexer.lpp"
1504 #line 153 "glsl_lexer.lpp"
1509 #line 154 "glsl_lexer.lpp"
1514 #line 155 "glsl_lexer.lpp"
1516 yylval
->identifier
= strdup(yytext
);
1522 #line 159 "glsl_lexer.lpp"
1524 yylval
->n
= strtol(yytext
, NULL
, 10);
1529 /* rule 19 can match eol */
1531 #line 163 "glsl_lexer.lpp"
1532 { BEGIN
0; yylineno
++; yycolumn
= 0; return EOL
; }
1535 /* rule 20 can match eol */
1537 #line 165 "glsl_lexer.lpp"
1538 { yylineno
++; yycolumn
= 0; }
1542 #line 167 "glsl_lexer.lpp"
1547 #line 168 "glsl_lexer.lpp"
1552 #line 169 "glsl_lexer.lpp"
1557 #line 170 "glsl_lexer.lpp"
1562 #line 171 "glsl_lexer.lpp"
1567 #line 172 "glsl_lexer.lpp"
1568 KEYWORD(130, 130, UINT_TOK
);
1572 #line 174 "glsl_lexer.lpp"
1577 #line 175 "glsl_lexer.lpp"
1582 #line 176 "glsl_lexer.lpp"
1587 #line 177 "glsl_lexer.lpp"
1592 #line 178 "glsl_lexer.lpp"
1597 #line 179 "glsl_lexer.lpp"
1602 #line 180 "glsl_lexer.lpp"
1607 #line 181 "glsl_lexer.lpp"
1612 #line 182 "glsl_lexer.lpp"
1617 #line 184 "glsl_lexer.lpp"
1622 #line 185 "glsl_lexer.lpp"
1627 #line 186 "glsl_lexer.lpp"
1632 #line 187 "glsl_lexer.lpp"
1637 #line 188 "glsl_lexer.lpp"
1642 #line 189 "glsl_lexer.lpp"
1647 #line 190 "glsl_lexer.lpp"
1648 KEYWORD(130, 130, UVEC2
);
1652 #line 191 "glsl_lexer.lpp"
1653 KEYWORD(130, 130, UVEC3
);
1657 #line 192 "glsl_lexer.lpp"
1658 KEYWORD(130, 130, UVEC4
);
1662 #line 193 "glsl_lexer.lpp"
1667 #line 194 "glsl_lexer.lpp"
1672 #line 195 "glsl_lexer.lpp"
1677 #line 196 "glsl_lexer.lpp"
1682 #line 197 "glsl_lexer.lpp"
1687 #line 198 "glsl_lexer.lpp"
1692 #line 199 "glsl_lexer.lpp"
1693 KEYWORD(120, 120, MAT2X2
);
1697 #line 200 "glsl_lexer.lpp"
1698 KEYWORD(120, 120, MAT2X3
);
1702 #line 201 "glsl_lexer.lpp"
1703 KEYWORD(120, 120, MAT2X4
);
1707 #line 202 "glsl_lexer.lpp"
1708 KEYWORD(120, 120, MAT3X2
);
1712 #line 203 "glsl_lexer.lpp"
1713 KEYWORD(120, 120, MAT3X3
);
1717 #line 204 "glsl_lexer.lpp"
1718 KEYWORD(120, 120, MAT3X4
);
1722 #line 205 "glsl_lexer.lpp"
1723 KEYWORD(120, 120, MAT4X2
);
1727 #line 206 "glsl_lexer.lpp"
1728 KEYWORD(120, 120, MAT4X3
);
1732 #line 207 "glsl_lexer.lpp"
1733 KEYWORD(120, 120, MAT4X4
);
1737 #line 209 "glsl_lexer.lpp"
1742 #line 210 "glsl_lexer.lpp"
1747 #line 211 "glsl_lexer.lpp"
1752 #line 212 "glsl_lexer.lpp"
1757 #line 213 "glsl_lexer.lpp"
1762 #line 214 "glsl_lexer.lpp"
1763 KEYWORD(120, 120, CENTROID
);
1767 #line 215 "glsl_lexer.lpp"
1768 KEYWORD(120 || ES
, 120 || ES
, INVARIANT
);
1772 #line 216 "glsl_lexer.lpp"
1773 KEYWORD(130 || ES
, 130, FLAT
);
1777 #line 217 "glsl_lexer.lpp"
1778 KEYWORD(130, 130, SMOOTH
);
1782 #line 218 "glsl_lexer.lpp"
1783 KEYWORD(130, 130, NOPERSPECTIVE
);
1787 #line 220 "glsl_lexer.lpp"
1792 #line 221 "glsl_lexer.lpp"
1797 #line 222 "glsl_lexer.lpp"
1802 #line 223 "glsl_lexer.lpp"
1807 #line 224 "glsl_lexer.lpp"
1808 KEYWORD(130, 130, SAMPLER1DARRAY
);
1812 #line 225 "glsl_lexer.lpp"
1813 KEYWORD(130, 130, SAMPLER2DARRAY
);
1817 #line 226 "glsl_lexer.lpp"
1818 return SAMPLER1DSHADOW
;
1822 #line 227 "glsl_lexer.lpp"
1823 return SAMPLER2DSHADOW
;
1827 #line 228 "glsl_lexer.lpp"
1828 KEYWORD(130, 130, SAMPLERCUBESHADOW
);
1832 #line 229 "glsl_lexer.lpp"
1833 KEYWORD(130, 130, SAMPLER1DARRAYSHADOW
);
1837 #line 230 "glsl_lexer.lpp"
1838 KEYWORD(130, 130, SAMPLER2DARRAYSHADOW
);
1842 #line 231 "glsl_lexer.lpp"
1843 KEYWORD(130, 130, ISAMPLER1D
);
1847 #line 232 "glsl_lexer.lpp"
1848 KEYWORD(130, 130, ISAMPLER2D
);
1852 #line 233 "glsl_lexer.lpp"
1853 KEYWORD(130, 130, ISAMPLER3D
);
1857 #line 234 "glsl_lexer.lpp"
1858 KEYWORD(130, 130, ISAMPLERCUBE
);
1862 #line 235 "glsl_lexer.lpp"
1863 KEYWORD(130, 130, ISAMPLER1DARRAY
);
1867 #line 236 "glsl_lexer.lpp"
1868 KEYWORD(130, 130, ISAMPLER2DARRAY
);
1872 #line 237 "glsl_lexer.lpp"
1873 KEYWORD(130, 130, USAMPLER1D
);
1877 #line 238 "glsl_lexer.lpp"
1878 KEYWORD(130, 130, USAMPLER2D
);
1882 #line 239 "glsl_lexer.lpp"
1883 KEYWORD(130, 130, USAMPLER3D
);
1887 #line 240 "glsl_lexer.lpp"
1888 KEYWORD(130, 130, USAMPLERCUBE
);
1892 #line 241 "glsl_lexer.lpp"
1893 KEYWORD(130, 130, USAMPLER1DARRAY
);
1897 #line 242 "glsl_lexer.lpp"
1898 KEYWORD(130, 130, USAMPLER2DARRAY
);
1902 #line 245 "glsl_lexer.lpp"
1907 #line 246 "glsl_lexer.lpp"
1912 #line 248 "glsl_lexer.lpp"
1914 if ((yyextra
->language_version
>= 140)
1915 || yyextra
->ARB_explicit_attrib_location_enable
1916 || (yyextra
->ARB_fragment_coord_conventions_enable
)){
1919 yylval
->identifier
= strdup(yytext
);
1926 #line 259 "glsl_lexer.lpp"
1931 #line 260 "glsl_lexer.lpp"
1936 #line 261 "glsl_lexer.lpp"
1941 #line 262 "glsl_lexer.lpp"
1946 #line 263 "glsl_lexer.lpp"
1951 #line 264 "glsl_lexer.lpp"
1956 #line 265 "glsl_lexer.lpp"
1961 #line 266 "glsl_lexer.lpp"
1966 #line 267 "glsl_lexer.lpp"
1971 #line 268 "glsl_lexer.lpp"
1976 #line 269 "glsl_lexer.lpp"
1981 #line 271 "glsl_lexer.lpp"
1986 #line 272 "glsl_lexer.lpp"
1991 #line 273 "glsl_lexer.lpp"
1996 #line 274 "glsl_lexer.lpp"
2001 #line 275 "glsl_lexer.lpp"
2006 #line 276 "glsl_lexer.lpp"
2007 return RIGHT_ASSIGN
;
2011 #line 277 "glsl_lexer.lpp"
2016 #line 278 "glsl_lexer.lpp"
2021 #line 279 "glsl_lexer.lpp"
2026 #line 280 "glsl_lexer.lpp"
2031 #line 282 "glsl_lexer.lpp"
2033 yylval
->n
= strtol(yytext
, NULL
, 10);
2034 return IS_UINT
? UINTCONSTANT
: INTCONSTANT
;
2039 #line 286 "glsl_lexer.lpp"
2041 yylval
->n
= strtol(yytext
+ 2, NULL
, 16);
2042 return IS_UINT
? UINTCONSTANT
: INTCONSTANT
;
2047 #line 290 "glsl_lexer.lpp"
2049 yylval
->n
= strtol(yytext
, NULL
, 8);
2050 return IS_UINT
? UINTCONSTANT
: INTCONSTANT
;
2055 #line 295 "glsl_lexer.lpp"
2057 yylval
->real
= strtod(yytext
, NULL
);
2058 return FLOATCONSTANT
;
2063 #line 299 "glsl_lexer.lpp"
2065 yylval
->real
= strtod(yytext
, NULL
);
2066 return FLOATCONSTANT
;
2071 #line 303 "glsl_lexer.lpp"
2073 yylval
->real
= strtod(yytext
, NULL
);
2074 return FLOATCONSTANT
;
2079 #line 307 "glsl_lexer.lpp"
2081 yylval
->real
= strtod(yytext
, NULL
);
2082 return FLOATCONSTANT
;
2087 #line 311 "glsl_lexer.lpp"
2089 yylval
->real
= strtod(yytext
, NULL
);
2090 return FLOATCONSTANT
;
2095 #line 316 "glsl_lexer.lpp"
2098 return BOOLCONSTANT
;
2103 #line 320 "glsl_lexer.lpp"
2106 return BOOLCONSTANT
;
2109 /* Reserved words in GLSL 1.10. */
2112 #line 327 "glsl_lexer.lpp"
2113 KEYWORD(110 || ES
, 999, ASM
);
2117 #line 328 "glsl_lexer.lpp"
2118 KEYWORD(110 || ES
, 999, CLASS
);
2122 #line 329 "glsl_lexer.lpp"
2123 KEYWORD(110 || ES
, 999, UNION
);
2127 #line 330 "glsl_lexer.lpp"
2128 KEYWORD(110 || ES
, 999, ENUM
);
2132 #line 331 "glsl_lexer.lpp"
2133 KEYWORD(110 || ES
, 999, TYPEDEF
);
2137 #line 332 "glsl_lexer.lpp"
2138 KEYWORD(110 || ES
, 999, TEMPLATE
);
2142 #line 333 "glsl_lexer.lpp"
2143 KEYWORD(110 || ES
, 999, THIS
);
2147 #line 334 "glsl_lexer.lpp"
2148 KEYWORD(110 || ES
, 999, PACKED_TOK
);
2152 #line 335 "glsl_lexer.lpp"
2153 KEYWORD(110 || ES
, 999, GOTO
);
2157 #line 336 "glsl_lexer.lpp"
2158 KEYWORD(110 || ES
, 130, SWITCH
);
2162 #line 337 "glsl_lexer.lpp"
2163 KEYWORD(110 || ES
, 130, DEFAULT
);
2167 #line 338 "glsl_lexer.lpp"
2168 KEYWORD(110 || ES
, 999, INLINE_TOK
);
2172 #line 339 "glsl_lexer.lpp"
2173 KEYWORD(110 || ES
, 999, NOINLINE
);
2177 #line 340 "glsl_lexer.lpp"
2178 KEYWORD(110 || ES
, 999, VOLATILE
);
2182 #line 341 "glsl_lexer.lpp"
2183 KEYWORD(110 || ES
, 999, PUBLIC_TOK
);
2187 #line 342 "glsl_lexer.lpp"
2188 KEYWORD(110 || ES
, 999, STATIC
);
2192 #line 343 "glsl_lexer.lpp"
2193 KEYWORD(110 || ES
, 999, EXTERN
);
2197 #line 344 "glsl_lexer.lpp"
2198 KEYWORD(110 || ES
, 999, EXTERNAL
);
2202 #line 345 "glsl_lexer.lpp"
2203 KEYWORD(110 || ES
, 999, INTERFACE
);
2207 #line 346 "glsl_lexer.lpp"
2208 KEYWORD(110 || ES
, 999, LONG_TOK
);
2212 #line 347 "glsl_lexer.lpp"
2213 KEYWORD(110 || ES
, 999, SHORT_TOK
);
2217 #line 348 "glsl_lexer.lpp"
2218 KEYWORD(110 || ES
, 400, DOUBLE_TOK
);
2222 #line 349 "glsl_lexer.lpp"
2223 KEYWORD(110 || ES
, 999, HALF
);
2227 #line 350 "glsl_lexer.lpp"
2228 KEYWORD(110 || ES
, 999, FIXED_TOK
);
2232 #line 351 "glsl_lexer.lpp"
2233 KEYWORD(110 || ES
, 999, UNSIGNED
);
2237 #line 352 "glsl_lexer.lpp"
2238 KEYWORD(110 || ES
, 999, INPUT_TOK
);
2242 #line 353 "glsl_lexer.lpp"
2243 KEYWORD(110 || ES
, 999, OUTPUT
);
2247 #line 354 "glsl_lexer.lpp"
2248 KEYWORD(110 || ES
, 999, HVEC2
);
2252 #line 355 "glsl_lexer.lpp"
2253 KEYWORD(110 || ES
, 999, HVEC3
);
2257 #line 356 "glsl_lexer.lpp"
2258 KEYWORD(110 || ES
, 999, HVEC4
);
2262 #line 357 "glsl_lexer.lpp"
2263 KEYWORD(110 || ES
, 400, DVEC2
);
2267 #line 358 "glsl_lexer.lpp"
2268 KEYWORD(110 || ES
, 400, DVEC3
);
2272 #line 359 "glsl_lexer.lpp"
2273 KEYWORD(110 || ES
, 400, DVEC4
);
2277 #line 360 "glsl_lexer.lpp"
2278 KEYWORD(110 || ES
, 999, FVEC2
);
2282 #line 361 "glsl_lexer.lpp"
2283 KEYWORD(110 || ES
, 999, FVEC3
);
2287 #line 362 "glsl_lexer.lpp"
2288 KEYWORD(110 || ES
, 999, FVEC4
);
2292 #line 363 "glsl_lexer.lpp"
2293 return SAMPLER2DRECT
;
2297 #line 364 "glsl_lexer.lpp"
2298 KEYWORD(110 || ES
, 999, SAMPLER3DRECT
);
2302 #line 365 "glsl_lexer.lpp"
2303 return SAMPLER2DRECTSHADOW
;
2307 #line 366 "glsl_lexer.lpp"
2308 KEYWORD(110 || ES
, 999, SIZEOF
);
2312 #line 367 "glsl_lexer.lpp"
2313 KEYWORD(110 || ES
, 999, CAST
);
2317 #line 368 "glsl_lexer.lpp"
2318 KEYWORD(110 || ES
, 999, NAMESPACE
);
2322 #line 369 "glsl_lexer.lpp"
2323 KEYWORD(110 || ES
, 999, USING
);
2325 /* Additional reserved words in GLSL 1.20. */
2328 #line 372 "glsl_lexer.lpp"
2329 KEYWORD(120, 130 || ES
, LOWP
);
2333 #line 373 "glsl_lexer.lpp"
2334 KEYWORD(120, 130 || ES
, MEDIUMP
);
2338 #line 374 "glsl_lexer.lpp"
2339 KEYWORD(120, 130 || ES
, HIGHP
);
2343 #line 375 "glsl_lexer.lpp"
2344 KEYWORD(120, 130 || ES
, PRECISION
);
2346 /* Additional reserved words in GLSL 1.30. */
2349 #line 378 "glsl_lexer.lpp"
2350 KEYWORD(130, 130, CASE
);
2354 #line 379 "glsl_lexer.lpp"
2355 KEYWORD(130, 999, COMMON
);
2359 #line 380 "glsl_lexer.lpp"
2360 KEYWORD(130, 999, PARTITION
);
2364 #line 381 "glsl_lexer.lpp"
2365 KEYWORD(130, 999, ACTIVE
);
2369 #line 382 "glsl_lexer.lpp"
2370 KEYWORD(130 || ES
, 999, SUPERP
);
2374 #line 383 "glsl_lexer.lpp"
2375 KEYWORD(130, 140, SAMPLERBUFFER
);
2379 #line 384 "glsl_lexer.lpp"
2380 KEYWORD(130, 999, FILTER
);
2384 #line 385 "glsl_lexer.lpp"
2385 KEYWORD(130, 999, IMAGE1D
);
2389 #line 386 "glsl_lexer.lpp"
2390 KEYWORD(130, 999, IMAGE2D
);
2394 #line 387 "glsl_lexer.lpp"
2395 KEYWORD(130, 999, IMAGE3D
);
2399 #line 388 "glsl_lexer.lpp"
2400 KEYWORD(130, 999, IMAGECUBE
);
2404 #line 389 "glsl_lexer.lpp"
2405 KEYWORD(130, 999, IIMAGE1D
);
2409 #line 390 "glsl_lexer.lpp"
2410 KEYWORD(130, 999, IIMAGE2D
);
2414 #line 391 "glsl_lexer.lpp"
2415 KEYWORD(130, 999, IIMAGE3D
);
2419 #line 392 "glsl_lexer.lpp"
2420 KEYWORD(130, 999, IIMAGECUBE
);
2424 #line 393 "glsl_lexer.lpp"
2425 KEYWORD(130, 999, UIMAGE1D
);
2429 #line 394 "glsl_lexer.lpp"
2430 KEYWORD(130, 999, UIMAGE2D
);
2434 #line 395 "glsl_lexer.lpp"
2435 KEYWORD(130, 999, UIMAGE3D
);
2439 #line 396 "glsl_lexer.lpp"
2440 KEYWORD(130, 999, UIMAGECUBE
);
2444 #line 397 "glsl_lexer.lpp"
2445 KEYWORD(130, 999, IMAGE1DARRAY
);
2449 #line 398 "glsl_lexer.lpp"
2450 KEYWORD(130, 999, IMAGE2DARRAY
);
2454 #line 399 "glsl_lexer.lpp"
2455 KEYWORD(130, 999, IIMAGE1DARRAY
);
2459 #line 400 "glsl_lexer.lpp"
2460 KEYWORD(130, 999, IIMAGE2DARRAY
);
2464 #line 401 "glsl_lexer.lpp"
2465 KEYWORD(130, 999, UIMAGE1DARRAY
);
2469 #line 402 "glsl_lexer.lpp"
2470 KEYWORD(130, 999, UIMAGE2DARRAY
);
2474 #line 403 "glsl_lexer.lpp"
2475 KEYWORD(130, 999, IMAGE1DSHADOW
);
2479 #line 404 "glsl_lexer.lpp"
2480 KEYWORD(130, 999, IMAGE2DSHADOW
);
2484 #line 405 "glsl_lexer.lpp"
2485 KEYWORD(130, 999, IMAGE1DARRAYSHADOW
);
2489 #line 406 "glsl_lexer.lpp"
2490 KEYWORD(130, 999, IMAGE2DARRAYSHADOW
);
2494 #line 407 "glsl_lexer.lpp"
2495 KEYWORD(130, 999, IMAGEBUFFER
);
2499 #line 408 "glsl_lexer.lpp"
2500 KEYWORD(130, 999, IIMAGEBUFFER
);
2504 #line 409 "glsl_lexer.lpp"
2505 KEYWORD(130, 999, UIMAGEBUFFER
);
2509 #line 410 "glsl_lexer.lpp"
2510 KEYWORD(130, 999, ROW_MAJOR
);
2514 #line 412 "glsl_lexer.lpp"
2516 struct _mesa_glsl_parse_state
*state
= yyextra
;
2518 yylval
->identifier
= talloc_strdup(ctx
, yytext
);
2524 #line 419 "glsl_lexer.lpp"
2525 { return yytext
[0]; }
2529 #line 421 "glsl_lexer.lpp"
2532 #line 2533 "glsl_lexer.cpp"
2533 case YY_STATE_EOF(INITIAL
):
2534 case YY_STATE_EOF(PP
):
2535 case YY_STATE_EOF(PRAGMA
):
2538 case YY_END_OF_BUFFER
:
2540 /* Amount of text matched not including the EOB char. */
2541 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
2543 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2544 *yy_cp
= yyg
->yy_hold_char
;
2545 YY_RESTORE_YY_MORE_OFFSET
2547 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
2549 /* We're scanning a new file or input source. It's
2550 * possible that this happened because the user
2551 * just pointed yyin at a new source and called
2552 * _mesa_glsl_lex(). If so, then we have to assure
2553 * consistency between YY_CURRENT_BUFFER and our
2554 * globals. Here is the right place to do so, because
2555 * this is the first action (other than possibly a
2556 * back-up) that will match for the new input source.
2558 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
2559 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
2560 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2563 /* Note that here we test for yy_c_buf_p "<=" to the position
2564 * of the first EOB in the buffer, since yy_c_buf_p will
2565 * already have been incremented past the NUL character
2566 * (since all states make transitions on EOB to the
2567 * end-of-buffer state). Contrast this with the test
2570 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
2571 { /* This was really a NUL. */
2572 yy_state_type yy_next_state
;
2574 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
2576 yy_current_state
= yy_get_previous_state( yyscanner
);
2578 /* Okay, we're now positioned to make the NUL
2579 * transition. We couldn't have
2580 * yy_get_previous_state() go ahead and do it
2581 * for us because it doesn't know how to deal
2582 * with the possibility of jamming (and we don't
2583 * want to build jamming into it because then it
2584 * will run more slowly).
2587 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
2589 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2591 if ( yy_next_state
)
2593 /* Consume the NUL. */
2594 yy_cp
= ++yyg
->yy_c_buf_p
;
2595 yy_current_state
= yy_next_state
;
2601 yy_cp
= yyg
->yy_last_accepting_cpos
;
2602 yy_current_state
= yyg
->yy_last_accepting_state
;
2603 goto yy_find_action
;
2607 else switch ( yy_get_next_buffer( yyscanner
) )
2609 case EOB_ACT_END_OF_FILE
:
2611 yyg
->yy_did_buffer_switch_on_eof
= 0;
2613 if ( _mesa_glsl_wrap(yyscanner
) )
2615 /* Note: because we've taken care in
2616 * yy_get_next_buffer() to have set up
2617 * yytext, we can now set up
2618 * yy_c_buf_p so that if some total
2619 * hoser (like flex itself) wants to
2620 * call the scanner after we return the
2621 * YY_NULL, it'll still work - another
2622 * YY_NULL will get returned.
2624 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2626 yy_act
= YY_STATE_EOF(YY_START
);
2632 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
2638 case EOB_ACT_CONTINUE_SCAN
:
2640 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
2642 yy_current_state
= yy_get_previous_state( yyscanner
);
2644 yy_cp
= yyg
->yy_c_buf_p
;
2645 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2648 case EOB_ACT_LAST_MATCH
:
2650 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
2652 yy_current_state
= yy_get_previous_state( yyscanner
);
2654 yy_cp
= yyg
->yy_c_buf_p
;
2655 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2656 goto yy_find_action
;
2663 "fatal flex scanner internal error--no action found" );
2664 } /* end of action switch */
2665 } /* end of scanning one token */
2666 } /* end of _mesa_glsl_lex */
2668 /* yy_get_next_buffer - try to read in a new buffer
2670 * Returns a code representing an action:
2671 * EOB_ACT_LAST_MATCH -
2672 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2673 * EOB_ACT_END_OF_FILE - end of file
2675 static int yy_get_next_buffer (yyscan_t yyscanner
)
2677 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2678 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
2679 register char *source
= yyg
->yytext_ptr
;
2680 register int number_to_move
, i
;
2683 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
2685 "fatal flex scanner internal error--end of buffer missed" );
2687 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
2688 { /* Don't try to fill the buffer, so this is an EOF. */
2689 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
2691 /* We matched a single character, the EOB, so
2692 * treat this as a final EOF.
2694 return EOB_ACT_END_OF_FILE
;
2699 /* We matched some text prior to the EOB, first
2702 return EOB_ACT_LAST_MATCH
;
2706 /* Try to read more data. */
2708 /* First move last chars to start of buffer. */
2709 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
2711 for ( i
= 0; i
< number_to_move
; ++i
)
2712 *(dest
++) = *(source
++);
2714 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2715 /* don't do the read, it's not guaranteed to return an EOF,
2718 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
2723 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
2725 while ( num_to_read
<= 0 )
2726 { /* Not enough room in the buffer - grow it. */
2728 /* just a shorter name for the current buffer */
2729 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
2731 int yy_c_buf_p_offset
=
2732 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
2734 if ( b
->yy_is_our_buffer
)
2736 int new_size
= b
->yy_buf_size
* 2;
2738 if ( new_size
<= 0 )
2739 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2741 b
->yy_buf_size
*= 2;
2743 b
->yy_ch_buf
= (char *)
2744 /* Include room in for 2 EOB chars. */
2745 _mesa_glsl_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
2748 /* Can't grow it, we don't own it. */
2751 if ( ! b
->yy_ch_buf
)
2753 "fatal error - scanner input buffer overflow" );
2755 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2757 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
2762 if ( num_to_read
> YY_READ_BUF_SIZE
)
2763 num_to_read
= YY_READ_BUF_SIZE
;
2765 /* Read in more data. */
2766 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
2767 yyg
->yy_n_chars
, (size_t) num_to_read
);
2769 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2772 if ( yyg
->yy_n_chars
== 0 )
2774 if ( number_to_move
== YY_MORE_ADJ
)
2776 ret_val
= EOB_ACT_END_OF_FILE
;
2777 _mesa_glsl_restart(yyin
,yyscanner
);
2782 ret_val
= EOB_ACT_LAST_MATCH
;
2783 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
2784 YY_BUFFER_EOF_PENDING
;
2789 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2791 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
2792 /* Extend the array by 50%, plus the number we really need. */
2793 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
2794 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
2795 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
2796 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2799 yyg
->yy_n_chars
+= number_to_move
;
2800 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2801 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2803 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
2808 /* yy_get_previous_state - get the state just before the EOB char was reached */
2810 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
2812 register yy_state_type yy_current_state
;
2813 register char *yy_cp
;
2814 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2816 yy_current_state
= yyg
->yy_start
;
2817 yy_current_state
+= YY_AT_BOL();
2819 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
2821 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2822 if ( yy_accept
[yy_current_state
] )
2824 yyg
->yy_last_accepting_state
= yy_current_state
;
2825 yyg
->yy_last_accepting_cpos
= yy_cp
;
2827 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2829 yy_current_state
= (int) yy_def
[yy_current_state
];
2830 if ( yy_current_state
>= 813 )
2831 yy_c
= yy_meta
[(unsigned int) yy_c
];
2833 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2836 return yy_current_state
;
2839 /* yy_try_NUL_trans - try to make a transition on the NUL character
2842 * next_state = yy_try_NUL_trans( current_state );
2844 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
2846 register int yy_is_jam
;
2847 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
2848 register char *yy_cp
= yyg
->yy_c_buf_p
;
2850 register YY_CHAR yy_c
= 1;
2851 if ( yy_accept
[yy_current_state
] )
2853 yyg
->yy_last_accepting_state
= yy_current_state
;
2854 yyg
->yy_last_accepting_cpos
= yy_cp
;
2856 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2858 yy_current_state
= (int) yy_def
[yy_current_state
];
2859 if ( yy_current_state
>= 813 )
2860 yy_c
= yy_meta
[(unsigned int) yy_c
];
2862 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2863 yy_is_jam
= (yy_current_state
== 812);
2865 return yy_is_jam
? 0 : yy_current_state
;
2870 static int yyinput (yyscan_t yyscanner
)
2872 static int input (yyscan_t yyscanner
)
2877 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2879 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2881 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2883 /* yy_c_buf_p now points to the character we want to return.
2884 * If this occurs *before* the EOB characters, then it's a
2885 * valid NUL; if not, then we've hit the end of the buffer.
2887 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
2888 /* This was really a NUL. */
2889 *yyg
->yy_c_buf_p
= '\0';
2892 { /* need more input */
2893 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
2896 switch ( yy_get_next_buffer( yyscanner
) )
2898 case EOB_ACT_LAST_MATCH
:
2899 /* This happens because yy_g_n_b()
2900 * sees that we've accumulated a
2901 * token and flags that we need to
2902 * try matching the token before
2903 * proceeding. But for input(),
2904 * there's no matching to consider.
2905 * So convert the EOB_ACT_LAST_MATCH
2906 * to EOB_ACT_END_OF_FILE.
2909 /* Reset buffer status. */
2910 _mesa_glsl_restart(yyin
,yyscanner
);
2914 case EOB_ACT_END_OF_FILE
:
2916 if ( _mesa_glsl_wrap(yyscanner
) )
2919 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
2922 return yyinput(yyscanner
);
2924 return input(yyscanner
);
2928 case EOB_ACT_CONTINUE_SCAN
:
2929 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
2935 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
2936 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
2937 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
2939 YY_CURRENT_BUFFER_LVALUE
->yy_at_bol
= (c
== '\n');
2943 #endif /* ifndef YY_NO_INPUT */
2945 /** Immediately switch to a different input stream.
2946 * @param input_file A readable stream.
2947 * @param yyscanner The scanner object.
2948 * @note This function does not reset the start condition to @c INITIAL .
2950 void _mesa_glsl_restart (FILE * input_file
, yyscan_t yyscanner
)
2952 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2954 if ( ! YY_CURRENT_BUFFER
){
2955 _mesa_glsl_ensure_buffer_stack (yyscanner
);
2956 YY_CURRENT_BUFFER_LVALUE
=
2957 _mesa_glsl__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
2960 _mesa_glsl__init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
2961 _mesa_glsl__load_buffer_state(yyscanner
);
2964 /** Switch to a different input buffer.
2965 * @param new_buffer The new input buffer.
2966 * @param yyscanner The scanner object.
2968 void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
2970 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2972 /* TODO. We should be able to replace this entire function body
2974 * _mesa_glsl_pop_buffer_state();
2975 * _mesa_glsl_push_buffer_state(new_buffer);
2977 _mesa_glsl_ensure_buffer_stack (yyscanner
);
2978 if ( YY_CURRENT_BUFFER
== new_buffer
)
2981 if ( YY_CURRENT_BUFFER
)
2983 /* Flush out information for old buffer. */
2984 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2985 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
2986 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2989 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2990 _mesa_glsl__load_buffer_state(yyscanner
);
2992 /* We don't actually know whether we did this switch during
2993 * EOF (_mesa_glsl_wrap()) processing, but the only time this flag
2994 * is looked at is after _mesa_glsl_wrap() is called, so it's safe
2995 * to go ahead and always set it.
2997 yyg
->yy_did_buffer_switch_on_eof
= 1;
3000 static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner
)
3002 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3003 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
3004 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
3005 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
3006 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
3009 /** Allocate and initialize an input buffer state.
3010 * @param file A readable stream.
3011 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3012 * @param yyscanner The scanner object.
3013 * @return the allocated buffer state.
3015 YY_BUFFER_STATE
_mesa_glsl__create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
3019 b
= (YY_BUFFER_STATE
) _mesa_glsl_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
3021 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
3023 b
->yy_buf_size
= size
;
3025 /* yy_ch_buf has to be 2 characters longer than the size given because
3026 * we need to put in 2 end-of-buffer characters.
3028 b
->yy_ch_buf
= (char *) _mesa_glsl_alloc(b
->yy_buf_size
+ 2 ,yyscanner
);
3029 if ( ! b
->yy_ch_buf
)
3030 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" );
3032 b
->yy_is_our_buffer
= 1;
3034 _mesa_glsl__init_buffer(b
,file
,yyscanner
);
3039 /** Destroy the buffer.
3040 * @param b a buffer created with _mesa_glsl__create_buffer()
3041 * @param yyscanner The scanner object.
3043 void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
3045 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3050 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
3051 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
3053 if ( b
->yy_is_our_buffer
)
3054 _mesa_glsl_free((void *) b
->yy_ch_buf
,yyscanner
);
3056 _mesa_glsl_free((void *) b
,yyscanner
);
3059 /* Initializes or reinitializes a buffer.
3060 * This function is sometimes called more than once on the same buffer,
3061 * such as during a _mesa_glsl_restart() or at EOF.
3063 static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
3067 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3069 _mesa_glsl__flush_buffer(b
,yyscanner
);
3071 b
->yy_input_file
= file
;
3072 b
->yy_fill_buffer
= 1;
3074 /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_
3075 * called from _mesa_glsl_restart() or through yy_get_next_buffer.
3076 * In that case, we don't want to reset the lineno or column.
3078 if (b
!= YY_CURRENT_BUFFER
){
3079 b
->yy_bs_lineno
= 1;
3080 b
->yy_bs_column
= 0;
3083 b
->yy_is_interactive
= 0;
3088 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3089 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3090 * @param yyscanner The scanner object.
3092 void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
3094 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3100 /* We always need two end-of-buffer characters. The first causes
3101 * a transition to the end-of-buffer state. The second causes
3102 * a jam in that state.
3104 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
3105 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
3107 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
3110 b
->yy_buffer_status
= YY_BUFFER_NEW
;
3112 if ( b
== YY_CURRENT_BUFFER
)
3113 _mesa_glsl__load_buffer_state(yyscanner
);
3116 /** Pushes the new state onto the stack. The new state becomes
3117 * the current state. This function will allocate the stack
3119 * @param new_buffer The new state.
3120 * @param yyscanner The scanner object.
3122 void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
3124 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3125 if (new_buffer
== NULL
)
3128 _mesa_glsl_ensure_buffer_stack(yyscanner
);
3130 /* This block is copied from _mesa_glsl__switch_to_buffer. */
3131 if ( YY_CURRENT_BUFFER
)
3133 /* Flush out information for old buffer. */
3134 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
3135 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
3136 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
3139 /* Only push if top exists. Otherwise, replace top. */
3140 if (YY_CURRENT_BUFFER
)
3141 yyg
->yy_buffer_stack_top
++;
3142 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
3144 /* copied from _mesa_glsl__switch_to_buffer. */
3145 _mesa_glsl__load_buffer_state(yyscanner
);
3146 yyg
->yy_did_buffer_switch_on_eof
= 1;
3149 /** Removes and deletes the top of the stack, if present.
3150 * The next element becomes the new top.
3151 * @param yyscanner The scanner object.
3153 void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner
)
3155 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3156 if (!YY_CURRENT_BUFFER
)
3159 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
3160 YY_CURRENT_BUFFER_LVALUE
= NULL
;
3161 if (yyg
->yy_buffer_stack_top
> 0)
3162 --yyg
->yy_buffer_stack_top
;
3164 if (YY_CURRENT_BUFFER
) {
3165 _mesa_glsl__load_buffer_state(yyscanner
);
3166 yyg
->yy_did_buffer_switch_on_eof
= 1;
3170 /* Allocates the stack if it does not exist.
3171 * Guarantees space for at least one push.
3173 static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner
)
3176 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3178 if (!yyg
->yy_buffer_stack
) {
3180 /* First allocation is just for 2 elements, since we don't know if this
3181 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3182 * immediate realloc on the next call.
3185 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_mesa_glsl_alloc
3186 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
3188 if ( ! yyg
->yy_buffer_stack
)
3189 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3191 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
3193 yyg
->yy_buffer_stack_max
= num_to_alloc
;
3194 yyg
->yy_buffer_stack_top
= 0;
3198 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
3200 /* Increase the buffer to prepare for a possible push. */
3201 int grow_size
= 8 /* arbitrary grow size */;
3203 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
3204 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_mesa_glsl_realloc
3205 (yyg
->yy_buffer_stack
,
3206 num_to_alloc
* sizeof(struct yy_buffer_state
*)
3208 if ( ! yyg
->yy_buffer_stack
)
3209 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" );
3211 /* zero only the new slots.*/
3212 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
3213 yyg
->yy_buffer_stack_max
= num_to_alloc
;
3217 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3218 * @param base the character buffer
3219 * @param size the size in bytes of the character buffer
3220 * @param yyscanner The scanner object.
3221 * @return the newly allocated buffer state object.
3223 YY_BUFFER_STATE
_mesa_glsl__scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
3228 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
3229 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
3230 /* They forgot to leave room for the EOB's. */
3233 b
= (YY_BUFFER_STATE
) _mesa_glsl_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
3235 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" );
3237 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
3238 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
3239 b
->yy_is_our_buffer
= 0;
3240 b
->yy_input_file
= 0;
3241 b
->yy_n_chars
= b
->yy_buf_size
;
3242 b
->yy_is_interactive
= 0;
3244 b
->yy_fill_buffer
= 0;
3245 b
->yy_buffer_status
= YY_BUFFER_NEW
;
3247 _mesa_glsl__switch_to_buffer(b
,yyscanner
);
3252 /** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will
3253 * scan from a @e copy of @a str.
3254 * @param yystr a NUL-terminated string to scan
3255 * @param yyscanner The scanner object.
3256 * @return the newly allocated buffer state object.
3257 * @note If you want to scan bytes that may contain NUL values, then use
3258 * _mesa_glsl__scan_bytes() instead.
3260 YY_BUFFER_STATE
_mesa_glsl__scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
3263 return _mesa_glsl__scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
3266 /** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
3267 * scan from a @e copy of @a bytes.
3268 * @param bytes the byte buffer to scan
3269 * @param len the number of bytes in the buffer pointed to by @a bytes.
3270 * @param yyscanner The scanner object.
3271 * @return the newly allocated buffer state object.
3273 YY_BUFFER_STATE
_mesa_glsl__scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
3280 /* Get memory for full buffer, including space for trailing EOB's. */
3281 n
= _yybytes_len
+ 2;
3282 buf
= (char *) _mesa_glsl_alloc(n
,yyscanner
);
3284 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" );
3286 for ( i
= 0; i
< _yybytes_len
; ++i
)
3287 buf
[i
] = yybytes
[i
];
3289 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
3291 b
= _mesa_glsl__scan_buffer(buf
,n
,yyscanner
);
3293 YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" );
3295 /* It's okay to grow etc. this buffer, and we should throw it
3296 * away when we're done.
3298 b
->yy_is_our_buffer
= 1;
3303 #ifndef YY_EXIT_FAILURE
3304 #define YY_EXIT_FAILURE 2
3307 static void yy_fatal_error (yyconst
char* msg
, yyscan_t yyscanner
)
3309 (void) fprintf( stderr
, "%s\n", msg
);
3310 exit( YY_EXIT_FAILURE
);
3313 /* Redefine yyless() so it works in section 3 code. */
3319 /* Undo effects of setting up yytext. */ \
3320 int yyless_macro_arg = (n); \
3321 YY_LESS_LINENO(yyless_macro_arg);\
3322 yytext[yyleng] = yyg->yy_hold_char; \
3323 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3324 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3325 *yyg->yy_c_buf_p = '\0'; \
3326 yyleng = yyless_macro_arg; \
3330 /* Accessor methods (get/set functions) to struct members. */
3332 /** Get the user-defined data for this scanner.
3333 * @param yyscanner The scanner object.
3335 YY_EXTRA_TYPE
_mesa_glsl_get_extra (yyscan_t yyscanner
)
3337 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3341 /** Get the current line number.
3342 * @param yyscanner The scanner object.
3344 int _mesa_glsl_get_lineno (yyscan_t yyscanner
)
3346 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3348 if (! YY_CURRENT_BUFFER
)
3354 /** Get the current column number.
3355 * @param yyscanner The scanner object.
3357 int _mesa_glsl_get_column (yyscan_t yyscanner
)
3359 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3361 if (! YY_CURRENT_BUFFER
)
3367 /** Get the input stream.
3368 * @param yyscanner The scanner object.
3370 FILE *_mesa_glsl_get_in (yyscan_t yyscanner
)
3372 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3376 /** Get the output stream.
3377 * @param yyscanner The scanner object.
3379 FILE *_mesa_glsl_get_out (yyscan_t yyscanner
)
3381 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3385 /** Get the length of the current token.
3386 * @param yyscanner The scanner object.
3388 int _mesa_glsl_get_leng (yyscan_t yyscanner
)
3390 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3394 /** Get the current token.
3395 * @param yyscanner The scanner object.
3398 char *_mesa_glsl_get_text (yyscan_t yyscanner
)
3400 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3404 /** Set the user-defined data. This data is never touched by the scanner.
3405 * @param user_defined The data to be associated with this scanner.
3406 * @param yyscanner The scanner object.
3408 void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
3410 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3411 yyextra
= user_defined
;
3414 /** Set the current line number.
3415 * @param line_number
3416 * @param yyscanner The scanner object.
3418 void _mesa_glsl_set_lineno (int line_number
, yyscan_t yyscanner
)
3420 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3422 /* lineno is only valid if an input buffer exists. */
3423 if (! YY_CURRENT_BUFFER
)
3424 yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner
);
3426 yylineno
= line_number
;
3429 /** Set the current column.
3430 * @param line_number
3431 * @param yyscanner The scanner object.
3433 void _mesa_glsl_set_column (int column_no
, yyscan_t yyscanner
)
3435 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3437 /* column is only valid if an input buffer exists. */
3438 if (! YY_CURRENT_BUFFER
)
3439 yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner
);
3441 yycolumn
= column_no
;
3444 /** Set the input stream. This does not discard the current
3446 * @param in_str A readable stream.
3447 * @param yyscanner The scanner object.
3448 * @see _mesa_glsl__switch_to_buffer
3450 void _mesa_glsl_set_in (FILE * in_str
, yyscan_t yyscanner
)
3452 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3456 void _mesa_glsl_set_out (FILE * out_str
, yyscan_t yyscanner
)
3458 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3462 int _mesa_glsl_get_debug (yyscan_t yyscanner
)
3464 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3465 return yy_flex_debug
;
3468 void _mesa_glsl_set_debug (int bdebug
, yyscan_t yyscanner
)
3470 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3471 yy_flex_debug
= bdebug
;
3474 /* Accessor methods for yylval and yylloc */
3476 YYSTYPE
* _mesa_glsl_get_lval (yyscan_t yyscanner
)
3478 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3482 void _mesa_glsl_set_lval (YYSTYPE
* yylval_param
, yyscan_t yyscanner
)
3484 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3485 yylval
= yylval_param
;
3488 YYLTYPE
*_mesa_glsl_get_lloc (yyscan_t yyscanner
)
3490 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3494 void _mesa_glsl_set_lloc (YYLTYPE
* yylloc_param
, yyscan_t yyscanner
)
3496 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3497 yylloc
= yylloc_param
;
3500 /* User-visible API */
3502 /* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is
3503 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3504 * That's why we explicitly handle the declaration, instead of using our macros.
3507 int _mesa_glsl_lex_init(yyscan_t
* ptr_yy_globals
)
3510 if (ptr_yy_globals
== NULL
){
3515 *ptr_yy_globals
= (yyscan_t
) _mesa_glsl_alloc ( sizeof( struct yyguts_t
), NULL
);
3517 if (*ptr_yy_globals
== NULL
){
3522 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3523 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
3525 return yy_init_globals ( *ptr_yy_globals
);
3528 /* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the
3529 * convention of taking the scanner as the last argument. Note however, that
3530 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3531 * is the reason, too, why this function also must handle its own declaration).
3532 * The user defined value in the first argument will be available to _mesa_glsl_alloc in
3533 * the yyextra field.
3536 int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined
,yyscan_t
* ptr_yy_globals
)
3539 struct yyguts_t dummy_yyguts
;
3541 _mesa_glsl_set_extra (yy_user_defined
, &dummy_yyguts
);
3543 if (ptr_yy_globals
== NULL
){
3548 *ptr_yy_globals
= (yyscan_t
) _mesa_glsl_alloc ( sizeof( struct yyguts_t
), &dummy_yyguts
);
3550 if (*ptr_yy_globals
== NULL
){
3555 /* By setting to 0xAA, we expose bugs in
3556 yy_init_globals. Leave at 0x00 for releases. */
3557 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
3559 _mesa_glsl_set_extra (yy_user_defined
, *ptr_yy_globals
);
3561 return yy_init_globals ( *ptr_yy_globals
);
3564 static int yy_init_globals (yyscan_t yyscanner
)
3566 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3567 /* Initialization is the same as for the non-reentrant scanner.
3568 * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here.
3571 yyg
->yy_buffer_stack
= 0;
3572 yyg
->yy_buffer_stack_top
= 0;
3573 yyg
->yy_buffer_stack_max
= 0;
3574 yyg
->yy_c_buf_p
= (char *) 0;
3578 yyg
->yy_start_stack_ptr
= 0;
3579 yyg
->yy_start_stack_depth
= 0;
3580 yyg
->yy_start_stack
= NULL
;
3582 /* Defined in main.c */
3591 /* For future reference: Set errno on error, since we are called by
3592 * _mesa_glsl_lex_init()
3597 /* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */
3598 int _mesa_glsl_lex_destroy (yyscan_t yyscanner
)
3600 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3602 /* Pop the buffer stack, destroying each element. */
3603 while(YY_CURRENT_BUFFER
){
3604 _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
3605 YY_CURRENT_BUFFER_LVALUE
= NULL
;
3606 _mesa_glsl_pop_buffer_state(yyscanner
);
3609 /* Destroy the stack itself. */
3610 _mesa_glsl_free(yyg
->yy_buffer_stack
,yyscanner
);
3611 yyg
->yy_buffer_stack
= NULL
;
3613 /* Destroy the start condition stack. */
3614 _mesa_glsl_free(yyg
->yy_start_stack
,yyscanner
);
3615 yyg
->yy_start_stack
= NULL
;
3617 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3618 * _mesa_glsl_lex() is called, initialization will occur. */
3619 yy_init_globals( yyscanner
);
3621 /* Destroy the main struct (reentrant only). */
3622 _mesa_glsl_free ( yyscanner
, yyscanner
);
3628 * Internal utility routines.
3632 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
3635 for ( i
= 0; i
< n
; ++i
)
3640 #ifdef YY_NEED_STRLEN
3641 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
3644 for ( n
= 0; s
[n
]; ++n
)
3651 void *_mesa_glsl_alloc (yy_size_t size
, yyscan_t yyscanner
)
3653 return (void *) malloc( size
);
3656 void *_mesa_glsl_realloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
3658 /* The cast to (char *) in the following accommodates both
3659 * implementations that use char* generic pointers, and those
3660 * that use void* generic pointers. It works with the latter
3661 * because both ANSI C and C++ allow castless assignment from
3662 * any pointer type to void*, and deal with argument conversions
3663 * as though doing an assignment.
3665 return (void *) realloc( (char *) ptr
, size
);
3668 void _mesa_glsl_free (void * ptr
, yyscan_t yyscanner
)
3670 free( (char *) ptr
); /* see _mesa_glsl_realloc() for (char *) cast */
3673 #define YYTABLES_NAME "yytables"
3675 #line 421 "glsl_lexer.lpp"
3680 _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state
*state
, const char *string
)
3682 _mesa_glsl_lex_init_extra(state
,& state
->scanner
);
3683 _mesa_glsl__scan_string(string
,state
->scanner
);
3687 _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state
*state
)
3689 _mesa_glsl_lex_destroy(state
->scanner
);