[D3DCOMPILER_43]
[reactos.git] / reactos / dll / directx / wine / d3dcompiler_43 / hlsl.yy.c
1 #line 2 "hlsl.yy.c"
2
3 #line 4 "hlsl.yy.c"
4
5 #define YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
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
16 #define yyin hlsl_in
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
27
28 #define FLEX_SCANNER
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
33 #define FLEX_BETA
34 #endif
35
36 /* First, we deal with platform-specific or compiler-specific issues. */
37
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
43
44 /* end standard C headers. */
45
46 /* flex integer type definitions */
47
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
50
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56 * if you want the limit (max/min) macros for int types.
57 */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
61
62 #include <inttypes.h>
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;
69 #else
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;
76
77 /* Limits of integral types. */
78 #ifndef INT8_MIN
79 #define INT8_MIN (-128)
80 #endif
81 #ifndef INT16_MIN
82 #define INT16_MIN (-32767-1)
83 #endif
84 #ifndef INT32_MIN
85 #define INT32_MIN (-2147483647-1)
86 #endif
87 #ifndef INT8_MAX
88 #define INT8_MAX (127)
89 #endif
90 #ifndef INT16_MAX
91 #define INT16_MAX (32767)
92 #endif
93 #ifndef INT32_MAX
94 #define INT32_MAX (2147483647)
95 #endif
96 #ifndef UINT8_MAX
97 #define UINT8_MAX (255U)
98 #endif
99 #ifndef UINT16_MAX
100 #define UINT16_MAX (65535U)
101 #endif
102 #ifndef UINT32_MAX
103 #define UINT32_MAX (4294967295U)
104 #endif
105
106 #endif /* ! C99 */
107
108 #endif /* ! FLEXINT_H */
109
110 #ifdef __cplusplus
111
112 /* The "const" storage-class-modifier is valid. */
113 #define YY_USE_CONST
114
115 #else /* ! __cplusplus */
116
117 /* C99 requires __STDC__ to be defined as 1. */
118 #if defined (__STDC__)
119
120 #define YY_USE_CONST
121
122 #endif /* defined (__STDC__) */
123 #endif /* ! __cplusplus */
124
125 #ifdef YY_USE_CONST
126 #define yyconst const
127 #else
128 #define yyconst
129 #endif
130
131 /* Returned upon end-of-file. */
132 #define YY_NULL 0
133
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
137 * double cast.
138 */
139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140
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.
144 */
145 #define BEGIN (yy_start) = 1 + 2 *
146
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
149 * compatibility.
150 */
151 #define YY_START (((yy_start) - 1) / 2)
152 #define YYSTATE YY_START
153
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE hlsl_restart(hlsl_in )
159
160 #define YY_END_OF_BUFFER_CHAR 0
161
162 /* Size of default input buffer. */
163 #ifndef YY_BUF_SIZE
164 #ifdef __ia64__
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.
168 */
169 #define YY_BUF_SIZE 32768
170 #else
171 #define YY_BUF_SIZE 16384
172 #endif /* __ia64__ */
173 #endif
174
175 /* The state buf must be large enough to hold one state per character in the main buffer.
176 */
177 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
178
179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
180 #define YY_TYPEDEF_YY_BUFFER_STATE
181 typedef struct yy_buffer_state *YY_BUFFER_STATE;
182 #endif
183
184 extern int hlsl_leng;
185
186 extern FILE *hlsl_in, *hlsl_out;
187
188 #define EOB_ACT_CONTINUE_SCAN 0
189 #define EOB_ACT_END_OF_FILE 1
190 #define EOB_ACT_LAST_MATCH 2
191
192 #define YY_LESS_LINENO(n)
193
194 /* Return all but the first "n" matched characters back to the input stream. */
195 #define yyless(n) \
196 do \
197 { \
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 */ \
205 } \
206 while ( 0 )
207
208 #define unput(c) yyunput( c, (yytext_ptr) )
209
210 #ifndef YY_TYPEDEF_YY_SIZE_T
211 #define YY_TYPEDEF_YY_SIZE_T
212 typedef size_t yy_size_t;
213 #endif
214
215 #ifndef YY_STRUCT_YY_BUFFER_STATE
216 #define YY_STRUCT_YY_BUFFER_STATE
217 struct yy_buffer_state
218 {
219 FILE *yy_input_file;
220
221 char *yy_ch_buf; /* input buffer */
222 char *yy_buf_pos; /* current position in input buffer */
223
224 /* Size of input buffer in bytes, not including room for EOB
225 * characters.
226 */
227 yy_size_t yy_buf_size;
228
229 /* Number of characters read into yy_ch_buf, not including EOB
230 * characters.
231 */
232 int yy_n_chars;
233
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
236 * delete it.
237 */
238 int yy_is_our_buffer;
239
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
243 * each newline.
244 */
245 int yy_is_interactive;
246
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
249 * not.
250 */
251 int yy_at_bol;
252
253 int yy_bs_lineno; /**< The line count. */
254 int yy_bs_column; /**< The column count. */
255
256 /* Whether to try to fill the input buffer when we reach the
257 * end of it.
258 */
259 int yy_fill_buffer;
260
261 int yy_buffer_status;
262
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.
270 *
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.
274 */
275 #define YY_BUFFER_EOF_PENDING 2
276
277 };
278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
279
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. */
284
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
287 * "scanner state".
288 *
289 * Returns the top of the stack, or NULL.
290 */
291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
292 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
293 : NULL)
294
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.
297 */
298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
299
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 */
303 int hlsl_leng;
304
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 */
309
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 ...
312 */
313 static int yy_did_buffer_switch_on_eof;
314
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 );
322
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 );
326
327 #define YY_FLUSH_BUFFER hlsl__flush_buffer(YY_CURRENT_BUFFER )
328
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 );
332
333 void *hlsl_alloc (yy_size_t );
334 void *hlsl_realloc (void *,yy_size_t );
335 void hlsl_free (void * );
336
337 #define yy_new_buffer hlsl__create_buffer
338
339 #define yy_set_interactive(is_interactive) \
340 { \
341 if ( ! YY_CURRENT_BUFFER ){ \
342 hlsl_ensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 hlsl__create_buffer(hlsl_in,YY_BUF_SIZE ); \
345 } \
346 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
347 }
348
349 #define yy_set_bol(at_bol) \
350 { \
351 if ( ! YY_CURRENT_BUFFER ){\
352 hlsl_ensure_buffer_stack (); \
353 YY_CURRENT_BUFFER_LVALUE = \
354 hlsl__create_buffer(hlsl_in,YY_BUF_SIZE ); \
355 } \
356 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
357 }
358
359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
360
361 /* Begin user sect3 */
362
363 #define hlsl_wrap() 1
364 #define YY_SKIP_YYWRAP
365
366 typedef unsigned char YY_CHAR;
367
368 FILE *hlsl_in = (FILE *) 0, *hlsl_out = (FILE *) 0;
369
370 typedef int yy_state_type;
371
372 extern int hlsl_lineno;
373
374 int hlsl_lineno = 1;
375
376 extern char *hlsl_text;
377 #define yytext_ptr hlsl_text
378
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[] );
383
384 /* Done after the current pattern has been matched and before the
385 * corresponding action - sets up hlsl_text.
386 */
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; \
391 *yy_cp = '\0'; \
392 (yy_c_buf_p) = yy_cp;
393
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. */
398 struct yy_trans_info
399 {
400 flex_int32_t yy_verify;
401 flex_int32_t yy_nxt;
402 };
403 static yyconst flex_int16_t yy_accept[717] =
404 { 0,
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,
415
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,
426
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,
437
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,
448
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,
459
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,
470
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,
481
482 0, 100, 0, 0, 100, 0, 0, 44, 0, 0,
483 112, 0, 0, 0, 113, 0
484 } ;
485
486 static yyconst flex_int32_t yy_ec[256] =
487 { 0,
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,
498
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,
509
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,
515 1, 1, 1, 1, 1
516 } ;
517
518 static yyconst flex_int32_t yy_meta[72] =
519 { 0,
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,
527 1
528 } ;
529
530 static yyconst flex_int16_t yy_base[725] =
531 { 0,
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,
542
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,
553
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,
564
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,
575
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,
586
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,
597
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,
608
609 240, 255, 278, 275, 289, 301, 370, 0, 315, 374,
610 939, 316, 377, 381, 939, 939, 504, 508, 512, 516,
611 518, 522, 526, 379
612 } ;
613
614 static yyconst flex_int16_t yy_def[725] =
615 { 0,
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,
626
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,
637
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,
648
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,
659
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,
670
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,
681
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,
692
693 716, 721, 716, 716, 721, 716, 716, 721, 716, 716,
694 716, 716, 716, 716, 716, 0, 716, 716, 716, 716,
695 716, 716, 716, 716
696 } ;
697
698 static yyconst flex_int16_t yy_nxt[1011] =
699 { 0,
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,
710
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,
721
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,
732
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,
743
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,
754
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,
765
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,
776
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,
787
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,
798
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,
809
810 716, 716, 716, 716, 716, 716, 716, 716, 716, 716
811 } ;
812
813 static yyconst flex_int16_t yy_chk[1011] =
814 { 0,
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,
825
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,
836
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,
847
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,
858
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,
869
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,
880
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,
891
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,
902
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,
913
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,
924
925 716, 716, 716, 716, 716, 716, 716, 716, 716, 716
926 } ;
927
928 static yy_state_type yy_last_accepting_state;
929 static char *yy_last_accepting_cpos;
930
931 extern int hlsl__flex_debug;
932 int hlsl__flex_debug = 0;
933
934 /* The intent behind this definition is that it'll catch
935 * any uses of REJECT which flex missed.
936 */
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
941 char *hlsl_text;
942 #line 1 "hlsl.l"
943 /*
944 * HLSL parser
945 *
946 * Copyright 2008 Stefan Dösinger
947 * Copyright 2012 Matteo Bruni for CodeWeavers
948 *
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.
953 *
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.
958 *
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
962 */
963 #line 23 "hlsl.l"
964 #include "config.h"
965 #include "wine/port.h"
966 #include "wine/debug.h"
967
968 #define YY_NO_UNISTD_H
969 #include "d3dcompiler_private.h"
970 #include "hlsl.tab.h"
971
972 WINE_DEFAULT_DEBUG_CHANNEL(hlsl_parser);
973
974 #define YY_USER_ACTION \
975 do { \
976 hlsl_lloc.first_column = hlsl_ctx.column; \
977 hlsl_lloc.first_line = hlsl_ctx.line_no; \
978 hlsl_ctx.column += hlsl_leng; \
979 } while(0);
980
981 #define YY_NO_INPUT 1
982
983 #line 984 "hlsl.yy.c"
984
985 #define INITIAL 0
986 #define pp 1
987 #define pp_line 2
988 #define pp_pragma 3
989 #define pp_ignore 4
990
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.
995 */
996 #include <unistd.h>
997 #endif
998
999 #ifndef YY_EXTRA_TYPE
1000 #define YY_EXTRA_TYPE void *
1001 #endif
1002
1003 static int yy_init_globals (void );
1004
1005 /* Accessor methods to globals.
1006 These are made visible to non-reentrant scanners for convenience. */
1007
1008 int hlsl_lex_destroy (void );
1009
1010 int hlsl_get_debug (void );
1011
1012 void hlsl_set_debug (int debug_flag );
1013
1014 YY_EXTRA_TYPE hlsl_get_extra (void );
1015
1016 void hlsl_set_extra (YY_EXTRA_TYPE user_defined );
1017
1018 FILE *hlsl_get_in (void );
1019
1020 void hlsl_set_in (FILE * in_str );
1021
1022 FILE *hlsl_get_out (void );
1023
1024 void hlsl_set_out (FILE * out_str );
1025
1026 int hlsl_get_leng (void );
1027
1028 char *hlsl_get_text (void );
1029
1030 int hlsl_get_lineno (void );
1031
1032 void hlsl_set_lineno (int line_number );
1033
1034 /* Macros after this point can all be overridden by user definitions in
1035 * section 1.
1036 */
1037
1038 #ifndef YY_SKIP_YYWRAP
1039 #ifdef __cplusplus
1040 extern "C" int hlsl_wrap (void );
1041 #else
1042 extern int hlsl_wrap (void );
1043 #endif
1044 #endif
1045
1046 #ifndef yytext_ptr
1047 static void yy_flex_strncpy (char *,yyconst char *,int );
1048 #endif
1049
1050 #ifdef YY_NEED_STRLEN
1051 static int yy_flex_strlen (yyconst char * );
1052 #endif
1053
1054 #ifndef YY_NO_INPUT
1055
1056 #ifdef __cplusplus
1057 static int yyinput (void );
1058 #else
1059 static int input (void );
1060 #endif
1061
1062 #endif
1063
1064 /* Amount of stuff to slurp up with each read. */
1065 #ifndef YY_READ_BUF_SIZE
1066 #ifdef __ia64__
1067 /* On IA-64, the buffer size is 16k, not 8k */
1068 #define YY_READ_BUF_SIZE 16384
1069 #else
1070 #define YY_READ_BUF_SIZE 8192
1071 #endif /* __ia64__ */
1072 #endif
1073
1074 /* Copy whatever the last rule matched to the standard output. */
1075 #ifndef ECHO
1076 /* This used to be an fputs(), but since the string might contain NUL's,
1077 * we now use fwrite().
1078 */
1079 #define ECHO do { if (fwrite( hlsl_text, hlsl_leng, 1, hlsl_out )) {} } while (0)
1080 #endif
1081
1082 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1083 * is returned in "result".
1084 */
1085 #ifndef YY_INPUT
1086 #define YY_INPUT(buf,result,max_size) \
1087 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1088 { \
1089 int c = '*'; \
1090 size_t n; \
1091 for ( n = 0; n < max_size && \
1092 (c = getc( hlsl_in )) != EOF && c != '\n'; ++n ) \
1093 buf[n] = (char) c; \
1094 if ( c == '\n' ) \
1095 buf[n++] = (char) c; \
1096 if ( c == EOF && ferror( hlsl_in ) ) \
1097 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1098 result = n; \
1099 } \
1100 else \
1101 { \
1102 errno=0; \
1103 while ( (result = fread(buf, 1, max_size, hlsl_in))==0 && ferror(hlsl_in)) \
1104 { \
1105 if( errno != EINTR) \
1106 { \
1107 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1108 break; \
1109 } \
1110 errno=0; \
1111 clearerr(hlsl_in); \
1112 } \
1113 }\
1114 \
1115
1116 #endif
1117
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.
1121 */
1122 #ifndef yyterminate
1123 #define yyterminate() return YY_NULL
1124 #endif
1125
1126 /* Number of entries by which start-condition stack grows. */
1127 #ifndef YY_START_STACK_INCR
1128 #define YY_START_STACK_INCR 25
1129 #endif
1130
1131 /* Report a fatal error. */
1132 #ifndef YY_FATAL_ERROR
1133 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1134 #endif
1135
1136 /* end tables serialization structures and prototypes */
1137
1138 /* Default declaration of generated scanner - a define so the user can
1139 * easily add parameters.
1140 */
1141 #ifndef YY_DECL
1142 #define YY_DECL_IS_OURS 1
1143
1144 extern int hlsl_lex (void);
1145
1146 #define YY_DECL int hlsl_lex (void)
1147 #endif /* !YY_DECL */
1148
1149 /* Code executed at the beginning of each rule, after hlsl_text and hlsl_leng
1150 * have been set up.
1151 */
1152 #ifndef YY_USER_ACTION
1153 #define YY_USER_ACTION
1154 #endif
1155
1156 /* Code executed at the end of each rule. */
1157 #ifndef YY_BREAK
1158 #define YY_BREAK break;
1159 #endif
1160
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'); \
1165 YY_USER_ACTION
1166
1167 /** The main scanner function which does all the work.
1168 */
1169 YY_DECL
1170 {
1171 register yy_state_type yy_current_state;
1172 register char *yy_cp, *yy_bp;
1173 register int yy_act;
1174
1175 #line 60 "hlsl.l"
1176
1177 #line 1178 "hlsl.yy.c"
1178
1179 if ( !(yy_init) )
1180 {
1181 (yy_init) = 1;
1182
1183 #ifdef YY_USER_INIT
1184 YY_USER_INIT;
1185 #endif
1186
1187 if ( ! (yy_start) )
1188 (yy_start) = 1; /* first start state */
1189
1190 if ( ! hlsl_in )
1191 hlsl_in = stdin;
1192
1193 if ( ! hlsl_out )
1194 hlsl_out = stdout;
1195
1196 if ( ! YY_CURRENT_BUFFER ) {
1197 hlsl_ensure_buffer_stack ();
1198 YY_CURRENT_BUFFER_LVALUE =
1199 hlsl__create_buffer(hlsl_in,YY_BUF_SIZE );
1200 }
1201
1202 hlsl__load_buffer_state( );
1203 }
1204
1205 while ( 1 ) /* loops until end-of-file is reached */
1206 {
1207 yy_cp = (yy_c_buf_p);
1208
1209 /* Support of hlsl_text. */
1210 *yy_cp = (yy_hold_char);
1211
1212 /* yy_bp points to the position in yy_ch_buf of the start of
1213 * the current run.
1214 */
1215 yy_bp = yy_cp;
1216
1217 yy_current_state = (yy_start);
1218 yy_current_state += YY_AT_BOL();
1219 yy_match:
1220 do
1221 {
1222 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1223 if ( yy_accept[yy_current_state] )
1224 {
1225 (yy_last_accepting_state) = yy_current_state;
1226 (yy_last_accepting_cpos) = yy_cp;
1227 }
1228 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1229 {
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];
1233 }
1234 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1235 ++yy_cp;
1236 }
1237 while ( yy_current_state != 716 );
1238 yy_cp = (yy_last_accepting_cpos);
1239 yy_current_state = (yy_last_accepting_state);
1240
1241 yy_find_action:
1242 yy_act = yy_accept[yy_current_state];
1243
1244 YY_DO_BEFORE_ACTION;
1245
1246 do_action: /* This label is used only to access EOF actions. */
1247
1248 switch ( yy_act )
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;
1256
1257 case 1:
1258 YY_RULE_SETUP
1259 #line 61 "hlsl.l"
1260 {
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);
1263 }
1264 YY_BREAK
1265 case 2:
1266 YY_RULE_SETUP
1267 #line 65 "hlsl.l"
1268 {
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);
1271 }
1272 YY_BREAK
1273 case 3:
1274 YY_RULE_SETUP
1275 #line 69 "hlsl.l"
1276 {
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);
1279 }
1280 YY_BREAK
1281 case 4:
1282 YY_RULE_SETUP
1283 #line 73 "hlsl.l"
1284 {
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);
1287 }
1288 YY_BREAK
1289 case 5:
1290 YY_RULE_SETUP
1291 #line 78 "hlsl.l"
1292 {return KW_BLENDSTATE; }
1293 YY_BREAK
1294 case 6:
1295 YY_RULE_SETUP
1296 #line 79 "hlsl.l"
1297 {return KW_BREAK; }
1298 YY_BREAK
1299 case 7:
1300 YY_RULE_SETUP
1301 #line 80 "hlsl.l"
1302 {return KW_BUFFER; }
1303 YY_BREAK
1304 case 8:
1305 YY_RULE_SETUP
1306 #line 81 "hlsl.l"
1307 {return KW_CBUFFER; }
1308 YY_BREAK
1309 case 9:
1310 YY_RULE_SETUP
1311 #line 82 "hlsl.l"
1312 {return KW_COMPILE; }
1313 YY_BREAK
1314 case 10:
1315 YY_RULE_SETUP
1316 #line 83 "hlsl.l"
1317 {return KW_CONST; }
1318 YY_BREAK
1319 case 11:
1320 YY_RULE_SETUP
1321 #line 84 "hlsl.l"
1322 {return KW_CONTINUE; }
1323 YY_BREAK
1324 case 12:
1325 YY_RULE_SETUP
1326 #line 85 "hlsl.l"
1327 {return KW_DEPTHSTENCILSTATE; }
1328 YY_BREAK
1329 case 13:
1330 YY_RULE_SETUP
1331 #line 86 "hlsl.l"
1332 {return KW_DEPTHSTENCILVIEW; }
1333 YY_BREAK
1334 case 14:
1335 YY_RULE_SETUP
1336 #line 87 "hlsl.l"
1337 {return KW_DISCARD; }
1338 YY_BREAK
1339 case 15:
1340 YY_RULE_SETUP
1341 #line 88 "hlsl.l"
1342 {return KW_DO; }
1343 YY_BREAK
1344 case 16:
1345 YY_RULE_SETUP
1346 #line 89 "hlsl.l"
1347 {return KW_DOUBLE; }
1348 YY_BREAK
1349 case 17:
1350 YY_RULE_SETUP
1351 #line 90 "hlsl.l"
1352 {return KW_ELSE; }
1353 YY_BREAK
1354 case 18:
1355 YY_RULE_SETUP
1356 #line 91 "hlsl.l"
1357 {return KW_EXTERN; }
1358 YY_BREAK
1359 case 19:
1360 YY_RULE_SETUP
1361 #line 92 "hlsl.l"
1362 {return KW_FALSE; }
1363 YY_BREAK
1364 case 20:
1365 YY_RULE_SETUP
1366 #line 93 "hlsl.l"
1367 {return KW_FOR; }
1368 YY_BREAK
1369 case 21:
1370 YY_RULE_SETUP
1371 #line 94 "hlsl.l"
1372 {return KW_GEOMETRYSHADER; }
1373 YY_BREAK
1374 case 22:
1375 YY_RULE_SETUP
1376 #line 95 "hlsl.l"
1377 {return KW_GROUPSHARED; }
1378 YY_BREAK
1379 case 23:
1380 YY_RULE_SETUP
1381 #line 96 "hlsl.l"
1382 {return KW_IF; }
1383 YY_BREAK
1384 case 24:
1385 YY_RULE_SETUP
1386 #line 97 "hlsl.l"
1387 {return KW_IN; }
1388 YY_BREAK
1389 case 25:
1390 YY_RULE_SETUP
1391 #line 98 "hlsl.l"
1392 {return KW_INLINE; }
1393 YY_BREAK
1394 case 26:
1395 YY_RULE_SETUP
1396 #line 99 "hlsl.l"
1397 {return KW_INOUT; }
1398 YY_BREAK
1399 case 27:
1400 YY_RULE_SETUP
1401 #line 100 "hlsl.l"
1402 {return KW_MATRIX; }
1403 YY_BREAK
1404 case 28:
1405 YY_RULE_SETUP
1406 #line 101 "hlsl.l"
1407 {return KW_NAMESPACE; }
1408 YY_BREAK
1409 case 29:
1410 YY_RULE_SETUP
1411 #line 102 "hlsl.l"
1412 {return KW_NOINTERPOLATION; }
1413 YY_BREAK
1414 case 30:
1415 YY_RULE_SETUP
1416 #line 103 "hlsl.l"
1417 {return KW_OUT; }
1418 YY_BREAK
1419 case 31:
1420 YY_RULE_SETUP
1421 #line 104 "hlsl.l"
1422 {return KW_PASS; }
1423 YY_BREAK
1424 case 32:
1425 YY_RULE_SETUP
1426 #line 105 "hlsl.l"
1427 {return KW_PIXELSHADER; }
1428 YY_BREAK
1429 case 33:
1430 YY_RULE_SETUP
1431 #line 106 "hlsl.l"
1432 {return KW_PRECISE; }
1433 YY_BREAK
1434 case 34:
1435 YY_RULE_SETUP
1436 #line 107 "hlsl.l"
1437 {return KW_RASTERIZERSTATE; }
1438 YY_BREAK
1439 case 35:
1440 YY_RULE_SETUP
1441 #line 108 "hlsl.l"
1442 {return KW_RENDERTARGETVIEW; }
1443 YY_BREAK
1444 case 36:
1445 YY_RULE_SETUP
1446 #line 109 "hlsl.l"
1447 {return KW_RETURN; }
1448 YY_BREAK
1449 case 37:
1450 YY_RULE_SETUP
1451 #line 110 "hlsl.l"
1452 {return KW_REGISTER; }
1453 YY_BREAK
1454 case 38:
1455 YY_RULE_SETUP
1456 #line 111 "hlsl.l"
1457 {return KW_SAMPLER; }
1458 YY_BREAK
1459 case 39:
1460 YY_RULE_SETUP
1461 #line 112 "hlsl.l"
1462 {return KW_SAMPLER1D; }
1463 YY_BREAK
1464 case 40:
1465 YY_RULE_SETUP
1466 #line 113 "hlsl.l"
1467 {return KW_SAMPLER2D; }
1468 YY_BREAK
1469 case 41:
1470 YY_RULE_SETUP
1471 #line 114 "hlsl.l"
1472 {return KW_SAMPLER3D; }
1473 YY_BREAK
1474 case 42:
1475 YY_RULE_SETUP
1476 #line 115 "hlsl.l"
1477 {return KW_SAMPLERCUBE; }
1478 YY_BREAK
1479 case 43:
1480 YY_RULE_SETUP
1481 #line 116 "hlsl.l"
1482 {return KW_SAMPLER_STATE; }
1483 YY_BREAK
1484 case 44:
1485 YY_RULE_SETUP
1486 #line 117 "hlsl.l"
1487 {return KW_SAMPLERCOMPARISONSTATE;}
1488 YY_BREAK
1489 case 45:
1490 YY_RULE_SETUP
1491 #line 118 "hlsl.l"
1492 {return KW_SHARED; }
1493 YY_BREAK
1494 case 46:
1495 YY_RULE_SETUP
1496 #line 119 "hlsl.l"
1497 {return KW_STATEBLOCK; }
1498 YY_BREAK
1499 case 47:
1500 YY_RULE_SETUP
1501 #line 120 "hlsl.l"
1502 {return KW_STATEBLOCK_STATE; }
1503 YY_BREAK
1504 case 48:
1505 YY_RULE_SETUP
1506 #line 121 "hlsl.l"
1507 {return KW_STATIC; }
1508 YY_BREAK
1509 case 49:
1510 YY_RULE_SETUP
1511 #line 122 "hlsl.l"
1512 {return KW_STRING; }
1513 YY_BREAK
1514 case 50:
1515 YY_RULE_SETUP
1516 #line 123 "hlsl.l"
1517 {return KW_STRUCT; }
1518 YY_BREAK
1519 case 51:
1520 YY_RULE_SETUP
1521 #line 124 "hlsl.l"
1522 {return KW_SWITCH; }
1523 YY_BREAK
1524 case 52:
1525 YY_RULE_SETUP
1526 #line 125 "hlsl.l"
1527 {return KW_TBUFFER; }
1528 YY_BREAK
1529 case 53:
1530 YY_RULE_SETUP
1531 #line 126 "hlsl.l"
1532 {return KW_TECHNIQUE; }
1533 YY_BREAK
1534 case 54:
1535 YY_RULE_SETUP
1536 #line 127 "hlsl.l"
1537 {return KW_TECHNIQUE10; }
1538 YY_BREAK
1539 case 55:
1540 YY_RULE_SETUP
1541 #line 128 "hlsl.l"
1542 {return KW_TEXTURE; }
1543 YY_BREAK
1544 case 56:
1545 YY_RULE_SETUP
1546 #line 129 "hlsl.l"
1547 {return KW_TEXTURE1D; }
1548 YY_BREAK
1549 case 57:
1550 YY_RULE_SETUP
1551 #line 130 "hlsl.l"
1552 {return KW_TEXTURE1DARRAY; }
1553 YY_BREAK
1554 case 58:
1555 YY_RULE_SETUP
1556 #line 131 "hlsl.l"
1557 {return KW_TEXTURE2D; }
1558 YY_BREAK
1559 case 59:
1560 YY_RULE_SETUP
1561 #line 132 "hlsl.l"
1562 {return KW_TEXTURE2DARRAY; }
1563 YY_BREAK
1564 case 60:
1565 YY_RULE_SETUP
1566 #line 133 "hlsl.l"
1567 {return KW_TEXTURE2DMS; }
1568 YY_BREAK
1569 case 61:
1570 YY_RULE_SETUP
1571 #line 134 "hlsl.l"
1572 {return KW_TEXTURE2DMSARRAY; }
1573 YY_BREAK
1574 case 62:
1575 YY_RULE_SETUP
1576 #line 135 "hlsl.l"
1577 {return KW_TEXTURE3D; }
1578 YY_BREAK
1579 case 63:
1580 YY_RULE_SETUP
1581 #line 136 "hlsl.l"
1582 {return KW_TEXTURE3DARRAY; }
1583 YY_BREAK
1584 case 64:
1585 YY_RULE_SETUP
1586 #line 137 "hlsl.l"
1587 {return KW_TEXTURECUBE; }
1588 YY_BREAK
1589 case 65:
1590 YY_RULE_SETUP
1591 #line 138 "hlsl.l"
1592 {return KW_TRUE; }
1593 YY_BREAK
1594 case 66:
1595 YY_RULE_SETUP
1596 #line 139 "hlsl.l"
1597 {return KW_TYPEDEF; }
1598 YY_BREAK
1599 case 67:
1600 YY_RULE_SETUP
1601 #line 140 "hlsl.l"
1602 {return KW_UNIFORM; }
1603 YY_BREAK
1604 case 68:
1605 YY_RULE_SETUP
1606 #line 141 "hlsl.l"
1607 {return KW_VECTOR; }
1608 YY_BREAK
1609 case 69:
1610 YY_RULE_SETUP
1611 #line 142 "hlsl.l"
1612 {return KW_VERTEXSHADER; }
1613 YY_BREAK
1614 case 70:
1615 YY_RULE_SETUP
1616 #line 143 "hlsl.l"
1617 {return KW_VOID; }
1618 YY_BREAK
1619 case 71:
1620 YY_RULE_SETUP
1621 #line 144 "hlsl.l"
1622 {return KW_VOLATILE; }
1623 YY_BREAK
1624 case 72:
1625 YY_RULE_SETUP
1626 #line 145 "hlsl.l"
1627 {return KW_WHILE; }
1628 YY_BREAK
1629 case 73:
1630 YY_RULE_SETUP
1631 #line 147 "hlsl.l"
1632 {return OP_INC; }
1633 YY_BREAK
1634 case 74:
1635 YY_RULE_SETUP
1636 #line 148 "hlsl.l"
1637 {return OP_DEC; }
1638 YY_BREAK
1639 case 75:
1640 YY_RULE_SETUP
1641 #line 149 "hlsl.l"
1642 {return OP_AND; }
1643 YY_BREAK
1644 case 76:
1645 YY_RULE_SETUP
1646 #line 150 "hlsl.l"
1647 {return OP_OR; }
1648 YY_BREAK
1649 case 77:
1650 YY_RULE_SETUP
1651 #line 151 "hlsl.l"
1652 {return OP_EQ; }
1653 YY_BREAK
1654 case 78:
1655 YY_RULE_SETUP
1656 #line 152 "hlsl.l"
1657 {return OP_LEFTSHIFT; }
1658 YY_BREAK
1659 case 79:
1660 YY_RULE_SETUP
1661 #line 153 "hlsl.l"
1662 {return OP_LEFTSHIFTASSIGN; }
1663 YY_BREAK
1664 case 80:
1665 YY_RULE_SETUP
1666 #line 154 "hlsl.l"
1667 {return OP_RIGHTSHIFT; }
1668 YY_BREAK
1669 case 81:
1670 YY_RULE_SETUP
1671 #line 155 "hlsl.l"
1672 {return OP_RIGHTSHIFTASSIGN; }
1673 YY_BREAK
1674 case 82:
1675 YY_RULE_SETUP
1676 #line 156 "hlsl.l"
1677 {return OP_ELLIPSIS; }
1678 YY_BREAK
1679 case 83:
1680 YY_RULE_SETUP
1681 #line 157 "hlsl.l"
1682 {return OP_LE; }
1683 YY_BREAK
1684 case 84:
1685 YY_RULE_SETUP
1686 #line 158 "hlsl.l"
1687 {return OP_GE; }
1688 YY_BREAK
1689 case 85:
1690 YY_RULE_SETUP
1691 #line 159 "hlsl.l"
1692 {return OP_NE; }
1693 YY_BREAK
1694 case 86:
1695 YY_RULE_SETUP
1696 #line 160 "hlsl.l"
1697 {return OP_ADDASSIGN; }
1698 YY_BREAK
1699 case 87:
1700 YY_RULE_SETUP
1701 #line 161 "hlsl.l"
1702 {return OP_SUBASSIGN; }
1703 YY_BREAK
1704 case 88:
1705 YY_RULE_SETUP
1706 #line 162 "hlsl.l"
1707 {return OP_MULASSIGN; }
1708 YY_BREAK
1709 case 89:
1710 YY_RULE_SETUP
1711 #line 163 "hlsl.l"
1712 {return OP_DIVASSIGN; }
1713 YY_BREAK
1714 case 90:
1715 YY_RULE_SETUP
1716 #line 164 "hlsl.l"
1717 {return OP_MODASSIGN; }
1718 YY_BREAK
1719 case 91:
1720 YY_RULE_SETUP
1721 #line 165 "hlsl.l"
1722 {return OP_ANDASSIGN; }
1723 YY_BREAK
1724 case 92:
1725 YY_RULE_SETUP
1726 #line 166 "hlsl.l"
1727 {return OP_ORASSIGN; }
1728 YY_BREAK
1729 case 93:
1730 YY_RULE_SETUP
1731 #line 167 "hlsl.l"
1732 {return OP_XORASSIGN; }
1733 YY_BREAK
1734 case 94:
1735 YY_RULE_SETUP
1736 #line 168 "hlsl.l"
1737 {return OP_UNKNOWN1; }
1738 YY_BREAK
1739 case 95:
1740 YY_RULE_SETUP
1741 #line 169 "hlsl.l"
1742 {return OP_UNKNOWN2; }
1743 YY_BREAK
1744 case 96:
1745 YY_RULE_SETUP
1746 #line 170 "hlsl.l"
1747 {return OP_UNKNOWN3; }
1748 YY_BREAK
1749 case 97:
1750 YY_RULE_SETUP
1751 #line 171 "hlsl.l"
1752 {return OP_UNKNOWN4; }
1753 YY_BREAK
1754 case 98:
1755 YY_RULE_SETUP
1756 #line 173 "hlsl.l"
1757 {return KW_COLUMN_MAJOR; }
1758 YY_BREAK
1759 case 99:
1760 YY_RULE_SETUP
1761 #line 174 "hlsl.l"
1762 {return KW_ROW_MAJOR; }
1763 YY_BREAK
1764 case 100:
1765 YY_RULE_SETUP
1766 #line 176 "hlsl.l"
1767 {
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;
1774 else
1775 return NEW_IDENTIFIER;
1776 }
1777 YY_BREAK
1778 case 101:
1779 YY_RULE_SETUP
1780 #line 187 "hlsl.l"
1781 {
1782 hlsl_lval.floatval = atof(hlsl_text);
1783 return C_FLOAT;
1784 }
1785 YY_BREAK
1786 case 102:
1787 YY_RULE_SETUP
1788 #line 191 "hlsl.l"
1789 {
1790 hlsl_lval.floatval = atof(hlsl_text);
1791 return C_FLOAT;
1792 }
1793 YY_BREAK
1794 case 103:
1795 YY_RULE_SETUP
1796 #line 195 "hlsl.l"
1797 {
1798 hlsl_lval.floatval = atof(hlsl_text);
1799 return C_FLOAT;
1800 }
1801 YY_BREAK
1802 case 104:
1803 YY_RULE_SETUP
1804 #line 199 "hlsl.l"
1805 {
1806 sscanf(hlsl_text, "0x%x", &hlsl_lval.intval);
1807 return C_INTEGER;
1808 }
1809 YY_BREAK
1810 case 105:
1811 YY_RULE_SETUP
1812 #line 203 "hlsl.l"
1813 {
1814 sscanf(hlsl_text, "0%o", &hlsl_lval.intval);
1815 return C_INTEGER;
1816 }
1817 YY_BREAK
1818 case 106:
1819 YY_RULE_SETUP
1820 #line 207 "hlsl.l"
1821 {
1822 hlsl_lval.intval = (atoi(hlsl_text));
1823 return C_INTEGER;
1824 }
1825 YY_BREAK
1826 case 107:
1827 YY_RULE_SETUP
1828 #line 212 "hlsl.l"
1829 {}
1830 YY_BREAK
1831 case 108:
1832 YY_RULE_SETUP
1833 #line 214 "hlsl.l"
1834 {}
1835 YY_BREAK
1836 case 109:
1837 /* rule 109 can match eol */
1838 YY_RULE_SETUP
1839 #line 215 "hlsl.l"
1840 {
1841 hlsl_ctx.line_no++;
1842 hlsl_ctx.column = 1;
1843 }
1844 YY_BREAK
1845 case 110:
1846 YY_RULE_SETUP
1847 #line 220 "hlsl.l"
1848 {
1849 BEGIN pp;
1850 }
1851 YY_BREAK
1852 case 111:
1853 YY_RULE_SETUP
1854 #line 224 "hlsl.l"
1855 {
1856 TRACE("Got a #pragma.\n");
1857 BEGIN pp_pragma;
1858 }
1859 YY_BREAK
1860 case 112:
1861 YY_RULE_SETUP
1862 #line 228 "hlsl.l"
1863 {
1864 TRACE("#pragma setting row_major mode.\n");
1865 hlsl_ctx.matrix_majority = HLSL_ROW_MAJOR;
1866 BEGIN pp_ignore;
1867 }
1868 YY_BREAK
1869 case 113:
1870 YY_RULE_SETUP
1871 #line 233 "hlsl.l"
1872 {
1873 TRACE("#pragma setting column_major mode.\n");
1874 hlsl_ctx.matrix_majority = HLSL_COLUMN_MAJOR;
1875 BEGIN pp_ignore;
1876 }
1877 YY_BREAK
1878 case 114:
1879 /* rule 114 can match eol */
1880 YY_RULE_SETUP
1881 #line 238 "hlsl.l"
1882 {
1883 FIXME("Unsupported preprocessor #pragma directive at line %u.\n", hlsl_ctx.line_no);
1884 BEGIN INITIAL;
1885 }
1886 YY_BREAK
1887 case 115:
1888 YY_RULE_SETUP
1889 #line 242 "hlsl.l"
1890 {}
1891 YY_BREAK
1892 case 116:
1893 YY_RULE_SETUP
1894 #line 243 "hlsl.l"
1895 {
1896 TRACE("Preprocessor line info.\n");
1897 BEGIN pp_line;
1898 hlsl_lval.intval = (atoi(hlsl_text));
1899 return PRE_LINE;
1900 }
1901 YY_BREAK
1902 case 117:
1903 /* rule 117 can match eol */
1904 YY_RULE_SETUP
1905 #line 249 "hlsl.l"
1906 {
1907 char *string = d3dcompiler_strdup(hlsl_text + 1);
1908
1909 BEGIN pp_ignore;
1910 string[strlen(string) - 1] = 0;
1911 hlsl_lval.name = string;
1912 return STRING;
1913 }
1914 YY_BREAK
1915 case 118:
1916 YY_RULE_SETUP
1917 #line 257 "hlsl.l"
1918 {}
1919 YY_BREAK
1920 case 119:
1921 /* rule 119 can match eol */
1922 YY_RULE_SETUP
1923 #line 258 "hlsl.l"
1924 {
1925 FIXME("Malformed preprocessor line directive?\n");
1926 BEGIN INITIAL;
1927 }
1928 YY_BREAK
1929 case 120:
1930 /* rule 120 can match eol */
1931 YY_RULE_SETUP
1932 #line 262 "hlsl.l"
1933 {
1934 BEGIN INITIAL;
1935 }
1936 YY_BREAK
1937 case 121:
1938 YY_RULE_SETUP
1939 #line 265 "hlsl.l"
1940 {}
1941 YY_BREAK
1942 case 122:
1943 /* rule 122 can match eol */
1944 YY_RULE_SETUP
1945 #line 266 "hlsl.l"
1946 {
1947 FIXME("Unexpected preprocessor directive.\n");
1948 BEGIN INITIAL;
1949 }
1950 YY_BREAK
1951 case 123:
1952 YY_RULE_SETUP
1953 #line 270 "hlsl.l"
1954 {}
1955 YY_BREAK
1956 case 124:
1957 YY_RULE_SETUP
1958 #line 272 "hlsl.l"
1959 {
1960 return hlsl_text[0];
1961 }
1962 YY_BREAK
1963 case 125:
1964 YY_RULE_SETUP
1965 #line 276 "hlsl.l"
1966 ECHO;
1967 YY_BREAK
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):
1974 yyterminate();
1975
1976 case YY_END_OF_BUFFER:
1977 {
1978 /* Amount of text matched not including the EOB char. */
1979 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1980
1981 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1982 *yy_cp = (yy_hold_char);
1983 YY_RESTORE_YY_MORE_OFFSET
1984
1985 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1986 {
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.
1995 */
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;
1999 }
2000
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
2006 * in input().
2007 */
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;
2011
2012 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2013
2014 yy_current_state = yy_get_previous_state( );
2015
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).
2023 */
2024
2025 yy_next_state = yy_try_NUL_trans( yy_current_state );
2026
2027 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2028
2029 if ( yy_next_state )
2030 {
2031 /* Consume the NUL. */
2032 yy_cp = ++(yy_c_buf_p);
2033 yy_current_state = yy_next_state;
2034 goto yy_match;
2035 }
2036
2037 else
2038 {
2039 yy_cp = (yy_last_accepting_cpos);
2040 yy_current_state = (yy_last_accepting_state);
2041 goto yy_find_action;
2042 }
2043 }
2044
2045 else switch ( yy_get_next_buffer( ) )
2046 {
2047 case EOB_ACT_END_OF_FILE:
2048 {
2049 (yy_did_buffer_switch_on_eof) = 0;
2050
2051 if ( hlsl_wrap( ) )
2052 {
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.
2061 */
2062 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2063
2064 yy_act = YY_STATE_EOF(YY_START);
2065 goto do_action;
2066 }
2067
2068 else
2069 {
2070 if ( ! (yy_did_buffer_switch_on_eof) )
2071 YY_NEW_FILE;
2072 }
2073 break;
2074 }
2075
2076 case EOB_ACT_CONTINUE_SCAN:
2077 (yy_c_buf_p) =
2078 (yytext_ptr) + yy_amount_of_matched_text;
2079
2080 yy_current_state = yy_get_previous_state( );
2081
2082 yy_cp = (yy_c_buf_p);
2083 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2084 goto yy_match;
2085
2086 case EOB_ACT_LAST_MATCH:
2087 (yy_c_buf_p) =
2088 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2089
2090 yy_current_state = yy_get_previous_state( );
2091
2092 yy_cp = (yy_c_buf_p);
2093 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2094 goto yy_find_action;
2095 }
2096 break;
2097 }
2098
2099 default:
2100 YY_FATAL_ERROR(
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 */
2105
2106 /* yy_get_next_buffer - try to read in a new buffer
2107 *
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
2112 */
2113 static int yy_get_next_buffer (void)
2114 {
2115 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2116 register char *source = (yytext_ptr);
2117 register int number_to_move, i;
2118 int ret_val;
2119
2120 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2121 YY_FATAL_ERROR(
2122 "fatal flex scanner internal error--end of buffer missed" );
2123
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 )
2127 {
2128 /* We matched a single character, the EOB, so
2129 * treat this as a final EOF.
2130 */
2131 return EOB_ACT_END_OF_FILE;
2132 }
2133
2134 else
2135 {
2136 /* We matched some text prior to the EOB, first
2137 * process it.
2138 */
2139 return EOB_ACT_LAST_MATCH;
2140 }
2141 }
2142
2143 /* Try to read more data. */
2144
2145 /* First move last chars to start of buffer. */
2146 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
2147
2148 for ( i = 0; i < number_to_move; ++i )
2149 *(dest++) = *(source++);
2150
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,
2153 * just force an EOF
2154 */
2155 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2156
2157 else
2158 {
2159 int num_to_read =
2160 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2161
2162 while ( num_to_read <= 0 )
2163 { /* Not enough room in the buffer - grow it. */
2164
2165 /* just a shorter name for the current buffer */
2166 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2167
2168 int yy_c_buf_p_offset =
2169 (int) ((yy_c_buf_p) - b->yy_ch_buf);
2170
2171 if ( b->yy_is_our_buffer )
2172 {
2173 int new_size = b->yy_buf_size * 2;
2174
2175 if ( new_size <= 0 )
2176 b->yy_buf_size += b->yy_buf_size / 8;
2177 else
2178 b->yy_buf_size *= 2;
2179
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 );
2183 }
2184 else
2185 /* Can't grow it, we don't own it. */
2186 b->yy_ch_buf = 0;
2187
2188 if ( ! b->yy_ch_buf )
2189 YY_FATAL_ERROR(
2190 "fatal error - scanner input buffer overflow" );
2191
2192 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2193
2194 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2195 number_to_move - 1;
2196
2197 }
2198
2199 if ( num_to_read > YY_READ_BUF_SIZE )
2200 num_to_read = YY_READ_BUF_SIZE;
2201
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 );
2205
2206 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2207 }
2208
2209 if ( (yy_n_chars) == 0 )
2210 {
2211 if ( number_to_move == YY_MORE_ADJ )
2212 {
2213 ret_val = EOB_ACT_END_OF_FILE;
2214 hlsl_restart(hlsl_in );
2215 }
2216
2217 else
2218 {
2219 ret_val = EOB_ACT_LAST_MATCH;
2220 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2221 YY_BUFFER_EOF_PENDING;
2222 }
2223 }
2224
2225 else
2226 ret_val = EOB_ACT_CONTINUE_SCAN;
2227
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()" );
2234 }
2235
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;
2239
2240 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2241
2242 return ret_val;
2243 }
2244
2245 /* yy_get_previous_state - get the state just before the EOB char was reached */
2246
2247 static yy_state_type yy_get_previous_state (void)
2248 {
2249 register yy_state_type yy_current_state;
2250 register char *yy_cp;
2251
2252 yy_current_state = (yy_start);
2253 yy_current_state += YY_AT_BOL();
2254
2255 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2256 {
2257 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2258 if ( yy_accept[yy_current_state] )
2259 {
2260 (yy_last_accepting_state) = yy_current_state;
2261 (yy_last_accepting_cpos) = yy_cp;
2262 }
2263 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2264 {
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];
2268 }
2269 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2270 }
2271
2272 return yy_current_state;
2273 }
2274
2275 /* yy_try_NUL_trans - try to make a transition on the NUL character
2276 *
2277 * synopsis
2278 * next_state = yy_try_NUL_trans( current_state );
2279 */
2280 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2281 {
2282 register int yy_is_jam;
2283 register char *yy_cp = (yy_c_buf_p);
2284
2285 register YY_CHAR yy_c = 1;
2286 if ( yy_accept[yy_current_state] )
2287 {
2288 (yy_last_accepting_state) = yy_current_state;
2289 (yy_last_accepting_cpos) = yy_cp;
2290 }
2291 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2292 {
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];
2296 }
2297 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2298 yy_is_jam = (yy_current_state == 716);
2299
2300 return yy_is_jam ? 0 : yy_current_state;
2301 }
2302
2303 #ifndef YY_NO_INPUT
2304 #ifdef __cplusplus
2305 static int yyinput (void)
2306 #else
2307 static int input (void)
2308 #endif
2309
2310 {
2311 int c;
2312
2313 *(yy_c_buf_p) = (yy_hold_char);
2314
2315 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2316 {
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.
2320 */
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';
2324
2325 else
2326 { /* need more input */
2327 int offset = (yy_c_buf_p) - (yytext_ptr);
2328 ++(yy_c_buf_p);
2329
2330 switch ( yy_get_next_buffer( ) )
2331 {
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.
2341 */
2342
2343 /* Reset buffer status. */
2344 hlsl_restart(hlsl_in );
2345
2346 /*FALLTHROUGH*/
2347
2348 case EOB_ACT_END_OF_FILE:
2349 {
2350 if ( hlsl_wrap( ) )
2351 return EOF;
2352
2353 if ( ! (yy_did_buffer_switch_on_eof) )
2354 YY_NEW_FILE;
2355 #ifdef __cplusplus
2356 return yyinput();
2357 #else
2358 return input();
2359 #endif
2360 }
2361
2362 case EOB_ACT_CONTINUE_SCAN:
2363 (yy_c_buf_p) = (yytext_ptr) + offset;
2364 break;
2365 }
2366 }
2367 }
2368
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);
2372
2373 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2374
2375 return c;
2376 }
2377 #endif /* ifndef YY_NO_INPUT */
2378
2379 /** Immediately switch to a different input stream.
2380 * @param input_file A readable stream.
2381 *
2382 * @note This function does not reset the start condition to @c INITIAL .
2383 */
2384 void hlsl_restart (FILE * input_file )
2385 {
2386
2387 if ( ! YY_CURRENT_BUFFER ){
2388 hlsl_ensure_buffer_stack ();
2389 YY_CURRENT_BUFFER_LVALUE =
2390 hlsl__create_buffer(hlsl_in,YY_BUF_SIZE );
2391 }
2392
2393 hlsl__init_buffer(YY_CURRENT_BUFFER,input_file );
2394 hlsl__load_buffer_state( );
2395 }
2396
2397 /** Switch to a different input buffer.
2398 * @param new_buffer The new input buffer.
2399 *
2400 */
2401 void hlsl__switch_to_buffer (YY_BUFFER_STATE new_buffer )
2402 {
2403
2404 /* TODO. We should be able to replace this entire function body
2405 * with
2406 * hlsl_pop_buffer_state();
2407 * hlsl_push_buffer_state(new_buffer);
2408 */
2409 hlsl_ensure_buffer_stack ();
2410 if ( YY_CURRENT_BUFFER == new_buffer )
2411 return;
2412
2413 if ( YY_CURRENT_BUFFER )
2414 {
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);
2419 }
2420
2421 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2422 hlsl__load_buffer_state( );
2423
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.
2428 */
2429 (yy_did_buffer_switch_on_eof) = 1;
2430 }
2431
2432 static void hlsl__load_buffer_state (void)
2433 {
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);
2438 }
2439
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.
2443 *
2444 * @return the allocated buffer state.
2445 */
2446 YY_BUFFER_STATE hlsl__create_buffer (FILE * file, int size )
2447 {
2448 YY_BUFFER_STATE b;
2449
2450 b = (YY_BUFFER_STATE) hlsl_alloc(sizeof( struct yy_buffer_state ) );
2451 if ( ! b )
2452 YY_FATAL_ERROR( "out of dynamic memory in hlsl__create_buffer()" );
2453
2454 b->yy_buf_size = size;
2455
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.
2458 */
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()" );
2462
2463 b->yy_is_our_buffer = 1;
2464
2465 hlsl__init_buffer(b,file );
2466
2467 return b;
2468 }
2469
2470 /** Destroy the buffer.
2471 * @param b a buffer created with hlsl__create_buffer()
2472 *
2473 */
2474 void hlsl__delete_buffer (YY_BUFFER_STATE b )
2475 {
2476
2477 if ( ! b )
2478 return;
2479
2480 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2481 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2482
2483 if ( b->yy_is_our_buffer )
2484 hlsl_free((void *) b->yy_ch_buf );
2485
2486 hlsl_free((void *) b );
2487 }
2488
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.
2492 */
2493 static void hlsl__init_buffer (YY_BUFFER_STATE b, FILE * file )
2494
2495 {
2496 int oerrno = errno;
2497
2498 hlsl__flush_buffer(b );
2499
2500 b->yy_input_file = file;
2501 b->yy_fill_buffer = 1;
2502
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.
2506 */
2507 if (b != YY_CURRENT_BUFFER){
2508 b->yy_bs_lineno = 1;
2509 b->yy_bs_column = 0;
2510 }
2511
2512 b->yy_is_interactive = 0;
2513
2514 errno = oerrno;
2515 }
2516
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.
2519 *
2520 */
2521 void hlsl__flush_buffer (YY_BUFFER_STATE b )
2522 {
2523 if ( ! b )
2524 return;
2525
2526 b->yy_n_chars = 0;
2527
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.
2531 */
2532 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2533 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2534
2535 b->yy_buf_pos = &b->yy_ch_buf[0];
2536
2537 b->yy_at_bol = 1;
2538 b->yy_buffer_status = YY_BUFFER_NEW;
2539
2540 if ( b == YY_CURRENT_BUFFER )
2541 hlsl__load_buffer_state( );
2542 }
2543
2544 /** Pushes the new state onto the stack. The new state becomes
2545 * the current state. This function will allocate the stack
2546 * if necessary.
2547 * @param new_buffer The new state.
2548 *
2549 */
2550 void hlsl_push_buffer_state (YY_BUFFER_STATE new_buffer )
2551 {
2552 if (new_buffer == NULL)
2553 return;
2554
2555 hlsl_ensure_buffer_stack();
2556
2557 /* This block is copied from hlsl__switch_to_buffer. */
2558 if ( YY_CURRENT_BUFFER )
2559 {
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);
2564 }
2565
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;
2570
2571 /* copied from hlsl__switch_to_buffer. */
2572 hlsl__load_buffer_state( );
2573 (yy_did_buffer_switch_on_eof) = 1;
2574 }
2575
2576 /** Removes and deletes the top of the stack, if present.
2577 * The next element becomes the new top.
2578 *
2579 */
2580 void hlsl_pop_buffer_state (void)
2581 {
2582 if (!YY_CURRENT_BUFFER)
2583 return;
2584
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);
2589
2590 if (YY_CURRENT_BUFFER) {
2591 hlsl__load_buffer_state( );
2592 (yy_did_buffer_switch_on_eof) = 1;
2593 }
2594 }
2595
2596 /* Allocates the stack if it does not exist.
2597 * Guarantees space for at least one push.
2598 */
2599 static void hlsl_ensure_buffer_stack (void)
2600 {
2601 int num_to_alloc;
2602
2603 if (!(yy_buffer_stack)) {
2604
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.
2608 */
2609 num_to_alloc = 1;
2610 (yy_buffer_stack) = (struct yy_buffer_state**)hlsl_alloc
2611 (num_to_alloc * sizeof(struct yy_buffer_state*)
2612 );
2613 if ( ! (yy_buffer_stack) )
2614 YY_FATAL_ERROR( "out of dynamic memory in hlsl_ensure_buffer_stack()" );
2615
2616 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2617
2618 (yy_buffer_stack_max) = num_to_alloc;
2619 (yy_buffer_stack_top) = 0;
2620 return;
2621 }
2622
2623 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2624
2625 /* Increase the buffer to prepare for a possible push. */
2626 int grow_size = 8 /* arbitrary grow size */;
2627
2628 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2629 (yy_buffer_stack) = (struct yy_buffer_state**)hlsl_realloc
2630 ((yy_buffer_stack),
2631 num_to_alloc * sizeof(struct yy_buffer_state*)
2632 );
2633 if ( ! (yy_buffer_stack) )
2634 YY_FATAL_ERROR( "out of dynamic memory in hlsl_ensure_buffer_stack()" );
2635
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;
2639 }
2640 }
2641
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
2645 *
2646 * @return the newly allocated buffer state object.
2647 */
2648 YY_BUFFER_STATE hlsl__scan_buffer (char * base, yy_size_t size )
2649 {
2650 YY_BUFFER_STATE b;
2651
2652 if ( size < 2 ||
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. */
2656 return 0;
2657
2658 b = (YY_BUFFER_STATE) hlsl_alloc(sizeof( struct yy_buffer_state ) );
2659 if ( ! b )
2660 YY_FATAL_ERROR( "out of dynamic memory in hlsl__scan_buffer()" );
2661
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;
2668 b->yy_at_bol = 1;
2669 b->yy_fill_buffer = 0;
2670 b->yy_buffer_status = YY_BUFFER_NEW;
2671
2672 hlsl__switch_to_buffer(b );
2673
2674 return b;
2675 }
2676
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
2680 *
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.
2684 */
2685 YY_BUFFER_STATE hlsl__scan_string (yyconst char * yystr )
2686 {
2687
2688 return hlsl__scan_bytes(yystr,strlen(yystr) );
2689 }
2690
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.
2695 *
2696 * @return the newly allocated buffer state object.
2697 */
2698 YY_BUFFER_STATE hlsl__scan_bytes (yyconst char * yybytes, int _yybytes_len )
2699 {
2700 YY_BUFFER_STATE b;
2701 char *buf;
2702 yy_size_t n;
2703 int i;
2704
2705 /* Get memory for full buffer, including space for trailing EOB's. */
2706 n = _yybytes_len + 2;
2707 buf = (char *) hlsl_alloc(n );
2708 if ( ! buf )
2709 YY_FATAL_ERROR( "out of dynamic memory in hlsl__scan_bytes()" );
2710
2711 for ( i = 0; i < _yybytes_len; ++i )
2712 buf[i] = yybytes[i];
2713
2714 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2715
2716 b = hlsl__scan_buffer(buf,n );
2717 if ( ! b )
2718 YY_FATAL_ERROR( "bad buffer in hlsl__scan_bytes()" );
2719
2720 /* It's okay to grow etc. this buffer, and we should throw it
2721 * away when we're done.
2722 */
2723 b->yy_is_our_buffer = 1;
2724
2725 return b;
2726 }
2727
2728 #ifndef YY_EXIT_FAILURE
2729 #define YY_EXIT_FAILURE 2
2730 #endif
2731
2732 static void yy_fatal_error (yyconst char* msg )
2733 {
2734 (void) fprintf( stderr, "%s\n", msg );
2735 exit( YY_EXIT_FAILURE );
2736 }
2737
2738 /* Redefine yyless() so it works in section 3 code. */
2739
2740 #undef yyless
2741 #define yyless(n) \
2742 do \
2743 { \
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; \
2752 } \
2753 while ( 0 )
2754
2755 /* Accessor methods (get/set functions) to struct members. */
2756
2757 /** Get the current line number.
2758 *
2759 */
2760 int hlsl_get_lineno (void)
2761 {
2762
2763 return hlsl_lineno;
2764 }
2765
2766 /** Get the input stream.
2767 *
2768 */
2769 FILE *hlsl_get_in (void)
2770 {
2771 return hlsl_in;
2772 }
2773
2774 /** Get the output stream.
2775 *
2776 */
2777 FILE *hlsl_get_out (void)
2778 {
2779 return hlsl_out;
2780 }
2781
2782 /** Get the length of the current token.
2783 *
2784 */
2785 int hlsl_get_leng (void)
2786 {
2787 return hlsl_leng;
2788 }
2789
2790 /** Get the current token.
2791 *
2792 */
2793
2794 char *hlsl_get_text (void)
2795 {
2796 return hlsl_text;
2797 }
2798
2799 /** Set the current line number.
2800 * @param line_number
2801 *
2802 */
2803 void hlsl_set_lineno (int line_number )
2804 {
2805
2806 hlsl_lineno = line_number;
2807 }
2808
2809 /** Set the input stream. This does not discard the current
2810 * input buffer.
2811 * @param in_str A readable stream.
2812 *
2813 * @see hlsl__switch_to_buffer
2814 */
2815 void hlsl_set_in (FILE * in_str )
2816 {
2817 hlsl_in = in_str ;
2818 }
2819
2820 void hlsl_set_out (FILE * out_str )
2821 {
2822 hlsl_out = out_str ;
2823 }
2824
2825 int hlsl_get_debug (void)
2826 {
2827 return hlsl__flex_debug;
2828 }
2829
2830 void hlsl_set_debug (int bdebug )
2831 {
2832 hlsl__flex_debug = bdebug ;
2833 }
2834
2835 static int yy_init_globals (void)
2836 {
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.
2839 */
2840
2841 (yy_buffer_stack) = 0;
2842 (yy_buffer_stack_top) = 0;
2843 (yy_buffer_stack_max) = 0;
2844 (yy_c_buf_p) = (char *) 0;
2845 (yy_init) = 0;
2846 (yy_start) = 0;
2847
2848 /* Defined in main.c */
2849 #ifdef YY_STDINIT
2850 hlsl_in = stdin;
2851 hlsl_out = stdout;
2852 #else
2853 hlsl_in = (FILE *) 0;
2854 hlsl_out = (FILE *) 0;
2855 #endif
2856
2857 /* For future reference: Set errno on error, since we are called by
2858 * hlsl_lex_init()
2859 */
2860 return 0;
2861 }
2862
2863 /* hlsl_lex_destroy is for both reentrant and non-reentrant scanners. */
2864 int hlsl_lex_destroy (void)
2865 {
2866
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();
2872 }
2873
2874 /* Destroy the stack itself. */
2875 hlsl_free((yy_buffer_stack) );
2876 (yy_buffer_stack) = NULL;
2877
2878 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2879 * hlsl_lex() is called, initialization will occur. */
2880 yy_init_globals( );
2881
2882 return 0;
2883 }
2884
2885 /*
2886 * Internal utility routines.
2887 */
2888
2889 #ifndef yytext_ptr
2890 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2891 {
2892 register int i;
2893 for ( i = 0; i < n; ++i )
2894 s1[i] = s2[i];
2895 }
2896 #endif
2897
2898 #ifdef YY_NEED_STRLEN
2899 static int yy_flex_strlen (yyconst char * s )
2900 {
2901 register int n;
2902 for ( n = 0; s[n]; ++n )
2903 ;
2904
2905 return n;
2906 }
2907 #endif
2908
2909 void *hlsl_alloc (yy_size_t size )
2910 {
2911 return (void *) malloc( size );
2912 }
2913
2914 void *hlsl_realloc (void * ptr, yy_size_t size )
2915 {
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.
2922 */
2923 return (void *) realloc( (char *) ptr, size );
2924 }
2925
2926 void hlsl_free (void * ptr )
2927 {
2928 free( (char *) ptr ); /* see hlsl_realloc() for (char *) cast */
2929 }
2930
2931 #define YYTABLES_NAME "yytables"
2932
2933 #line 276 "hlsl.l"
2934
2935
2936
2937 struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD minor,
2938 const char *entrypoint, char **messages);
2939
2940 struct bwriter_shader *parse_hlsl_shader(const char *text, enum shader_type type, DWORD major, DWORD minor,
2941 const char *entrypoint, char **messages)
2942 {
2943 struct bwriter_shader *ret = NULL;
2944 YY_BUFFER_STATE buffer;
2945
2946 buffer = hlsl__scan_string(text);
2947 hlsl__switch_to_buffer(buffer);
2948
2949 ret = parse_hlsl(type, major, minor, entrypoint, messages);
2950
2951 hlsl__delete_buffer(buffer);
2952 return ret;
2953 }
2954