5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
9 #define yy_create_buffer hlsl__create_buffer
10 #define yy_delete_buffer hlsl__delete_buffer
11 #define yy_flex_debug hlsl__flex_debug
12 #define yy_init_buffer hlsl__init_buffer
13 #define yy_flush_buffer hlsl__flush_buffer
14 #define yy_load_buffer_state hlsl__load_buffer_state
15 #define yy_switch_to_buffer hlsl__switch_to_buffer
17 #define yyleng hlsl_leng
18 #define yylex hlsl_lex
19 #define yylineno hlsl_lineno
20 #define yyout hlsl_out
21 #define yyrestart hlsl_restart
22 #define yytext hlsl_text
23 #define yywrap hlsl_wrap
24 #define yyalloc hlsl_alloc
25 #define yyrealloc hlsl_realloc
26 #define yyfree hlsl_free
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
36 /* First, we deal with platform-specific or compiler-specific issues. */
38 /* begin standard C headers. */
44 /* end standard C headers. */
46 /* flex integer type definitions */
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56 * if you want the limit (max/min) macros for int types.
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
63 typedef int8_t flex_int8_t
;
64 typedef uint8_t flex_uint8_t
;
65 typedef int16_t flex_int16_t
;
66 typedef uint16_t flex_uint16_t
;
67 typedef int32_t flex_int32_t
;
68 typedef uint32_t flex_uint32_t
;
70 typedef signed char flex_int8_t
;
71 typedef short int flex_int16_t
;
72 typedef int flex_int32_t
;
73 typedef unsigned char flex_uint8_t
;
74 typedef unsigned short int flex_uint16_t
;
75 typedef unsigned int flex_uint32_t
;
77 /* Limits of integral types. */
79 #define INT8_MIN (-128)
82 #define INT16_MIN (-32767-1)
85 #define INT32_MIN (-2147483647-1)
88 #define INT8_MAX (127)
91 #define INT16_MAX (32767)
94 #define INT32_MAX (2147483647)
97 #define UINT8_MAX (255U)
100 #define UINT16_MAX (65535U)
103 #define UINT32_MAX (4294967295U)
108 #endif /* ! FLEXINT_H */
112 /* The "const" storage-class-modifier is valid. */
115 #else /* ! __cplusplus */
117 /* C99 requires __STDC__ to be defined as 1. */
118 #if defined (__STDC__)
122 #endif /* defined (__STDC__) */
123 #endif /* ! __cplusplus */
126 #define yyconst const
131 /* Returned upon end-of-file. */
134 /* Promotes a possibly negative, possibly signed char to an unsigned
135 * integer for use as an array index. If the signed char is negative,
136 * we want to instead treat it as an 8-bit unsigned char, hence the
139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
141 /* Enter a start condition. This macro really ought to take a parameter,
142 * but we do it the disgusting crufty way forced on us by the ()-less
143 * definition of BEGIN.
145 #define BEGIN (yy_start) = 1 + 2 *
147 /* Translate the current start state into a value that can be later handed
148 * to BEGIN to return to the state. The YYSTATE alias is for lex
151 #define YY_START (((yy_start) - 1) / 2)
152 #define YYSTATE YY_START
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE hlsl_restart(hlsl_in )
160 #define YY_END_OF_BUFFER_CHAR 0
162 /* Size of default input buffer. */
165 /* On IA-64, the buffer size is 16k, not 8k.
166 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
167 * Ditto for the __ia64__ case accordingly.
169 #define YY_BUF_SIZE 32768
171 #define YY_BUF_SIZE 16384
172 #endif /* __ia64__ */
175 /* The state buf must be large enough to hold one state per character in the main buffer.
177 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
180 #define YY_TYPEDEF_YY_BUFFER_STATE
181 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
184 extern int hlsl_leng
;
186 extern FILE *hlsl_in
, *hlsl_out
;
188 #define EOB_ACT_CONTINUE_SCAN 0
189 #define EOB_ACT_END_OF_FILE 1
190 #define EOB_ACT_LAST_MATCH 2
192 #define YY_LESS_LINENO(n)
194 /* Return all but the first "n" matched characters back to the input stream. */
198 /* Undo effects of setting up hlsl_text. */ \
199 int yyless_macro_arg = (n); \
200 YY_LESS_LINENO(yyless_macro_arg);\
201 *yy_cp = (yy_hold_char); \
202 YY_RESTORE_YY_MORE_OFFSET \
203 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
204 YY_DO_BEFORE_ACTION; /* set up hlsl_text again */ \
208 #define unput(c) yyunput( c, (yytext_ptr) )
210 #ifndef YY_TYPEDEF_YY_SIZE_T
211 #define YY_TYPEDEF_YY_SIZE_T
212 typedef size_t yy_size_t
;
215 #ifndef YY_STRUCT_YY_BUFFER_STATE
216 #define YY_STRUCT_YY_BUFFER_STATE
217 struct yy_buffer_state
221 char *yy_ch_buf
; /* input buffer */
222 char *yy_buf_pos
; /* current position in input buffer */
224 /* Size of input buffer in bytes, not including room for EOB
227 yy_size_t yy_buf_size
;
229 /* Number of characters read into yy_ch_buf, not including EOB
234 /* Whether we "own" the buffer - i.e., we know we created it,
235 * and can realloc() it to grow it, and should free() it to
238 int yy_is_our_buffer
;
240 /* Whether this is an "interactive" input source; if so, and
241 * if we're using stdio for input, then we want to use getc()
242 * instead of fread(), to make sure we stop fetching input after
245 int yy_is_interactive
;
247 /* Whether we're considered to be at the beginning of a line.
248 * If so, '^' rules will be active on the next match, otherwise
253 int yy_bs_lineno
; /**< The line count. */
254 int yy_bs_column
; /**< The column count. */
256 /* Whether to try to fill the input buffer when we reach the
261 int yy_buffer_status
;
263 #define YY_BUFFER_NEW 0
264 #define YY_BUFFER_NORMAL 1
265 /* When an EOF's been seen but there's still some text to process
266 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
267 * shouldn't try reading from the input source any more. We might
268 * still have a bunch of tokens to match, though, because of
269 * possible backing-up.
271 * When we actually see the EOF, we change the status to "new"
272 * (via hlsl_restart()), so that the user can continue scanning by
273 * just pointing hlsl_in at a new input file.
275 #define YY_BUFFER_EOF_PENDING 2
278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
280 /* Stack of input buffers. */
281 static size_t yy_buffer_stack_top
= 0; /**< index of top of stack. */
282 static size_t yy_buffer_stack_max
= 0; /**< capacity of stack. */
283 static YY_BUFFER_STATE
* yy_buffer_stack
= 0; /**< Stack as an array. */
285 /* We provide macros for accessing buffer states in case in the
286 * future we want to put the buffer states in a more general
289 * Returns the top of the stack, or NULL.
291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
292 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
295 /* Same as previous macro, but useful when we know that the buffer stack is not
296 * NULL or when we need an lvalue. For internal use only.
298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
300 /* yy_hold_char holds the character lost when hlsl_text is formed. */
301 static char yy_hold_char
;
302 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
305 /* Points to current character in buffer. */
306 static char *yy_c_buf_p
= (char *) 0;
307 static int yy_init
= 0; /* whether we need to initialize */
308 static int yy_start
= 0; /* start state number */
310 /* Flag which is used to allow hlsl_wrap()'s to do buffer switches
311 * instead of setting up a fresh hlsl_in. A bit of a hack ...
313 static int yy_did_buffer_switch_on_eof
;
315 void hlsl_restart (FILE *input_file
);
316 void hlsl__switch_to_buffer (YY_BUFFER_STATE new_buffer
);
317 YY_BUFFER_STATE
hlsl__create_buffer (FILE *file
,int size
);
318 void hlsl__delete_buffer (YY_BUFFER_STATE b
);
319 void hlsl__flush_buffer (YY_BUFFER_STATE b
);
320 void hlsl_push_buffer_state (YY_BUFFER_STATE new_buffer
);
321 void hlsl_pop_buffer_state (void );
323 static void hlsl_ensure_buffer_stack (void );
324 static void hlsl__load_buffer_state (void );
325 static void hlsl__init_buffer (YY_BUFFER_STATE b
,FILE *file
);
327 #define YY_FLUSH_BUFFER hlsl__flush_buffer(YY_CURRENT_BUFFER )
329 YY_BUFFER_STATE
hlsl__scan_buffer (char *base
,yy_size_t size
);
330 YY_BUFFER_STATE
hlsl__scan_string (yyconst
char *yy_str
);
331 YY_BUFFER_STATE
hlsl__scan_bytes (yyconst
char *bytes
,int len
);
333 void *hlsl_alloc (yy_size_t
);
334 void *hlsl_realloc (void *,yy_size_t
);
335 void hlsl_free (void * );
337 #define yy_new_buffer hlsl__create_buffer
339 #define yy_set_interactive(is_interactive) \
341 if ( ! YY_CURRENT_BUFFER ){ \
342 hlsl_ensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 hlsl__create_buffer(hlsl_in,YY_BUF_SIZE ); \
346 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
349 #define yy_set_bol(at_bol) \
351 if ( ! YY_CURRENT_BUFFER ){\
352 hlsl_ensure_buffer_stack (); \
353 YY_CURRENT_BUFFER_LVALUE = \
354 hlsl__create_buffer(hlsl_in,YY_BUF_SIZE ); \
356 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
361 /* Begin user sect3 */
363 #define hlsl_wrap() 1
364 #define YY_SKIP_YYWRAP
366 typedef unsigned char YY_CHAR
;
368 FILE *hlsl_in
= (FILE *) 0, *hlsl_out
= (FILE *) 0;
370 typedef int yy_state_type
;
372 extern int hlsl_lineno
;
376 extern char *hlsl_text
;
377 #define yytext_ptr hlsl_text
379 static yy_state_type
yy_get_previous_state (void );
380 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
);
381 static int yy_get_next_buffer (void );
382 static void yy_fatal_error (yyconst
char msg
[] );
384 /* Done after the current pattern has been matched and before the
385 * corresponding action - sets up hlsl_text.
387 #define YY_DO_BEFORE_ACTION \
388 (yytext_ptr) = yy_bp; \
389 hlsl_leng = (size_t) (yy_cp - yy_bp); \
390 (yy_hold_char) = *yy_cp; \
392 (yy_c_buf_p) = yy_cp;
394 #define YY_NUM_RULES 125
395 #define YY_END_OF_BUFFER 126
396 /* This struct is not used in this scanner,
397 but its presence is necessary. */
400 flex_int32_t yy_verify
;
403 static yyconst flex_int16_t yy_accept
[717] =
405 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
406 126, 124, 108, 109, 124, 124, 124, 124, 124, 124,
407 124, 124, 124, 124, 106, 106, 124, 124, 124, 124,
408 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
409 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
410 100, 100, 100, 100, 100, 100, 100, 100, 124, 110,
411 93, 123, 122, 123, 116, 123, 125, 118, 119, 125,
412 125, 115, 114, 115, 115, 121, 120, 121, 108, 109,
413 85, 94, 95, 90, 75, 91, 88, 73, 86, 74,
414 87, 97, 0, 101, 107, 89, 102, 105, 106, 0,
416 103, 0, 96, 78, 83, 77, 84, 80, 100, 100,
417 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
418 100, 100, 100, 100, 100, 100, 100, 100, 15, 100,
419 100, 100, 100, 100, 100, 100, 100, 100, 23, 24,
420 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
421 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
422 100, 100, 100, 100, 100, 100, 100, 100, 100, 92,
423 76, 122, 116, 0, 118, 119, 0, 117, 114, 0,
424 120, 82, 0, 101, 107, 0, 102, 0, 0, 104,
425 79, 81, 100, 100, 100, 100, 100, 100, 100, 100,
427 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
428 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
429 100, 100, 20, 100, 100, 100, 100, 100, 100, 100,
430 100, 100, 2, 100, 100, 30, 100, 100, 100, 100,
431 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
432 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
433 3, 100, 100, 100, 100, 100, 100, 100, 100, 100,
434 0, 0, 0, 101, 0, 102, 100, 100, 100, 100,
435 100, 100, 100, 100, 100, 100, 1, 100, 100, 100,
436 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
438 17, 100, 100, 100, 100, 100, 100, 100, 100, 100,
439 100, 100, 100, 31, 100, 100, 100, 100, 100, 100,
440 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
441 100, 100, 100, 100, 100, 100, 65, 100, 100, 100,
442 100, 100, 100, 100, 70, 100, 100, 0, 0, 100,
443 100, 100, 100, 100, 100, 100, 100, 100, 100, 6,
444 100, 100, 100, 10, 100, 100, 100, 100, 100, 100,
445 100, 100, 19, 100, 100, 100, 26, 100, 100, 100,
446 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
447 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
449 100, 100, 100, 100, 100, 100, 4, 100, 100, 100,
450 100, 72, 0, 0, 100, 7, 100, 100, 100, 100,
451 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
452 100, 16, 100, 100, 18, 100, 25, 27, 100, 100,
453 100, 100, 100, 100, 100, 100, 100, 36, 100, 100,
454 45, 100, 48, 49, 50, 51, 100, 100, 100, 100,
455 100, 100, 100, 100, 68, 100, 100, 0, 0, 100,
456 100, 100, 100, 100, 100, 100, 100, 100, 8, 100,
457 9, 100, 100, 14, 100, 100, 100, 100, 100, 100,
458 33, 100, 100, 100, 100, 38, 100, 100, 52, 100,
460 100, 55, 66, 100, 67, 100, 100, 111, 0, 100,
461 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
462 100, 100, 11, 100, 100, 100, 100, 100, 37, 100,
463 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
464 100, 100, 100, 71, 0, 100, 100, 100, 100, 100,
465 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
466 28, 100, 100, 99, 39, 40, 41, 100, 100, 100,
467 100, 53, 56, 58, 62, 100, 0, 5, 100, 100,
468 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
469 100, 100, 100, 100, 100, 100, 46, 100, 100, 100,
471 0, 100, 100, 32, 100, 100, 100, 100, 100, 60,
472 100, 100, 100, 100, 22, 100, 100, 42, 100, 100,
473 54, 64, 0, 100, 100, 100, 100, 100, 100, 100,
474 100, 100, 69, 98, 100, 100, 100, 100, 0, 0,
475 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
476 100, 100, 43, 100, 0, 0, 0, 100, 100, 21,
477 100, 100, 100, 57, 59, 100, 63, 100, 100, 100,
478 0, 0, 100, 100, 34, 100, 100, 100, 29, 100,
479 100, 0, 0, 100, 13, 35, 100, 61, 47, 0,
480 0, 12, 100, 0, 0, 100, 0, 0, 100, 0,
482 0, 100, 0, 0, 100, 0, 0, 44, 0, 0,
486 static yyconst flex_int32_t yy_ec
[256] =
488 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
489 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
490 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
491 1, 2, 5, 6, 7, 1, 8, 9, 1, 10,
492 11, 12, 13, 1, 14, 15, 16, 17, 18, 19,
493 20, 21, 21, 21, 21, 22, 22, 23, 1, 24,
494 25, 26, 1, 27, 28, 29, 30, 31, 32, 33,
495 34, 35, 36, 36, 36, 36, 37, 36, 36, 38,
496 36, 39, 40, 41, 42, 43, 36, 36, 36, 36,
497 1, 1, 1, 1, 44, 1, 45, 46, 47, 48,
499 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
500 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
501 69, 70, 1, 71, 1, 1, 1, 1, 1, 1,
502 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
503 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
504 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
507 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
508 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
510 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
511 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
512 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
513 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
514 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
518 static yyconst flex_int32_t yy_meta
[72] =
520 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
521 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
522 3, 3, 1, 1, 1, 1, 1, 3, 3, 3,
523 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,
524 4, 4, 4, 4, 3, 3, 3, 3, 3, 3,
525 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
526 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
530 static yyconst flex_int16_t yy_base
[725] =
532 0, 65, 74, 80, 83, 101, 70, 72, 76, 78,
533 938, 939, 935, 939, 933, 910, 81, 909, 97, 908,
534 96, 98, 96, 94, 126, 118, 909, 101, 906, 102,
535 0, 64, 881, 880, 875, 104, 882, 877, 876, 859,
536 861, 110, 101, 109, 112, 120, 114, 863, 86, 136,
537 103, 128, 93, 135, 152, 126, 147, 869, 158, 184,
538 895, 939, 939, 916, 198, 856, 939, 915, 939, 913,
539 909, 939, 939, 911, 868, 939, 939, 909, 909, 939,
540 939, 939, 939, 939, 939, 939, 939, 939, 939, 939,
541 939, 939, 895, 213, 0, 939, 268, 841, 0, 236,
543 939, 0, 939, 883, 939, 939, 939, 882, 0, 857,
544 855, 844, 844, 834, 838, 842, 842, 830, 835, 832,
545 846, 144, 829, 848, 847, 166, 153, 828, 825, 831,
546 825, 822, 176, 830, 823, 831, 819, 823, 0, 154,
547 823, 816, 815, 821, 810, 823, 826, 810, 810, 188,
548 826, 174, 804, 813, 167, 191, 198, 816, 803, 212,
549 211, 201, 807, 214, 813, 818, 802, 215, 810, 939,
550 939, 939, 274, 817, 859, 939, 854, 939, 939, 812,
551 939, 939, 291, 939, 0, 308, 939, 314, 323, 0,
552 939, 939, 800, 807, 792, 798, 805, 789, 804, 791,
554 786, 785, 789, 802, 797, 798, 794, 781, 779, 776,
555 780, 188, 794, 789, 790, 790, 790, 785, 776, 776,
556 782, 767, 0, 780, 769, 762, 773, 760, 773, 761,
557 777, 772, 0, 762, 757, 0, 755, 770, 750, 751,
558 758, 760, 754, 746, 766, 749, 746, 745, 748, 756,
559 740, 249, 739, 752, 749, 740, 735, 735, 738, 747,
560 0, 746, 222, 741, 735, 728, 727, 742, 744, 732,
561 736, 731, 329, 378, 342, 433, 737, 735, 731, 733,
562 725, 731, 730, 722, 712, 727, 0, 720, 722, 723,
563 709, 714, 717, 705, 715, 702, 702, 720, 708, 706,
565 0, 709, 699, 711, 701, 698, 699, 692, 702, 708,
566 690, 688, 706, 0, 697, 704, 699, 694, 683, 681,
567 682, 686, 686, 692, 676, 690, 679, 225, 679, 689,
568 688, 684, 675, 676, 666, 663, 0, 249, 670, 670,
569 676, 675, 666, 659, 0, 659, 673, 664, 676, 679,
570 656, 677, 652, 675, 652, 651, 663, 649, 642, 0,
571 660, 650, 651, 662, 647, 648, 654, 640, 652, 647,
572 652, 640, 0, 649, 633, 646, 0, 626, 637, 632,
573 642, 626, 626, 624, 640, 639, 621, 635, 625, 637,
574 632, 632, 631, 628, 631, 629, 624, 610, 621, 623,
576 618, 625, 607, 619, 622, 604, 0, 607, 602, 618,
577 609, 0, 616, 603, 595, 0, 594, 595, 604, 602,
578 613, 591, 603, 611, 588, 605, 599, 600, 581, 581,
579 596, 0, 596, 589, 0, 589, 0, 0, 591, 594,
580 576, 578, 587, 586, 570, 584, 570, 0, 577, 568,
581 0, 573, 584, 0, 0, 0, 565, 565, 561, 575,
582 573, 565, 564, 571, 0, 563, 562, 615, 571, 570,
583 565, 544, 567, 541, 565, 579, 334, 556, 0, 550,
584 0, 561, 556, 0, 560, 539, 557, 554, 540, 537,
585 0, 549, 535, 536, 536, 347, 535, 546, 0, 527,
587 542, 350, 0, 541, 0, 541, 539, 585, 522, 521,
588 526, 543, 534, 532, 518, 520, 547, 546, 545, 530,
589 529, 510, 0, 525, 509, 521, 510, 520, 0, 505,
590 504, 534, 533, 532, 520, 498, 513, 514, 509, 526,
591 525, 524, 512, 0, 491, 503, 504, 498, 500, 486,
592 496, 489, 517, 278, 516, 495, 488, 477, 495, 490,
593 0, 482, 488, 0, 0, 0, 0, 507, 471, 479,
594 470, 514, 0, 0, 0, 502, 475, 0, 450, 457,
595 439, 460, 450, 438, 435, 434, 455, 432, 444, 433,
596 428, 442, 444, 424, 455, 441, 440, 418, 464, 448,
598 411, 422, 429, 0, 412, 411, 429, 411, 410, 443,
599 408, 407, 405, 401, 0, 400, 419, 0, 398, 398,
600 0, 0, 273, 236, 411, 414, 415, 395, 411, 403,
601 385, 401, 0, 0, 392, 397, 394, 378, 314, 355,
602 377, 387, 377, 374, 384, 383, 366, 365, 371, 363,
603 370, 382, 0, 381, 369, 366, 365, 378, 373, 0,
604 372, 371, 356, 0, 0, 373, 0, 357, 351, 348,
605 354, 342, 344, 340, 0, 339, 346, 335, 0, 339,
606 352, 328, 346, 340, 0, 0, 329, 0, 0, 329,
607 327, 0, 93, 134, 160, 164, 195, 190, 237, 241,
609 240, 255, 278, 275, 289, 301, 370, 0, 315, 374,
610 939, 316, 377, 381, 939, 939, 504, 508, 512, 516,
614 static yyconst flex_int16_t yy_def
[725] =
616 716, 1, 717, 717, 718, 718, 719, 719, 720, 720,
617 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
618 716, 716, 716, 716, 716, 25, 716, 716, 716, 716,
619 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
620 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
621 721, 721, 721, 721, 721, 721, 721, 721, 716, 716,
622 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
623 722, 716, 716, 716, 716, 716, 716, 716, 716, 716,
624 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
625 716, 716, 716, 716, 723, 716, 716, 25, 26, 716,
627 716, 724, 716, 716, 716, 716, 716, 716, 721, 721,
628 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
629 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
630 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
631 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
632 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
633 721, 721, 721, 721, 721, 721, 721, 721, 721, 716,
634 716, 716, 716, 716, 716, 716, 722, 716, 716, 716,
635 716, 716, 716, 716, 723, 716, 716, 716, 716, 724,
636 716, 716, 721, 721, 721, 721, 721, 721, 721, 721,
638 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
639 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
640 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
641 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
642 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
643 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
644 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
645 716, 716, 716, 716, 716, 716, 721, 721, 721, 721,
646 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
647 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
649 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
650 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
651 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
652 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
653 721, 721, 721, 721, 721, 721, 721, 716, 716, 721,
654 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
655 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
656 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
657 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
658 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
660 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
661 721, 721, 716, 716, 721, 721, 721, 721, 721, 721,
662 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
663 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
664 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
665 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
666 721, 721, 721, 721, 721, 721, 721, 716, 716, 721,
667 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
668 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
669 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
671 721, 721, 721, 721, 721, 721, 721, 716, 716, 721,
672 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
673 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
674 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
675 721, 721, 721, 721, 716, 721, 721, 721, 721, 721,
676 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
677 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
678 721, 721, 721, 721, 721, 721, 716, 721, 721, 721,
679 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
680 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
682 716, 721, 721, 721, 721, 721, 721, 721, 721, 721,
683 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
684 721, 721, 716, 721, 721, 721, 721, 721, 721, 721,
685 721, 721, 721, 721, 721, 721, 721, 721, 716, 716,
686 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
687 721, 721, 721, 721, 716, 716, 716, 721, 721, 721,
688 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
689 716, 716, 721, 721, 721, 721, 721, 721, 721, 721,
690 721, 716, 716, 721, 721, 721, 721, 721, 721, 716,
691 716, 721, 721, 716, 716, 721, 716, 716, 721, 716,
693 716, 721, 716, 716, 721, 716, 716, 721, 716, 716,
694 716, 716, 716, 716, 716, 0, 716, 716, 716, 716,
698 static yyconst flex_int16_t yy_nxt
[1011] =
700 12, 13, 14, 15, 16, 12, 17, 18, 19, 12,
701 12, 20, 21, 22, 23, 24, 25, 26, 26, 26,
702 26, 26, 27, 28, 29, 30, 12, 31, 32, 31,
703 33, 31, 31, 34, 31, 31, 31, 35, 36, 37,
704 38, 31, 39, 31, 40, 41, 42, 43, 44, 45,
705 46, 31, 47, 31, 31, 48, 49, 50, 51, 52,
706 31, 53, 54, 55, 56, 57, 58, 31, 31, 31,
707 59, 60, 73, 74, 73, 74, 63, 64, 77, 78,
708 77, 78, 63, 64, 68, 69, 70, 82, 71, 61,
709 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
711 65, 65, 68, 69, 70, 85, 71, 83, 88, 95,
712 93, 90, 94, 94, 94, 94, 94, 94, 96, 110,
713 89, 86, 91, 92, 104, 105, 107, 108, 111, 75,
714 142, 75, 696, 66, 99, 99, 99, 99, 99, 66,
715 97, 152, 98, 98, 98, 98, 98, 99, 115, 127,
716 143, 153, 116, 128, 122, 123, 134, 100, 101, 129,
717 101, 124, 147, 139, 131, 125, 132, 148, 126, 130,
718 135, 140, 149, 136, 100, 101, 133, 101, 137, 154,
719 144, 138, 170, 164, 145, 716, 155, 156, 165, 150,
720 82, 697, 151, 102, 146, 166, 101, 159, 157, 167,
722 160, 158, 213, 161, 698, 168, 205, 206, 214, 227,
723 83, 247, 228, 162, 173, 173, 173, 173, 173, 173,
724 163, 210, 211, 212, 242, 248, 243, 699, 171, 94,
725 94, 94, 94, 94, 94, 220, 238, 244, 700, 221,
726 239, 249, 251, 701, 183, 184, 240, 184, 188, 188,
727 294, 295, 189, 189, 189, 189, 189, 189, 255, 252,
728 250, 183, 184, 258, 184, 260, 263, 268, 256, 261,
729 269, 339, 259, 395, 639, 641, 264, 396, 642, 257,
730 340, 702, 640, 184, 94, 94, 94, 94, 94, 94,
731 173, 173, 173, 173, 173, 173, 404, 703, 704, 186,
733 187, 329, 187, 273, 273, 586, 405, 274, 274, 274,
734 274, 274, 274, 330, 587, 639, 186, 187, 705, 187,
735 275, 275, 706, 640, 276, 276, 276, 276, 276, 276,
736 189, 189, 189, 189, 189, 189, 707, 708, 187, 189,
737 189, 189, 189, 189, 189, 274, 274, 274, 274, 274,
738 274, 517, 518, 519, 709, 101, 655, 101, 276, 276,
739 276, 276, 276, 276, 532, 533, 534, 540, 541, 542,
740 655, 710, 101, 712, 101, 710, 535, 713, 714, 543,
741 711, 190, 714, 695, 711, 694, 693, 715, 692, 691,
742 536, 715, 690, 101, 274, 274, 274, 274, 274, 274,
744 689, 656, 261, 688, 687, 686, 685, 684, 683, 682,
745 184, 681, 184, 680, 679, 656, 657, 678, 677, 676,
746 675, 674, 673, 672, 671, 670, 669, 184, 668, 184,
747 657, 667, 666, 665, 664, 663, 662, 661, 660, 659,
748 658, 654, 653, 652, 651, 650, 649, 648, 184, 276,
749 276, 276, 276, 276, 276, 647, 646, 645, 644, 643,
750 638, 637, 636, 635, 287, 187, 634, 187, 633, 632,
751 631, 630, 629, 628, 627, 626, 625, 624, 623, 622,
752 621, 261, 187, 620, 187, 619, 618, 617, 616, 615,
753 614, 613, 612, 611, 610, 609, 608, 607, 606, 605,
755 604, 603, 602, 187, 62, 62, 62, 62, 67, 67,
756 67, 67, 72, 72, 72, 72, 76, 76, 76, 76,
757 109, 109, 177, 177, 177, 177, 185, 601, 185, 185,
758 600, 599, 598, 597, 596, 595, 594, 593, 592, 591,
759 287, 590, 589, 588, 585, 584, 583, 582, 581, 580,
760 579, 578, 577, 576, 575, 574, 573, 572, 571, 570,
761 569, 568, 567, 566, 565, 564, 563, 233, 562, 561,
762 560, 559, 558, 557, 556, 555, 554, 553, 552, 551,
763 550, 549, 548, 547, 546, 545, 508, 544, 407, 407,
764 261, 539, 538, 537, 531, 530, 529, 528, 233, 527,
766 526, 525, 233, 524, 523, 522, 521, 520, 516, 515,
767 514, 513, 512, 511, 510, 509, 508, 507, 407, 506,
768 505, 504, 503, 502, 501, 500, 499, 498, 497, 496,
769 495, 494, 493, 492, 233, 491, 490, 489, 488, 233,
770 487, 486, 485, 484, 287, 483, 482, 481, 480, 479,
771 478, 477, 476, 475, 474, 473, 472, 471, 470, 469,
772 468, 467, 466, 465, 464, 463, 462, 461, 460, 459,
773 458, 457, 456, 455, 454, 453, 452, 261, 261, 451,
774 450, 449, 448, 447, 446, 233, 445, 444, 443, 442,
775 441, 440, 439, 438, 437, 436, 233, 435, 434, 433,
777 432, 431, 287, 430, 429, 428, 427, 426, 425, 424,
778 423, 422, 421, 420, 419, 418, 417, 416, 415, 414,
779 413, 412, 411, 410, 409, 407, 408, 407, 406, 261,
780 403, 402, 401, 400, 399, 398, 397, 394, 393, 261,
781 392, 391, 390, 389, 388, 387, 386, 385, 384, 383,
782 382, 381, 380, 379, 378, 377, 376, 375, 374, 373,
783 372, 371, 370, 369, 368, 367, 366, 365, 364, 363,
784 362, 287, 361, 287, 360, 359, 358, 357, 356, 355,
785 354, 353, 352, 351, 350, 349, 348, 347, 346, 345,
786 344, 343, 342, 341, 338, 337, 336, 261, 335, 334,
788 333, 332, 331, 328, 327, 326, 325, 324, 323, 322,
789 321, 320, 319, 318, 317, 316, 315, 314, 313, 312,
790 311, 310, 309, 233, 308, 307, 306, 233, 305, 304,
791 303, 302, 287, 301, 300, 299, 298, 297, 296, 293,
792 292, 291, 287, 290, 289, 287, 288, 287, 286, 285,
793 284, 283, 282, 281, 280, 279, 278, 277, 272, 178,
794 175, 271, 270, 267, 266, 265, 262, 254, 253, 246,
795 245, 241, 237, 236, 235, 234, 233, 232, 231, 230,
796 229, 226, 225, 224, 223, 222, 219, 218, 217, 216,
797 215, 209, 208, 207, 204, 203, 202, 201, 200, 199,
799 198, 197, 196, 195, 194, 193, 192, 191, 716, 182,
800 79, 181, 180, 179, 178, 176, 175, 174, 172, 106,
801 169, 141, 121, 120, 119, 118, 117, 114, 113, 112,
802 106, 103, 87, 84, 81, 80, 79, 716, 11, 716,
803 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
804 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
805 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
806 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
807 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
808 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
810 716, 716, 716, 716, 716, 716, 716, 716, 716, 716
813 static yyconst flex_int16_t yy_chk
[1011] =
815 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
816 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
817 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
818 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
819 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
820 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
821 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
822 1, 2, 7, 7, 8, 8, 3, 3, 9, 9,
823 10, 10, 4, 4, 5, 5, 5, 17, 5, 2,
824 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
826 4, 4, 6, 6, 6, 19, 6, 17, 21, 24,
827 23, 22, 23, 23, 23, 23, 23, 23, 24, 32,
828 21, 19, 22, 22, 28, 28, 30, 30, 32, 7,
829 49, 8, 693, 3, 26, 26, 26, 26, 26, 4,
830 25, 53, 25, 25, 25, 25, 25, 25, 36, 43,
831 49, 53, 36, 43, 42, 42, 45, 25, 25, 43,
832 25, 42, 51, 47, 44, 42, 44, 51, 42, 43,
833 45, 47, 52, 45, 25, 25, 44, 25, 46, 54,
834 50, 46, 59, 56, 50, 26, 54, 54, 56, 52,
835 60, 694, 52, 25, 50, 57, 25, 55, 54, 57,
837 55, 54, 127, 55, 695, 57, 122, 122, 127, 140,
838 60, 155, 140, 55, 65, 65, 65, 65, 65, 65,
839 55, 126, 126, 126, 152, 155, 152, 696, 59, 94,
840 94, 94, 94, 94, 94, 133, 150, 152, 697, 133,
841 150, 156, 157, 698, 94, 94, 150, 94, 100, 100,
842 212, 212, 100, 100, 100, 100, 100, 100, 160, 157,
843 156, 94, 94, 161, 94, 162, 164, 168, 160, 162,
844 168, 263, 161, 328, 623, 624, 164, 328, 624, 160,
845 263, 699, 623, 94, 97, 97, 97, 97, 97, 97,
846 173, 173, 173, 173, 173, 173, 338, 700, 701, 97,
848 97, 252, 97, 183, 183, 554, 338, 183, 183, 183,
849 183, 183, 183, 252, 554, 639, 97, 97, 702, 97,
850 186, 186, 703, 639, 186, 186, 186, 186, 186, 186,
851 188, 188, 188, 188, 188, 188, 704, 705, 97, 189,
852 189, 189, 189, 189, 189, 273, 273, 273, 273, 273,
853 273, 477, 477, 477, 706, 189, 640, 189, 275, 275,
854 275, 275, 275, 275, 496, 496, 496, 502, 502, 502,
855 655, 707, 189, 709, 189, 710, 496, 712, 713, 502,
856 707, 724, 714, 691, 710, 690, 687, 713, 684, 683,
857 496, 714, 682, 189, 274, 274, 274, 274, 274, 274,
859 681, 640, 680, 678, 677, 676, 674, 673, 672, 671,
860 274, 670, 274, 669, 668, 655, 640, 666, 663, 662,
861 661, 659, 658, 657, 656, 654, 652, 274, 651, 274,
862 655, 650, 649, 648, 647, 646, 645, 644, 643, 642,
863 641, 638, 637, 636, 635, 632, 631, 630, 274, 276,
864 276, 276, 276, 276, 276, 629, 628, 627, 626, 625,
865 620, 619, 617, 616, 614, 276, 613, 276, 612, 611,
866 610, 609, 608, 607, 606, 605, 603, 602, 601, 600,
867 599, 598, 276, 597, 276, 596, 595, 594, 593, 592,
868 591, 590, 589, 588, 587, 586, 585, 584, 583, 582,
870 581, 580, 579, 276, 717, 717, 717, 717, 718, 718,
871 718, 718, 719, 719, 719, 719, 720, 720, 720, 720,
872 721, 721, 722, 722, 722, 722, 723, 577, 723, 723,
873 576, 572, 571, 570, 569, 568, 563, 562, 560, 559,
874 558, 557, 556, 555, 553, 552, 551, 550, 549, 548,
875 547, 546, 545, 543, 542, 541, 540, 539, 538, 537,
876 536, 535, 534, 533, 532, 531, 530, 528, 527, 526,
877 525, 524, 522, 521, 520, 519, 518, 517, 516, 515,
878 514, 513, 512, 511, 510, 509, 508, 507, 506, 504,
879 501, 500, 498, 497, 495, 494, 493, 492, 490, 489,
881 488, 487, 486, 485, 483, 482, 480, 478, 476, 475,
882 474, 473, 472, 471, 470, 469, 468, 467, 466, 464,
883 463, 462, 461, 460, 459, 458, 457, 453, 452, 450,
884 449, 447, 446, 445, 444, 443, 442, 441, 440, 439,
885 436, 434, 433, 431, 430, 429, 428, 427, 426, 425,
886 424, 423, 422, 421, 420, 419, 418, 417, 415, 414,
887 413, 411, 410, 409, 408, 406, 405, 404, 403, 402,
888 401, 400, 399, 398, 397, 396, 395, 394, 393, 392,
889 391, 390, 389, 388, 387, 386, 385, 384, 383, 382,
890 381, 380, 379, 378, 376, 375, 374, 372, 371, 370,
892 369, 368, 367, 366, 365, 364, 363, 362, 361, 359,
893 358, 357, 356, 355, 354, 353, 352, 351, 350, 349,
894 348, 347, 346, 344, 343, 342, 341, 340, 339, 336,
895 335, 334, 333, 332, 331, 330, 329, 327, 326, 325,
896 324, 323, 322, 321, 320, 319, 318, 317, 316, 315,
897 313, 312, 311, 310, 309, 308, 307, 306, 305, 304,
898 303, 302, 300, 299, 298, 297, 296, 295, 294, 293,
899 292, 291, 290, 289, 288, 286, 285, 284, 283, 282,
900 281, 280, 279, 278, 277, 272, 271, 270, 269, 268,
901 267, 266, 265, 264, 262, 260, 259, 258, 257, 256,
903 255, 254, 253, 251, 250, 249, 248, 247, 246, 245,
904 244, 243, 242, 241, 240, 239, 238, 237, 235, 234,
905 232, 231, 230, 229, 228, 227, 226, 225, 224, 222,
906 221, 220, 219, 218, 217, 216, 215, 214, 213, 211,
907 210, 209, 208, 207, 206, 205, 204, 203, 202, 201,
908 200, 199, 198, 197, 196, 195, 194, 193, 180, 177,
909 175, 174, 169, 167, 166, 165, 163, 159, 158, 154,
910 153, 151, 149, 148, 147, 146, 145, 144, 143, 142,
911 141, 138, 137, 136, 135, 134, 132, 131, 130, 129,
912 128, 125, 124, 123, 121, 120, 119, 118, 117, 116,
914 115, 114, 113, 112, 111, 110, 108, 104, 98, 93,
915 79, 78, 75, 74, 71, 70, 68, 66, 64, 61,
916 58, 48, 41, 40, 39, 38, 37, 35, 34, 33,
917 29, 27, 20, 18, 16, 15, 13, 11, 716, 716,
918 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
919 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
920 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
921 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
922 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
923 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
925 716, 716, 716, 716, 716, 716, 716, 716, 716, 716
928 static yy_state_type yy_last_accepting_state
;
929 static char *yy_last_accepting_cpos
;
931 extern int hlsl__flex_debug
;
932 int hlsl__flex_debug
= 0;
934 /* The intent behind this definition is that it'll catch
935 * any uses of REJECT which flex missed.
937 #define REJECT reject_used_but_not_detected
938 #define yymore() yymore_used_but_not_detected
939 #define YY_MORE_ADJ 0
940 #define YY_RESTORE_YY_MORE_OFFSET
946 * Copyright 2008 Stefan Dösinger
947 * Copyright 2012 Matteo Bruni for CodeWeavers
949 * This library is free software; you can redistribute it and/or
950 * modify it under the terms of the GNU Lesser General Public
951 * License as published by the Free Software Foundation; either
952 * version 2.1 of the License, or (at your option) any later version.
954 * This library is distributed in the hope that it will be useful,
955 * but WITHOUT ANY WARRANTY; without even the implied warranty of
956 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
957 * Lesser General Public License for more details.
959 * You should have received a copy of the GNU Lesser General Public
960 * License along with this library; if not, write to the Free Software
961 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
965 #include "wine/port.h"
966 #include "wine/debug.h"
968 #define YY_NO_UNISTD_H
969 #include "d3dcompiler_private.h"
970 #include "hlsl.tab.h"
972 WINE_DEFAULT_DEBUG_CHANNEL(hlsl_parser
);
974 #define YY_USER_ACTION \
976 hlsl_lloc.first_column = hlsl_ctx.column; \
977 hlsl_lloc.first_line = hlsl_ctx.line_no; \
978 hlsl_ctx.column += hlsl_leng; \
981 #define YY_NO_INPUT 1
983 #line 984 "hlsl.yy.c"
991 #ifndef YY_NO_UNISTD_H
992 /* Special case for "unistd.h", since it is non-ANSI. We include it way
993 * down here because we want the user's section 1 to have been scanned first.
994 * The user has a chance to override it with an option.
999 #ifndef YY_EXTRA_TYPE
1000 #define YY_EXTRA_TYPE void *
1003 static int yy_init_globals (void );
1005 /* Accessor methods to globals.
1006 These are made visible to non-reentrant scanners for convenience. */
1008 int hlsl_lex_destroy (void );
1010 int hlsl_get_debug (void );
1012 void hlsl_set_debug (int debug_flag
);
1014 YY_EXTRA_TYPE
hlsl_get_extra (void );
1016 void hlsl_set_extra (YY_EXTRA_TYPE user_defined
);
1018 FILE *hlsl_get_in (void );
1020 void hlsl_set_in (FILE * in_str
);
1022 FILE *hlsl_get_out (void );
1024 void hlsl_set_out (FILE * out_str
);
1026 int hlsl_get_leng (void );
1028 char *hlsl_get_text (void );
1030 int hlsl_get_lineno (void );
1032 void hlsl_set_lineno (int line_number
);
1034 /* Macros after this point can all be overridden by user definitions in
1038 #ifndef YY_SKIP_YYWRAP
1040 extern "C" int hlsl_wrap (void );
1042 extern int hlsl_wrap (void );
1047 static void yy_flex_strncpy (char *,yyconst
char *,int );
1050 #ifdef YY_NEED_STRLEN
1051 static int yy_flex_strlen (yyconst
char * );
1057 static int yyinput (void );
1059 static int input (void );
1064 /* Amount of stuff to slurp up with each read. */
1065 #ifndef YY_READ_BUF_SIZE
1067 /* On IA-64, the buffer size is 16k, not 8k */
1068 #define YY_READ_BUF_SIZE 16384
1070 #define YY_READ_BUF_SIZE 8192
1071 #endif /* __ia64__ */
1074 /* Copy whatever the last rule matched to the standard output. */
1076 /* This used to be an fputs(), but since the string might contain NUL's,
1077 * we now use fwrite().
1079 #define ECHO do { if (fwrite( hlsl_text, hlsl_leng, 1, hlsl_out )) {} } while (0)
1082 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1083 * is returned in "result".
1086 #define YY_INPUT(buf,result,max_size) \
1087 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1091 for ( n = 0; n < max_size && \
1092 (c = getc( hlsl_in )) != EOF && c != '\n'; ++n ) \
1093 buf[n] = (char) c; \
1095 buf[n++] = (char) c; \
1096 if ( c == EOF && ferror( hlsl_in ) ) \
1097 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1103 while ( (result = fread(buf, 1, max_size, hlsl_in))==0 && ferror(hlsl_in)) \
1105 if( errno != EINTR) \
1107 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1111 clearerr(hlsl_in); \
1118 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1119 * we don't want an extra ';' after the "return" because that will cause
1120 * some compilers to complain about unreachable statements.
1123 #define yyterminate() return YY_NULL
1126 /* Number of entries by which start-condition stack grows. */
1127 #ifndef YY_START_STACK_INCR
1128 #define YY_START_STACK_INCR 25
1131 /* Report a fatal error. */
1132 #ifndef YY_FATAL_ERROR
1133 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1136 /* end tables serialization structures and prototypes */
1138 /* Default declaration of generated scanner - a define so the user can
1139 * easily add parameters.
1142 #define YY_DECL_IS_OURS 1
1144 extern int hlsl_lex (void);
1146 #define YY_DECL int hlsl_lex (void)
1147 #endif /* !YY_DECL */
1149 /* Code executed at the beginning of each rule, after hlsl_text and hlsl_leng
1152 #ifndef YY_USER_ACTION
1153 #define YY_USER_ACTION
1156 /* Code executed at the end of each rule. */
1158 #define YY_BREAK break;
1161 #define YY_RULE_SETUP \
1162 if ( hlsl_leng > 0 ) \
1163 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1164 (hlsl_text[hlsl_leng - 1] == '\n'); \
1167 /** The main scanner function which does all the work.
1171 register yy_state_type yy_current_state
;
1172 register char *yy_cp
, *yy_bp
;
1173 register int yy_act
;
1177 #line 1178 "hlsl.yy.c"
1188 (yy_start
) = 1; /* first start state */
1196 if ( ! YY_CURRENT_BUFFER
) {
1197 hlsl_ensure_buffer_stack ();
1198 YY_CURRENT_BUFFER_LVALUE
=
1199 hlsl__create_buffer(hlsl_in
,YY_BUF_SIZE
);
1202 hlsl__load_buffer_state( );
1205 while ( 1 ) /* loops until end-of-file is reached */
1207 yy_cp
= (yy_c_buf_p
);
1209 /* Support of hlsl_text. */
1210 *yy_cp
= (yy_hold_char
);
1212 /* yy_bp points to the position in yy_ch_buf of the start of
1217 yy_current_state
= (yy_start
);
1218 yy_current_state
+= YY_AT_BOL();
1222 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1223 if ( yy_accept
[yy_current_state
] )
1225 (yy_last_accepting_state
) = yy_current_state
;
1226 (yy_last_accepting_cpos
) = yy_cp
;
1228 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1230 yy_current_state
= (int) yy_def
[yy_current_state
];
1231 if ( yy_current_state
>= 717 )
1232 yy_c
= yy_meta
[(unsigned int) yy_c
];
1234 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1237 while ( yy_current_state
!= 716 );
1238 yy_cp
= (yy_last_accepting_cpos
);
1239 yy_current_state
= (yy_last_accepting_state
);
1242 yy_act
= yy_accept
[yy_current_state
];
1244 YY_DO_BEFORE_ACTION
;
1246 do_action
: /* This label is used only to access EOF actions. */
1249 { /* beginning of action switch */
1250 case 0: /* must back up */
1251 /* undo the effects of YY_DO_BEFORE_ACTION */
1252 *yy_cp
= (yy_hold_char
);
1253 yy_cp
= (yy_last_accepting_cpos
);
1254 yy_current_state
= (yy_last_accepting_state
);
1255 goto yy_find_action
;
1261 hlsl_message("Line %u: Reserved keyword \"%s\" used.\n", hlsl_ctx
.line_no
, hlsl_text
);
1262 set_parse_status(&hlsl_ctx
.status
, PARSE_ERR
);
1269 hlsl_message("Line %u: Reserved keyword \"%s\" used.\n", hlsl_ctx
.line_no
, hlsl_text
);
1270 set_parse_status(&hlsl_ctx
.status
, PARSE_ERR
);
1277 hlsl_message("Line %u: Reserved keyword \"%s\" used.\n", hlsl_ctx
.line_no
, hlsl_text
);
1278 set_parse_status(&hlsl_ctx
.status
, PARSE_ERR
);
1285 hlsl_message("Line %u: Reserved keyword \"%s\" used.\n", hlsl_ctx
.line_no
, hlsl_text
);
1286 set_parse_status(&hlsl_ctx
.status
, PARSE_ERR
);
1292 {return KW_BLENDSTATE
; }
1302 {return KW_BUFFER
; }
1307 {return KW_CBUFFER
; }
1312 {return KW_COMPILE
; }
1322 {return KW_CONTINUE
; }
1327 {return KW_DEPTHSTENCILSTATE
; }
1332 {return KW_DEPTHSTENCILVIEW
; }
1337 {return KW_DISCARD
; }
1347 {return KW_DOUBLE
; }
1357 {return KW_EXTERN
; }
1372 {return KW_GEOMETRYSHADER
; }
1377 {return KW_GROUPSHARED
; }
1392 {return KW_INLINE
; }
1402 {return KW_MATRIX
; }
1407 {return KW_NAMESPACE
; }
1412 {return KW_NOINTERPOLATION
; }
1427 {return KW_PIXELSHADER
; }
1432 {return KW_PRECISE
; }
1437 {return KW_RASTERIZERSTATE
; }
1442 {return KW_RENDERTARGETVIEW
; }
1447 {return KW_RETURN
; }
1452 {return KW_REGISTER
; }
1457 {return KW_SAMPLER
; }
1462 {return KW_SAMPLER1D
; }
1467 {return KW_SAMPLER2D
; }
1472 {return KW_SAMPLER3D
; }
1477 {return KW_SAMPLERCUBE
; }
1482 {return KW_SAMPLER_STATE
; }
1487 {return KW_SAMPLERCOMPARISONSTATE
;}
1492 {return KW_SHARED
; }
1497 {return KW_STATEBLOCK
; }
1502 {return KW_STATEBLOCK_STATE
; }
1507 {return KW_STATIC
; }
1512 {return KW_STRING
; }
1517 {return KW_STRUCT
; }
1522 {return KW_SWITCH
; }
1527 {return KW_TBUFFER
; }
1532 {return KW_TECHNIQUE
; }
1537 {return KW_TECHNIQUE10
; }
1542 {return KW_TEXTURE
; }
1547 {return KW_TEXTURE1D
; }
1552 {return KW_TEXTURE1DARRAY
; }
1557 {return KW_TEXTURE2D
; }
1562 {return KW_TEXTURE2DARRAY
; }
1567 {return KW_TEXTURE2DMS
; }
1572 {return KW_TEXTURE2DMSARRAY
; }
1577 {return KW_TEXTURE3D
; }
1582 {return KW_TEXTURE3DARRAY
; }
1587 {return KW_TEXTURECUBE
; }
1597 {return KW_TYPEDEF
; }
1602 {return KW_UNIFORM
; }
1607 {return KW_VECTOR
; }
1612 {return KW_VERTEXSHADER
; }
1622 {return KW_VOLATILE
; }
1657 {return OP_LEFTSHIFT
; }
1662 {return OP_LEFTSHIFTASSIGN
; }
1667 {return OP_RIGHTSHIFT
; }
1672 {return OP_RIGHTSHIFTASSIGN
; }
1677 {return OP_ELLIPSIS
; }
1697 {return OP_ADDASSIGN
; }
1702 {return OP_SUBASSIGN
; }
1707 {return OP_MULASSIGN
; }
1712 {return OP_DIVASSIGN
; }
1717 {return OP_MODASSIGN
; }
1722 {return OP_ANDASSIGN
; }
1727 {return OP_ORASSIGN
; }
1732 {return OP_XORASSIGN
; }
1737 {return OP_UNKNOWN1
; }
1742 {return OP_UNKNOWN2
; }
1747 {return OP_UNKNOWN3
; }
1752 {return OP_UNKNOWN4
; }
1757 {return KW_COLUMN_MAJOR
; }
1762 {return KW_ROW_MAJOR
; }
1768 hlsl_lval
.name
= d3dcompiler_strdup(hlsl_text
);
1769 if (get_variable(hlsl_ctx
.cur_scope
, hlsl_text
)
1770 || find_function(hlsl_text
))
1771 return VAR_IDENTIFIER
;
1772 else if (get_type(hlsl_ctx
.cur_scope
, hlsl_text
, TRUE
))
1773 return TYPE_IDENTIFIER
;
1775 return NEW_IDENTIFIER
;
1782 hlsl_lval
.floatval
= atof(hlsl_text
);
1790 hlsl_lval
.floatval
= atof(hlsl_text
);
1798 hlsl_lval
.floatval
= atof(hlsl_text
);
1806 sscanf(hlsl_text
, "0x%x", &hlsl_lval
.intval
);
1814 sscanf(hlsl_text
, "0%o", &hlsl_lval
.intval
);
1822 hlsl_lval
.intval
= (atoi(hlsl_text
));
1837 /* rule 109 can match eol */
1842 hlsl_ctx
.column
= 1;
1856 TRACE("Got a #pragma.\n");
1864 TRACE("#pragma setting row_major mode.\n");
1865 hlsl_ctx
.matrix_majority
= HLSL_ROW_MAJOR
;
1873 TRACE("#pragma setting column_major mode.\n");
1874 hlsl_ctx
.matrix_majority
= HLSL_COLUMN_MAJOR
;
1879 /* rule 114 can match eol */
1883 FIXME("Unsupported preprocessor #pragma directive at line %u.\n", hlsl_ctx
.line_no
);
1896 TRACE("Preprocessor line info.\n");
1898 hlsl_lval
.intval
= (atoi(hlsl_text
));
1903 /* rule 117 can match eol */
1907 char *string
= d3dcompiler_strdup(hlsl_text
+ 1);
1910 string
[strlen(string
) - 1] = 0;
1911 hlsl_lval
.name
= string
;
1921 /* rule 119 can match eol */
1925 FIXME("Malformed preprocessor line directive?\n");
1930 /* rule 120 can match eol */
1943 /* rule 122 can match eol */
1947 FIXME("Unexpected preprocessor directive.\n");
1960 return hlsl_text
[0];
1968 #line 1969 "hlsl.yy.c"
1969 case YY_STATE_EOF(INITIAL
):
1970 case YY_STATE_EOF(pp
):
1971 case YY_STATE_EOF(pp_line
):
1972 case YY_STATE_EOF(pp_pragma
):
1973 case YY_STATE_EOF(pp_ignore
):
1976 case YY_END_OF_BUFFER
:
1978 /* Amount of text matched not including the EOB char. */
1979 int yy_amount_of_matched_text
= (int) (yy_cp
- (yytext_ptr
)) - 1;
1981 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1982 *yy_cp
= (yy_hold_char
);
1983 YY_RESTORE_YY_MORE_OFFSET
1985 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1987 /* We're scanning a new file or input source. It's
1988 * possible that this happened because the user
1989 * just pointed hlsl_in at a new source and called
1990 * hlsl_lex(). If so, then we have to assure
1991 * consistency between YY_CURRENT_BUFFER and our
1992 * globals. Here is the right place to do so, because
1993 * this is the first action (other than possibly a
1994 * back-up) that will match for the new input source.
1996 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1997 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= hlsl_in
;
1998 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2001 /* Note that here we test for yy_c_buf_p "<=" to the position
2002 * of the first EOB in the buffer, since yy_c_buf_p will
2003 * already have been incremented past the NUL character
2004 * (since all states make transitions on EOB to the
2005 * end-of-buffer state). Contrast this with the test
2008 if ( (yy_c_buf_p
) <= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
2009 { /* This was really a NUL. */
2010 yy_state_type yy_next_state
;
2012 (yy_c_buf_p
) = (yytext_ptr
) + yy_amount_of_matched_text
;
2014 yy_current_state
= yy_get_previous_state( );
2016 /* Okay, we're now positioned to make the NUL
2017 * transition. We couldn't have
2018 * yy_get_previous_state() go ahead and do it
2019 * for us because it doesn't know how to deal
2020 * with the possibility of jamming (and we don't
2021 * want to build jamming into it because then it
2022 * will run more slowly).
2025 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2027 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
2029 if ( yy_next_state
)
2031 /* Consume the NUL. */
2032 yy_cp
= ++(yy_c_buf_p
);
2033 yy_current_state
= yy_next_state
;
2039 yy_cp
= (yy_last_accepting_cpos
);
2040 yy_current_state
= (yy_last_accepting_state
);
2041 goto yy_find_action
;
2045 else switch ( yy_get_next_buffer( ) )
2047 case EOB_ACT_END_OF_FILE
:
2049 (yy_did_buffer_switch_on_eof
) = 0;
2053 /* Note: because we've taken care in
2054 * yy_get_next_buffer() to have set up
2055 * hlsl_text, we can now set up
2056 * yy_c_buf_p so that if some total
2057 * hoser (like flex itself) wants to
2058 * call the scanner after we return the
2059 * YY_NULL, it'll still work - another
2060 * YY_NULL will get returned.
2062 (yy_c_buf_p
) = (yytext_ptr
) + YY_MORE_ADJ
;
2064 yy_act
= YY_STATE_EOF(YY_START
);
2070 if ( ! (yy_did_buffer_switch_on_eof
) )
2076 case EOB_ACT_CONTINUE_SCAN
:
2078 (yytext_ptr
) + yy_amount_of_matched_text
;
2080 yy_current_state
= yy_get_previous_state( );
2082 yy_cp
= (yy_c_buf_p
);
2083 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
2086 case EOB_ACT_LAST_MATCH
:
2088 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)];
2090 yy_current_state
= yy_get_previous_state( );
2092 yy_cp
= (yy_c_buf_p
);
2093 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
2094 goto yy_find_action
;
2101 "fatal flex scanner internal error--no action found" );
2102 } /* end of action switch */
2103 } /* end of scanning one token */
2104 } /* end of hlsl_lex */
2106 /* yy_get_next_buffer - try to read in a new buffer
2108 * Returns a code representing an action:
2109 * EOB_ACT_LAST_MATCH -
2110 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2111 * EOB_ACT_END_OF_FILE - end of file
2113 static int yy_get_next_buffer (void)
2115 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
2116 register char *source
= (yytext_ptr
);
2117 register int number_to_move
, i
;
2120 if ( (yy_c_buf_p
) > &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] )
2122 "fatal flex scanner internal error--end of buffer missed" );
2124 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
2125 { /* Don't try to fill the buffer, so this is an EOF. */
2126 if ( (yy_c_buf_p
) - (yytext_ptr
) - YY_MORE_ADJ
== 1 )
2128 /* We matched a single character, the EOB, so
2129 * treat this as a final EOF.
2131 return EOB_ACT_END_OF_FILE
;
2136 /* We matched some text prior to the EOB, first
2139 return EOB_ACT_LAST_MATCH
;
2143 /* Try to read more data. */
2145 /* First move last chars to start of buffer. */
2146 number_to_move
= (int) ((yy_c_buf_p
) - (yytext_ptr
)) - 1;
2148 for ( i
= 0; i
< number_to_move
; ++i
)
2149 *(dest
++) = *(source
++);
2151 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2152 /* don't do the read, it's not guaranteed to return an EOF,
2155 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
) = 0;
2160 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
2162 while ( num_to_read
<= 0 )
2163 { /* Not enough room in the buffer - grow it. */
2165 /* just a shorter name for the current buffer */
2166 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
2168 int yy_c_buf_p_offset
=
2169 (int) ((yy_c_buf_p
) - b
->yy_ch_buf
);
2171 if ( b
->yy_is_our_buffer
)
2173 int new_size
= b
->yy_buf_size
* 2;
2175 if ( new_size
<= 0 )
2176 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2178 b
->yy_buf_size
*= 2;
2180 b
->yy_ch_buf
= (char *)
2181 /* Include room in for 2 EOB chars. */
2182 hlsl_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 );
2185 /* Can't grow it, we don't own it. */
2188 if ( ! b
->yy_ch_buf
)
2190 "fatal error - scanner input buffer overflow" );
2192 (yy_c_buf_p
) = &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2194 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
2199 if ( num_to_read
> YY_READ_BUF_SIZE
)
2200 num_to_read
= YY_READ_BUF_SIZE
;
2202 /* Read in more data. */
2203 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
2204 (yy_n_chars
), (size_t) num_to_read
);
2206 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
2209 if ( (yy_n_chars
) == 0 )
2211 if ( number_to_move
== YY_MORE_ADJ
)
2213 ret_val
= EOB_ACT_END_OF_FILE
;
2214 hlsl_restart(hlsl_in
);
2219 ret_val
= EOB_ACT_LAST_MATCH
;
2220 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
2221 YY_BUFFER_EOF_PENDING
;
2226 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2228 if ((yy_size_t
) ((yy_n_chars
) + number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
2229 /* Extend the array by 50%, plus the number we really need. */
2230 yy_size_t new_size
= (yy_n_chars
) + number_to_move
+ ((yy_n_chars
) >> 1);
2231 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) hlsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
);
2232 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
2233 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2236 (yy_n_chars
) += number_to_move
;
2237 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] = YY_END_OF_BUFFER_CHAR
;
2238 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] = YY_END_OF_BUFFER_CHAR
;
2240 (yytext_ptr
) = &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
2245 /* yy_get_previous_state - get the state just before the EOB char was reached */
2247 static yy_state_type
yy_get_previous_state (void)
2249 register yy_state_type yy_current_state
;
2250 register char *yy_cp
;
2252 yy_current_state
= (yy_start
);
2253 yy_current_state
+= YY_AT_BOL();
2255 for ( yy_cp
= (yytext_ptr
) + YY_MORE_ADJ
; yy_cp
< (yy_c_buf_p
); ++yy_cp
)
2257 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2258 if ( yy_accept
[yy_current_state
] )
2260 (yy_last_accepting_state
) = yy_current_state
;
2261 (yy_last_accepting_cpos
) = yy_cp
;
2263 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2265 yy_current_state
= (int) yy_def
[yy_current_state
];
2266 if ( yy_current_state
>= 717 )
2267 yy_c
= yy_meta
[(unsigned int) yy_c
];
2269 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2272 return yy_current_state
;
2275 /* yy_try_NUL_trans - try to make a transition on the NUL character
2278 * next_state = yy_try_NUL_trans( current_state );
2280 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
)
2282 register int yy_is_jam
;
2283 register char *yy_cp
= (yy_c_buf_p
);
2285 register YY_CHAR yy_c
= 1;
2286 if ( yy_accept
[yy_current_state
] )
2288 (yy_last_accepting_state
) = yy_current_state
;
2289 (yy_last_accepting_cpos
) = yy_cp
;
2291 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2293 yy_current_state
= (int) yy_def
[yy_current_state
];
2294 if ( yy_current_state
>= 717 )
2295 yy_c
= yy_meta
[(unsigned int) yy_c
];
2297 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2298 yy_is_jam
= (yy_current_state
== 716);
2300 return yy_is_jam
? 0 : yy_current_state
;
2305 static int yyinput (void)
2307 static int input (void)
2313 *(yy_c_buf_p
) = (yy_hold_char
);
2315 if ( *(yy_c_buf_p
) == YY_END_OF_BUFFER_CHAR
)
2317 /* yy_c_buf_p now points to the character we want to return.
2318 * If this occurs *before* the EOB characters, then it's a
2319 * valid NUL; if not, then we've hit the end of the buffer.
2321 if ( (yy_c_buf_p
) < &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
2322 /* This was really a NUL. */
2323 *(yy_c_buf_p
) = '\0';
2326 { /* need more input */
2327 int offset
= (yy_c_buf_p
) - (yytext_ptr
);
2330 switch ( yy_get_next_buffer( ) )
2332 case EOB_ACT_LAST_MATCH
:
2333 /* This happens because yy_g_n_b()
2334 * sees that we've accumulated a
2335 * token and flags that we need to
2336 * try matching the token before
2337 * proceeding. But for input(),
2338 * there's no matching to consider.
2339 * So convert the EOB_ACT_LAST_MATCH
2340 * to EOB_ACT_END_OF_FILE.
2343 /* Reset buffer status. */
2344 hlsl_restart(hlsl_in
);
2348 case EOB_ACT_END_OF_FILE
:
2353 if ( ! (yy_did_buffer_switch_on_eof
) )
2362 case EOB_ACT_CONTINUE_SCAN
:
2363 (yy_c_buf_p
) = (yytext_ptr
) + offset
;
2369 c
= *(unsigned char *) (yy_c_buf_p
); /* cast for 8-bit char's */
2370 *(yy_c_buf_p
) = '\0'; /* preserve hlsl_text */
2371 (yy_hold_char
) = *++(yy_c_buf_p
);
2373 YY_CURRENT_BUFFER_LVALUE
->yy_at_bol
= (c
== '\n');
2377 #endif /* ifndef YY_NO_INPUT */
2379 /** Immediately switch to a different input stream.
2380 * @param input_file A readable stream.
2382 * @note This function does not reset the start condition to @c INITIAL .
2384 void hlsl_restart (FILE * input_file
)
2387 if ( ! YY_CURRENT_BUFFER
){
2388 hlsl_ensure_buffer_stack ();
2389 YY_CURRENT_BUFFER_LVALUE
=
2390 hlsl__create_buffer(hlsl_in
,YY_BUF_SIZE
);
2393 hlsl__init_buffer(YY_CURRENT_BUFFER
,input_file
);
2394 hlsl__load_buffer_state( );
2397 /** Switch to a different input buffer.
2398 * @param new_buffer The new input buffer.
2401 void hlsl__switch_to_buffer (YY_BUFFER_STATE new_buffer
)
2404 /* TODO. We should be able to replace this entire function body
2406 * hlsl_pop_buffer_state();
2407 * hlsl_push_buffer_state(new_buffer);
2409 hlsl_ensure_buffer_stack ();
2410 if ( YY_CURRENT_BUFFER
== new_buffer
)
2413 if ( YY_CURRENT_BUFFER
)
2415 /* Flush out information for old buffer. */
2416 *(yy_c_buf_p
) = (yy_hold_char
);
2417 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
2418 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
2421 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2422 hlsl__load_buffer_state( );
2424 /* We don't actually know whether we did this switch during
2425 * EOF (hlsl_wrap()) processing, but the only time this flag
2426 * is looked at is after hlsl_wrap() is called, so it's safe
2427 * to go ahead and always set it.
2429 (yy_did_buffer_switch_on_eof
) = 1;
2432 static void hlsl__load_buffer_state (void)
2434 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
2435 (yytext_ptr
) = (yy_c_buf_p
) = YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
2436 hlsl_in
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
2437 (yy_hold_char
) = *(yy_c_buf_p
);
2440 /** Allocate and initialize an input buffer state.
2441 * @param file A readable stream.
2442 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2444 * @return the allocated buffer state.
2446 YY_BUFFER_STATE
hlsl__create_buffer (FILE * file
, int size
)
2450 b
= (YY_BUFFER_STATE
) hlsl_alloc(sizeof( struct yy_buffer_state
) );
2452 YY_FATAL_ERROR( "out of dynamic memory in hlsl__create_buffer()" );
2454 b
->yy_buf_size
= size
;
2456 /* yy_ch_buf has to be 2 characters longer than the size given because
2457 * we need to put in 2 end-of-buffer characters.
2459 b
->yy_ch_buf
= (char *) hlsl_alloc(b
->yy_buf_size
+ 2 );
2460 if ( ! b
->yy_ch_buf
)
2461 YY_FATAL_ERROR( "out of dynamic memory in hlsl__create_buffer()" );
2463 b
->yy_is_our_buffer
= 1;
2465 hlsl__init_buffer(b
,file
);
2470 /** Destroy the buffer.
2471 * @param b a buffer created with hlsl__create_buffer()
2474 void hlsl__delete_buffer (YY_BUFFER_STATE b
)
2480 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
2481 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
2483 if ( b
->yy_is_our_buffer
)
2484 hlsl_free((void *) b
->yy_ch_buf
);
2486 hlsl_free((void *) b
);
2489 /* Initializes or reinitializes a buffer.
2490 * This function is sometimes called more than once on the same buffer,
2491 * such as during a hlsl_restart() or at EOF.
2493 static void hlsl__init_buffer (YY_BUFFER_STATE b
, FILE * file
)
2498 hlsl__flush_buffer(b
);
2500 b
->yy_input_file
= file
;
2501 b
->yy_fill_buffer
= 1;
2503 /* If b is the current buffer, then hlsl__init_buffer was _probably_
2504 * called from hlsl_restart() or through yy_get_next_buffer.
2505 * In that case, we don't want to reset the lineno or column.
2507 if (b
!= YY_CURRENT_BUFFER
){
2508 b
->yy_bs_lineno
= 1;
2509 b
->yy_bs_column
= 0;
2512 b
->yy_is_interactive
= 0;
2517 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2518 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2521 void hlsl__flush_buffer (YY_BUFFER_STATE b
)
2528 /* We always need two end-of-buffer characters. The first causes
2529 * a transition to the end-of-buffer state. The second causes
2530 * a jam in that state.
2532 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2533 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2535 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2538 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2540 if ( b
== YY_CURRENT_BUFFER
)
2541 hlsl__load_buffer_state( );
2544 /** Pushes the new state onto the stack. The new state becomes
2545 * the current state. This function will allocate the stack
2547 * @param new_buffer The new state.
2550 void hlsl_push_buffer_state (YY_BUFFER_STATE new_buffer
)
2552 if (new_buffer
== NULL
)
2555 hlsl_ensure_buffer_stack();
2557 /* This block is copied from hlsl__switch_to_buffer. */
2558 if ( YY_CURRENT_BUFFER
)
2560 /* Flush out information for old buffer. */
2561 *(yy_c_buf_p
) = (yy_hold_char
);
2562 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
2563 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
2566 /* Only push if top exists. Otherwise, replace top. */
2567 if (YY_CURRENT_BUFFER
)
2568 (yy_buffer_stack_top
)++;
2569 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2571 /* copied from hlsl__switch_to_buffer. */
2572 hlsl__load_buffer_state( );
2573 (yy_did_buffer_switch_on_eof
) = 1;
2576 /** Removes and deletes the top of the stack, if present.
2577 * The next element becomes the new top.
2580 void hlsl_pop_buffer_state (void)
2582 if (!YY_CURRENT_BUFFER
)
2585 hlsl__delete_buffer(YY_CURRENT_BUFFER
);
2586 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2587 if ((yy_buffer_stack_top
) > 0)
2588 --(yy_buffer_stack_top
);
2590 if (YY_CURRENT_BUFFER
) {
2591 hlsl__load_buffer_state( );
2592 (yy_did_buffer_switch_on_eof
) = 1;
2596 /* Allocates the stack if it does not exist.
2597 * Guarantees space for at least one push.
2599 static void hlsl_ensure_buffer_stack (void)
2603 if (!(yy_buffer_stack
)) {
2605 /* First allocation is just for 2 elements, since we don't know if this
2606 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2607 * immediate realloc on the next call.
2610 (yy_buffer_stack
) = (struct yy_buffer_state
**)hlsl_alloc
2611 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
2613 if ( ! (yy_buffer_stack
) )
2614 YY_FATAL_ERROR( "out of dynamic memory in hlsl_ensure_buffer_stack()" );
2616 memset((yy_buffer_stack
), 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
2618 (yy_buffer_stack_max
) = num_to_alloc
;
2619 (yy_buffer_stack_top
) = 0;
2623 if ((yy_buffer_stack_top
) >= ((yy_buffer_stack_max
)) - 1){
2625 /* Increase the buffer to prepare for a possible push. */
2626 int grow_size
= 8 /* arbitrary grow size */;
2628 num_to_alloc
= (yy_buffer_stack_max
) + grow_size
;
2629 (yy_buffer_stack
) = (struct yy_buffer_state
**)hlsl_realloc
2631 num_to_alloc
* sizeof(struct yy_buffer_state
*)
2633 if ( ! (yy_buffer_stack
) )
2634 YY_FATAL_ERROR( "out of dynamic memory in hlsl_ensure_buffer_stack()" );
2636 /* zero only the new slots.*/
2637 memset((yy_buffer_stack
) + (yy_buffer_stack_max
), 0, grow_size
* sizeof(struct yy_buffer_state
*));
2638 (yy_buffer_stack_max
) = num_to_alloc
;
2642 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2643 * @param base the character buffer
2644 * @param size the size in bytes of the character buffer
2646 * @return the newly allocated buffer state object.
2648 YY_BUFFER_STATE
hlsl__scan_buffer (char * base
, yy_size_t size
)
2653 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2654 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2655 /* They forgot to leave room for the EOB's. */
2658 b
= (YY_BUFFER_STATE
) hlsl_alloc(sizeof( struct yy_buffer_state
) );
2660 YY_FATAL_ERROR( "out of dynamic memory in hlsl__scan_buffer()" );
2662 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2663 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2664 b
->yy_is_our_buffer
= 0;
2665 b
->yy_input_file
= 0;
2666 b
->yy_n_chars
= b
->yy_buf_size
;
2667 b
->yy_is_interactive
= 0;
2669 b
->yy_fill_buffer
= 0;
2670 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2672 hlsl__switch_to_buffer(b
);
2677 /** Setup the input buffer state to scan a string. The next call to hlsl_lex() will
2678 * scan from a @e copy of @a str.
2679 * @param yystr a NUL-terminated string to scan
2681 * @return the newly allocated buffer state object.
2682 * @note If you want to scan bytes that may contain NUL values, then use
2683 * hlsl__scan_bytes() instead.
2685 YY_BUFFER_STATE
hlsl__scan_string (yyconst
char * yystr
)
2688 return hlsl__scan_bytes(yystr
,strlen(yystr
) );
2691 /** Setup the input buffer state to scan the given bytes. The next call to hlsl_lex() will
2692 * scan from a @e copy of @a bytes.
2693 * @param yybytes the byte buffer to scan
2694 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2696 * @return the newly allocated buffer state object.
2698 YY_BUFFER_STATE
hlsl__scan_bytes (yyconst
char * yybytes
, int _yybytes_len
)
2705 /* Get memory for full buffer, including space for trailing EOB's. */
2706 n
= _yybytes_len
+ 2;
2707 buf
= (char *) hlsl_alloc(n
);
2709 YY_FATAL_ERROR( "out of dynamic memory in hlsl__scan_bytes()" );
2711 for ( i
= 0; i
< _yybytes_len
; ++i
)
2712 buf
[i
] = yybytes
[i
];
2714 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
2716 b
= hlsl__scan_buffer(buf
,n
);
2718 YY_FATAL_ERROR( "bad buffer in hlsl__scan_bytes()" );
2720 /* It's okay to grow etc. this buffer, and we should throw it
2721 * away when we're done.
2723 b
->yy_is_our_buffer
= 1;
2728 #ifndef YY_EXIT_FAILURE
2729 #define YY_EXIT_FAILURE 2
2732 static void yy_fatal_error (yyconst
char* msg
)
2734 (void) fprintf( stderr
, "%s\n", msg
);
2735 exit( YY_EXIT_FAILURE
);
2738 /* Redefine yyless() so it works in section 3 code. */
2744 /* Undo effects of setting up hlsl_text. */ \
2745 int yyless_macro_arg = (n); \
2746 YY_LESS_LINENO(yyless_macro_arg);\
2747 hlsl_text[hlsl_leng] = (yy_hold_char); \
2748 (yy_c_buf_p) = hlsl_text + yyless_macro_arg; \
2749 (yy_hold_char) = *(yy_c_buf_p); \
2750 *(yy_c_buf_p) = '\0'; \
2751 hlsl_leng = yyless_macro_arg; \
2755 /* Accessor methods (get/set functions) to struct members. */
2757 /** Get the current line number.
2760 int hlsl_get_lineno (void)
2766 /** Get the input stream.
2769 FILE *hlsl_get_in (void)
2774 /** Get the output stream.
2777 FILE *hlsl_get_out (void)
2782 /** Get the length of the current token.
2785 int hlsl_get_leng (void)
2790 /** Get the current token.
2794 char *hlsl_get_text (void)
2799 /** Set the current line number.
2800 * @param line_number
2803 void hlsl_set_lineno (int line_number
)
2806 hlsl_lineno
= line_number
;
2809 /** Set the input stream. This does not discard the current
2811 * @param in_str A readable stream.
2813 * @see hlsl__switch_to_buffer
2815 void hlsl_set_in (FILE * in_str
)
2820 void hlsl_set_out (FILE * out_str
)
2822 hlsl_out
= out_str
;
2825 int hlsl_get_debug (void)
2827 return hlsl__flex_debug
;
2830 void hlsl_set_debug (int bdebug
)
2832 hlsl__flex_debug
= bdebug
;
2835 static int yy_init_globals (void)
2837 /* Initialization is the same as for the non-reentrant scanner.
2838 * This function is called from hlsl_lex_destroy(), so don't allocate here.
2841 (yy_buffer_stack
) = 0;
2842 (yy_buffer_stack_top
) = 0;
2843 (yy_buffer_stack_max
) = 0;
2844 (yy_c_buf_p
) = (char *) 0;
2848 /* Defined in main.c */
2853 hlsl_in
= (FILE *) 0;
2854 hlsl_out
= (FILE *) 0;
2857 /* For future reference: Set errno on error, since we are called by
2863 /* hlsl_lex_destroy is for both reentrant and non-reentrant scanners. */
2864 int hlsl_lex_destroy (void)
2867 /* Pop the buffer stack, destroying each element. */
2868 while(YY_CURRENT_BUFFER
){
2869 hlsl__delete_buffer(YY_CURRENT_BUFFER
);
2870 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2871 hlsl_pop_buffer_state();
2874 /* Destroy the stack itself. */
2875 hlsl_free((yy_buffer_stack
) );
2876 (yy_buffer_stack
) = NULL
;
2878 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2879 * hlsl_lex() is called, initialization will occur. */
2886 * Internal utility routines.
2890 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
)
2893 for ( i
= 0; i
< n
; ++i
)
2898 #ifdef YY_NEED_STRLEN
2899 static int yy_flex_strlen (yyconst
char * s
)
2902 for ( n
= 0; s
[n
]; ++n
)
2909 void *hlsl_alloc (yy_size_t size
)
2911 return (void *) malloc( size
);
2914 void *hlsl_realloc (void * ptr
, yy_size_t size
)
2916 /* The cast to (char *) in the following accommodates both
2917 * implementations that use char* generic pointers, and those
2918 * that use void* generic pointers. It works with the latter
2919 * because both ANSI C and C++ allow castless assignment from
2920 * any pointer type to void*, and deal with argument conversions
2921 * as though doing an assignment.
2923 return (void *) realloc( (char *) ptr
, size
);
2926 void hlsl_free (void * ptr
)
2928 free( (char *) ptr
); /* see hlsl_realloc() for (char *) cast */
2931 #define YYTABLES_NAME "yytables"
2937 struct bwriter_shader
*parse_hlsl(enum shader_type type
, DWORD major
, DWORD minor
,
2938 const char *entrypoint
, char **messages
);
2940 struct bwriter_shader
*parse_hlsl_shader(const char *text
, enum shader_type type
, DWORD major
, DWORD minor
,
2941 const char *entrypoint
, char **messages
)
2943 struct bwriter_shader
*ret
= NULL
;
2944 YY_BUFFER_STATE buffer
;
2946 buffer
= hlsl__scan_string(text
);
2947 hlsl__switch_to_buffer(buffer
);
2949 ret
= parse_hlsl(type
, major
, minor
, entrypoint
, messages
);
2951 hlsl__delete_buffer(buffer
);