[D3DCOMPILER_43]
[reactos.git] / reactos / dll / directx / wine / d3dcompiler_43 / asmshader.yy.c
1 #line 2 "asmshader.yy.c"
2
3 #line 4 "asmshader.yy.c"
4
5 #define YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define yy_create_buffer asmshader__create_buffer
10 #define yy_delete_buffer asmshader__delete_buffer
11 #define yy_flex_debug asmshader__flex_debug
12 #define yy_init_buffer asmshader__init_buffer
13 #define yy_flush_buffer asmshader__flush_buffer
14 #define yy_load_buffer_state asmshader__load_buffer_state
15 #define yy_switch_to_buffer asmshader__switch_to_buffer
16 #define yyin asmshader_in
17 #define yyleng asmshader_leng
18 #define yylex asmshader_lex
19 #define yylineno asmshader_lineno
20 #define yyout asmshader_out
21 #define yyrestart asmshader_restart
22 #define yytext asmshader_text
23 #define yywrap asmshader_wrap
24 #define yyalloc asmshader_alloc
25 #define yyrealloc asmshader_realloc
26 #define yyfree asmshader_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 asmshader_restart(asmshader_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 asmshader_leng;
185
186 extern FILE *asmshader_in, *asmshader_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 asmshader_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 asmshader_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 asmshader_restart()), so that the user can continue scanning by
273 * just pointing asmshader_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 asmshader_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 asmshader_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 asmshader_wrap()'s to do buffer switches
311 * instead of setting up a fresh asmshader_in. A bit of a hack ...
312 */
313 static int yy_did_buffer_switch_on_eof;
314
315 void asmshader_restart (FILE *input_file );
316 void asmshader__switch_to_buffer (YY_BUFFER_STATE new_buffer );
317 YY_BUFFER_STATE asmshader__create_buffer (FILE *file,int size );
318 void asmshader__delete_buffer (YY_BUFFER_STATE b );
319 void asmshader__flush_buffer (YY_BUFFER_STATE b );
320 void asmshader_push_buffer_state (YY_BUFFER_STATE new_buffer );
321 void asmshader_pop_buffer_state (void );
322
323 static void asmshader_ensure_buffer_stack (void );
324 static void asmshader__load_buffer_state (void );
325 static void asmshader__init_buffer (YY_BUFFER_STATE b,FILE *file );
326
327 #define YY_FLUSH_BUFFER asmshader__flush_buffer(YY_CURRENT_BUFFER )
328
329 YY_BUFFER_STATE asmshader__scan_buffer (char *base,yy_size_t size );
330 YY_BUFFER_STATE asmshader__scan_string (yyconst char *yy_str );
331 YY_BUFFER_STATE asmshader__scan_bytes (yyconst char *bytes,int len );
332
333 void *asmshader_alloc (yy_size_t );
334 void *asmshader_realloc (void *,yy_size_t );
335 void asmshader_free (void * );
336
337 #define yy_new_buffer asmshader__create_buffer
338
339 #define yy_set_interactive(is_interactive) \
340 { \
341 if ( ! YY_CURRENT_BUFFER ){ \
342 asmshader_ensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 asmshader__create_buffer(asmshader_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 asmshader_ensure_buffer_stack (); \
353 YY_CURRENT_BUFFER_LVALUE = \
354 asmshader__create_buffer(asmshader_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 asmshader_wrap() 1
364 #define YY_SKIP_YYWRAP
365
366 typedef unsigned char YY_CHAR;
367
368 FILE *asmshader_in = (FILE *) 0, *asmshader_out = (FILE *) 0;
369
370 typedef int yy_state_type;
371
372 extern int asmshader_lineno;
373
374 int asmshader_lineno = 1;
375
376 extern char *asmshader_text;
377 #define yytext_ptr asmshader_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 asmshader_text.
386 */
387 #define YY_DO_BEFORE_ACTION \
388 (yytext_ptr) = yy_bp; \
389 asmshader_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 174
395 #define YY_END_OF_BUFFER 175
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[481] =
404 { 0,
405 0, 0, 175, 173, 171, 172, 173, 149, 173, 141,
406 142, 143, 139, 140, 119, 173, 136, 170, 173, 120,
407 120, 88, 173, 173, 173, 120, 173, 173, 173, 173,
408 86, 173, 120, 173, 173, 87, 171, 172, 0, 168,
409 0, 136, 136, 169, 136, 136, 170, 0, 0, 0,
410 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
411 0, 0, 0, 102, 103, 0, 0, 90, 0, 0,
412 88, 0, 0, 0, 0, 0, 0, 0, 0, 0,
413 0, 0, 0, 0, 89, 39, 105, 0, 0, 0,
414 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,
415
416 0, 0, 0, 0, 0, 104, 0, 0, 0, 85,
417 0, 0, 0, 93, 0, 0, 0, 0, 0, 91,
418 0, 0, 87, 0, 0, 0, 169, 164, 165, 0,
419 0, 0, 0, 0, 0, 0, 124, 125, 126, 0,
420 147, 146, 134, 0, 132, 130, 133, 131, 135, 0,
421 0, 128, 0, 0, 0, 0, 0, 121, 122, 123,
422 15, 1, 78, 0, 0, 55, 54, 24, 33, 34,
423 0, 9, 10, 20, 79, 80, 0, 0, 16, 0,
424 22, 0, 52, 17, 0, 21, 0, 0, 5, 12,
425 11, 3, 6, 2, 26, 98, 97, 0, 0, 0,
426
427 0, 92, 0, 23, 0, 0, 7, 37, 47, 8,
428 0, 14, 25, 0, 13, 4, 60, 0, 0, 0,
429 0, 0, 148, 0, 0, 0, 145, 0, 0, 0,
430 0, 161, 0, 0, 0, 0, 127, 0, 0, 0,
431 0, 0, 44, 35, 36, 0, 40, 0, 0, 0,
432 18, 0, 0, 19, 46, 32, 31, 30, 29, 28,
433 53, 0, 95, 94, 96, 0, 0, 0, 0, 0,
434 0, 0, 50, 0, 0, 0, 0, 0, 0, 0,
435 0, 137, 0, 100, 0, 0, 0, 0, 0, 0,
436 144, 0, 0, 0, 0, 166, 0, 161, 0, 0,
437
438 0, 0, 0, 0, 0, 0, 42, 0, 0, 41,
439 0, 0, 138, 49, 0, 84, 0, 0, 0, 0,
440 0, 0, 0, 0, 0, 0, 0, 0, 0, 61,
441 0, 0, 101, 0, 0, 0, 0, 0, 0, 0,
442 0, 0, 160, 162, 0, 0, 154, 0, 0, 0,
443 0, 0, 43, 45, 56, 0, 38, 99, 111, 112,
444 113, 114, 115, 116, 117, 118, 27, 62, 0, 58,
445 0, 75, 0, 82, 83, 51, 81, 0, 0, 106,
446 107, 108, 109, 110, 0, 0, 0, 0, 160, 162,
447 153, 0, 154, 163, 0, 0, 0, 167, 48, 63,
448
449 0, 0, 0, 59, 0, 76, 0, 0, 0, 0,
450 0, 153, 0, 163, 156, 0, 0, 57, 77, 0,
451 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
452 157, 0, 0, 129, 150, 156, 0, 155, 73, 0,
453 0, 0, 0, 0, 0, 0, 64, 65, 0, 157,
454 0, 0, 150, 159, 0, 155, 0, 67, 68, 69,
455 0, 72, 0, 66, 0, 0, 159, 158, 0, 70,
456 0, 0, 151, 158, 74, 71, 152, 151, 152, 0
457 } ;
458
459 static yyconst flex_int32_t yy_ec[256] =
460 { 0,
461 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
462 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 2, 5, 1, 6, 1, 1, 1, 1, 7,
465 8, 1, 9, 10, 11, 12, 13, 14, 15, 16,
466 17, 18, 19, 19, 19, 20, 19, 1, 21, 1,
467 1, 1, 1, 1, 1, 1, 22, 23, 1, 24,
468 1, 1, 1, 1, 1, 25, 1, 1, 1, 26,
469 1, 1, 1, 27, 1, 1, 1, 1, 1, 1,
470 28, 1, 29, 1, 30, 1, 31, 32, 33, 34,
471
472 35, 36, 37, 38, 39, 1, 40, 41, 42, 43,
473 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
474 54, 55, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
486 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
487 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
488 1, 1, 1, 1, 1
489 } ;
490
491 static yyconst flex_int32_t yy_meta[56] =
492 { 0,
493 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
494 1, 3, 1, 4, 4, 4, 4, 4, 4, 4,
495 1, 1, 1, 5, 1, 5, 1, 1, 1, 1,
496 6, 1, 7, 1, 8, 3, 1, 1, 9, 1,
497 1, 10, 10, 9, 1, 1, 11, 12, 1, 1,
498 1, 1, 1, 1, 1
499 } ;
500
501 static yyconst flex_int16_t yy_base[491] =
502 { 0,
503 0, 0, 889, 890, 886, 890, 884, 890, 883, 890,
504 890, 890, 890, 44, 51, 872, 45, 0, 67, 59,
505 39, 45, 61, 36, 64, 890, 107, 97, 114, 28,
506 151, 91, 107, 165, 43, 124, 882, 890, 880, 890,
507 172, 101, 193, 0, 202, 890, 0, 848, 847, 848,
508 108, 189, 179, 833, 834, 84, 103, 116, 182, 846,
509 99, 832, 178, 890, 890, 827, 840, 226, 831, 837,
510 233, 830, 825, 835, 820, 826, 830, 219, 205, 817,
511 830, 818, 821, 828, 246, 890, 253, 828, 810, 70,
512 813, 804, 803, 123, 812, 803, 812, 807, 809, 260,
513
514 267, 274, 806, 36, 276, 890, 818, 796, 193, 283,
515 802, 114, 800, 296, 796, 111, 801, 794, 810, 303,
516 788, 790, 310, 808, 794, 319, 0, 890, 890, 789,
517 301, 801, 819, 791, 792, 800, 890, 890, 890, 786,
518 890, 890, 890, 793, 890, 890, 890, 890, 890, 782,
519 780, 890, 788, 183, 783, 285, 784, 890, 890, 890,
520 890, 890, 890, 793, 782, 890, 890, 890, 890, 302,
521 791, 890, 890, 890, 890, 890, 786, 296, 775, 771,
522 890, 783, 890, 772, 771, 890, 239, 287, 890, 890,
523 890, 784, 890, 890, 890, 336, 890, 769, 776, 764,
524
525 763, 343, 762, 890, 291, 330, 890, 890, 890, 890,
526 764, 890, 890, 775, 890, 890, 332, 772, 773, 757,
527 352, 360, 890, 756, 759, 759, 890, 752, 756, 764,
528 749, 366, 755, 757, 740, 749, 890, 756, 744, 758,
529 740, 749, 745, 890, 890, 753, 890, 750, 741, 749,
530 890, 748, 741, 890, 890, 890, 890, 890, 890, 890,
531 890, 732, 890, 890, 890, 745, 767, 766, 765, 746,
532 745, 744, 890, 729, 737, 292, 158, 732, 736, 752,
533 733, 890, 732, 890, 754, 753, 752, 733, 732, 731,
534 890, 713, 725, 711, 710, 890, 718, 373, 724, 705,
535
536 718, 711, 716, 714, 705, 706, 702, 691, 711, 890,
537 700, 698, 890, 890, 704, 890, 380, 103, 727, 385,
538 148, 726, 691, 696, 693, 702, 690, 717, 692, 372,
539 679, 694, 890, 356, 391, 716, 393, 395, 715, 686,
540 371, 683, 410, 417, 685, 686, 435, 689, 670, 679,
541 665, 673, 890, 890, 890, 662, 890, 890, 890, 890,
542 890, 890, 890, 890, 890, 890, 890, 665, 658, 890,
543 652, 651, 657, 890, 890, 890, 890, 395, 681, 890,
544 890, 890, 890, 890, 665, 650, 657, 652, 442, 449,
545 456, 644, 463, 470, 638, 651, 635, 890, 890, 890,
546
547 647, 641, 640, 890, 457, 370, 461, 633, 639, 632,
548 634, 495, 624, 502, 509, 616, 630, 890, 890, 610,
549 616, 476, 470, 473, 458, 466, 452, 452, 465, 459,
550 516, 456, 457, 890, 523, 530, 449, 537, 890, 402,
551 412, 392, 409, 407, 388, 395, 890, 890, 407, 544,
552 405, 384, 551, 559, 373, 566, 367, 890, 890, 890,
553 381, 890, 343, 890, 313, 293, 573, 580, 302, 890,
554 195, 49, 587, 594, 890, 890, 601, 608, 615, 890,
555 635, 645, 649, 658, 666, 674, 682, 691, 699, 711
556 } ;
557
558 static yyconst flex_int16_t yy_def[491] =
559 { 0,
560 480, 1, 480, 480, 480, 480, 480, 480, 481, 480,
561 480, 480, 480, 480, 480, 480, 482, 483, 480, 480,
562 484, 485, 480, 480, 480, 480, 480, 486, 480, 480,
563 480, 480, 487, 480, 488, 489, 480, 480, 481, 480,
564 480, 482, 480, 490, 480, 480, 483, 480, 480, 480,
565 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
566 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
567 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
568 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
569 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
570
571 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
572 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
573 480, 480, 480, 480, 480, 480, 490, 480, 480, 480,
574 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
575 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
576 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
577 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
578 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
579 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
580 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
581
582 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
583 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
584 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
585 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
586 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
587 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
588 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
589 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
590 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
591 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
592
593 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
594 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
595 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
596 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
597 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
598 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
599 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
600 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
601 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
602 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
603
604 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
605 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
606 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
607 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
608 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
609 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
610 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
611 480, 480, 480, 480, 480, 480, 480, 480, 480, 0,
612 480, 480, 480, 480, 480, 480, 480, 480, 480, 480
613 } ;
614
615 static yyconst flex_int16_t yy_nxt[946] =
616 { 0,
617 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
618 14, 15, 16, 17, 17, 17, 17, 17, 17, 17,
619 18, 4, 4, 4, 4, 4, 4, 12, 12, 19,
620 20, 21, 22, 23, 24, 25, 26, 4, 27, 4,
621 28, 29, 30, 31, 32, 4, 33, 34, 35, 4,
622 36, 26, 26, 26, 26, 41, 45, 42, 42, 42,
623 42, 42, 42, 42, 43, 43, 43, 43, 43, 43,
624 43, 98, 64, 69, 99, 72, 80, 121, 81, 200,
625 46, 48, 49, 65, 201, 70, 73, 74, 82, 122,
626 66, 75, 67, 76, 83, 77, 477, 50, 51, 52,
627
628 53, 54, 55, 56, 106, 78, 184, 57, 79, 58,
629 84, 59, 45, 185, 60, 61, 364, 62, 145, 63,
630 85, 85, 85, 85, 85, 85, 85, 88, 107, 155,
631 92, 93, 146, 156, 108, 89, 46, 147, 109, 111,
632 90, 112, 86, 91, 94, 212, 131, 124, 132, 125,
633 149, 148, 95, 213, 113, 365, 189, 96, 208, 150,
634 133, 364, 209, 97, 100, 100, 100, 100, 100, 100,
635 100, 126, 101, 102, 103, 190, 104, 105, 114, 114,
636 114, 114, 114, 114, 114, 43, 43, 43, 43, 43,
637 43, 43, 327, 158, 137, 159, 138, 160, 139, 115,
638
639 365, 116, 328, 117, 205, 118, 43, 43, 43, 43,
640 43, 43, 43, 140, 119, 43, 43, 43, 43, 43,
641 43, 43, 206, 134, 236, 151, 152, 476, 46, 153,
642 141, 237, 135, 142, 171, 172, 173, 46, 136, 68,
643 68, 68, 68, 68, 68, 68, 71, 71, 71, 71,
644 71, 71, 71, 174, 256, 257, 258, 175, 176, 85,
645 85, 85, 85, 85, 85, 85, 87, 87, 87, 87,
646 87, 87, 87, 100, 100, 100, 100, 100, 100, 100,
647 196, 196, 196, 196, 196, 196, 196, 197, 197, 202,
648 202, 202, 202, 202, 202, 202, 110, 110, 110, 110,
649
650 110, 110, 110, 259, 260, 267, 268, 269, 198, 114,
651 114, 114, 114, 114, 114, 114, 120, 120, 120, 120,
652 120, 120, 120, 123, 123, 123, 123, 123, 123, 123,
653 221, 224, 239, 244, 248, 325, 249, 240, 326, 475,
654 245, 473, 250, 225, 270, 271, 272, 472, 222, 196,
655 196, 196, 196, 196, 196, 196, 202, 202, 202, 202,
656 202, 202, 202, 275, 276, 277, 285, 286, 287, 380,
657 381, 278, 279, 280, 288, 289, 290, 471, 281, 298,
658 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
659 298, 298, 298, 359, 360, 361, 362, 363, 359, 360,
660
661 361, 362, 363, 374, 382, 375, 380, 381, 382, 386,
662 405, 406, 376, 470, 424, 469, 377, 425, 426, 468,
663 427, 466, 387, 389, 389, 389, 389, 389, 389, 389,
664 390, 390, 390, 390, 390, 390, 390, 465, 464, 463,
665 462, 461, 460, 383, 459, 458, 457, 383, 393, 393,
666 393, 393, 393, 393, 393, 389, 389, 389, 389, 389,
667 389, 389, 390, 390, 390, 390, 390, 390, 390, 412,
668 412, 412, 412, 412, 412, 412, 393, 393, 393, 393,
669 393, 393, 393, 414, 414, 414, 414, 414, 414, 414,
670 421, 428, 455, 452, 451, 449, 448, 429, 447, 446,
671
672 445, 422, 444, 443, 442, 423, 441, 430, 412, 412,
673 412, 412, 412, 412, 412, 414, 414, 414, 414, 414,
674 414, 414, 436, 436, 436, 436, 436, 436, 436, 450,
675 450, 450, 450, 450, 450, 450, 453, 453, 453, 453,
676 453, 453, 453, 436, 436, 436, 436, 436, 436, 436,
677 456, 456, 456, 456, 456, 456, 456, 450, 450, 450,
678 450, 450, 450, 450, 453, 453, 453, 453, 453, 453,
679 453, 454, 467, 467, 467, 467, 467, 467, 467, 456,
680 456, 456, 456, 456, 456, 456, 467, 467, 467, 467,
681 467, 467, 467, 474, 474, 474, 474, 474, 474, 474,
682
683 478, 478, 478, 478, 478, 478, 478, 474, 474, 474,
684 474, 474, 474, 474, 479, 479, 479, 479, 479, 479,
685 479, 478, 478, 478, 478, 478, 478, 478, 479, 479,
686 479, 479, 479, 479, 479, 39, 39, 39, 39, 39,
687 39, 39, 39, 39, 39, 39, 39, 42, 42, 47,
688 440, 47, 47, 47, 47, 47, 47, 47, 47, 47,
689 47, 68, 439, 438, 437, 68, 435, 434, 68, 71,
690 433, 71, 432, 431, 420, 71, 71, 87, 419, 87,
691 418, 417, 87, 416, 87, 110, 415, 413, 110, 110,
692 411, 410, 409, 110, 120, 408, 407, 404, 120, 403,
693
694 402, 120, 123, 123, 401, 400, 399, 398, 397, 396,
695 123, 127, 395, 127, 127, 127, 127, 127, 127, 127,
696 127, 127, 127, 394, 392, 391, 388, 385, 384, 384,
697 379, 378, 373, 372, 371, 370, 369, 368, 367, 366,
698 366, 358, 357, 356, 355, 354, 353, 352, 351, 350,
699 349, 348, 347, 346, 345, 344, 343, 342, 341, 340,
700 339, 338, 337, 336, 335, 334, 333, 332, 331, 330,
701 329, 324, 323, 322, 321, 320, 319, 318, 317, 316,
702 315, 314, 313, 312, 311, 310, 309, 308, 307, 306,
703 305, 304, 303, 302, 301, 300, 299, 297, 296, 295,
704
705 294, 293, 292, 291, 284, 283, 282, 274, 273, 266,
706 265, 264, 263, 262, 261, 255, 254, 253, 252, 251,
707 247, 246, 243, 242, 241, 238, 235, 234, 233, 232,
708 231, 230, 229, 228, 227, 226, 223, 220, 219, 218,
709 217, 216, 215, 214, 211, 210, 207, 204, 203, 199,
710 195, 194, 193, 192, 191, 188, 187, 186, 183, 182,
711 181, 180, 179, 178, 177, 170, 169, 168, 167, 166,
712 165, 164, 163, 162, 161, 157, 154, 144, 143, 130,
713 129, 128, 40, 37, 44, 40, 38, 37, 480, 3,
714 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
715
716 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
717 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
718 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
719 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
720 480, 480, 480, 480, 480
721 } ;
722
723 static yyconst flex_int16_t yy_chk[946] =
724 { 0,
725 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
726 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
727 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
728 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
729 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
730 1, 1, 1, 1, 1, 14, 17, 14, 14, 14,
731 14, 14, 14, 14, 15, 15, 15, 15, 15, 15,
732 15, 30, 20, 21, 30, 22, 24, 35, 24, 104,
733 17, 19, 19, 20, 104, 21, 22, 22, 24, 35,
734 20, 22, 20, 23, 25, 23, 472, 19, 19, 19,
735
736 19, 19, 19, 19, 32, 23, 90, 19, 23, 19,
737 25, 19, 42, 90, 19, 19, 318, 19, 56, 19,
738 27, 27, 27, 27, 27, 27, 27, 28, 32, 61,
739 29, 29, 56, 61, 32, 28, 42, 57, 32, 33,
740 28, 33, 27, 28, 29, 116, 51, 36, 51, 36,
741 58, 57, 29, 116, 33, 318, 94, 29, 112, 58,
742 51, 321, 112, 29, 31, 31, 31, 31, 31, 31,
743 31, 36, 31, 31, 31, 94, 31, 31, 34, 34,
744 34, 34, 34, 34, 34, 41, 41, 41, 41, 41,
745 41, 41, 277, 63, 53, 63, 53, 63, 53, 34,
746
747 321, 34, 277, 34, 109, 34, 43, 43, 43, 43,
748 43, 43, 43, 53, 34, 45, 45, 45, 45, 45,
749 45, 45, 109, 52, 154, 59, 59, 471, 43, 59,
750 53, 154, 52, 53, 78, 78, 78, 45, 52, 68,
751 68, 68, 68, 68, 68, 68, 71, 71, 71, 71,
752 71, 71, 71, 79, 187, 187, 187, 79, 79, 85,
753 85, 85, 85, 85, 85, 85, 87, 87, 87, 87,
754 87, 87, 87, 100, 100, 100, 100, 100, 100, 100,
755 101, 101, 101, 101, 101, 101, 101, 102, 102, 105,
756 105, 105, 105, 105, 105, 105, 110, 110, 110, 110,
757
758 110, 110, 110, 188, 188, 205, 205, 205, 102, 114,
759 114, 114, 114, 114, 114, 114, 120, 120, 120, 120,
760 120, 120, 120, 123, 123, 123, 123, 123, 123, 123,
761 126, 131, 156, 170, 178, 276, 178, 156, 276, 469,
762 170, 466, 178, 131, 206, 206, 206, 465, 126, 196,
763 196, 196, 196, 196, 196, 196, 202, 202, 202, 202,
764 202, 202, 202, 217, 217, 217, 221, 221, 221, 334,
765 334, 217, 217, 217, 222, 222, 222, 463, 217, 232,
766 232, 232, 232, 232, 232, 232, 298, 298, 298, 298,
767 298, 298, 298, 317, 317, 317, 317, 317, 320, 320,
768
769 320, 320, 320, 330, 335, 330, 337, 337, 338, 341,
770 378, 378, 330, 461, 406, 457, 330, 406, 406, 455,
771 406, 452, 341, 343, 343, 343, 343, 343, 343, 343,
772 344, 344, 344, 344, 344, 344, 344, 451, 449, 446,
773 445, 444, 443, 335, 442, 441, 440, 338, 347, 347,
774 347, 347, 347, 347, 347, 389, 389, 389, 389, 389,
775 389, 389, 390, 390, 390, 390, 390, 390, 390, 391,
776 391, 391, 391, 391, 391, 391, 393, 393, 393, 393,
777 393, 393, 393, 394, 394, 394, 394, 394, 394, 394,
778 405, 407, 437, 433, 432, 430, 429, 407, 428, 427,
779
780 426, 405, 425, 424, 423, 405, 422, 407, 412, 412,
781 412, 412, 412, 412, 412, 414, 414, 414, 414, 414,
782 414, 414, 415, 415, 415, 415, 415, 415, 415, 431,
783 431, 431, 431, 431, 431, 431, 435, 435, 435, 435,
784 435, 435, 435, 436, 436, 436, 436, 436, 436, 436,
785 438, 438, 438, 438, 438, 438, 438, 450, 450, 450,
786 450, 450, 450, 450, 453, 453, 453, 453, 453, 453,
787 453, 435, 454, 454, 454, 454, 454, 454, 454, 456,
788 456, 456, 456, 456, 456, 456, 467, 467, 467, 467,
789 467, 467, 467, 468, 468, 468, 468, 468, 468, 468,
790
791 473, 473, 473, 473, 473, 473, 473, 474, 474, 474,
792 474, 474, 474, 474, 477, 477, 477, 477, 477, 477,
793 477, 478, 478, 478, 478, 478, 478, 478, 479, 479,
794 479, 479, 479, 479, 479, 481, 481, 481, 481, 481,
795 481, 481, 481, 481, 481, 481, 481, 482, 482, 483,
796 421, 483, 483, 483, 483, 483, 483, 483, 483, 483,
797 483, 484, 420, 417, 416, 484, 413, 411, 484, 485,
798 410, 485, 409, 408, 403, 485, 485, 486, 402, 486,
799 401, 397, 486, 396, 486, 487, 395, 392, 487, 487,
800 388, 387, 386, 487, 488, 385, 379, 373, 488, 372,
801
802 371, 488, 489, 489, 369, 368, 356, 352, 351, 350,
803 489, 490, 349, 490, 490, 490, 490, 490, 490, 490,
804 490, 490, 490, 348, 346, 345, 342, 340, 339, 336,
805 332, 331, 329, 328, 327, 326, 325, 324, 323, 322,
806 319, 315, 312, 311, 309, 308, 307, 306, 305, 304,
807 303, 302, 301, 300, 299, 297, 295, 294, 293, 292,
808 290, 289, 288, 287, 286, 285, 283, 281, 280, 279,
809 278, 275, 274, 272, 271, 270, 269, 268, 267, 266,
810 262, 253, 252, 250, 249, 248, 246, 243, 242, 241,
811 240, 239, 238, 236, 235, 234, 233, 231, 230, 229,
812
813 228, 226, 225, 224, 220, 219, 218, 214, 211, 203,
814 201, 200, 199, 198, 192, 185, 184, 182, 180, 179,
815 177, 171, 165, 164, 157, 155, 153, 151, 150, 144,
816 140, 136, 135, 134, 133, 132, 130, 125, 124, 122,
817 121, 119, 118, 117, 115, 113, 111, 108, 107, 103,
818 99, 98, 97, 96, 95, 93, 92, 91, 89, 88,
819 84, 83, 82, 81, 80, 77, 76, 75, 74, 73,
820 72, 70, 69, 67, 66, 62, 60, 55, 54, 50,
821 49, 48, 39, 37, 16, 9, 7, 5, 3, 480,
822 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
823
824 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
825 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
826 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
827 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,
828 480, 480, 480, 480, 480
829 } ;
830
831 static yy_state_type yy_last_accepting_state;
832 static char *yy_last_accepting_cpos;
833
834 extern int asmshader__flex_debug;
835 int asmshader__flex_debug = 0;
836
837 /* The intent behind this definition is that it'll catch
838 * any uses of REJECT which flex missed.
839 */
840 #define REJECT reject_used_but_not_detected
841 #define yymore() yymore_used_but_not_detected
842 #define YY_MORE_ADJ 0
843 #define YY_RESTORE_YY_MORE_OFFSET
844 char *asmshader_text;
845 #line 1 "asmshader.l"
846 /*
847 * Direct3D shader assembler
848 *
849 * Copyright 2008 Stefan Dösinger
850 * Copyright 2009 Matteo Bruni
851 *
852 * This library is free software; you can redistribute it and/or
853 * modify it under the terms of the GNU Lesser General Public
854 * License as published by the Free Software Foundation; either
855 * version 2.1 of the License, or (at your option) any later version.
856 *
857 * This library is distributed in the hope that it will be useful,
858 * but WITHOUT ANY WARRANTY; without even the implied warranty of
859 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
860 * Lesser General Public License for more details.
861 *
862 * You should have received a copy of the GNU Lesser General Public
863 * License along with this library; if not, write to the Free Software
864 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
865 */
866 #line 23 "asmshader.l"
867 #include "config.h"
868 #include "wine/port.h"
869 #include "wine/debug.h"
870
871 #include "d3dcompiler_private.h"
872 #include "asmshader.tab.h"
873
874 WINE_DEFAULT_DEBUG_CHANNEL(asmshader);
875 #define YY_NO_INPUT 1
876 /* Swizzles and writemasks consist of a dot and up to 4 x, y, z or w characters,
877 * or up to 4 a, r, g, b characters. There are different rules for swizzles and
878 * writemasks wrt repetition, those are handled in the grammar.
879 */
880 /* Registers */
881 /* for relative addressing in the form o[x], v[x] and c[x] */
882 /* Not really a register, but it is considered as such */
883 /* Comments */
884 /* Whitespaces are spaces, tabs and newlines */
885 #line 886 "asmshader.yy.c"
886
887 #define INITIAL 0
888
889 #ifndef YY_NO_UNISTD_H
890 /* Special case for "unistd.h", since it is non-ANSI. We include it way
891 * down here because we want the user's section 1 to have been scanned first.
892 * The user has a chance to override it with an option.
893 */
894 #include <unistd.h>
895 #endif
896
897 #ifndef YY_EXTRA_TYPE
898 #define YY_EXTRA_TYPE void *
899 #endif
900
901 static int yy_init_globals (void );
902
903 /* Accessor methods to globals.
904 These are made visible to non-reentrant scanners for convenience. */
905
906 int asmshader_lex_destroy (void );
907
908 int asmshader_get_debug (void );
909
910 void asmshader_set_debug (int debug_flag );
911
912 YY_EXTRA_TYPE asmshader_get_extra (void );
913
914 void asmshader_set_extra (YY_EXTRA_TYPE user_defined );
915
916 FILE *asmshader_get_in (void );
917
918 void asmshader_set_in (FILE * in_str );
919
920 FILE *asmshader_get_out (void );
921
922 void asmshader_set_out (FILE * out_str );
923
924 int asmshader_get_leng (void );
925
926 char *asmshader_get_text (void );
927
928 int asmshader_get_lineno (void );
929
930 void asmshader_set_lineno (int line_number );
931
932 /* Macros after this point can all be overridden by user definitions in
933 * section 1.
934 */
935
936 #ifndef YY_SKIP_YYWRAP
937 #ifdef __cplusplus
938 extern "C" int asmshader_wrap (void );
939 #else
940 extern int asmshader_wrap (void );
941 #endif
942 #endif
943
944 #ifndef yytext_ptr
945 static void yy_flex_strncpy (char *,yyconst char *,int );
946 #endif
947
948 #ifdef YY_NEED_STRLEN
949 static int yy_flex_strlen (yyconst char * );
950 #endif
951
952 #ifndef YY_NO_INPUT
953
954 #ifdef __cplusplus
955 static int yyinput (void );
956 #else
957 static int input (void );
958 #endif
959
960 #endif
961
962 /* Amount of stuff to slurp up with each read. */
963 #ifndef YY_READ_BUF_SIZE
964 #ifdef __ia64__
965 /* On IA-64, the buffer size is 16k, not 8k */
966 #define YY_READ_BUF_SIZE 16384
967 #else
968 #define YY_READ_BUF_SIZE 8192
969 #endif /* __ia64__ */
970 #endif
971
972 /* Copy whatever the last rule matched to the standard output. */
973 #ifndef ECHO
974 /* This used to be an fputs(), but since the string might contain NUL's,
975 * we now use fwrite().
976 */
977 #define ECHO do { if (fwrite( asmshader_text, asmshader_leng, 1, asmshader_out )) {} } while (0)
978 #endif
979
980 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
981 * is returned in "result".
982 */
983 #ifndef YY_INPUT
984 #define YY_INPUT(buf,result,max_size) \
985 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
986 { \
987 int c = '*'; \
988 size_t n; \
989 for ( n = 0; n < max_size && \
990 (c = getc( asmshader_in )) != EOF && c != '\n'; ++n ) \
991 buf[n] = (char) c; \
992 if ( c == '\n' ) \
993 buf[n++] = (char) c; \
994 if ( c == EOF && ferror( asmshader_in ) ) \
995 YY_FATAL_ERROR( "input in flex scanner failed" ); \
996 result = n; \
997 } \
998 else \
999 { \
1000 errno=0; \
1001 while ( (result = fread(buf, 1, max_size, asmshader_in))==0 && ferror(asmshader_in)) \
1002 { \
1003 if( errno != EINTR) \
1004 { \
1005 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1006 break; \
1007 } \
1008 errno=0; \
1009 clearerr(asmshader_in); \
1010 } \
1011 }\
1012 \
1013
1014 #endif
1015
1016 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1017 * we don't want an extra ';' after the "return" because that will cause
1018 * some compilers to complain about unreachable statements.
1019 */
1020 #ifndef yyterminate
1021 #define yyterminate() return YY_NULL
1022 #endif
1023
1024 /* Number of entries by which start-condition stack grows. */
1025 #ifndef YY_START_STACK_INCR
1026 #define YY_START_STACK_INCR 25
1027 #endif
1028
1029 /* Report a fatal error. */
1030 #ifndef YY_FATAL_ERROR
1031 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1032 #endif
1033
1034 /* end tables serialization structures and prototypes */
1035
1036 /* Default declaration of generated scanner - a define so the user can
1037 * easily add parameters.
1038 */
1039 #ifndef YY_DECL
1040 #define YY_DECL_IS_OURS 1
1041
1042 extern int asmshader_lex (void);
1043
1044 #define YY_DECL int asmshader_lex (void)
1045 #endif /* !YY_DECL */
1046
1047 /* Code executed at the beginning of each rule, after asmshader_text and asmshader_leng
1048 * have been set up.
1049 */
1050 #ifndef YY_USER_ACTION
1051 #define YY_USER_ACTION
1052 #endif
1053
1054 /* Code executed at the end of each rule. */
1055 #ifndef YY_BREAK
1056 #define YY_BREAK break;
1057 #endif
1058
1059 #define YY_RULE_SETUP \
1060 YY_USER_ACTION
1061
1062 /** The main scanner function which does all the work.
1063 */
1064 YY_DECL
1065 {
1066 register yy_state_type yy_current_state;
1067 register char *yy_cp, *yy_bp;
1068 register int yy_act;
1069
1070 #line 105 "asmshader.l"
1071
1072
1073 /* Common instructions(vertex and pixel shaders) */
1074 #line 1075 "asmshader.yy.c"
1075
1076 if ( !(yy_init) )
1077 {
1078 (yy_init) = 1;
1079
1080 #ifdef YY_USER_INIT
1081 YY_USER_INIT;
1082 #endif
1083
1084 if ( ! (yy_start) )
1085 (yy_start) = 1; /* first start state */
1086
1087 if ( ! asmshader_in )
1088 asmshader_in = stdin;
1089
1090 if ( ! asmshader_out )
1091 asmshader_out = stdout;
1092
1093 if ( ! YY_CURRENT_BUFFER ) {
1094 asmshader_ensure_buffer_stack ();
1095 YY_CURRENT_BUFFER_LVALUE =
1096 asmshader__create_buffer(asmshader_in,YY_BUF_SIZE );
1097 }
1098
1099 asmshader__load_buffer_state( );
1100 }
1101
1102 while ( 1 ) /* loops until end-of-file is reached */
1103 {
1104 yy_cp = (yy_c_buf_p);
1105
1106 /* Support of asmshader_text. */
1107 *yy_cp = (yy_hold_char);
1108
1109 /* yy_bp points to the position in yy_ch_buf of the start of
1110 * the current run.
1111 */
1112 yy_bp = yy_cp;
1113
1114 yy_current_state = (yy_start);
1115 yy_match:
1116 do
1117 {
1118 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1119 if ( yy_accept[yy_current_state] )
1120 {
1121 (yy_last_accepting_state) = yy_current_state;
1122 (yy_last_accepting_cpos) = yy_cp;
1123 }
1124 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1125 {
1126 yy_current_state = (int) yy_def[yy_current_state];
1127 if ( yy_current_state >= 481 )
1128 yy_c = yy_meta[(unsigned int) yy_c];
1129 }
1130 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1131 ++yy_cp;
1132 }
1133 while ( yy_current_state != 480 );
1134 yy_cp = (yy_last_accepting_cpos);
1135 yy_current_state = (yy_last_accepting_state);
1136
1137 yy_find_action:
1138 yy_act = yy_accept[yy_current_state];
1139
1140 YY_DO_BEFORE_ACTION;
1141
1142 do_action: /* This label is used only to access EOF actions. */
1143
1144 switch ( yy_act )
1145 { /* beginning of action switch */
1146 case 0: /* must back up */
1147 /* undo the effects of YY_DO_BEFORE_ACTION */
1148 *yy_cp = (yy_hold_char);
1149 yy_cp = (yy_last_accepting_cpos);
1150 yy_current_state = (yy_last_accepting_state);
1151 goto yy_find_action;
1152
1153 case 1:
1154 YY_RULE_SETUP
1155 #line 108 "asmshader.l"
1156 {return INSTR_ADD; }
1157 YY_BREAK
1158 case 2:
1159 YY_RULE_SETUP
1160 #line 109 "asmshader.l"
1161 {return INSTR_NOP; }
1162 YY_BREAK
1163 case 3:
1164 YY_RULE_SETUP
1165 #line 110 "asmshader.l"
1166 {return INSTR_MOV; }
1167 YY_BREAK
1168 case 4:
1169 YY_RULE_SETUP
1170 #line 111 "asmshader.l"
1171 {return INSTR_SUB; }
1172 YY_BREAK
1173 case 5:
1174 YY_RULE_SETUP
1175 #line 112 "asmshader.l"
1176 {return INSTR_MAD; }
1177 YY_BREAK
1178 case 6:
1179 YY_RULE_SETUP
1180 #line 113 "asmshader.l"
1181 {return INSTR_MUL; }
1182 YY_BREAK
1183 case 7:
1184 YY_RULE_SETUP
1185 #line 114 "asmshader.l"
1186 {return INSTR_RCP; }
1187 YY_BREAK
1188 case 8:
1189 YY_RULE_SETUP
1190 #line 115 "asmshader.l"
1191 {return INSTR_RSQ; }
1192 YY_BREAK
1193 case 9:
1194 YY_RULE_SETUP
1195 #line 116 "asmshader.l"
1196 {return INSTR_DP3; }
1197 YY_BREAK
1198 case 10:
1199 YY_RULE_SETUP
1200 #line 117 "asmshader.l"
1201 {return INSTR_DP4; }
1202 YY_BREAK
1203 case 11:
1204 YY_RULE_SETUP
1205 #line 118 "asmshader.l"
1206 {return INSTR_MIN; }
1207 YY_BREAK
1208 case 12:
1209 YY_RULE_SETUP
1210 #line 119 "asmshader.l"
1211 {return INSTR_MAX; }
1212 YY_BREAK
1213 case 13:
1214 YY_RULE_SETUP
1215 #line 120 "asmshader.l"
1216 {return INSTR_SLT; }
1217 YY_BREAK
1218 case 14:
1219 YY_RULE_SETUP
1220 #line 121 "asmshader.l"
1221 {return INSTR_SGE; }
1222 YY_BREAK
1223 case 15:
1224 YY_RULE_SETUP
1225 #line 122 "asmshader.l"
1226 {return INSTR_ABS; }
1227 YY_BREAK
1228 case 16:
1229 YY_RULE_SETUP
1230 #line 123 "asmshader.l"
1231 {return INSTR_EXP; }
1232 YY_BREAK
1233 case 17:
1234 YY_RULE_SETUP
1235 #line 124 "asmshader.l"
1236 {return INSTR_LOG; }
1237 YY_BREAK
1238 case 18:
1239 YY_RULE_SETUP
1240 #line 125 "asmshader.l"
1241 {return INSTR_EXPP; }
1242 YY_BREAK
1243 case 19:
1244 YY_RULE_SETUP
1245 #line 126 "asmshader.l"
1246 {return INSTR_LOGP; }
1247 YY_BREAK
1248 case 20:
1249 YY_RULE_SETUP
1250 #line 127 "asmshader.l"
1251 {return INSTR_DST; }
1252 YY_BREAK
1253 case 21:
1254 YY_RULE_SETUP
1255 #line 128 "asmshader.l"
1256 {return INSTR_LRP; }
1257 YY_BREAK
1258 case 22:
1259 YY_RULE_SETUP
1260 #line 129 "asmshader.l"
1261 {return INSTR_FRC; }
1262 YY_BREAK
1263 case 23:
1264 YY_RULE_SETUP
1265 #line 130 "asmshader.l"
1266 {return INSTR_POW; }
1267 YY_BREAK
1268 case 24:
1269 YY_RULE_SETUP
1270 #line 131 "asmshader.l"
1271 {return INSTR_CRS; }
1272 YY_BREAK
1273 case 25:
1274 YY_RULE_SETUP
1275 #line 132 "asmshader.l"
1276 {return INSTR_SGN; }
1277 YY_BREAK
1278 case 26:
1279 YY_RULE_SETUP
1280 #line 133 "asmshader.l"
1281 {return INSTR_NRM; }
1282 YY_BREAK
1283 case 27:
1284 YY_RULE_SETUP
1285 #line 134 "asmshader.l"
1286 {return INSTR_SINCOS; }
1287 YY_BREAK
1288 case 28:
1289 YY_RULE_SETUP
1290 #line 135 "asmshader.l"
1291 {return INSTR_M4x4; }
1292 YY_BREAK
1293 case 29:
1294 YY_RULE_SETUP
1295 #line 136 "asmshader.l"
1296 {return INSTR_M4x3; }
1297 YY_BREAK
1298 case 30:
1299 YY_RULE_SETUP
1300 #line 137 "asmshader.l"
1301 {return INSTR_M3x4; }
1302 YY_BREAK
1303 case 31:
1304 YY_RULE_SETUP
1305 #line 138 "asmshader.l"
1306 {return INSTR_M3x3; }
1307 YY_BREAK
1308 case 32:
1309 YY_RULE_SETUP
1310 #line 139 "asmshader.l"
1311 {return INSTR_M3x2; }
1312 YY_BREAK
1313 case 33:
1314 YY_RULE_SETUP
1315 #line 140 "asmshader.l"
1316 {return INSTR_DCL; }
1317 YY_BREAK
1318 case 34:
1319 YY_RULE_SETUP
1320 #line 141 "asmshader.l"
1321 {return INSTR_DEF; }
1322 YY_BREAK
1323 case 35:
1324 YY_RULE_SETUP
1325 #line 142 "asmshader.l"
1326 {return INSTR_DEFB; }
1327 YY_BREAK
1328 case 36:
1329 YY_RULE_SETUP
1330 #line 143 "asmshader.l"
1331 {return INSTR_DEFI; }
1332 YY_BREAK
1333 case 37:
1334 YY_RULE_SETUP
1335 #line 144 "asmshader.l"
1336 {return INSTR_REP; }
1337 YY_BREAK
1338 case 38:
1339 YY_RULE_SETUP
1340 #line 145 "asmshader.l"
1341 {return INSTR_ENDREP; }
1342 YY_BREAK
1343 case 39:
1344 YY_RULE_SETUP
1345 #line 146 "asmshader.l"
1346 {return INSTR_IF; }
1347 YY_BREAK
1348 case 40:
1349 YY_RULE_SETUP
1350 #line 147 "asmshader.l"
1351 {return INSTR_ELSE; }
1352 YY_BREAK
1353 case 41:
1354 YY_RULE_SETUP
1355 #line 148 "asmshader.l"
1356 {return INSTR_ENDIF; }
1357 YY_BREAK
1358 case 42:
1359 YY_RULE_SETUP
1360 #line 149 "asmshader.l"
1361 {return INSTR_BREAK; }
1362 YY_BREAK
1363 case 43:
1364 YY_RULE_SETUP
1365 #line 150 "asmshader.l"
1366 {return INSTR_BREAKP; }
1367 YY_BREAK
1368 case 44:
1369 YY_RULE_SETUP
1370 #line 151 "asmshader.l"
1371 {return INSTR_CALL; }
1372 YY_BREAK
1373 case 45:
1374 YY_RULE_SETUP
1375 #line 152 "asmshader.l"
1376 {return INSTR_CALLNZ; }
1377 YY_BREAK
1378 case 46:
1379 YY_RULE_SETUP
1380 #line 153 "asmshader.l"
1381 {return INSTR_LOOP; }
1382 YY_BREAK
1383 case 47:
1384 YY_RULE_SETUP
1385 #line 154 "asmshader.l"
1386 {return INSTR_RET; }
1387 YY_BREAK
1388 case 48:
1389 YY_RULE_SETUP
1390 #line 155 "asmshader.l"
1391 {return INSTR_ENDLOOP; }
1392 YY_BREAK
1393 case 49:
1394 YY_RULE_SETUP
1395 #line 156 "asmshader.l"
1396 {return INSTR_LABEL; }
1397 YY_BREAK
1398 case 50:
1399 YY_RULE_SETUP
1400 #line 157 "asmshader.l"
1401 {return INSTR_SETP; }
1402 YY_BREAK
1403 case 51:
1404 YY_RULE_SETUP
1405 #line 158 "asmshader.l"
1406 {return INSTR_TEXLDL; }
1407 YY_BREAK
1408 /* Vertex shader only instructions */
1409 case 52:
1410 YY_RULE_SETUP
1411 #line 161 "asmshader.l"
1412 {return INSTR_LIT; }
1413 YY_BREAK
1414 case 53:
1415 YY_RULE_SETUP
1416 #line 162 "asmshader.l"
1417 {return INSTR_MOVA; }
1418 YY_BREAK
1419 /* Pixel shader only instructions */
1420 case 54:
1421 YY_RULE_SETUP
1422 #line 165 "asmshader.l"
1423 {return INSTR_CND; }
1424 YY_BREAK
1425 case 55:
1426 YY_RULE_SETUP
1427 #line 166 "asmshader.l"
1428 {return INSTR_CMP; }
1429 YY_BREAK
1430 case 56:
1431 YY_RULE_SETUP
1432 #line 167 "asmshader.l"
1433 {return INSTR_DP2ADD; }
1434 YY_BREAK
1435 case 57:
1436 YY_RULE_SETUP
1437 #line 168 "asmshader.l"
1438 {return INSTR_TEXCOORD; }
1439 YY_BREAK
1440 case 58:
1441 YY_RULE_SETUP
1442 #line 169 "asmshader.l"
1443 {return INSTR_TEXCRD; }
1444 YY_BREAK
1445 case 59:
1446 YY_RULE_SETUP
1447 #line 170 "asmshader.l"
1448 {return INSTR_TEXKILL; }
1449 YY_BREAK
1450 case 60:
1451 YY_RULE_SETUP
1452 #line 171 "asmshader.l"
1453 {return INSTR_TEX; }
1454 YY_BREAK
1455 case 61:
1456 YY_RULE_SETUP
1457 #line 172 "asmshader.l"
1458 {return INSTR_TEXLD; }
1459 YY_BREAK
1460 case 62:
1461 YY_RULE_SETUP
1462 #line 173 "asmshader.l"
1463 {return INSTR_TEXBEM; }
1464 YY_BREAK
1465 case 63:
1466 YY_RULE_SETUP
1467 #line 174 "asmshader.l"
1468 {return INSTR_TEXBEML; }
1469 YY_BREAK
1470 case 64:
1471 YY_RULE_SETUP
1472 #line 175 "asmshader.l"
1473 {return INSTR_TEXREG2AR; }
1474 YY_BREAK
1475 case 65:
1476 YY_RULE_SETUP
1477 #line 176 "asmshader.l"
1478 {return INSTR_TEXREG2GB; }
1479 YY_BREAK
1480 case 66:
1481 YY_RULE_SETUP
1482 #line 177 "asmshader.l"
1483 {return INSTR_TEXREG2RGB; }
1484 YY_BREAK
1485 case 67:
1486 YY_RULE_SETUP
1487 #line 178 "asmshader.l"
1488 {return INSTR_TEXM3x2PAD; }
1489 YY_BREAK
1490 case 68:
1491 YY_RULE_SETUP
1492 #line 179 "asmshader.l"
1493 {return INSTR_TEXM3x2TEX; }
1494 YY_BREAK
1495 case 69:
1496 YY_RULE_SETUP
1497 #line 180 "asmshader.l"
1498 {return INSTR_TEXM3x3PAD; }
1499 YY_BREAK
1500 case 70:
1501 YY_RULE_SETUP
1502 #line 181 "asmshader.l"
1503 {return INSTR_TEXM3x3SPEC; }
1504 YY_BREAK
1505 case 71:
1506 YY_RULE_SETUP
1507 #line 182 "asmshader.l"
1508 {return INSTR_TEXM3x3VSPEC; }
1509 YY_BREAK
1510 case 72:
1511 YY_RULE_SETUP
1512 #line 183 "asmshader.l"
1513 {return INSTR_TEXM3x3TEX; }
1514 YY_BREAK
1515 case 73:
1516 YY_RULE_SETUP
1517 #line 184 "asmshader.l"
1518 {return INSTR_TEXDP3TEX; }
1519 YY_BREAK
1520 case 74:
1521 YY_RULE_SETUP
1522 #line 185 "asmshader.l"
1523 {return INSTR_TEXM3x2DEPTH; }
1524 YY_BREAK
1525 case 75:
1526 YY_RULE_SETUP
1527 #line 186 "asmshader.l"
1528 {return INSTR_TEXDP3; }
1529 YY_BREAK
1530 case 76:
1531 YY_RULE_SETUP
1532 #line 187 "asmshader.l"
1533 {return INSTR_TEXM3x3; }
1534 YY_BREAK
1535 case 77:
1536 YY_RULE_SETUP
1537 #line 188 "asmshader.l"
1538 {return INSTR_TEXDEPTH; }
1539 YY_BREAK
1540 case 78:
1541 YY_RULE_SETUP
1542 #line 189 "asmshader.l"
1543 {return INSTR_BEM; }
1544 YY_BREAK
1545 case 79:
1546 YY_RULE_SETUP
1547 #line 190 "asmshader.l"
1548 {return INSTR_DSX; }
1549 YY_BREAK
1550 case 80:
1551 YY_RULE_SETUP
1552 #line 191 "asmshader.l"
1553 {return INSTR_DSY; }
1554 YY_BREAK
1555 case 81:
1556 YY_RULE_SETUP
1557 #line 192 "asmshader.l"
1558 {return INSTR_TEXLDP; }
1559 YY_BREAK
1560 case 82:
1561 YY_RULE_SETUP
1562 #line 193 "asmshader.l"
1563 {return INSTR_TEXLDB; }
1564 YY_BREAK
1565 case 83:
1566 YY_RULE_SETUP
1567 #line 194 "asmshader.l"
1568 {return INSTR_TEXLDD; }
1569 YY_BREAK
1570 case 84:
1571 YY_RULE_SETUP
1572 #line 195 "asmshader.l"
1573 {return INSTR_PHASE; }
1574 YY_BREAK
1575 case 85:
1576 YY_RULE_SETUP
1577 #line 197 "asmshader.l"
1578 {
1579 asmshader_lval.regnum = atoi(asmshader_text + 1);
1580 return REG_TEMP;
1581 }
1582 YY_BREAK
1583 case 86:
1584 YY_RULE_SETUP
1585 #line 201 "asmshader.l"
1586 {
1587 asmshader_lval.regnum = atoi(asmshader_text + 1);
1588 return REG_OUTPUT;
1589 }
1590 YY_BREAK
1591 case 87:
1592 YY_RULE_SETUP
1593 #line 205 "asmshader.l"
1594 {
1595 asmshader_lval.regnum = atoi(asmshader_text + 1);
1596 return REG_INPUT;
1597 }
1598 YY_BREAK
1599 case 88:
1600 YY_RULE_SETUP
1601 #line 209 "asmshader.l"
1602 {
1603 asmshader_lval.regnum = atoi(asmshader_text + 1);
1604 return REG_CONSTFLOAT;
1605 }
1606 YY_BREAK
1607 case 89:
1608 YY_RULE_SETUP
1609 #line 213 "asmshader.l"
1610 {
1611 asmshader_lval.regnum = atoi(asmshader_text + 1);
1612 return REG_CONSTINT;
1613 }
1614 YY_BREAK
1615 case 90:
1616 YY_RULE_SETUP
1617 #line 217 "asmshader.l"
1618 {
1619 asmshader_lval.regnum = atoi(asmshader_text + 1);
1620 return REG_CONSTBOOL;
1621 }
1622 YY_BREAK
1623 case 91:
1624 YY_RULE_SETUP
1625 #line 221 "asmshader.l"
1626 {
1627 asmshader_lval.regnum = atoi(asmshader_text + 1);
1628 return REG_TEXTURE;
1629 }
1630 YY_BREAK
1631 case 92:
1632 YY_RULE_SETUP
1633 #line 225 "asmshader.l"
1634 {
1635 asmshader_lval.regnum = atoi(asmshader_text + 2);
1636 return REG_TEXCRDOUT;
1637 }
1638 YY_BREAK
1639 case 93:
1640 YY_RULE_SETUP
1641 #line 229 "asmshader.l"
1642 {
1643 asmshader_lval.regnum = atoi(asmshader_text + 1);
1644 return REG_SAMPLER;
1645 }
1646 YY_BREAK
1647 case 94:
1648 YY_RULE_SETUP
1649 #line 233 "asmshader.l"
1650 {return REG_OPOS; }
1651 YY_BREAK
1652 case 95:
1653 YY_RULE_SETUP
1654 #line 234 "asmshader.l"
1655 {return REG_OFOG; }
1656 YY_BREAK
1657 case 96:
1658 YY_RULE_SETUP
1659 #line 235 "asmshader.l"
1660 {return REG_OPTS; }
1661 YY_BREAK
1662 case 97:
1663 YY_RULE_SETUP
1664 #line 236 "asmshader.l"
1665 {
1666 asmshader_lval.regnum = atoi(asmshader_text + 2);
1667 return REG_VERTEXCOLOR;
1668 }
1669 YY_BREAK
1670 case 98:
1671 YY_RULE_SETUP
1672 #line 240 "asmshader.l"
1673 {
1674 asmshader_lval.regnum = atoi(asmshader_text + 2);
1675 return REG_FRAGCOLOR;
1676 }
1677 YY_BREAK
1678 case 99:
1679 YY_RULE_SETUP
1680 #line 244 "asmshader.l"
1681 {return REG_FRAGDEPTH; }
1682 YY_BREAK
1683 case 100:
1684 YY_RULE_SETUP
1685 #line 245 "asmshader.l"
1686 {return REG_VPOS; }
1687 YY_BREAK
1688 case 101:
1689 YY_RULE_SETUP
1690 #line 246 "asmshader.l"
1691 {return REG_VFACE; }
1692 YY_BREAK
1693 case 102:
1694 YY_RULE_SETUP
1695 #line 247 "asmshader.l"
1696 {return REG_ADDRESS; }
1697 YY_BREAK
1698 case 103:
1699 YY_RULE_SETUP
1700 #line 248 "asmshader.l"
1701 {return REG_LOOP; }
1702 YY_BREAK
1703 case 104:
1704 YY_RULE_SETUP
1705 #line 249 "asmshader.l"
1706 {return REG_PREDICATE; }
1707 YY_BREAK
1708 case 105:
1709 YY_RULE_SETUP
1710 #line 251 "asmshader.l"
1711 {
1712 asmshader_lval.regnum = atoi(asmshader_text + 1);
1713 return REG_LABEL;
1714 }
1715 YY_BREAK
1716 /* Shader versions. These are important to select the correct
1717 * parser profile.
1718 */
1719 case 106:
1720 YY_RULE_SETUP
1721 #line 259 "asmshader.l"
1722 {return VER_VS10; }
1723 YY_BREAK
1724 case 107:
1725 YY_RULE_SETUP
1726 #line 260 "asmshader.l"
1727 {return VER_VS11; }
1728 YY_BREAK
1729 case 108:
1730 YY_RULE_SETUP
1731 #line 262 "asmshader.l"
1732 {return VER_VS20; }
1733 YY_BREAK
1734 case 109:
1735 YY_RULE_SETUP
1736 #line 263 "asmshader.l"
1737 {return VER_VS2X; }
1738 YY_BREAK
1739 case 110:
1740 YY_RULE_SETUP
1741 #line 264 "asmshader.l"
1742 {return VER_VS30; }
1743 YY_BREAK
1744 case 111:
1745 YY_RULE_SETUP
1746 #line 266 "asmshader.l"
1747 {return VER_PS10; }
1748 YY_BREAK
1749 case 112:
1750 YY_RULE_SETUP
1751 #line 267 "asmshader.l"
1752 {return VER_PS11; }
1753 YY_BREAK
1754 case 113:
1755 YY_RULE_SETUP
1756 #line 268 "asmshader.l"
1757 {return VER_PS12; }
1758 YY_BREAK
1759 case 114:
1760 YY_RULE_SETUP
1761 #line 269 "asmshader.l"
1762 {return VER_PS13; }
1763 YY_BREAK
1764 case 115:
1765 YY_RULE_SETUP
1766 #line 270 "asmshader.l"
1767 {return VER_PS14; }
1768 YY_BREAK
1769 case 116:
1770 YY_RULE_SETUP
1771 #line 272 "asmshader.l"
1772 {return VER_PS20; }
1773 YY_BREAK
1774 case 117:
1775 YY_RULE_SETUP
1776 #line 273 "asmshader.l"
1777 {return VER_PS2X; }
1778 YY_BREAK
1779 case 118:
1780 YY_RULE_SETUP
1781 #line 274 "asmshader.l"
1782 {return VER_PS30; }
1783 YY_BREAK
1784 case 119:
1785 YY_RULE_SETUP
1786 #line 276 "asmshader.l"
1787 {return asmshader_text[0]; }
1788 YY_BREAK
1789 case 120:
1790 YY_RULE_SETUP
1791 #line 277 "asmshader.l"
1792 {
1793 switch(asmshader_text[0]) {
1794 case 'x':
1795 case 'r':
1796 asmshader_lval.component = 0;
1797 break;
1798 case 'y':
1799 case 'g':
1800 asmshader_lval.component = 1;
1801 break;
1802 case 'z':
1803 case 'b':
1804 asmshader_lval.component = 2;
1805 break;
1806 case 'w':
1807 case 'a':
1808 asmshader_lval.component = 3;
1809 break;
1810 }
1811 return COMPONENT;
1812 }
1813 YY_BREAK
1814 /* Output modifiers */
1815 case 121:
1816 YY_RULE_SETUP
1817 #line 300 "asmshader.l"
1818 {return SHIFT_X2; }
1819 YY_BREAK
1820 case 122:
1821 YY_RULE_SETUP
1822 #line 301 "asmshader.l"
1823 {return SHIFT_X4; }
1824 YY_BREAK
1825 case 123:
1826 YY_RULE_SETUP
1827 #line 302 "asmshader.l"
1828 {return SHIFT_X8; }
1829 YY_BREAK
1830 case 124:
1831 YY_RULE_SETUP
1832 #line 303 "asmshader.l"
1833 {return SHIFT_D2; }
1834 YY_BREAK
1835 case 125:
1836 YY_RULE_SETUP
1837 #line 304 "asmshader.l"
1838 {return SHIFT_D4; }
1839 YY_BREAK
1840 case 126:
1841 YY_RULE_SETUP
1842 #line 305 "asmshader.l"
1843 {return SHIFT_D8; }
1844 YY_BREAK
1845 case 127:
1846 YY_RULE_SETUP
1847 #line 306 "asmshader.l"
1848 {return MOD_SAT; }
1849 YY_BREAK
1850 case 128:
1851 YY_RULE_SETUP
1852 #line 307 "asmshader.l"
1853 {return MOD_PP; }
1854 YY_BREAK
1855 case 129:
1856 YY_RULE_SETUP
1857 #line 308 "asmshader.l"
1858 {return MOD_CENTROID; }
1859 YY_BREAK
1860 /* compare params */
1861 case 130:
1862 YY_RULE_SETUP
1863 #line 311 "asmshader.l"
1864 {return COMP_GT; }
1865 YY_BREAK
1866 case 131:
1867 YY_RULE_SETUP
1868 #line 312 "asmshader.l"
1869 {return COMP_LT; }
1870 YY_BREAK
1871 case 132:
1872 YY_RULE_SETUP
1873 #line 313 "asmshader.l"
1874 {return COMP_GE; }
1875 YY_BREAK
1876 case 133:
1877 YY_RULE_SETUP
1878 #line 314 "asmshader.l"
1879 {return COMP_LE; }
1880 YY_BREAK
1881 case 134:
1882 YY_RULE_SETUP
1883 #line 315 "asmshader.l"
1884 {return COMP_EQ; }
1885 YY_BREAK
1886 case 135:
1887 YY_RULE_SETUP
1888 #line 316 "asmshader.l"
1889 {return COMP_NE; }
1890 YY_BREAK
1891 case 136:
1892 YY_RULE_SETUP
1893 #line 318 "asmshader.l"
1894 {
1895 asmshader_lval.immval.val = atof(asmshader_text);
1896 asmshader_lval.immval.integer = ((strstr(asmshader_text, ".") == NULL) && (strstr(asmshader_text, "f") == NULL));
1897 return IMMVAL;
1898 }
1899 YY_BREAK
1900 case 137:
1901 YY_RULE_SETUP
1902 #line 323 "asmshader.l"
1903 {
1904 asmshader_lval.immbool = TRUE;
1905 return IMMBOOL;
1906 }
1907 YY_BREAK
1908 case 138:
1909 YY_RULE_SETUP
1910 #line 327 "asmshader.l"
1911 {
1912 asmshader_lval.immbool = FALSE;
1913 return IMMBOOL;
1914 }
1915 YY_BREAK
1916 case 139:
1917 YY_RULE_SETUP
1918 #line 332 "asmshader.l"
1919 {return asmshader_text[0]; }
1920 YY_BREAK
1921 case 140:
1922 YY_RULE_SETUP
1923 #line 333 "asmshader.l"
1924 {return asmshader_text[0]; }
1925 YY_BREAK
1926 case 141:
1927 YY_RULE_SETUP
1928 #line 334 "asmshader.l"
1929 {return asmshader_text[0]; }
1930 YY_BREAK
1931 case 142:
1932 YY_RULE_SETUP
1933 #line 335 "asmshader.l"
1934 {return asmshader_text[0]; }
1935 YY_BREAK
1936 /* for relative addressing */
1937 case 143:
1938 YY_RULE_SETUP
1939 #line 338 "asmshader.l"
1940 {return asmshader_text[0]; }
1941 YY_BREAK
1942 case 144:
1943 YY_RULE_SETUP
1944 #line 340 "asmshader.l"
1945 {return SMOD_BIAS; }
1946 YY_BREAK
1947 /* No _x2 here; it is identical to MOD_X2 */
1948 case 145:
1949 YY_RULE_SETUP
1950 #line 342 "asmshader.l"
1951 {return SMOD_SCALEBIAS; }
1952 YY_BREAK
1953 case 146:
1954 YY_RULE_SETUP
1955 #line 343 "asmshader.l"
1956 {return SMOD_DZ; }
1957 YY_BREAK
1958 case 147:
1959 YY_RULE_SETUP
1960 #line 344 "asmshader.l"
1961 {return SMOD_DW; }
1962 YY_BREAK
1963 case 148:
1964 YY_RULE_SETUP
1965 #line 345 "asmshader.l"
1966 {return SMOD_ABS; }
1967 YY_BREAK
1968 case 149:
1969 YY_RULE_SETUP
1970 #line 347 "asmshader.l"
1971 {return SMOD_NOT; }
1972 YY_BREAK
1973 case 150:
1974 YY_RULE_SETUP
1975 #line 349 "asmshader.l"
1976 {
1977 if(asmshader_text[strlen("_position")] == '\0') {
1978 asmshader_lval.regnum = 0;
1979 } else {
1980 asmshader_lval.regnum = atoi(asmshader_text + strlen("_position"));
1981 }
1982 return USAGE_POSITION;
1983 }
1984 YY_BREAK
1985 case 151:
1986 YY_RULE_SETUP
1987 #line 357 "asmshader.l"
1988 {
1989 if(asmshader_text[strlen("_blendweight")] == '\0') {
1990 asmshader_lval.regnum = 0;
1991 } else {
1992 asmshader_lval.regnum = atoi(asmshader_text + strlen("_blendweight"));
1993 }
1994 return USAGE_BLENDWEIGHT;
1995 }
1996 YY_BREAK
1997 case 152:
1998 YY_RULE_SETUP
1999 #line 365 "asmshader.l"
2000 {
2001 if(asmshader_text[strlen("_blendindices")] == '\0') {
2002 asmshader_lval.regnum = 0;
2003 } else {
2004 asmshader_lval.regnum = atoi(asmshader_text + strlen("_blendindices"));
2005 }
2006 return USAGE_BLENDINDICES;
2007 }
2008 YY_BREAK
2009 case 153:
2010 YY_RULE_SETUP
2011 #line 373 "asmshader.l"
2012 {
2013 if(asmshader_text[strlen("_normal")] == '\0') {
2014 asmshader_lval.regnum = 0;
2015 } else {
2016 asmshader_lval.regnum = atoi(asmshader_text + strlen("_normal"));
2017 }
2018 return USAGE_NORMAL;
2019 }
2020 YY_BREAK
2021 case 154:
2022 YY_RULE_SETUP
2023 #line 381 "asmshader.l"
2024 {
2025 if(asmshader_text[strlen("_psize")] == '\0') {
2026 asmshader_lval.regnum = 0;
2027 } else {
2028 asmshader_lval.regnum = atoi(asmshader_text + strlen("_psize"));
2029 }
2030 return USAGE_PSIZE;
2031 }
2032 YY_BREAK
2033 case 155:
2034 YY_RULE_SETUP
2035 #line 389 "asmshader.l"
2036 {
2037 if(asmshader_text[strlen("_texcoord")] == '\0') {
2038 asmshader_lval.regnum = 0;
2039 } else {
2040 asmshader_lval.regnum = atoi(asmshader_text + strlen("_texcoord"));
2041 }
2042 return USAGE_TEXCOORD;
2043 }
2044 YY_BREAK
2045 case 156:
2046 YY_RULE_SETUP
2047 #line 397 "asmshader.l"
2048 {
2049 if(asmshader_text[strlen("_tangent")] == '\0') {
2050 asmshader_lval.regnum = 0;
2051 } else {
2052 asmshader_lval.regnum = atoi(asmshader_text + strlen("_tangent"));
2053 }
2054 return USAGE_TANGENT;
2055 }
2056 YY_BREAK
2057 case 157:
2058 YY_RULE_SETUP
2059 #line 405 "asmshader.l"
2060 {
2061 if(asmshader_text[strlen("_binormal")] == '\0') {
2062 asmshader_lval.regnum = 0;
2063 } else {
2064 asmshader_lval.regnum = atoi(asmshader_text + strlen("_binormal"));
2065 }
2066 return USAGE_BINORMAL;
2067 }
2068 YY_BREAK
2069 case 158:
2070 YY_RULE_SETUP
2071 #line 413 "asmshader.l"
2072 {
2073 if(asmshader_text[strlen("_tessfactor")] == '\0') {
2074 asmshader_lval.regnum = 0;
2075 } else {
2076 asmshader_lval.regnum = atoi(asmshader_text + strlen("_tessfactor"));
2077 }
2078 return USAGE_TESSFACTOR;
2079 }
2080 YY_BREAK
2081 case 159:
2082 YY_RULE_SETUP
2083 #line 421 "asmshader.l"
2084 {
2085 if(asmshader_text[strlen("_positiont")] == '\0') {
2086 asmshader_lval.regnum = 0;
2087 } else {
2088 asmshader_lval.regnum = atoi(asmshader_text + strlen("_positiont"));
2089 }
2090 return USAGE_POSITIONT;
2091 }
2092 YY_BREAK
2093 case 160:
2094 YY_RULE_SETUP
2095 #line 429 "asmshader.l"
2096 {
2097 if(asmshader_text[strlen("_color")] == '\0') {
2098 asmshader_lval.regnum = 0;
2099 } else {
2100 asmshader_lval.regnum = atoi(asmshader_text + strlen("_color"));
2101 }
2102 return USAGE_COLOR;
2103 }
2104 YY_BREAK
2105 case 161:
2106 YY_RULE_SETUP
2107 #line 437 "asmshader.l"
2108 {
2109 if(asmshader_text[strlen("_fog")] == '\0') {
2110 asmshader_lval.regnum = 0;
2111 } else {
2112 asmshader_lval.regnum = atoi(asmshader_text + strlen("_fog"));
2113 }
2114 return USAGE_FOG;
2115 }
2116 YY_BREAK
2117 case 162:
2118 YY_RULE_SETUP
2119 #line 445 "asmshader.l"
2120 {
2121 if(asmshader_text[strlen("_depth")] == '\0') {
2122 asmshader_lval.regnum = 0;
2123 } else {
2124 asmshader_lval.regnum = atoi(asmshader_text + strlen("_depth"));
2125 }
2126 return USAGE_DEPTH;
2127 }
2128 YY_BREAK
2129 case 163:
2130 YY_RULE_SETUP
2131 #line 453 "asmshader.l"
2132 {
2133 if(asmshader_text[strlen("_sample")] == '\0') {
2134 asmshader_lval.regnum = 0;
2135 } else {
2136 asmshader_lval.regnum = atoi(asmshader_text + strlen("_sample"));
2137 }
2138 return USAGE_SAMPLE;
2139 }
2140 YY_BREAK
2141 case 164:
2142 YY_RULE_SETUP
2143 #line 462 "asmshader.l"
2144 { return SAMPTYPE_1D; }
2145 YY_BREAK
2146 case 165:
2147 YY_RULE_SETUP
2148 #line 463 "asmshader.l"
2149 { return SAMPTYPE_2D; }
2150 YY_BREAK
2151 case 166:
2152 YY_RULE_SETUP
2153 #line 464 "asmshader.l"
2154 { return SAMPTYPE_CUBE; }
2155 YY_BREAK
2156 case 167:
2157 YY_RULE_SETUP
2158 #line 465 "asmshader.l"
2159 { return SAMPTYPE_VOLUME; }
2160 YY_BREAK
2161 case 168:
2162 /* rule 168 can match eol */
2163 YY_RULE_SETUP
2164 #line 467 "asmshader.l"
2165 {
2166 /* TODO: update current line information */
2167 TRACE("line info update: %s", asmshader_text);
2168 }
2169 YY_BREAK
2170 /* Skip comments */
2171 case 169:
2172 YY_RULE_SETUP
2173 #line 473 "asmshader.l"
2174 { }
2175 YY_BREAK
2176 case 170:
2177 YY_RULE_SETUP
2178 #line 474 "asmshader.l"
2179 { }
2180 YY_BREAK
2181 case 171:
2182 YY_RULE_SETUP
2183 #line 476 "asmshader.l"
2184 { /* Do nothing */ }
2185 YY_BREAK
2186 case 172:
2187 /* rule 172 can match eol */
2188 YY_RULE_SETUP
2189 #line 477 "asmshader.l"
2190 {
2191 asm_ctx.line_no++;
2192 }
2193 YY_BREAK
2194 case 173:
2195 YY_RULE_SETUP
2196 #line 481 "asmshader.l"
2197 {
2198 asmparser_message(&asm_ctx, "Line %u: Unexpected input %s\n", asm_ctx.line_no, asmshader_text);
2199 set_parse_status(&asm_ctx.status, PARSE_ERR);
2200 }
2201 YY_BREAK
2202 case 174:
2203 YY_RULE_SETUP
2204 #line 486 "asmshader.l"
2205 ECHO;
2206 YY_BREAK
2207 #line 2208 "asmshader.yy.c"
2208 case YY_STATE_EOF(INITIAL):
2209 yyterminate();
2210
2211 case YY_END_OF_BUFFER:
2212 {
2213 /* Amount of text matched not including the EOB char. */
2214 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2215
2216 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2217 *yy_cp = (yy_hold_char);
2218 YY_RESTORE_YY_MORE_OFFSET
2219
2220 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2221 {
2222 /* We're scanning a new file or input source. It's
2223 * possible that this happened because the user
2224 * just pointed asmshader_in at a new source and called
2225 * asmshader_lex(). If so, then we have to assure
2226 * consistency between YY_CURRENT_BUFFER and our
2227 * globals. Here is the right place to do so, because
2228 * this is the first action (other than possibly a
2229 * back-up) that will match for the new input source.
2230 */
2231 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2232 YY_CURRENT_BUFFER_LVALUE->yy_input_file = asmshader_in;
2233 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2234 }
2235
2236 /* Note that here we test for yy_c_buf_p "<=" to the position
2237 * of the first EOB in the buffer, since yy_c_buf_p will
2238 * already have been incremented past the NUL character
2239 * (since all states make transitions on EOB to the
2240 * end-of-buffer state). Contrast this with the test
2241 * in input().
2242 */
2243 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2244 { /* This was really a NUL. */
2245 yy_state_type yy_next_state;
2246
2247 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2248
2249 yy_current_state = yy_get_previous_state( );
2250
2251 /* Okay, we're now positioned to make the NUL
2252 * transition. We couldn't have
2253 * yy_get_previous_state() go ahead and do it
2254 * for us because it doesn't know how to deal
2255 * with the possibility of jamming (and we don't
2256 * want to build jamming into it because then it
2257 * will run more slowly).
2258 */
2259
2260 yy_next_state = yy_try_NUL_trans( yy_current_state );
2261
2262 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2263
2264 if ( yy_next_state )
2265 {
2266 /* Consume the NUL. */
2267 yy_cp = ++(yy_c_buf_p);
2268 yy_current_state = yy_next_state;
2269 goto yy_match;
2270 }
2271
2272 else
2273 {
2274 yy_cp = (yy_last_accepting_cpos);
2275 yy_current_state = (yy_last_accepting_state);
2276 goto yy_find_action;
2277 }
2278 }
2279
2280 else switch ( yy_get_next_buffer( ) )
2281 {
2282 case EOB_ACT_END_OF_FILE:
2283 {
2284 (yy_did_buffer_switch_on_eof) = 0;
2285
2286 if ( asmshader_wrap( ) )
2287 {
2288 /* Note: because we've taken care in
2289 * yy_get_next_buffer() to have set up
2290 * asmshader_text, we can now set up
2291 * yy_c_buf_p so that if some total
2292 * hoser (like flex itself) wants to
2293 * call the scanner after we return the
2294 * YY_NULL, it'll still work - another
2295 * YY_NULL will get returned.
2296 */
2297 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2298
2299 yy_act = YY_STATE_EOF(YY_START);
2300 goto do_action;
2301 }
2302
2303 else
2304 {
2305 if ( ! (yy_did_buffer_switch_on_eof) )
2306 YY_NEW_FILE;
2307 }
2308 break;
2309 }
2310
2311 case EOB_ACT_CONTINUE_SCAN:
2312 (yy_c_buf_p) =
2313 (yytext_ptr) + yy_amount_of_matched_text;
2314
2315 yy_current_state = yy_get_previous_state( );
2316
2317 yy_cp = (yy_c_buf_p);
2318 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2319 goto yy_match;
2320
2321 case EOB_ACT_LAST_MATCH:
2322 (yy_c_buf_p) =
2323 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2324
2325 yy_current_state = yy_get_previous_state( );
2326
2327 yy_cp = (yy_c_buf_p);
2328 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2329 goto yy_find_action;
2330 }
2331 break;
2332 }
2333
2334 default:
2335 YY_FATAL_ERROR(
2336 "fatal flex scanner internal error--no action found" );
2337 } /* end of action switch */
2338 } /* end of scanning one token */
2339 } /* end of asmshader_lex */
2340
2341 /* yy_get_next_buffer - try to read in a new buffer
2342 *
2343 * Returns a code representing an action:
2344 * EOB_ACT_LAST_MATCH -
2345 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2346 * EOB_ACT_END_OF_FILE - end of file
2347 */
2348 static int yy_get_next_buffer (void)
2349 {
2350 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2351 register char *source = (yytext_ptr);
2352 register int number_to_move, i;
2353 int ret_val;
2354
2355 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2356 YY_FATAL_ERROR(
2357 "fatal flex scanner internal error--end of buffer missed" );
2358
2359 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2360 { /* Don't try to fill the buffer, so this is an EOF. */
2361 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2362 {
2363 /* We matched a single character, the EOB, so
2364 * treat this as a final EOF.
2365 */
2366 return EOB_ACT_END_OF_FILE;
2367 }
2368
2369 else
2370 {
2371 /* We matched some text prior to the EOB, first
2372 * process it.
2373 */
2374 return EOB_ACT_LAST_MATCH;
2375 }
2376 }
2377
2378 /* Try to read more data. */
2379
2380 /* First move last chars to start of buffer. */
2381 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
2382
2383 for ( i = 0; i < number_to_move; ++i )
2384 *(dest++) = *(source++);
2385
2386 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2387 /* don't do the read, it's not guaranteed to return an EOF,
2388 * just force an EOF
2389 */
2390 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2391
2392 else
2393 {
2394 int num_to_read =
2395 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2396
2397 while ( num_to_read <= 0 )
2398 { /* Not enough room in the buffer - grow it. */
2399
2400 /* just a shorter name for the current buffer */
2401 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2402
2403 int yy_c_buf_p_offset =
2404 (int) ((yy_c_buf_p) - b->yy_ch_buf);
2405
2406 if ( b->yy_is_our_buffer )
2407 {
2408 int new_size = b->yy_buf_size * 2;
2409
2410 if ( new_size <= 0 )
2411 b->yy_buf_size += b->yy_buf_size / 8;
2412 else
2413 b->yy_buf_size *= 2;
2414
2415 b->yy_ch_buf = (char *)
2416 /* Include room in for 2 EOB chars. */
2417 asmshader_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
2418 }
2419 else
2420 /* Can't grow it, we don't own it. */
2421 b->yy_ch_buf = 0;
2422
2423 if ( ! b->yy_ch_buf )
2424 YY_FATAL_ERROR(
2425 "fatal error - scanner input buffer overflow" );
2426
2427 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2428
2429 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2430 number_to_move - 1;
2431
2432 }
2433
2434 if ( num_to_read > YY_READ_BUF_SIZE )
2435 num_to_read = YY_READ_BUF_SIZE;
2436
2437 /* Read in more data. */
2438 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2439 (yy_n_chars), (size_t) num_to_read );
2440
2441 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2442 }
2443
2444 if ( (yy_n_chars) == 0 )
2445 {
2446 if ( number_to_move == YY_MORE_ADJ )
2447 {
2448 ret_val = EOB_ACT_END_OF_FILE;
2449 asmshader_restart(asmshader_in );
2450 }
2451
2452 else
2453 {
2454 ret_val = EOB_ACT_LAST_MATCH;
2455 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2456 YY_BUFFER_EOF_PENDING;
2457 }
2458 }
2459
2460 else
2461 ret_val = EOB_ACT_CONTINUE_SCAN;
2462
2463 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2464 /* Extend the array by 50%, plus the number we really need. */
2465 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2466 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) asmshader_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
2467 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2468 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2469 }
2470
2471 (yy_n_chars) += number_to_move;
2472 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2473 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2474
2475 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2476
2477 return ret_val;
2478 }
2479
2480 /* yy_get_previous_state - get the state just before the EOB char was reached */
2481
2482 static yy_state_type yy_get_previous_state (void)
2483 {
2484 register yy_state_type yy_current_state;
2485 register char *yy_cp;
2486
2487 yy_current_state = (yy_start);
2488
2489 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2490 {
2491 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2492 if ( yy_accept[yy_current_state] )
2493 {
2494 (yy_last_accepting_state) = yy_current_state;
2495 (yy_last_accepting_cpos) = yy_cp;
2496 }
2497 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2498 {
2499 yy_current_state = (int) yy_def[yy_current_state];
2500 if ( yy_current_state >= 481 )
2501 yy_c = yy_meta[(unsigned int) yy_c];
2502 }
2503 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2504 }
2505
2506 return yy_current_state;
2507 }
2508
2509 /* yy_try_NUL_trans - try to make a transition on the NUL character
2510 *
2511 * synopsis
2512 * next_state = yy_try_NUL_trans( current_state );
2513 */
2514 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2515 {
2516 register int yy_is_jam;
2517 register char *yy_cp = (yy_c_buf_p);
2518
2519 register YY_CHAR yy_c = 1;
2520 if ( yy_accept[yy_current_state] )
2521 {
2522 (yy_last_accepting_state) = yy_current_state;
2523 (yy_last_accepting_cpos) = yy_cp;
2524 }
2525 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2526 {
2527 yy_current_state = (int) yy_def[yy_current_state];
2528 if ( yy_current_state >= 481 )
2529 yy_c = yy_meta[(unsigned int) yy_c];
2530 }
2531 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2532 yy_is_jam = (yy_current_state == 480);
2533
2534 return yy_is_jam ? 0 : yy_current_state;
2535 }
2536
2537 #ifndef YY_NO_INPUT
2538 #ifdef __cplusplus
2539 static int yyinput (void)
2540 #else
2541 static int input (void)
2542 #endif
2543
2544 {
2545 int c;
2546
2547 *(yy_c_buf_p) = (yy_hold_char);
2548
2549 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2550 {
2551 /* yy_c_buf_p now points to the character we want to return.
2552 * If this occurs *before* the EOB characters, then it's a
2553 * valid NUL; if not, then we've hit the end of the buffer.
2554 */
2555 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2556 /* This was really a NUL. */
2557 *(yy_c_buf_p) = '\0';
2558
2559 else
2560 { /* need more input */
2561 int offset = (yy_c_buf_p) - (yytext_ptr);
2562 ++(yy_c_buf_p);
2563
2564 switch ( yy_get_next_buffer( ) )
2565 {
2566 case EOB_ACT_LAST_MATCH:
2567 /* This happens because yy_g_n_b()
2568 * sees that we've accumulated a
2569 * token and flags that we need to
2570 * try matching the token before
2571 * proceeding. But for input(),
2572 * there's no matching to consider.
2573 * So convert the EOB_ACT_LAST_MATCH
2574 * to EOB_ACT_END_OF_FILE.
2575 */
2576
2577 /* Reset buffer status. */
2578 asmshader_restart(asmshader_in );
2579
2580 /*FALLTHROUGH*/
2581
2582 case EOB_ACT_END_OF_FILE:
2583 {
2584 if ( asmshader_wrap( ) )
2585 return EOF;
2586
2587 if ( ! (yy_did_buffer_switch_on_eof) )
2588 YY_NEW_FILE;
2589 #ifdef __cplusplus
2590 return yyinput();
2591 #else
2592 return input();
2593 #endif
2594 }
2595
2596 case EOB_ACT_CONTINUE_SCAN:
2597 (yy_c_buf_p) = (yytext_ptr) + offset;
2598 break;
2599 }
2600 }
2601 }
2602
2603 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2604 *(yy_c_buf_p) = '\0'; /* preserve asmshader_text */
2605 (yy_hold_char) = *++(yy_c_buf_p);
2606
2607 return c;
2608 }
2609 #endif /* ifndef YY_NO_INPUT */
2610
2611 /** Immediately switch to a different input stream.
2612 * @param input_file A readable stream.
2613 *
2614 * @note This function does not reset the start condition to @c INITIAL .
2615 */
2616 void asmshader_restart (FILE * input_file )
2617 {
2618
2619 if ( ! YY_CURRENT_BUFFER ){
2620 asmshader_ensure_buffer_stack ();
2621 YY_CURRENT_BUFFER_LVALUE =
2622 asmshader__create_buffer(asmshader_in,YY_BUF_SIZE );
2623 }
2624
2625 asmshader__init_buffer(YY_CURRENT_BUFFER,input_file );
2626 asmshader__load_buffer_state( );
2627 }
2628
2629 /** Switch to a different input buffer.
2630 * @param new_buffer The new input buffer.
2631 *
2632 */
2633 void asmshader__switch_to_buffer (YY_BUFFER_STATE new_buffer )
2634 {
2635
2636 /* TODO. We should be able to replace this entire function body
2637 * with
2638 * asmshader_pop_buffer_state();
2639 * asmshader_push_buffer_state(new_buffer);
2640 */
2641 asmshader_ensure_buffer_stack ();
2642 if ( YY_CURRENT_BUFFER == new_buffer )
2643 return;
2644
2645 if ( YY_CURRENT_BUFFER )
2646 {
2647 /* Flush out information for old buffer. */
2648 *(yy_c_buf_p) = (yy_hold_char);
2649 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2650 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2651 }
2652
2653 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2654 asmshader__load_buffer_state( );
2655
2656 /* We don't actually know whether we did this switch during
2657 * EOF (asmshader_wrap()) processing, but the only time this flag
2658 * is looked at is after asmshader_wrap() is called, so it's safe
2659 * to go ahead and always set it.
2660 */
2661 (yy_did_buffer_switch_on_eof) = 1;
2662 }
2663
2664 static void asmshader__load_buffer_state (void)
2665 {
2666 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2667 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2668 asmshader_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2669 (yy_hold_char) = *(yy_c_buf_p);
2670 }
2671
2672 /** Allocate and initialize an input buffer state.
2673 * @param file A readable stream.
2674 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2675 *
2676 * @return the allocated buffer state.
2677 */
2678 YY_BUFFER_STATE asmshader__create_buffer (FILE * file, int size )
2679 {
2680 YY_BUFFER_STATE b;
2681
2682 b = (YY_BUFFER_STATE) asmshader_alloc(sizeof( struct yy_buffer_state ) );
2683 if ( ! b )
2684 YY_FATAL_ERROR( "out of dynamic memory in asmshader__create_buffer()" );
2685
2686 b->yy_buf_size = size;
2687
2688 /* yy_ch_buf has to be 2 characters longer than the size given because
2689 * we need to put in 2 end-of-buffer characters.
2690 */
2691 b->yy_ch_buf = (char *) asmshader_alloc(b->yy_buf_size + 2 );
2692 if ( ! b->yy_ch_buf )
2693 YY_FATAL_ERROR( "out of dynamic memory in asmshader__create_buffer()" );
2694
2695 b->yy_is_our_buffer = 1;
2696
2697 asmshader__init_buffer(b,file );
2698
2699 return b;
2700 }
2701
2702 /** Destroy the buffer.
2703 * @param b a buffer created with asmshader__create_buffer()
2704 *
2705 */
2706 void asmshader__delete_buffer (YY_BUFFER_STATE b )
2707 {
2708
2709 if ( ! b )
2710 return;
2711
2712 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2713 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2714
2715 if ( b->yy_is_our_buffer )
2716 asmshader_free((void *) b->yy_ch_buf );
2717
2718 asmshader_free((void *) b );
2719 }
2720
2721 /* Initializes or reinitializes a buffer.
2722 * This function is sometimes called more than once on the same buffer,
2723 * such as during a asmshader_restart() or at EOF.
2724 */
2725 static void asmshader__init_buffer (YY_BUFFER_STATE b, FILE * file )
2726
2727 {
2728 int oerrno = errno;
2729
2730 asmshader__flush_buffer(b );
2731
2732 b->yy_input_file = file;
2733 b->yy_fill_buffer = 1;
2734
2735 /* If b is the current buffer, then asmshader__init_buffer was _probably_
2736 * called from asmshader_restart() or through yy_get_next_buffer.
2737 * In that case, we don't want to reset the lineno or column.
2738 */
2739 if (b != YY_CURRENT_BUFFER){
2740 b->yy_bs_lineno = 1;
2741 b->yy_bs_column = 0;
2742 }
2743
2744 b->yy_is_interactive = 0;
2745
2746 errno = oerrno;
2747 }
2748
2749 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2750 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2751 *
2752 */
2753 void asmshader__flush_buffer (YY_BUFFER_STATE b )
2754 {
2755 if ( ! b )
2756 return;
2757
2758 b->yy_n_chars = 0;
2759
2760 /* We always need two end-of-buffer characters. The first causes
2761 * a transition to the end-of-buffer state. The second causes
2762 * a jam in that state.
2763 */
2764 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2765 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2766
2767 b->yy_buf_pos = &b->yy_ch_buf[0];
2768
2769 b->yy_at_bol = 1;
2770 b->yy_buffer_status = YY_BUFFER_NEW;
2771
2772 if ( b == YY_CURRENT_BUFFER )
2773 asmshader__load_buffer_state( );
2774 }
2775
2776 /** Pushes the new state onto the stack. The new state becomes
2777 * the current state. This function will allocate the stack
2778 * if necessary.
2779 * @param new_buffer The new state.
2780 *
2781 */
2782 void asmshader_push_buffer_state (YY_BUFFER_STATE new_buffer )
2783 {
2784 if (new_buffer == NULL)
2785 return;
2786
2787 asmshader_ensure_buffer_stack();
2788
2789 /* This block is copied from asmshader__switch_to_buffer. */
2790 if ( YY_CURRENT_BUFFER )
2791 {
2792 /* Flush out information for old buffer. */
2793 *(yy_c_buf_p) = (yy_hold_char);
2794 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2795 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2796 }
2797
2798 /* Only push if top exists. Otherwise, replace top. */
2799 if (YY_CURRENT_BUFFER)
2800 (yy_buffer_stack_top)++;
2801 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2802
2803 /* copied from asmshader__switch_to_buffer. */
2804 asmshader__load_buffer_state( );
2805 (yy_did_buffer_switch_on_eof) = 1;
2806 }
2807
2808 /** Removes and deletes the top of the stack, if present.
2809 * The next element becomes the new top.
2810 *
2811 */
2812 void asmshader_pop_buffer_state (void)
2813 {
2814 if (!YY_CURRENT_BUFFER)
2815 return;
2816
2817 asmshader__delete_buffer(YY_CURRENT_BUFFER );
2818 YY_CURRENT_BUFFER_LVALUE = NULL;
2819 if ((yy_buffer_stack_top) > 0)
2820 --(yy_buffer_stack_top);
2821
2822 if (YY_CURRENT_BUFFER) {
2823 asmshader__load_buffer_state( );
2824 (yy_did_buffer_switch_on_eof) = 1;
2825 }
2826 }
2827
2828 /* Allocates the stack if it does not exist.
2829 * Guarantees space for at least one push.
2830 */
2831 static void asmshader_ensure_buffer_stack (void)
2832 {
2833 int num_to_alloc;
2834
2835 if (!(yy_buffer_stack)) {
2836
2837 /* First allocation is just for 2 elements, since we don't know if this
2838 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2839 * immediate realloc on the next call.
2840 */
2841 num_to_alloc = 1;
2842 (yy_buffer_stack) = (struct yy_buffer_state**)asmshader_alloc
2843 (num_to_alloc * sizeof(struct yy_buffer_state*)
2844 );
2845 if ( ! (yy_buffer_stack) )
2846 YY_FATAL_ERROR( "out of dynamic memory in asmshader_ensure_buffer_stack()" );
2847
2848 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2849
2850 (yy_buffer_stack_max) = num_to_alloc;
2851 (yy_buffer_stack_top) = 0;
2852 return;
2853 }
2854
2855 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2856
2857 /* Increase the buffer to prepare for a possible push. */
2858 int grow_size = 8 /* arbitrary grow size */;
2859
2860 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2861 (yy_buffer_stack) = (struct yy_buffer_state**)asmshader_realloc
2862 ((yy_buffer_stack),
2863 num_to_alloc * sizeof(struct yy_buffer_state*)
2864 );
2865 if ( ! (yy_buffer_stack) )
2866 YY_FATAL_ERROR( "out of dynamic memory in asmshader_ensure_buffer_stack()" );
2867
2868 /* zero only the new slots.*/
2869 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2870 (yy_buffer_stack_max) = num_to_alloc;
2871 }
2872 }
2873
2874 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2875 * @param base the character buffer
2876 * @param size the size in bytes of the character buffer
2877 *
2878 * @return the newly allocated buffer state object.
2879 */
2880 YY_BUFFER_STATE asmshader__scan_buffer (char * base, yy_size_t size )
2881 {
2882 YY_BUFFER_STATE b;
2883
2884 if ( size < 2 ||
2885 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2886 base[size-1] != YY_END_OF_BUFFER_CHAR )
2887 /* They forgot to leave room for the EOB's. */
2888 return 0;
2889
2890 b = (YY_BUFFER_STATE) asmshader_alloc(sizeof( struct yy_buffer_state ) );
2891 if ( ! b )
2892 YY_FATAL_ERROR( "out of dynamic memory in asmshader__scan_buffer()" );
2893
2894 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2895 b->yy_buf_pos = b->yy_ch_buf = base;
2896 b->yy_is_our_buffer = 0;
2897 b->yy_input_file = 0;
2898 b->yy_n_chars = b->yy_buf_size;
2899 b->yy_is_interactive = 0;
2900 b->yy_at_bol = 1;
2901 b->yy_fill_buffer = 0;
2902 b->yy_buffer_status = YY_BUFFER_NEW;
2903
2904 asmshader__switch_to_buffer(b );
2905
2906 return b;
2907 }
2908
2909 /** Setup the input buffer state to scan a string. The next call to asmshader_lex() will
2910 * scan from a @e copy of @a str.
2911 * @param yystr a NUL-terminated string to scan
2912 *
2913 * @return the newly allocated buffer state object.
2914 * @note If you want to scan bytes that may contain NUL values, then use
2915 * asmshader__scan_bytes() instead.
2916 */
2917 YY_BUFFER_STATE asmshader__scan_string (yyconst char * yystr )
2918 {
2919
2920 return asmshader__scan_bytes(yystr,strlen(yystr) );
2921 }
2922
2923 /** Setup the input buffer state to scan the given bytes. The next call to asmshader_lex() will
2924 * scan from a @e copy of @a bytes.
2925 * @param yybytes the byte buffer to scan
2926 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2927 *
2928 * @return the newly allocated buffer state object.
2929 */
2930 YY_BUFFER_STATE asmshader__scan_bytes (yyconst char * yybytes, int _yybytes_len )
2931 {
2932 YY_BUFFER_STATE b;
2933 char *buf;
2934 yy_size_t n;
2935 int i;
2936
2937 /* Get memory for full buffer, including space for trailing EOB's. */
2938 n = _yybytes_len + 2;
2939 buf = (char *) asmshader_alloc(n );
2940 if ( ! buf )
2941 YY_FATAL_ERROR( "out of dynamic memory in asmshader__scan_bytes()" );
2942
2943 for ( i = 0; i < _yybytes_len; ++i )
2944 buf[i] = yybytes[i];
2945
2946 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2947
2948 b = asmshader__scan_buffer(buf,n );
2949 if ( ! b )
2950 YY_FATAL_ERROR( "bad buffer in asmshader__scan_bytes()" );
2951
2952 /* It's okay to grow etc. this buffer, and we should throw it
2953 * away when we're done.
2954 */
2955 b->yy_is_our_buffer = 1;
2956
2957 return b;
2958 }
2959
2960 #ifndef YY_EXIT_FAILURE
2961 #define YY_EXIT_FAILURE 2
2962 #endif
2963
2964 static void yy_fatal_error (yyconst char* msg )
2965 {
2966 (void) fprintf( stderr, "%s\n", msg );
2967 exit( YY_EXIT_FAILURE );
2968 }
2969
2970 /* Redefine yyless() so it works in section 3 code. */
2971
2972 #undef yyless
2973 #define yyless(n) \
2974 do \
2975 { \
2976 /* Undo effects of setting up asmshader_text. */ \
2977 int yyless_macro_arg = (n); \
2978 YY_LESS_LINENO(yyless_macro_arg);\
2979 asmshader_text[asmshader_leng] = (yy_hold_char); \
2980 (yy_c_buf_p) = asmshader_text + yyless_macro_arg; \
2981 (yy_hold_char) = *(yy_c_buf_p); \
2982 *(yy_c_buf_p) = '\0'; \
2983 asmshader_leng = yyless_macro_arg; \
2984 } \
2985 while ( 0 )
2986
2987 /* Accessor methods (get/set functions) to struct members. */
2988
2989 /** Get the current line number.
2990 *
2991 */
2992 int asmshader_get_lineno (void)
2993 {
2994
2995 return asmshader_lineno;
2996 }
2997
2998 /** Get the input stream.
2999 *
3000 */
3001 FILE *asmshader_get_in (void)
3002 {
3003 return asmshader_in;
3004 }
3005
3006 /** Get the output stream.
3007 *
3008 */
3009 FILE *asmshader_get_out (void)
3010 {
3011 return asmshader_out;
3012 }
3013
3014 /** Get the length of the current token.
3015 *
3016 */
3017 int asmshader_get_leng (void)
3018 {
3019 return asmshader_leng;
3020 }
3021
3022 /** Get the current token.
3023 *
3024 */
3025
3026 char *asmshader_get_text (void)
3027 {
3028 return asmshader_text;
3029 }
3030
3031 /** Set the current line number.
3032 * @param line_number
3033 *
3034 */
3035 void asmshader_set_lineno (int line_number )
3036 {
3037
3038 asmshader_lineno = line_number;
3039 }
3040
3041 /** Set the input stream. This does not discard the current
3042 * input buffer.
3043 * @param in_str A readable stream.
3044 *
3045 * @see asmshader__switch_to_buffer
3046 */
3047 void asmshader_set_in (FILE * in_str )
3048 {
3049 asmshader_in = in_str ;
3050 }
3051
3052 void asmshader_set_out (FILE * out_str )
3053 {
3054 asmshader_out = out_str ;
3055 }
3056
3057 int asmshader_get_debug (void)
3058 {
3059 return asmshader__flex_debug;
3060 }
3061
3062 void asmshader_set_debug (int bdebug )
3063 {
3064 asmshader__flex_debug = bdebug ;
3065 }
3066
3067 static int yy_init_globals (void)
3068 {
3069 /* Initialization is the same as for the non-reentrant scanner.
3070 * This function is called from asmshader_lex_destroy(), so don't allocate here.
3071 */
3072
3073 (yy_buffer_stack) = 0;
3074 (yy_buffer_stack_top) = 0;
3075 (yy_buffer_stack_max) = 0;
3076 (yy_c_buf_p) = (char *) 0;
3077 (yy_init) = 0;
3078 (yy_start) = 0;
3079
3080 /* Defined in main.c */
3081 #ifdef YY_STDINIT
3082 asmshader_in = stdin;
3083 asmshader_out = stdout;
3084 #else
3085 asmshader_in = (FILE *) 0;
3086 asmshader_out = (FILE *) 0;
3087 #endif
3088
3089 /* For future reference: Set errno on error, since we are called by
3090 * asmshader_lex_init()
3091 */
3092 return 0;
3093 }
3094
3095 /* asmshader_lex_destroy is for both reentrant and non-reentrant scanners. */
3096 int asmshader_lex_destroy (void)
3097 {
3098
3099 /* Pop the buffer stack, destroying each element. */
3100 while(YY_CURRENT_BUFFER){
3101 asmshader__delete_buffer(YY_CURRENT_BUFFER );
3102 YY_CURRENT_BUFFER_LVALUE = NULL;
3103 asmshader_pop_buffer_state();
3104 }
3105
3106 /* Destroy the stack itself. */
3107 asmshader_free((yy_buffer_stack) );
3108 (yy_buffer_stack) = NULL;
3109
3110 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3111 * asmshader_lex() is called, initialization will occur. */
3112 yy_init_globals( );
3113
3114 return 0;
3115 }
3116
3117 /*
3118 * Internal utility routines.
3119 */
3120
3121 #ifndef yytext_ptr
3122 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
3123 {
3124 register int i;
3125 for ( i = 0; i < n; ++i )
3126 s1[i] = s2[i];
3127 }
3128 #endif
3129
3130 #ifdef YY_NEED_STRLEN
3131 static int yy_flex_strlen (yyconst char * s )
3132 {
3133 register int n;
3134 for ( n = 0; s[n]; ++n )
3135 ;
3136
3137 return n;
3138 }
3139 #endif
3140
3141 void *asmshader_alloc (yy_size_t size )
3142 {
3143 return (void *) malloc( size );
3144 }
3145
3146 void *asmshader_realloc (void * ptr, yy_size_t size )
3147 {
3148 /* The cast to (char *) in the following accommodates both
3149 * implementations that use char* generic pointers, and those
3150 * that use void* generic pointers. It works with the latter
3151 * because both ANSI C and C++ allow castless assignment from
3152 * any pointer type to void*, and deal with argument conversions
3153 * as though doing an assignment.
3154 */
3155 return (void *) realloc( (char *) ptr, size );
3156 }
3157
3158 void asmshader_free (void * ptr )
3159 {
3160 free( (char *) ptr ); /* see asmshader_realloc() for (char *) cast */
3161 }
3162
3163 #define YYTABLES_NAME "yytables"
3164
3165 #line 486 "asmshader.l"
3166
3167
3168
3169 struct bwriter_shader *SlAssembleShader(const char *text, char **messages) {
3170 struct bwriter_shader *ret = NULL;
3171 YY_BUFFER_STATE buffer;
3172 TRACE("%p, %p\n", text, messages);
3173
3174 buffer = asmshader__scan_string(text);
3175 asmshader__switch_to_buffer(buffer);
3176
3177 ret = parse_asm_shader(messages);
3178
3179 asmshader__delete_buffer(buffer);
3180
3181 return ret;
3182 }
3183