ARB_fp/vp: Initial import of new ARB vp/fp assembler
[mesa.git] / src / mesa / shader / lex.yy.c
1
2 #line 3 "lex.yy.c"
3
4 #define YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 35
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
15
16 /* First, we deal with platform-specific or compiler-specific issues. */
17
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
23
24 /* end standard C headers. */
25
26 /* flex integer type definitions */
27
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
30
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
37 */
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
41
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56
57 /* Limits of integral types. */
58 #ifndef INT8_MIN
59 #define INT8_MIN (-128)
60 #endif
61 #ifndef INT16_MIN
62 #define INT16_MIN (-32767-1)
63 #endif
64 #ifndef INT32_MIN
65 #define INT32_MIN (-2147483647-1)
66 #endif
67 #ifndef INT8_MAX
68 #define INT8_MAX (127)
69 #endif
70 #ifndef INT16_MAX
71 #define INT16_MAX (32767)
72 #endif
73 #ifndef INT32_MAX
74 #define INT32_MAX (2147483647)
75 #endif
76 #ifndef UINT8_MAX
77 #define UINT8_MAX (255U)
78 #endif
79 #ifndef UINT16_MAX
80 #define UINT16_MAX (65535U)
81 #endif
82 #ifndef UINT32_MAX
83 #define UINT32_MAX (4294967295U)
84 #endif
85
86 #endif /* ! C99 */
87
88 #endif /* ! FLEXINT_H */
89
90 #ifdef __cplusplus
91
92 /* The "const" storage-class-modifier is valid. */
93 #define YY_USE_CONST
94
95 #else /* ! __cplusplus */
96
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
99
100 #define YY_USE_CONST
101
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
104
105 #ifdef YY_USE_CONST
106 #define yyconst const
107 #else
108 #define yyconst
109 #endif
110
111 /* Returned upon end-of-file. */
112 #define YY_NULL 0
113
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
117 * double cast.
118 */
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
121 /* An opaque pointer. */
122 #ifndef YY_TYPEDEF_YY_SCANNER_T
123 #define YY_TYPEDEF_YY_SCANNER_T
124 typedef void* yyscan_t;
125 #endif
126
127 /* For convenience, these vars (plus the bison vars far below)
128 are macros in the reentrant scanner. */
129 #define yyin yyg->yyin_r
130 #define yyout yyg->yyout_r
131 #define yyextra yyg->yyextra_r
132 #define yyleng yyg->yyleng_r
133 #define yytext yyg->yytext_r
134 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136 #define yy_flex_debug yyg->yy_flex_debug_r
137
138 /* Enter a start condition. This macro really ought to take a parameter,
139 * but we do it the disgusting crufty way forced on us by the ()-less
140 * definition of BEGIN.
141 */
142 #define BEGIN yyg->yy_start = 1 + 2 *
143
144 /* Translate the current start state into a value that can be later handed
145 * to BEGIN to return to the state. The YYSTATE alias is for lex
146 * compatibility.
147 */
148 #define YY_START ((yyg->yy_start - 1) / 2)
149 #define YYSTATE YY_START
150
151 /* Action number for EOF rule of a given start state. */
152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153
154 /* Special action meaning "start processing a new file". */
155 #define YY_NEW_FILE yyrestart(yyin ,yyscanner )
156
157 #define YY_END_OF_BUFFER_CHAR 0
158
159 /* Size of default input buffer. */
160 #ifndef YY_BUF_SIZE
161 #ifdef __ia64__
162 /* On IA-64, the buffer size is 16k, not 8k.
163 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
164 * Ditto for the __ia64__ case accordingly.
165 */
166 #define YY_BUF_SIZE 32768
167 #else
168 #define YY_BUF_SIZE 16384
169 #endif /* __ia64__ */
170 #endif
171
172 /* The state buf must be large enough to hold one state per character in the main buffer.
173 */
174 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
175
176 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
177 #define YY_TYPEDEF_YY_BUFFER_STATE
178 typedef struct yy_buffer_state *YY_BUFFER_STATE;
179 #endif
180
181 #define EOB_ACT_CONTINUE_SCAN 0
182 #define EOB_ACT_END_OF_FILE 1
183 #define EOB_ACT_LAST_MATCH 2
184
185 #define YY_LESS_LINENO(n)
186
187 /* Return all but the first "n" matched characters back to the input stream. */
188 #define yyless(n) \
189 do \
190 { \
191 /* Undo effects of setting up yytext. */ \
192 int yyless_macro_arg = (n); \
193 YY_LESS_LINENO(yyless_macro_arg);\
194 *yy_cp = yyg->yy_hold_char; \
195 YY_RESTORE_YY_MORE_OFFSET \
196 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
197 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
198 } \
199 while ( 0 )
200
201 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
202
203 #ifndef YY_TYPEDEF_YY_SIZE_T
204 #define YY_TYPEDEF_YY_SIZE_T
205 typedef size_t yy_size_t;
206 #endif
207
208 #ifndef YY_STRUCT_YY_BUFFER_STATE
209 #define YY_STRUCT_YY_BUFFER_STATE
210 struct yy_buffer_state
211 {
212 FILE *yy_input_file;
213
214 char *yy_ch_buf; /* input buffer */
215 char *yy_buf_pos; /* current position in input buffer */
216
217 /* Size of input buffer in bytes, not including room for EOB
218 * characters.
219 */
220 yy_size_t yy_buf_size;
221
222 /* Number of characters read into yy_ch_buf, not including EOB
223 * characters.
224 */
225 int yy_n_chars;
226
227 /* Whether we "own" the buffer - i.e., we know we created it,
228 * and can realloc() it to grow it, and should free() it to
229 * delete it.
230 */
231 int yy_is_our_buffer;
232
233 /* Whether this is an "interactive" input source; if so, and
234 * if we're using stdio for input, then we want to use getc()
235 * instead of fread(), to make sure we stop fetching input after
236 * each newline.
237 */
238 int yy_is_interactive;
239
240 /* Whether we're considered to be at the beginning of a line.
241 * If so, '^' rules will be active on the next match, otherwise
242 * not.
243 */
244 int yy_at_bol;
245
246 int yy_bs_lineno; /**< The line count. */
247 int yy_bs_column; /**< The column count. */
248
249 /* Whether to try to fill the input buffer when we reach the
250 * end of it.
251 */
252 int yy_fill_buffer;
253
254 int yy_buffer_status;
255
256 #define YY_BUFFER_NEW 0
257 #define YY_BUFFER_NORMAL 1
258 /* When an EOF's been seen but there's still some text to process
259 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
260 * shouldn't try reading from the input source any more. We might
261 * still have a bunch of tokens to match, though, because of
262 * possible backing-up.
263 *
264 * When we actually see the EOF, we change the status to "new"
265 * (via yyrestart()), so that the user can continue scanning by
266 * just pointing yyin at a new input file.
267 */
268 #define YY_BUFFER_EOF_PENDING 2
269
270 };
271 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
272
273 /* We provide macros for accessing buffer states in case in the
274 * future we want to put the buffer states in a more general
275 * "scanner state".
276 *
277 * Returns the top of the stack, or NULL.
278 */
279 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
280 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
281 : NULL)
282
283 /* Same as previous macro, but useful when we know that the buffer stack is not
284 * NULL or when we need an lvalue. For internal use only.
285 */
286 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
287
288 void yyrestart (FILE *input_file ,yyscan_t yyscanner );
289 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
290 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
291 void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
292 void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
293 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
294 void yypop_buffer_state (yyscan_t yyscanner );
295
296 static void yyensure_buffer_stack (yyscan_t yyscanner );
297 static void yy_load_buffer_state (yyscan_t yyscanner );
298 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
299
300 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
301
302 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
303 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
304 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
305
306 void *yyalloc (yy_size_t ,yyscan_t yyscanner );
307 void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
308 void yyfree (void * ,yyscan_t yyscanner );
309
310 #define yy_new_buffer yy_create_buffer
311
312 #define yy_set_interactive(is_interactive) \
313 { \
314 if ( ! YY_CURRENT_BUFFER ){ \
315 yyensure_buffer_stack (yyscanner); \
316 YY_CURRENT_BUFFER_LVALUE = \
317 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
318 } \
319 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
320 }
321
322 #define yy_set_bol(at_bol) \
323 { \
324 if ( ! YY_CURRENT_BUFFER ){\
325 yyensure_buffer_stack (yyscanner); \
326 YY_CURRENT_BUFFER_LVALUE = \
327 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
328 } \
329 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
330 }
331
332 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
333
334 /* Begin user sect3 */
335
336 #define yywrap(n) 1
337 #define YY_SKIP_YYWRAP
338
339 typedef unsigned char YY_CHAR;
340
341 typedef int yy_state_type;
342
343 #define yytext_ptr yytext_r
344
345 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
346 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
347 static int yy_get_next_buffer (yyscan_t yyscanner );
348 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
349
350 /* Done after the current pattern has been matched and before the
351 * corresponding action - sets up yytext.
352 */
353 #define YY_DO_BEFORE_ACTION \
354 yyg->yytext_ptr = yy_bp; \
355 yyleng = (size_t) (yy_cp - yy_bp); \
356 yyg->yy_hold_char = *yy_cp; \
357 *yy_cp = '\0'; \
358 yyg->yy_c_buf_p = yy_cp;
359
360 #define YY_NUM_RULES 176
361 #define YY_END_OF_BUFFER 177
362 /* This struct is not used in this scanner,
363 but its presence is necessary. */
364 struct yy_trans_info
365 {
366 flex_int32_t yy_verify;
367 flex_int32_t yy_nxt;
368 };
369 static yyconst flex_int16_t yy_accept[645] =
370 { 0,
371 0, 0, 177, 175, 173, 172, 175, 175, 145, 171,
372 147, 147, 147, 147, 145, 145, 145, 145, 145, 145,
373 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
374 145, 145, 145, 145, 173, 0, 0, 174, 145, 0,
375 146, 148, 168, 168, 0, 0, 0, 0, 168, 0,
376 0, 0, 0, 0, 0, 0, 132, 169, 133, 134,
377 159, 159, 159, 159, 0, 147, 0, 140, 141, 142,
378 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
379 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
380 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
381
382 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
383 145, 145, 145, 145, 145, 0, 0, 0, 0, 0,
384 0, 0, 0, 0, 167, 0, 0, 0, 0, 0,
385 0, 0, 0, 0, 166, 166, 0, 0, 0, 0,
386 0, 0, 0, 0, 0, 0, 0, 0, 0, 165,
387 165, 165, 0, 0, 0, 0, 0, 0, 0, 0,
388 0, 0, 156, 156, 156, 157, 157, 158, 149, 148,
389 149, 0, 150, 11, 13, 145, 15, 145, 16, 18,
390 145, 20, 22, 24, 26, 6, 28, 30, 31, 33,
391 35, 38, 36, 40, 41, 43, 45, 47, 49, 51,
392
393 145, 145, 145, 53, 55, 145, 57, 59, 61, 63,
394 65, 67, 69, 145, 71, 73, 75, 77, 145, 145,
395 145, 145, 145, 145, 0, 0, 0, 0, 148, 0,
396 0, 0, 0, 0, 0, 0, 0, 0, 0, 93,
397 94, 96, 0, 164, 0, 0, 0, 0, 0, 0,
398 110, 0, 0, 0, 0, 0, 0, 0, 0, 0,
399 0, 163, 162, 162, 122, 0, 0, 0, 0, 0,
400 0, 0, 0, 0, 0, 153, 153, 154, 155, 0,
401 151, 145, 145, 145, 145, 145, 145, 145, 143, 145,
402 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
403
404 145, 145, 145, 145, 145, 145, 145, 145, 145, 144,
405 145, 145, 145, 145, 145, 145, 145, 10, 145, 145,
406 145, 145, 145, 145, 145, 145, 145, 145, 0, 170,
407 0, 0, 0, 86, 87, 0, 0, 0, 0, 0,
408 0, 0, 98, 0, 0, 0, 0, 0, 0, 0,
409 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
410 0, 161, 0, 0, 0, 126, 0, 128, 0, 0,
411 0, 0, 0, 0, 160, 152, 145, 145, 145, 4,
412 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
413 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
414
415 9, 145, 145, 145, 145, 145, 145, 145, 145, 145,
416 145, 145, 145, 145, 145, 145, 145, 82, 145, 145,
417 0, 0, 0, 0, 0, 88, 89, 0, 0, 0,
418 0, 97, 0, 0, 101, 104, 0, 0, 0, 0,
419 0, 0, 0, 115, 116, 0, 0, 0, 0, 121,
420 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
421 145, 145, 145, 5, 145, 145, 145, 145, 145, 145,
422 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
423 145, 7, 8, 145, 145, 145, 145, 145, 145, 145,
424 145, 145, 145, 145, 145, 145, 145, 145, 83, 145,
425
426 79, 0, 0, 0, 0, 137, 0, 0, 0, 0,
427 0, 0, 0, 0, 0, 107, 0, 111, 112, 0,
428 114, 0, 0, 0, 0, 0, 0, 0, 0, 0,
429 0, 130, 131, 0, 0, 138, 12, 3, 14, 17,
430 19, 21, 23, 25, 27, 29, 32, 34, 39, 37,
431 42, 44, 46, 48, 50, 52, 54, 56, 58, 60,
432 62, 64, 66, 68, 70, 72, 74, 76, 78, 145,
433 81, 139, 0, 0, 84, 0, 90, 0, 0, 0,
434 99, 0, 0, 0, 0, 0, 0, 113, 0, 0,
435 119, 106, 0, 0, 0, 0, 0, 0, 135, 0,
436
437 80, 0, 0, 0, 0, 92, 95, 100, 0, 0,
438 105, 0, 0, 0, 118, 0, 0, 0, 0, 127,
439 129, 0, 2, 1, 0, 91, 0, 103, 0, 109,
440 117, 0, 0, 124, 125, 136, 0, 102, 0, 120,
441 123, 85, 108, 0
442 } ;
443
444 static yyconst flex_int32_t yy_ec[256] =
445 { 0,
446 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 2, 4, 1, 5, 6, 1, 1, 1, 1,
450 1, 1, 7, 1, 7, 8, 1, 9, 10, 11,
451 12, 13, 14, 14, 14, 14, 14, 1, 1, 1,
452 1, 1, 1, 1, 15, 16, 17, 18, 19, 20,
453 21, 22, 23, 6, 24, 25, 26, 27, 28, 29,
454 30, 31, 32, 33, 34, 35, 36, 37, 6, 38,
455 1, 1, 1, 1, 39, 1, 40, 41, 42, 43,
456
457 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
458 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
459 64, 65, 1, 1, 1, 1, 1, 1, 1, 1,
460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
467
468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1
474 } ;
475
476 static yyconst flex_int32_t yy_meta[66] =
477 { 0,
478 1, 1, 1, 1, 1, 2, 1, 3, 4, 4,
479 4, 4, 4, 4, 2, 2, 2, 4, 4, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482 2, 2, 2, 4, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2
485 } ;
486
487 static yyconst flex_int16_t yy_base[649] =
488 { 0,
489 0, 0, 904, 905, 901, 905, 898, 898, 0, 64,
490 80, 95, 117, 882, 115, 53, 38, 58, 55, 876,
491 121, 122, 67, 54, 115, 134, 65, 869, 840, 839,
492 851, 835, 849, 848, 889, 875, 886, 905, 0, 169,
493 905, 153, 133, 136, 17, 110, 131, 43, 148, 848,
494 834, 121, 146, 832, 844, 147, 905, 189, 190, 86,
495 189, 177, 185, 193, 250, 262, 273, 905, 905, 905,
496 852, 865, 859, 856, 847, 850, 846, 861, 255, 843,
497 857, 149, 843, 856, 847, 860, 837, 848, 839, 162,
498 840, 831, 840, 831, 830, 831, 825, 831, 842, 828,
499
500 825, 837, 828, 821, 837, 814, 165, 190, 833, 810,
501 795, 790, 807, 783, 788, 813, 144, 803, 225, 798,
502 286, 261, 800, 781, 263, 791, 787, 782, 96, 788,
503 774, 790, 787, 778, 270, 273, 780, 769, 783, 786,
504 768, 783, 770, 767, 774, 264, 782, 160, 269, 285,
505 288, 295, 759, 776, 777, 770, 752, 234, 753, 775,
506 766, 227, 284, 291, 295, 299, 303, 307, 905, 364,
507 375, 381, 387, 774, 205, 797, 0, 780, 771, 770,
508 789, 768, 767, 766, 765, 0, 764, 0, 763, 762,
509 0, 761, 760, 0, 759, 758, 757, 756, 755, 754,
510
511 769, 762, 775, 750, 749, 754, 747, 746, 745, 744,
512 743, 742, 741, 750, 739, 738, 737, 736, 728, 727,
513 712, 712, 711, 710, 752, 725, 713, 393, 400, 375,
514 717, 280, 714, 708, 708, 702, 715, 715, 700, 905,
515 905, 715, 703, 377, 710, 39, 707, 713, 376, 708,
516 905, 699, 706, 705, 708, 694, 693, 697, 692, 294,
517 697, 384, 396, 398, 905, 689, 687, 687, 695, 696,
518 678, 401, 683, 689, 364, 386, 394, 399, 403, 460,
519 466, 702, 714, 700, 699, 707, 697, 696, 0, 695,
520 694, 693, 692, 691, 690, 689, 688, 687, 686, 685,
521
522 684, 683, 682, 681, 684, 677, 684, 677, 676, 0,
523 675, 674, 673, 672, 671, 670, 669, 0, 668, 667,
524 666, 665, 644, 638, 643, 649, 632, 647, 374, 905,
525 646, 636, 640, 905, 905, 630, 639, 625, 642, 625,
526 628, 622, 905, 623, 622, 619, 626, 619, 627, 623,
527 633, 630, 612, 618, 625, 609, 608, 626, 608, 620,
528 619, 905, 618, 608, 612, 905, 599, 905, 604, 604,
529 612, 595, 596, 606, 905, 905, 637, 619, 635, 0,
530 633, 633, 632, 631, 630, 629, 628, 627, 626, 625,
531 624, 623, 622, 621, 620, 619, 618, 617, 604, 597,
532
533 0, 614, 613, 612, 611, 610, 609, 608, 607, 606,
534 605, 604, 603, 602, 572, 575, 555, 0, 556, 549,
535 556, 555, 556, 548, 566, 905, 905, 548, 546, 556,
536 549, 905, 544, 561, 429, 905, 552, 536, 537, 546,
537 537, 536, 536, 905, 535, 544, 534, 550, 547, 905,
538 546, 544, 533, 534, 530, 522, 529, 524, 525, 520,
539 545, 545, 543, 0, 542, 541, 540, 539, 538, 537,
540 536, 535, 534, 533, 532, 531, 530, 529, 528, 527,
541 526, 0, 0, 525, 524, 523, 522, 521, 520, 519,
542 518, 517, 516, 515, 514, 513, 492, 492, 0, 499,
543
544 0, 532, 531, 481, 499, 905, 494, 489, 482, 478,
545 490, 480, 478, 474, 490, 481, 480, 905, 905, 483,
546 905, 478, 471, 460, 471, 463, 467, 480, 475, 478,
547 460, 905, 905, 472, 461, 905, 0, 0, 0, 0,
548 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
549 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
550 0, 0, 0, 0, 0, 0, 0, 0, 0, 455,
551 0, 0, 505, 504, 905, 452, 905, 456, 456, 465,
552 905, 449, 463, 451, 453, 450, 458, 905, 436, 447,
553 905, 905, 451, 447, 439, 432, 426, 439, 905, 396,
554
555 0, 443, 437, 392, 378, 905, 905, 905, 378, 338,
556 905, 337, 317, 307, 905, 296, 290, 275, 275, 905,
557 905, 288, 905, 905, 268, 905, 261, 905, 264, 905,
558 905, 213, 158, 905, 905, 905, 128, 905, 75, 905,
559 905, 905, 905, 905, 484, 487, 489, 493
560 } ;
561
562 static yyconst flex_int16_t yy_def[649] =
563 { 0,
564 644, 1, 644, 644, 644, 644, 644, 645, 646, 644,
565 644, 647, 647, 13, 646, 646, 646, 646, 646, 646,
566 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
567 646, 646, 646, 646, 644, 644, 645, 644, 646, 644,
568 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
569 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
570 644, 644, 644, 644, 648, 644, 644, 644, 644, 644,
571 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
572 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
573 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
574
575 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
576 646, 646, 646, 646, 646, 644, 644, 644, 644, 644,
577 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
578 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
579 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
580 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
581 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
582 644, 644, 644, 646, 646, 646, 646, 646, 646, 646,
583 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
584 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
585
586 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
587 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
588 646, 646, 646, 646, 644, 644, 644, 644, 644, 644,
589 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
590 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
591 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
592 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
593 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
594 644, 646, 646, 646, 646, 646, 646, 646, 646, 646,
595 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
596
597 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
598 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
599 646, 646, 646, 646, 646, 646, 646, 646, 644, 644,
600 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
601 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
602 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
603 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
604 644, 644, 644, 644, 644, 644, 646, 646, 646, 646,
605 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
606 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
607
608 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
609 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
610 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
611 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
612 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
613 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
614 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
615 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
616 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
617 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
618
619 646, 644, 644, 644, 644, 644, 644, 644, 644, 644,
620 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
621 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
622 644, 644, 644, 644, 644, 644, 646, 646, 646, 646,
623 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
624 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
625 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
626 646, 646, 644, 644, 644, 644, 644, 644, 644, 644,
627 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
628 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
629
630 646, 644, 644, 644, 644, 644, 644, 644, 644, 644,
631 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
632 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
633 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
634 644, 644, 644, 0, 644, 644, 644, 644
635 } ;
636
637 static yyconst flex_int16_t yy_nxt[971] =
638 { 0,
639 4, 5, 6, 7, 8, 9, 4, 10, 11, 12,
640 13, 14, 11, 11, 15, 9, 16, 17, 18, 19,
641 9, 9, 9, 20, 21, 22, 9, 23, 24, 9,
642 25, 26, 27, 9, 9, 9, 28, 9, 9, 9,
643 9, 9, 9, 9, 29, 9, 9, 9, 9, 9,
644 9, 9, 9, 9, 30, 9, 31, 32, 33, 9,
645 34, 9, 9, 9, 9, 40, 79, 126, 96, 80,
646 127, 41, 42, 42, 42, 42, 42, 42, 76, 83,
647 77, 97, 344, 107, 81, 84, 78, 65, 66, 66,
648 66, 66, 66, 66, 82, 94, 133, 345, 67, 134,
649
650 95, 108, 65, 43, 44, 45, 46, 47, 48, 49,
651 50, 51, 68, 67, 52, 53, 54, 55, 56, 57,
652 58, 59, 60, 67, 65, 61, 62, 63, 64, 159,
653 71, 98, 72, 99, 69, 67, 90, 643, 67, 73,
654 237, 86, 160, 87, 91, 74, 100, 75, 88, 92,
655 101, 89, 238, 128, 102, 93, 103, 129, 104, 187,
656 67, 42, 42, 42, 42, 42, 42, 105, 139, 106,
657 40, 121, 122, 122, 140, 125, 122, 188, 122, 196,
658 642, 122, 130, 131, 123, 141, 146, 135, 136, 122,
659 214, 124, 122, 122, 132, 123, 121, 147, 197, 142,
660
661 148, 215, 124, 149, 122, 216, 143, 257, 117, 118,
662 45, 46, 47, 48, 641, 50, 51, 258, 217, 52,
663 53, 54, 55, 56, 57, 119, 59, 60, 150, 151,
664 120, 154, 161, 155, 152, 283, 156, 157, 163, 162,
665 164, 165, 153, 284, 158, 122, 166, 162, 162, 167,
666 162, 162, 162, 162, 168, 162, 162, 162, 170, 170,
667 170, 170, 170, 170, 227, 640, 182, 183, 171, 65,
668 66, 66, 66, 66, 66, 66, 184, 270, 153, 172,
669 67, 173, 173, 173, 173, 173, 173, 271, 275, 275,
670 275, 275, 228, 171, 229, 229, 229, 229, 229, 229,
671
672 230, 230, 230, 230, 233, 67, 230, 639, 230, 230,
673 230, 638, 244, 230, 254, 230, 259, 230, 230, 230,
674 255, 637, 260, 332, 230, 230, 230, 262, 230, 230,
675 230, 636, 635, 230, 263, 264, 333, 261, 634, 359,
676 230, 230, 360, 633, 230, 275, 275, 275, 275, 632,
677 631, 230, 276, 275, 275, 277, 278, 275, 275, 275,
678 275, 275, 275, 275, 279, 275, 275, 275, 275, 275,
679 275, 275, 42, 42, 42, 42, 42, 42, 630, 629,
680 628, 280, 121, 281, 281, 281, 281, 281, 281, 173,
681 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
682
683 173, 229, 229, 229, 229, 229, 229, 121, 229, 229,
684 229, 229, 229, 229, 330, 330, 330, 330, 421, 348,
685 330, 627, 330, 330, 330, 375, 375, 375, 375, 330,
686 626, 330, 349, 330, 422, 330, 330, 362, 330, 625,
687 330, 330, 369, 330, 370, 624, 371, 375, 375, 375,
688 375, 623, 330, 622, 330, 376, 375, 375, 375, 372,
689 375, 375, 375, 375, 375, 375, 375, 375, 281, 281,
690 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
691 513, 621, 620, 514, 37, 37, 37, 37, 39, 619,
692 39, 66, 66, 169, 169, 618, 169, 617, 616, 615,
693
694 614, 613, 612, 611, 610, 609, 608, 607, 606, 605,
695 604, 603, 602, 601, 600, 599, 598, 597, 596, 595,
696 594, 593, 592, 591, 590, 589, 588, 587, 586, 585,
697 584, 583, 582, 581, 580, 579, 578, 577, 576, 575,
698 574, 573, 572, 571, 570, 569, 568, 567, 566, 565,
699 564, 563, 562, 561, 560, 559, 558, 557, 556, 555,
700 554, 553, 552, 551, 550, 549, 548, 547, 546, 545,
701 544, 543, 542, 541, 540, 539, 538, 537, 536, 535,
702 534, 533, 532, 531, 530, 529, 528, 527, 526, 525,
703 524, 523, 522, 521, 520, 519, 518, 517, 516, 515,
704
705 512, 511, 510, 509, 508, 507, 506, 505, 504, 503,
706 502, 501, 500, 499, 498, 497, 496, 495, 494, 493,
707 492, 491, 490, 489, 488, 487, 486, 485, 484, 483,
708 482, 481, 480, 479, 478, 477, 476, 475, 474, 473,
709 472, 471, 470, 469, 468, 467, 466, 465, 464, 463,
710 462, 461, 460, 459, 458, 457, 456, 455, 454, 453,
711 452, 451, 450, 449, 448, 447, 446, 445, 444, 443,
712 442, 441, 440, 439, 438, 437, 436, 435, 434, 433,
713 432, 431, 430, 429, 428, 427, 426, 425, 424, 423,
714 420, 419, 418, 417, 416, 415, 414, 413, 412, 411,
715
716 410, 409, 408, 407, 406, 405, 404, 403, 402, 401,
717 400, 399, 398, 397, 396, 395, 394, 393, 392, 391,
718 390, 389, 388, 387, 386, 385, 384, 383, 382, 381,
719 380, 379, 378, 377, 374, 373, 368, 367, 366, 365,
720 364, 363, 361, 358, 357, 356, 355, 354, 353, 352,
721 351, 350, 347, 346, 343, 342, 341, 340, 339, 338,
722 337, 336, 335, 334, 331, 261, 233, 329, 328, 327,
723 326, 325, 324, 323, 322, 321, 320, 319, 318, 317,
724 316, 315, 314, 313, 312, 311, 310, 309, 308, 307,
725 306, 305, 304, 303, 302, 301, 300, 299, 298, 297,
726
727 296, 295, 294, 293, 292, 291, 290, 289, 288, 287,
728 286, 285, 282, 274, 273, 272, 269, 268, 267, 266,
729 265, 256, 253, 252, 251, 250, 249, 248, 247, 246,
730 245, 243, 242, 241, 240, 239, 236, 235, 234, 232,
731 231, 161, 226, 225, 224, 223, 222, 221, 220, 219,
732 218, 213, 212, 211, 210, 209, 208, 207, 206, 205,
733 204, 203, 202, 201, 200, 199, 198, 195, 194, 193,
734 192, 191, 190, 189, 186, 185, 181, 180, 179, 178,
735 177, 176, 175, 174, 145, 144, 138, 137, 38, 116,
736 35, 115, 114, 113, 112, 111, 110, 109, 85, 70,
737
738 38, 36, 35, 644, 3, 644, 644, 644, 644, 644,
739 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
740 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
741 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
742 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
743 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
744 644, 644, 644, 644, 644, 644, 644, 644, 644, 644
745 } ;
746
747 static yyconst flex_int16_t yy_chk[971] =
748 { 0,
749 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
750 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
751 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
752 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
753 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
754 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
755 1, 1, 1, 1, 1, 10, 17, 45, 24, 17,
756 45, 10, 10, 10, 10, 10, 10, 10, 16, 19,
757 16, 24, 246, 27, 18, 19, 16, 11, 11, 11,
758 11, 11, 11, 11, 18, 23, 48, 246, 11, 48,
759
760 23, 27, 12, 10, 10, 10, 10, 10, 10, 10,
761 10, 10, 12, 12, 10, 10, 10, 10, 10, 10,
762 10, 10, 10, 11, 13, 10, 10, 10, 10, 60,
763 15, 25, 15, 25, 13, 13, 22, 639, 12, 15,
764 129, 21, 60, 21, 22, 15, 25, 15, 21, 22,
765 26, 21, 129, 46, 26, 22, 26, 46, 26, 82,
766 13, 42, 42, 42, 42, 42, 42, 26, 52, 26,
767 40, 42, 43, 43, 52, 44, 44, 82, 43, 90,
768 637, 44, 47, 47, 43, 53, 56, 49, 49, 43,
769 107, 43, 44, 49, 47, 117, 42, 56, 90, 53,
770
771 56, 107, 117, 56, 49, 108, 53, 148, 40, 40,
772 40, 40, 40, 40, 633, 40, 40, 148, 108, 40,
773 40, 40, 40, 40, 40, 40, 40, 40, 58, 58,
774 40, 59, 61, 59, 58, 175, 59, 59, 62, 62,
775 62, 62, 58, 175, 59, 58, 63, 63, 63, 63,
776 61, 61, 61, 61, 64, 64, 64, 64, 65, 65,
777 65, 65, 65, 65, 119, 632, 79, 79, 65, 66,
778 66, 66, 66, 66, 66, 66, 79, 158, 119, 67,
779 66, 67, 67, 67, 67, 67, 67, 158, 162, 162,
780 162, 162, 121, 65, 121, 121, 121, 121, 121, 121,
781
782 122, 122, 125, 125, 125, 66, 122, 629, 125, 135,
783 135, 627, 136, 136, 146, 135, 149, 122, 136, 125,
784 146, 625, 149, 232, 150, 150, 135, 151, 151, 136,
785 150, 622, 619, 151, 152, 152, 232, 150, 618, 260,
786 152, 150, 260, 617, 151, 163, 163, 163, 163, 616,
787 614, 152, 164, 164, 164, 164, 165, 165, 165, 165,
788 166, 166, 166, 166, 167, 167, 167, 167, 168, 168,
789 168, 168, 170, 170, 170, 170, 170, 170, 613, 612,
790 610, 171, 170, 171, 171, 171, 171, 171, 171, 172,
791 172, 172, 172, 172, 172, 173, 173, 173, 173, 173,
792
793 173, 228, 228, 228, 228, 228, 228, 170, 229, 229,
794 229, 229, 229, 229, 230, 230, 244, 244, 329, 249,
795 230, 609, 244, 262, 262, 275, 275, 275, 275, 262,
796 605, 230, 249, 244, 329, 263, 263, 264, 264, 604,
797 262, 263, 272, 264, 272, 603, 272, 276, 276, 276,
798 276, 602, 263, 600, 264, 277, 277, 277, 277, 272,
799 278, 278, 278, 278, 279, 279, 279, 279, 280, 280,
800 280, 280, 280, 280, 281, 281, 281, 281, 281, 281,
801 435, 598, 597, 435, 645, 645, 645, 645, 646, 596,
802 646, 647, 647, 648, 648, 595, 648, 594, 593, 590,
803
804 589, 587, 586, 585, 584, 583, 582, 580, 579, 578,
805 576, 574, 573, 570, 535, 534, 531, 530, 529, 528,
806 527, 526, 525, 524, 523, 522, 520, 517, 516, 515,
807 514, 513, 512, 511, 510, 509, 508, 507, 505, 504,
808 503, 502, 500, 498, 497, 496, 495, 494, 493, 492,
809 491, 490, 489, 488, 487, 486, 485, 484, 481, 480,
810 479, 478, 477, 476, 475, 474, 473, 472, 471, 470,
811 469, 468, 467, 466, 465, 463, 462, 461, 460, 459,
812 458, 457, 456, 455, 454, 453, 452, 451, 449, 448,
813 447, 446, 445, 443, 442, 441, 440, 439, 438, 437,
814
815 434, 433, 431, 430, 429, 428, 425, 424, 423, 422,
816 421, 420, 419, 417, 416, 415, 414, 413, 412, 411,
817 410, 409, 408, 407, 406, 405, 404, 403, 402, 400,
818 399, 398, 397, 396, 395, 394, 393, 392, 391, 390,
819 389, 388, 387, 386, 385, 384, 383, 382, 381, 379,
820 378, 377, 374, 373, 372, 371, 370, 369, 367, 365,
821 364, 363, 361, 360, 359, 358, 357, 356, 355, 354,
822 353, 352, 351, 350, 349, 348, 347, 346, 345, 344,
823 342, 341, 340, 339, 338, 337, 336, 333, 332, 331,
824 328, 327, 326, 325, 324, 323, 322, 321, 320, 319,
825
826 317, 316, 315, 314, 313, 312, 311, 309, 308, 307,
827 306, 305, 304, 303, 302, 301, 300, 299, 298, 297,
828 296, 295, 294, 293, 292, 291, 290, 288, 287, 286,
829 285, 284, 283, 282, 274, 273, 271, 270, 269, 268,
830 267, 266, 261, 259, 258, 257, 256, 255, 254, 253,
831 252, 250, 248, 247, 245, 243, 242, 239, 238, 237,
832 236, 235, 234, 233, 231, 227, 226, 225, 224, 223,
833 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
834 212, 211, 210, 209, 208, 207, 206, 205, 204, 203,
835 202, 201, 200, 199, 198, 197, 196, 195, 193, 192,
836
837 190, 189, 187, 185, 184, 183, 182, 181, 180, 179,
838 178, 176, 174, 161, 160, 159, 157, 156, 155, 154,
839 153, 147, 145, 144, 143, 142, 141, 140, 139, 138,
840 137, 134, 133, 132, 131, 130, 128, 127, 126, 124,
841 123, 120, 118, 116, 115, 114, 113, 112, 111, 110,
842 109, 106, 105, 104, 103, 102, 101, 100, 99, 98,
843 97, 96, 95, 94, 93, 92, 91, 89, 88, 87,
844 86, 85, 84, 83, 81, 80, 78, 77, 76, 75,
845 74, 73, 72, 71, 55, 54, 51, 50, 37, 36,
846 35, 34, 33, 32, 31, 30, 29, 28, 20, 14,
847
848 8, 7, 5, 3, 644, 644, 644, 644, 644, 644,
849 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
850 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
851 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
852 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
853 644, 644, 644, 644, 644, 644, 644, 644, 644, 644,
854 644, 644, 644, 644, 644, 644, 644, 644, 644, 644
855 } ;
856
857 /* The intent behind this definition is that it'll catch
858 * any uses of REJECT which flex missed.
859 */
860 #define REJECT reject_used_but_not_detected
861 #define yymore() yymore_used_but_not_detected
862 #define YY_MORE_ADJ 0
863 #define YY_RESTORE_YY_MORE_OFFSET
864 #line 1 "program_lexer.l"
865 #line 2 "program_lexer.l"
866 /*
867 * Copyright © 2009 Intel Corporation
868 *
869 * Permission is hereby granted, free of charge, to any person obtaining a
870 * copy of this software and associated documentation files (the "Software"),
871 * to deal in the Software without restriction, including without limitation
872 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
873 * and/or sell copies of the Software, and to permit persons to whom the
874 * Software is furnished to do so, subject to the following conditions:
875 *
876 * The above copyright notice and this permission notice (including the next
877 * paragraph) shall be included in all copies or substantial portions of the
878 * Software.
879 *
880 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
881 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
882 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
883 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
884 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
885 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
886 * DEALINGS IN THE SOFTWARE.
887 */
888 #include "main/glheader.h"
889 #include "prog_instruction.h"
890
891 #include "program_parser.h"
892 #include "program_parse.tab.h"
893
894 #define require_ARB_vp (yyextra->mode == ARB_vertex)
895 #define require_ARB_fp (yyextra->mode == ARB_fragment)
896
897 #define return_token_or_IDENTIFIER(condition, token) \
898 do { \
899 if (condition) { \
900 return token; \
901 } else { \
902 yylval->string = strdup(yytext); \
903 return IDENTIFIER; \
904 } \
905 } while (0)
906
907 #define return_token_or_DOT(condition, token) \
908 do { \
909 if (condition) { \
910 return token; \
911 } else { \
912 yyless(1); \
913 return DOT; \
914 } \
915 } while (0)
916
917
918 #define return_opcode(condition, token, opcode, sat) \
919 do { \
920 if (condition) { \
921 yylval->temp_inst.Opcode = OPCODE_ ## opcode; \
922 yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \
923 return token; \
924 } else { \
925 yylval->string = strdup(yytext); \
926 return IDENTIFIER; \
927 } \
928 } while (0)
929
930 #define SWIZZLE_INVAL MAKE_SWIZZLE4(SWIZZLE_NIL, SWIZZLE_NIL, \
931 SWIZZLE_NIL, SWIZZLE_NIL)
932
933 static unsigned
934 mask_from_char(char c)
935 {
936 switch (c) {
937 case 'x':
938 case 'r':
939 return WRITEMASK_X;
940 case 'y':
941 case 'g':
942 return WRITEMASK_Y;
943 case 'z':
944 case 'b':
945 return WRITEMASK_Z;
946 case 'w':
947 case 'a':
948 return WRITEMASK_W;
949 }
950
951 return 0;
952 }
953
954 static unsigned
955 swiz_from_char(char c)
956 {
957 switch (c) {
958 case 'x':
959 case 'r':
960 return SWIZZLE_X;
961 case 'y':
962 case 'g':
963 return SWIZZLE_Y;
964 case 'z':
965 case 'b':
966 return SWIZZLE_Z;
967 case 'w':
968 case 'a':
969 return SWIZZLE_W;
970 }
971
972 return 0;
973 }
974
975 #define YY_USER_ACTION \
976 do { \
977 yylloc->first_column = yylloc->last_column; \
978 yylloc->last_column += yyleng; \
979 if ((yylloc->first_line == 1) \
980 && (yylloc->first_column == 1)) { \
981 yylloc->position = 1; \
982 } else { \
983 yylloc->position += yylloc->last_column - yylloc->first_column; \
984 } \
985 } while(0);
986
987 #define YY_EXTRA_TYPE struct asm_parser_state *
988 #line 989 "lex.yy.c"
989
990 #define INITIAL 0
991
992 #ifndef YY_NO_UNISTD_H
993 /* Special case for "unistd.h", since it is non-ANSI. We include it way
994 * down here because we want the user's section 1 to have been scanned first.
995 * The user has a chance to override it with an option.
996 */
997 #include <unistd.h>
998 #endif
999
1000 #ifndef YY_EXTRA_TYPE
1001 #define YY_EXTRA_TYPE void *
1002 #endif
1003
1004 /* Holds the entire state of the reentrant scanner. */
1005 struct yyguts_t
1006 {
1007
1008 /* User-defined. Not touched by flex. */
1009 YY_EXTRA_TYPE yyextra_r;
1010
1011 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1012 FILE *yyin_r, *yyout_r;
1013 size_t yy_buffer_stack_top; /**< index of top of stack. */
1014 size_t yy_buffer_stack_max; /**< capacity of stack. */
1015 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1016 char yy_hold_char;
1017 int yy_n_chars;
1018 int yyleng_r;
1019 char *yy_c_buf_p;
1020 int yy_init;
1021 int yy_start;
1022 int yy_did_buffer_switch_on_eof;
1023 int yy_start_stack_ptr;
1024 int yy_start_stack_depth;
1025 int *yy_start_stack;
1026 yy_state_type yy_last_accepting_state;
1027 char* yy_last_accepting_cpos;
1028
1029 int yylineno_r;
1030 int yy_flex_debug_r;
1031
1032 char *yytext_r;
1033 int yy_more_flag;
1034 int yy_more_len;
1035
1036 YYSTYPE * yylval_r;
1037
1038 YYLTYPE * yylloc_r;
1039
1040 }; /* end struct yyguts_t */
1041
1042 static int yy_init_globals (yyscan_t yyscanner );
1043
1044 /* This must go here because YYSTYPE and YYLTYPE are included
1045 * from bison output in section 1.*/
1046 # define yylval yyg->yylval_r
1047
1048 # define yylloc yyg->yylloc_r
1049
1050 int yylex_init (yyscan_t* scanner);
1051
1052 int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1053
1054 /* Accessor methods to globals.
1055 These are made visible to non-reentrant scanners for convenience. */
1056
1057 int yylex_destroy (yyscan_t yyscanner );
1058
1059 int yyget_debug (yyscan_t yyscanner );
1060
1061 void yyset_debug (int debug_flag ,yyscan_t yyscanner );
1062
1063 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
1064
1065 void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1066
1067 FILE *yyget_in (yyscan_t yyscanner );
1068
1069 void yyset_in (FILE * in_str ,yyscan_t yyscanner );
1070
1071 FILE *yyget_out (yyscan_t yyscanner );
1072
1073 void yyset_out (FILE * out_str ,yyscan_t yyscanner );
1074
1075 int yyget_leng (yyscan_t yyscanner );
1076
1077 char *yyget_text (yyscan_t yyscanner );
1078
1079 int yyget_lineno (yyscan_t yyscanner );
1080
1081 void yyset_lineno (int line_number ,yyscan_t yyscanner );
1082
1083 YYSTYPE * yyget_lval (yyscan_t yyscanner );
1084
1085 void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1086
1087 YYLTYPE *yyget_lloc (yyscan_t yyscanner );
1088
1089 void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
1090
1091 /* Macros after this point can all be overridden by user definitions in
1092 * section 1.
1093 */
1094
1095 #ifndef YY_SKIP_YYWRAP
1096 #ifdef __cplusplus
1097 extern "C" int yywrap (yyscan_t yyscanner );
1098 #else
1099 extern int yywrap (yyscan_t yyscanner );
1100 #endif
1101 #endif
1102
1103 static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
1104
1105 #ifndef yytext_ptr
1106 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1107 #endif
1108
1109 #ifdef YY_NEED_STRLEN
1110 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1111 #endif
1112
1113 #ifndef YY_NO_INPUT
1114
1115 #ifdef __cplusplus
1116 static int yyinput (yyscan_t yyscanner );
1117 #else
1118 static int input (yyscan_t yyscanner );
1119 #endif
1120
1121 #endif
1122
1123 /* Amount of stuff to slurp up with each read. */
1124 #ifndef YY_READ_BUF_SIZE
1125 #ifdef __ia64__
1126 /* On IA-64, the buffer size is 16k, not 8k */
1127 #define YY_READ_BUF_SIZE 16384
1128 #else
1129 #define YY_READ_BUF_SIZE 8192
1130 #endif /* __ia64__ */
1131 #endif
1132
1133 /* Copy whatever the last rule matched to the standard output. */
1134 #ifndef ECHO
1135 /* This used to be an fputs(), but since the string might contain NUL's,
1136 * we now use fwrite().
1137 */
1138 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1139 #endif
1140
1141 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1142 * is returned in "result".
1143 */
1144 #ifndef YY_INPUT
1145 #define YY_INPUT(buf,result,max_size) \
1146 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1147 { \
1148 int c = '*'; \
1149 size_t n; \
1150 for ( n = 0; n < max_size && \
1151 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1152 buf[n] = (char) c; \
1153 if ( c == '\n' ) \
1154 buf[n++] = (char) c; \
1155 if ( c == EOF && ferror( yyin ) ) \
1156 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1157 result = n; \
1158 } \
1159 else \
1160 { \
1161 errno=0; \
1162 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1163 { \
1164 if( errno != EINTR) \
1165 { \
1166 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1167 break; \
1168 } \
1169 errno=0; \
1170 clearerr(yyin); \
1171 } \
1172 }\
1173 \
1174
1175 #endif
1176
1177 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1178 * we don't want an extra ';' after the "return" because that will cause
1179 * some compilers to complain about unreachable statements.
1180 */
1181 #ifndef yyterminate
1182 #define yyterminate() return YY_NULL
1183 #endif
1184
1185 /* Number of entries by which start-condition stack grows. */
1186 #ifndef YY_START_STACK_INCR
1187 #define YY_START_STACK_INCR 25
1188 #endif
1189
1190 /* Report a fatal error. */
1191 #ifndef YY_FATAL_ERROR
1192 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1193 #endif
1194
1195 /* end tables serialization structures and prototypes */
1196
1197 /* Default declaration of generated scanner - a define so the user can
1198 * easily add parameters.
1199 */
1200 #ifndef YY_DECL
1201 #define YY_DECL_IS_OURS 1
1202
1203 extern int yylex \
1204 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1205
1206 #define YY_DECL int yylex \
1207 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1208 #endif /* !YY_DECL */
1209
1210 /* Code executed at the beginning of each rule, after yytext and yyleng
1211 * have been set up.
1212 */
1213 #ifndef YY_USER_ACTION
1214 #define YY_USER_ACTION
1215 #endif
1216
1217 /* Code executed at the end of each rule. */
1218 #ifndef YY_BREAK
1219 #define YY_BREAK break;
1220 #endif
1221
1222 #define YY_RULE_SETUP \
1223 YY_USER_ACTION
1224
1225 /** The main scanner function which does all the work.
1226 */
1227 YY_DECL
1228 {
1229 register yy_state_type yy_current_state;
1230 register char *yy_cp, *yy_bp;
1231 register int yy_act;
1232 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1233
1234 #line 132 "program_lexer.l"
1235
1236
1237 #line 1238 "lex.yy.c"
1238
1239 yylval = yylval_param;
1240
1241 yylloc = yylloc_param;
1242
1243 if ( !yyg->yy_init )
1244 {
1245 yyg->yy_init = 1;
1246
1247 #ifdef YY_USER_INIT
1248 YY_USER_INIT;
1249 #endif
1250
1251 if ( ! yyg->yy_start )
1252 yyg->yy_start = 1; /* first start state */
1253
1254 if ( ! yyin )
1255 yyin = stdin;
1256
1257 if ( ! yyout )
1258 yyout = stdout;
1259
1260 if ( ! YY_CURRENT_BUFFER ) {
1261 yyensure_buffer_stack (yyscanner);
1262 YY_CURRENT_BUFFER_LVALUE =
1263 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1264 }
1265
1266 yy_load_buffer_state(yyscanner );
1267 }
1268
1269 while ( 1 ) /* loops until end-of-file is reached */
1270 {
1271 yy_cp = yyg->yy_c_buf_p;
1272
1273 /* Support of yytext. */
1274 *yy_cp = yyg->yy_hold_char;
1275
1276 /* yy_bp points to the position in yy_ch_buf of the start of
1277 * the current run.
1278 */
1279 yy_bp = yy_cp;
1280
1281 yy_current_state = yyg->yy_start;
1282 yy_match:
1283 do
1284 {
1285 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1286 if ( yy_accept[yy_current_state] )
1287 {
1288 yyg->yy_last_accepting_state = yy_current_state;
1289 yyg->yy_last_accepting_cpos = yy_cp;
1290 }
1291 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1292 {
1293 yy_current_state = (int) yy_def[yy_current_state];
1294 if ( yy_current_state >= 645 )
1295 yy_c = yy_meta[(unsigned int) yy_c];
1296 }
1297 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1298 ++yy_cp;
1299 }
1300 while ( yy_base[yy_current_state] != 905 );
1301
1302 yy_find_action:
1303 yy_act = yy_accept[yy_current_state];
1304 if ( yy_act == 0 )
1305 { /* have to back up */
1306 yy_cp = yyg->yy_last_accepting_cpos;
1307 yy_current_state = yyg->yy_last_accepting_state;
1308 yy_act = yy_accept[yy_current_state];
1309 }
1310
1311 YY_DO_BEFORE_ACTION;
1312
1313 do_action: /* This label is used only to access EOF actions. */
1314
1315 switch ( yy_act )
1316 { /* beginning of action switch */
1317 case 0: /* must back up */
1318 /* undo the effects of YY_DO_BEFORE_ACTION */
1319 *yy_cp = yyg->yy_hold_char;
1320 yy_cp = yyg->yy_last_accepting_cpos;
1321 yy_current_state = yyg->yy_last_accepting_state;
1322 goto yy_find_action;
1323
1324 case 1:
1325 YY_RULE_SETUP
1326 #line 134 "program_lexer.l"
1327 { return ARBvp_10; }
1328 YY_BREAK
1329 case 2:
1330 YY_RULE_SETUP
1331 #line 135 "program_lexer.l"
1332 { return ARBfp_10; }
1333 YY_BREAK
1334 case 3:
1335 YY_RULE_SETUP
1336 #line 136 "program_lexer.l"
1337 {
1338 yylval->integer = at_address;
1339 return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS);
1340 }
1341 YY_BREAK
1342 case 4:
1343 YY_RULE_SETUP
1344 #line 140 "program_lexer.l"
1345 { return ALIAS; }
1346 YY_BREAK
1347 case 5:
1348 YY_RULE_SETUP
1349 #line 141 "program_lexer.l"
1350 { return ATTRIB; }
1351 YY_BREAK
1352 case 6:
1353 YY_RULE_SETUP
1354 #line 142 "program_lexer.l"
1355 { return END; }
1356 YY_BREAK
1357 case 7:
1358 YY_RULE_SETUP
1359 #line 143 "program_lexer.l"
1360 { return OPTION; }
1361 YY_BREAK
1362 case 8:
1363 YY_RULE_SETUP
1364 #line 144 "program_lexer.l"
1365 { return OUTPUT; }
1366 YY_BREAK
1367 case 9:
1368 YY_RULE_SETUP
1369 #line 145 "program_lexer.l"
1370 { return PARAM; }
1371 YY_BREAK
1372 case 10:
1373 YY_RULE_SETUP
1374 #line 146 "program_lexer.l"
1375 { yylval->integer = at_temp; return TEMP; }
1376 YY_BREAK
1377 case 11:
1378 YY_RULE_SETUP
1379 #line 148 "program_lexer.l"
1380 { return_opcode( 1, VECTOR_OP, ABS, OFF); }
1381 YY_BREAK
1382 case 12:
1383 YY_RULE_SETUP
1384 #line 149 "program_lexer.l"
1385 { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); }
1386 YY_BREAK
1387 case 13:
1388 YY_RULE_SETUP
1389 #line 150 "program_lexer.l"
1390 { return_opcode( 1, BIN_OP, ADD, OFF); }
1391 YY_BREAK
1392 case 14:
1393 YY_RULE_SETUP
1394 #line 151 "program_lexer.l"
1395 { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); }
1396 YY_BREAK
1397 case 15:
1398 YY_RULE_SETUP
1399 #line 152 "program_lexer.l"
1400 { return_opcode(require_ARB_vp, ARL, ARL, OFF); }
1401 YY_BREAK
1402 case 16:
1403 YY_RULE_SETUP
1404 #line 154 "program_lexer.l"
1405 { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); }
1406 YY_BREAK
1407 case 17:
1408 YY_RULE_SETUP
1409 #line 155 "program_lexer.l"
1410 { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); }
1411 YY_BREAK
1412 case 18:
1413 YY_RULE_SETUP
1414 #line 156 "program_lexer.l"
1415 { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); }
1416 YY_BREAK
1417 case 19:
1418 YY_RULE_SETUP
1419 #line 157 "program_lexer.l"
1420 { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); }
1421 YY_BREAK
1422 case 20:
1423 YY_RULE_SETUP
1424 #line 159 "program_lexer.l"
1425 { return_opcode( 1, BIN_OP, DP3, OFF); }
1426 YY_BREAK
1427 case 21:
1428 YY_RULE_SETUP
1429 #line 160 "program_lexer.l"
1430 { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); }
1431 YY_BREAK
1432 case 22:
1433 YY_RULE_SETUP
1434 #line 161 "program_lexer.l"
1435 { return_opcode( 1, BIN_OP, DP4, OFF); }
1436 YY_BREAK
1437 case 23:
1438 YY_RULE_SETUP
1439 #line 162 "program_lexer.l"
1440 { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); }
1441 YY_BREAK
1442 case 24:
1443 YY_RULE_SETUP
1444 #line 163 "program_lexer.l"
1445 { return_opcode( 1, BIN_OP, DPH, OFF); }
1446 YY_BREAK
1447 case 25:
1448 YY_RULE_SETUP
1449 #line 164 "program_lexer.l"
1450 { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); }
1451 YY_BREAK
1452 case 26:
1453 YY_RULE_SETUP
1454 #line 165 "program_lexer.l"
1455 { return_opcode( 1, BIN_OP, DST, OFF); }
1456 YY_BREAK
1457 case 27:
1458 YY_RULE_SETUP
1459 #line 166 "program_lexer.l"
1460 { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); }
1461 YY_BREAK
1462 case 28:
1463 YY_RULE_SETUP
1464 #line 168 "program_lexer.l"
1465 { return_opcode( 1, SCALAR_OP, EX2, OFF); }
1466 YY_BREAK
1467 case 29:
1468 YY_RULE_SETUP
1469 #line 169 "program_lexer.l"
1470 { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); }
1471 YY_BREAK
1472 case 30:
1473 YY_RULE_SETUP
1474 #line 170 "program_lexer.l"
1475 { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); }
1476 YY_BREAK
1477 case 31:
1478 YY_RULE_SETUP
1479 #line 172 "program_lexer.l"
1480 { return_opcode( 1, VECTOR_OP, FLR, OFF); }
1481 YY_BREAK
1482 case 32:
1483 YY_RULE_SETUP
1484 #line 173 "program_lexer.l"
1485 { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); }
1486 YY_BREAK
1487 case 33:
1488 YY_RULE_SETUP
1489 #line 174 "program_lexer.l"
1490 { return_opcode( 1, VECTOR_OP, FRC, OFF); }
1491 YY_BREAK
1492 case 34:
1493 YY_RULE_SETUP
1494 #line 175 "program_lexer.l"
1495 { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); }
1496 YY_BREAK
1497 case 35:
1498 YY_RULE_SETUP
1499 #line 177 "program_lexer.l"
1500 { return_opcode(require_ARB_fp, KIL, KIL, OFF); }
1501 YY_BREAK
1502 case 36:
1503 YY_RULE_SETUP
1504 #line 179 "program_lexer.l"
1505 { return_opcode( 1, VECTOR_OP, LIT, OFF); }
1506 YY_BREAK
1507 case 37:
1508 YY_RULE_SETUP
1509 #line 180 "program_lexer.l"
1510 { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); }
1511 YY_BREAK
1512 case 38:
1513 YY_RULE_SETUP
1514 #line 181 "program_lexer.l"
1515 { return_opcode( 1, SCALAR_OP, LG2, OFF); }
1516 YY_BREAK
1517 case 39:
1518 YY_RULE_SETUP
1519 #line 182 "program_lexer.l"
1520 { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); }
1521 YY_BREAK
1522 case 40:
1523 YY_RULE_SETUP
1524 #line 183 "program_lexer.l"
1525 { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); }
1526 YY_BREAK
1527 case 41:
1528 YY_RULE_SETUP
1529 #line 184 "program_lexer.l"
1530 { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); }
1531 YY_BREAK
1532 case 42:
1533 YY_RULE_SETUP
1534 #line 185 "program_lexer.l"
1535 { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); }
1536 YY_BREAK
1537 case 43:
1538 YY_RULE_SETUP
1539 #line 187 "program_lexer.l"
1540 { return_opcode( 1, TRI_OP, MAD, OFF); }
1541 YY_BREAK
1542 case 44:
1543 YY_RULE_SETUP
1544 #line 188 "program_lexer.l"
1545 { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); }
1546 YY_BREAK
1547 case 45:
1548 YY_RULE_SETUP
1549 #line 189 "program_lexer.l"
1550 { return_opcode( 1, BIN_OP, MAX, OFF); }
1551 YY_BREAK
1552 case 46:
1553 YY_RULE_SETUP
1554 #line 190 "program_lexer.l"
1555 { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); }
1556 YY_BREAK
1557 case 47:
1558 YY_RULE_SETUP
1559 #line 191 "program_lexer.l"
1560 { return_opcode( 1, BIN_OP, MIN, OFF); }
1561 YY_BREAK
1562 case 48:
1563 YY_RULE_SETUP
1564 #line 192 "program_lexer.l"
1565 { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); }
1566 YY_BREAK
1567 case 49:
1568 YY_RULE_SETUP
1569 #line 193 "program_lexer.l"
1570 { return_opcode( 1, VECTOR_OP, MOV, OFF); }
1571 YY_BREAK
1572 case 50:
1573 YY_RULE_SETUP
1574 #line 194 "program_lexer.l"
1575 { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); }
1576 YY_BREAK
1577 case 51:
1578 YY_RULE_SETUP
1579 #line 195 "program_lexer.l"
1580 { return_opcode( 1, BIN_OP, MUL, OFF); }
1581 YY_BREAK
1582 case 52:
1583 YY_RULE_SETUP
1584 #line 196 "program_lexer.l"
1585 { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); }
1586 YY_BREAK
1587 case 53:
1588 YY_RULE_SETUP
1589 #line 198 "program_lexer.l"
1590 { return_opcode( 1, BINSC_OP, POW, OFF); }
1591 YY_BREAK
1592 case 54:
1593 YY_RULE_SETUP
1594 #line 199 "program_lexer.l"
1595 { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); }
1596 YY_BREAK
1597 case 55:
1598 YY_RULE_SETUP
1599 #line 201 "program_lexer.l"
1600 { return_opcode( 1, SCALAR_OP, RCP, OFF); }
1601 YY_BREAK
1602 case 56:
1603 YY_RULE_SETUP
1604 #line 202 "program_lexer.l"
1605 { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); }
1606 YY_BREAK
1607 case 57:
1608 YY_RULE_SETUP
1609 #line 203 "program_lexer.l"
1610 { return_opcode( 1, SCALAR_OP, RSQ, OFF); }
1611 YY_BREAK
1612 case 58:
1613 YY_RULE_SETUP
1614 #line 204 "program_lexer.l"
1615 { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); }
1616 YY_BREAK
1617 case 59:
1618 YY_RULE_SETUP
1619 #line 206 "program_lexer.l"
1620 { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); }
1621 YY_BREAK
1622 case 60:
1623 YY_RULE_SETUP
1624 #line 207 "program_lexer.l"
1625 { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); }
1626 YY_BREAK
1627 case 61:
1628 YY_RULE_SETUP
1629 #line 208 "program_lexer.l"
1630 { return_opcode( 1, BIN_OP, SGE, OFF); }
1631 YY_BREAK
1632 case 62:
1633 YY_RULE_SETUP
1634 #line 209 "program_lexer.l"
1635 { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); }
1636 YY_BREAK
1637 case 63:
1638 YY_RULE_SETUP
1639 #line 210 "program_lexer.l"
1640 { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); }
1641 YY_BREAK
1642 case 64:
1643 YY_RULE_SETUP
1644 #line 211 "program_lexer.l"
1645 { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); }
1646 YY_BREAK
1647 case 65:
1648 YY_RULE_SETUP
1649 #line 212 "program_lexer.l"
1650 { return_opcode( 1, BIN_OP, SLT, OFF); }
1651 YY_BREAK
1652 case 66:
1653 YY_RULE_SETUP
1654 #line 213 "program_lexer.l"
1655 { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); }
1656 YY_BREAK
1657 case 67:
1658 YY_RULE_SETUP
1659 #line 214 "program_lexer.l"
1660 { return_opcode( 1, BIN_OP, SUB, OFF); }
1661 YY_BREAK
1662 case 68:
1663 YY_RULE_SETUP
1664 #line 215 "program_lexer.l"
1665 { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); }
1666 YY_BREAK
1667 case 69:
1668 YY_RULE_SETUP
1669 #line 216 "program_lexer.l"
1670 { return_opcode( 1, SWZ, SWZ, OFF); }
1671 YY_BREAK
1672 case 70:
1673 YY_RULE_SETUP
1674 #line 217 "program_lexer.l"
1675 { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); }
1676 YY_BREAK
1677 case 71:
1678 YY_RULE_SETUP
1679 #line 219 "program_lexer.l"
1680 { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); }
1681 YY_BREAK
1682 case 72:
1683 YY_RULE_SETUP
1684 #line 220 "program_lexer.l"
1685 { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); }
1686 YY_BREAK
1687 case 73:
1688 YY_RULE_SETUP
1689 #line 221 "program_lexer.l"
1690 { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); }
1691 YY_BREAK
1692 case 74:
1693 YY_RULE_SETUP
1694 #line 222 "program_lexer.l"
1695 { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); }
1696 YY_BREAK
1697 case 75:
1698 YY_RULE_SETUP
1699 #line 223 "program_lexer.l"
1700 { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); }
1701 YY_BREAK
1702 case 76:
1703 YY_RULE_SETUP
1704 #line 224 "program_lexer.l"
1705 { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); }
1706 YY_BREAK
1707 case 77:
1708 YY_RULE_SETUP
1709 #line 226 "program_lexer.l"
1710 { return_opcode( 1, BIN_OP, XPD, OFF); }
1711 YY_BREAK
1712 case 78:
1713 YY_RULE_SETUP
1714 #line 227 "program_lexer.l"
1715 { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); }
1716 YY_BREAK
1717 case 79:
1718 YY_RULE_SETUP
1719 #line 229 "program_lexer.l"
1720 { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); }
1721 YY_BREAK
1722 case 80:
1723 YY_RULE_SETUP
1724 #line 230 "program_lexer.l"
1725 { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); }
1726 YY_BREAK
1727 case 81:
1728 YY_RULE_SETUP
1729 #line 231 "program_lexer.l"
1730 { return PROGRAM; }
1731 YY_BREAK
1732 case 82:
1733 YY_RULE_SETUP
1734 #line 232 "program_lexer.l"
1735 { return STATE; }
1736 YY_BREAK
1737 case 83:
1738 YY_RULE_SETUP
1739 #line 233 "program_lexer.l"
1740 { return RESULT; }
1741 YY_BREAK
1742 case 84:
1743 YY_RULE_SETUP
1744 #line 235 "program_lexer.l"
1745 { return AMBIENT; }
1746 YY_BREAK
1747 case 85:
1748 YY_RULE_SETUP
1749 #line 236 "program_lexer.l"
1750 { return_token_or_DOT(require_ARB_vp, ATTENUATION); }
1751 YY_BREAK
1752 case 86:
1753 YY_RULE_SETUP
1754 #line 237 "program_lexer.l"
1755 { return BACK; }
1756 YY_BREAK
1757 case 87:
1758 YY_RULE_SETUP
1759 #line 238 "program_lexer.l"
1760 { return_token_or_DOT(require_ARB_vp, CLIP); }
1761 YY_BREAK
1762 case 88:
1763 YY_RULE_SETUP
1764 #line 239 "program_lexer.l"
1765 { return COLOR; }
1766 YY_BREAK
1767 case 89:
1768 YY_RULE_SETUP
1769 #line 240 "program_lexer.l"
1770 { return_token_or_DOT(require_ARB_fp, DEPTH); }
1771 YY_BREAK
1772 case 90:
1773 YY_RULE_SETUP
1774 #line 241 "program_lexer.l"
1775 { return DIFFUSE; }
1776 YY_BREAK
1777 case 91:
1778 YY_RULE_SETUP
1779 #line 242 "program_lexer.l"
1780 { return DIRECTION; }
1781 YY_BREAK
1782 case 92:
1783 YY_RULE_SETUP
1784 #line 243 "program_lexer.l"
1785 { return EMISSION; }
1786 YY_BREAK
1787 case 93:
1788 YY_RULE_SETUP
1789 #line 244 "program_lexer.l"
1790 { return ENV; }
1791 YY_BREAK
1792 case 94:
1793 YY_RULE_SETUP
1794 #line 245 "program_lexer.l"
1795 { return EYE; }
1796 YY_BREAK
1797 case 95:
1798 YY_RULE_SETUP
1799 #line 246 "program_lexer.l"
1800 { return FOGCOORD; }
1801 YY_BREAK
1802 case 96:
1803 YY_RULE_SETUP
1804 #line 247 "program_lexer.l"
1805 { return FOG; }
1806 YY_BREAK
1807 case 97:
1808 YY_RULE_SETUP
1809 #line 248 "program_lexer.l"
1810 { return FRONT; }
1811 YY_BREAK
1812 case 98:
1813 YY_RULE_SETUP
1814 #line 249 "program_lexer.l"
1815 { return HALF; }
1816 YY_BREAK
1817 case 99:
1818 YY_RULE_SETUP
1819 #line 250 "program_lexer.l"
1820 { return INVERSE; }
1821 YY_BREAK
1822 case 100:
1823 YY_RULE_SETUP
1824 #line 251 "program_lexer.l"
1825 { return INVTRANS; }
1826 YY_BREAK
1827 case 101:
1828 YY_RULE_SETUP
1829 #line 252 "program_lexer.l"
1830 { return LIGHT; }
1831 YY_BREAK
1832 case 102:
1833 YY_RULE_SETUP
1834 #line 253 "program_lexer.l"
1835 { return LIGHTMODEL; }
1836 YY_BREAK
1837 case 103:
1838 YY_RULE_SETUP
1839 #line 254 "program_lexer.l"
1840 { return LIGHTPROD; }
1841 YY_BREAK
1842 case 104:
1843 YY_RULE_SETUP
1844 #line 255 "program_lexer.l"
1845 { return LOCAL; }
1846 YY_BREAK
1847 case 105:
1848 YY_RULE_SETUP
1849 #line 256 "program_lexer.l"
1850 { return MATERIAL; }
1851 YY_BREAK
1852 case 106:
1853 YY_RULE_SETUP
1854 #line 257 "program_lexer.l"
1855 { return MAT_PROGRAM; }
1856 YY_BREAK
1857 case 107:
1858 YY_RULE_SETUP
1859 #line 258 "program_lexer.l"
1860 { return MATRIX; }
1861 YY_BREAK
1862 case 108:
1863 YY_RULE_SETUP
1864 #line 259 "program_lexer.l"
1865 { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); }
1866 YY_BREAK
1867 case 109:
1868 YY_RULE_SETUP
1869 #line 260 "program_lexer.l"
1870 { return MODELVIEW; }
1871 YY_BREAK
1872 case 110:
1873 YY_RULE_SETUP
1874 #line 261 "program_lexer.l"
1875 { return MVP; }
1876 YY_BREAK
1877 case 111:
1878 YY_RULE_SETUP
1879 #line 262 "program_lexer.l"
1880 { return_token_or_DOT(require_ARB_vp, NORMAL); }
1881 YY_BREAK
1882 case 112:
1883 YY_RULE_SETUP
1884 #line 263 "program_lexer.l"
1885 { return OBJECT; }
1886 YY_BREAK
1887 case 113:
1888 YY_RULE_SETUP
1889 #line 264 "program_lexer.l"
1890 { return PALETTE; }
1891 YY_BREAK
1892 case 114:
1893 YY_RULE_SETUP
1894 #line 265 "program_lexer.l"
1895 { return PARAMS; }
1896 YY_BREAK
1897 case 115:
1898 YY_RULE_SETUP
1899 #line 266 "program_lexer.l"
1900 { return PLANE; }
1901 YY_BREAK
1902 case 116:
1903 YY_RULE_SETUP
1904 #line 267 "program_lexer.l"
1905 { return_token_or_DOT(require_ARB_vp, POINT); }
1906 YY_BREAK
1907 case 117:
1908 YY_RULE_SETUP
1909 #line 268 "program_lexer.l"
1910 { return_token_or_DOT(require_ARB_vp, POINTSIZE); }
1911 YY_BREAK
1912 case 118:
1913 YY_RULE_SETUP
1914 #line 269 "program_lexer.l"
1915 { return POSITION; }
1916 YY_BREAK
1917 case 119:
1918 YY_RULE_SETUP
1919 #line 270 "program_lexer.l"
1920 { return PRIMARY; }
1921 YY_BREAK
1922 case 120:
1923 YY_RULE_SETUP
1924 #line 271 "program_lexer.l"
1925 { return PROJECTION; }
1926 YY_BREAK
1927 case 121:
1928 YY_RULE_SETUP
1929 #line 272 "program_lexer.l"
1930 { return_token_or_DOT(require_ARB_fp, RANGE); }
1931 YY_BREAK
1932 case 122:
1933 YY_RULE_SETUP
1934 #line 273 "program_lexer.l"
1935 { return ROW; }
1936 YY_BREAK
1937 case 123:
1938 YY_RULE_SETUP
1939 #line 274 "program_lexer.l"
1940 { return SCENECOLOR; }
1941 YY_BREAK
1942 case 124:
1943 YY_RULE_SETUP
1944 #line 275 "program_lexer.l"
1945 { return SECONDARY; }
1946 YY_BREAK
1947 case 125:
1948 YY_RULE_SETUP
1949 #line 276 "program_lexer.l"
1950 { return SHININESS; }
1951 YY_BREAK
1952 case 126:
1953 YY_RULE_SETUP
1954 #line 277 "program_lexer.l"
1955 { return_token_or_DOT(require_ARB_vp, SIZE); }
1956 YY_BREAK
1957 case 127:
1958 YY_RULE_SETUP
1959 #line 278 "program_lexer.l"
1960 { return SPECULAR; }
1961 YY_BREAK
1962 case 128:
1963 YY_RULE_SETUP
1964 #line 279 "program_lexer.l"
1965 { return SPOT; }
1966 YY_BREAK
1967 case 129:
1968 YY_RULE_SETUP
1969 #line 280 "program_lexer.l"
1970 { return TEXCOORD; }
1971 YY_BREAK
1972 case 130:
1973 YY_RULE_SETUP
1974 #line 281 "program_lexer.l"
1975 { return_token_or_DOT(require_ARB_fp, TEXENV); }
1976 YY_BREAK
1977 case 131:
1978 YY_RULE_SETUP
1979 #line 282 "program_lexer.l"
1980 { return_token_or_DOT(require_ARB_vp, TEXGEN); }
1981 YY_BREAK
1982 case 132:
1983 YY_RULE_SETUP
1984 #line 283 "program_lexer.l"
1985 { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); }
1986 YY_BREAK
1987 case 133:
1988 YY_RULE_SETUP
1989 #line 284 "program_lexer.l"
1990 { return_token_or_DOT(require_ARB_vp, TEXGEN_S); }
1991 YY_BREAK
1992 case 134:
1993 YY_RULE_SETUP
1994 #line 285 "program_lexer.l"
1995 { return_token_or_DOT(require_ARB_vp, TEXGEN_T); }
1996 YY_BREAK
1997 case 135:
1998 YY_RULE_SETUP
1999 #line 286 "program_lexer.l"
2000 { return TEXTURE; }
2001 YY_BREAK
2002 case 136:
2003 YY_RULE_SETUP
2004 #line 287 "program_lexer.l"
2005 { return TRANSPOSE; }
2006 YY_BREAK
2007 case 137:
2008 YY_RULE_SETUP
2009 #line 288 "program_lexer.l"
2010 { return_token_or_DOT(require_ARB_vp, VTXATTRIB); }
2011 YY_BREAK
2012 case 138:
2013 YY_RULE_SETUP
2014 #line 289 "program_lexer.l"
2015 { return_token_or_DOT(require_ARB_vp, WEIGHT); }
2016 YY_BREAK
2017 case 139:
2018 YY_RULE_SETUP
2019 #line 291 "program_lexer.l"
2020 { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); }
2021 YY_BREAK
2022 case 140:
2023 YY_RULE_SETUP
2024 #line 292 "program_lexer.l"
2025 { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); }
2026 YY_BREAK
2027 case 141:
2028 YY_RULE_SETUP
2029 #line 293 "program_lexer.l"
2030 { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); }
2031 YY_BREAK
2032 case 142:
2033 YY_RULE_SETUP
2034 #line 294 "program_lexer.l"
2035 { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); }
2036 YY_BREAK
2037 case 143:
2038 YY_RULE_SETUP
2039 #line 295 "program_lexer.l"
2040 { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); }
2041 YY_BREAK
2042 case 144:
2043 YY_RULE_SETUP
2044 #line 296 "program_lexer.l"
2045 { return_token_or_IDENTIFIER(require_ARB_fp, TEX_RECT); }
2046 YY_BREAK
2047 case 145:
2048 YY_RULE_SETUP
2049 #line 298 "program_lexer.l"
2050 {
2051 yylval->string = strdup(yytext);
2052 return IDENTIFIER;
2053 }
2054 YY_BREAK
2055 case 146:
2056 YY_RULE_SETUP
2057 #line 303 "program_lexer.l"
2058 { return DOT_DOT; }
2059 YY_BREAK
2060 case 147:
2061 YY_RULE_SETUP
2062 #line 305 "program_lexer.l"
2063 {
2064 yylval->integer = strtol(yytext, NULL, 10);
2065 return INTEGER;
2066 }
2067 YY_BREAK
2068 case 148:
2069 YY_RULE_SETUP
2070 #line 309 "program_lexer.l"
2071 {
2072 yylval->real = strtod(yytext, NULL);
2073 return REAL;
2074 }
2075 YY_BREAK
2076 case 149:
2077 /* rule 149 can match eol */
2078 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
2079 yyg->yy_c_buf_p = yy_cp -= 1;
2080 YY_DO_BEFORE_ACTION; /* set up yytext again */
2081 YY_RULE_SETUP
2082 #line 313 "program_lexer.l"
2083 {
2084 yylval->real = strtod(yytext, NULL);
2085 return REAL;
2086 }
2087 YY_BREAK
2088 case 150:
2089 YY_RULE_SETUP
2090 #line 317 "program_lexer.l"
2091 {
2092 yylval->real = strtod(yytext, NULL);
2093 return REAL;
2094 }
2095 YY_BREAK
2096 case 151:
2097 YY_RULE_SETUP
2098 #line 321 "program_lexer.l"
2099 {
2100 yylval->real = strtod(yytext, NULL);
2101 return REAL;
2102 }
2103 YY_BREAK
2104 case 152:
2105 YY_RULE_SETUP
2106 #line 326 "program_lexer.l"
2107 {
2108 yylval->swiz_mask.swizzle = SWIZZLE_NOOP;
2109 yylval->swiz_mask.mask = WRITEMASK_XYZW;
2110 return MASK4;
2111 }
2112 YY_BREAK
2113 case 153:
2114 YY_RULE_SETUP
2115 #line 332 "program_lexer.l"
2116 {
2117 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2118 yylval->swiz_mask.mask = WRITEMASK_XY
2119 | mask_from_char(yytext[3]);
2120 return MASK3;
2121 }
2122 YY_BREAK
2123 case 154:
2124 YY_RULE_SETUP
2125 #line 338 "program_lexer.l"
2126 {
2127 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2128 yylval->swiz_mask.mask = WRITEMASK_XZW;
2129 return MASK3;
2130 }
2131 YY_BREAK
2132 case 155:
2133 YY_RULE_SETUP
2134 #line 343 "program_lexer.l"
2135 {
2136 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2137 yylval->swiz_mask.mask = WRITEMASK_YZW;
2138 return MASK3;
2139 }
2140 YY_BREAK
2141 case 156:
2142 YY_RULE_SETUP
2143 #line 349 "program_lexer.l"
2144 {
2145 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2146 yylval->swiz_mask.mask = WRITEMASK_X
2147 | mask_from_char(yytext[2]);
2148 return MASK2;
2149 }
2150 YY_BREAK
2151 case 157:
2152 YY_RULE_SETUP
2153 #line 355 "program_lexer.l"
2154 {
2155 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2156 yylval->swiz_mask.mask = WRITEMASK_Y
2157 | mask_from_char(yytext[2]);
2158 return MASK2;
2159 }
2160 YY_BREAK
2161 case 158:
2162 YY_RULE_SETUP
2163 #line 361 "program_lexer.l"
2164 {
2165 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2166 yylval->swiz_mask.mask = WRITEMASK_ZW;
2167 return MASK2;
2168 }
2169 YY_BREAK
2170 case 159:
2171 YY_RULE_SETUP
2172 #line 367 "program_lexer.l"
2173 {
2174 const unsigned s = swiz_from_char(yytext[1]);
2175 yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s);
2176 yylval->swiz_mask.mask = mask_from_char(yytext[1]);
2177 return MASK1;
2178 }
2179 YY_BREAK
2180 case 160:
2181 YY_RULE_SETUP
2182 #line 374 "program_lexer.l"
2183 {
2184 yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]),
2185 swiz_from_char(yytext[2]),
2186 swiz_from_char(yytext[3]),
2187 swiz_from_char(yytext[4]));
2188 yylval->swiz_mask.mask = 0;
2189 return SWIZZLE;
2190 }
2191 YY_BREAK
2192 case 161:
2193 YY_RULE_SETUP
2194 #line 383 "program_lexer.l"
2195 {
2196 yylval->swiz_mask.swizzle = SWIZZLE_NOOP;
2197 yylval->swiz_mask.mask = WRITEMASK_XYZW;
2198 return_token_or_DOT(require_ARB_fp, MASK4);
2199 }
2200 YY_BREAK
2201 case 162:
2202 YY_RULE_SETUP
2203 #line 389 "program_lexer.l"
2204 {
2205 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2206 yylval->swiz_mask.mask = WRITEMASK_XY
2207 | mask_from_char(yytext[3]);
2208 return_token_or_DOT(require_ARB_fp, MASK3);
2209 }
2210 YY_BREAK
2211 case 163:
2212 YY_RULE_SETUP
2213 #line 395 "program_lexer.l"
2214 {
2215 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2216 yylval->swiz_mask.mask = WRITEMASK_XZW;
2217 return_token_or_DOT(require_ARB_fp, MASK3);
2218 }
2219 YY_BREAK
2220 case 164:
2221 YY_RULE_SETUP
2222 #line 400 "program_lexer.l"
2223 {
2224 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2225 yylval->swiz_mask.mask = WRITEMASK_YZW;
2226 return_token_or_DOT(require_ARB_fp, MASK3);
2227 }
2228 YY_BREAK
2229 case 165:
2230 YY_RULE_SETUP
2231 #line 406 "program_lexer.l"
2232 {
2233 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2234 yylval->swiz_mask.mask = WRITEMASK_X
2235 | mask_from_char(yytext[2]);
2236 return_token_or_DOT(require_ARB_fp, MASK2);
2237 }
2238 YY_BREAK
2239 case 166:
2240 YY_RULE_SETUP
2241 #line 412 "program_lexer.l"
2242 {
2243 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2244 yylval->swiz_mask.mask = WRITEMASK_Y
2245 | mask_from_char(yytext[2]);
2246 return_token_or_DOT(require_ARB_fp, MASK2);
2247 }
2248 YY_BREAK
2249 case 167:
2250 YY_RULE_SETUP
2251 #line 418 "program_lexer.l"
2252 {
2253 yylval->swiz_mask.swizzle = SWIZZLE_INVAL;
2254 yylval->swiz_mask.mask = WRITEMASK_ZW;
2255 return_token_or_DOT(require_ARB_fp, MASK2);
2256 }
2257 YY_BREAK
2258 case 168:
2259 YY_RULE_SETUP
2260 #line 424 "program_lexer.l"
2261 {
2262 const unsigned s = swiz_from_char(yytext[1]);
2263 yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s);
2264 yylval->swiz_mask.mask = mask_from_char(yytext[1]);
2265 return_token_or_DOT(require_ARB_fp, MASK1);
2266 }
2267 YY_BREAK
2268 case 169:
2269 YY_RULE_SETUP
2270 #line 432 "program_lexer.l"
2271 {
2272 if (require_ARB_vp) {
2273 return TEXGEN_R;
2274 } else {
2275 yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X,
2276 SWIZZLE_X, SWIZZLE_X);
2277 yylval->swiz_mask.mask = WRITEMASK_X;
2278 return MASK1;
2279 }
2280 }
2281 YY_BREAK
2282 case 170:
2283 YY_RULE_SETUP
2284 #line 443 "program_lexer.l"
2285 {
2286 yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]),
2287 swiz_from_char(yytext[2]),
2288 swiz_from_char(yytext[3]),
2289 swiz_from_char(yytext[4]));
2290 yylval->swiz_mask.mask = 0;
2291 return_token_or_DOT(require_ARB_fp, SWIZZLE);
2292 }
2293 YY_BREAK
2294 case 171:
2295 YY_RULE_SETUP
2296 #line 452 "program_lexer.l"
2297 { return DOT; }
2298 YY_BREAK
2299 case 172:
2300 /* rule 172 can match eol */
2301 YY_RULE_SETUP
2302 #line 454 "program_lexer.l"
2303 {
2304 yylloc->first_line++;
2305 yylloc->first_column = 1;
2306 yylloc->last_line++;
2307 yylloc->last_column = 1;
2308 yylloc->position++;
2309 }
2310 YY_BREAK
2311 case 173:
2312 YY_RULE_SETUP
2313 #line 461 "program_lexer.l"
2314 /* eat whitespace */ ;
2315 YY_BREAK
2316 case 174:
2317 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
2318 yyg->yy_c_buf_p = yy_cp -= 1;
2319 YY_DO_BEFORE_ACTION; /* set up yytext again */
2320 YY_RULE_SETUP
2321 #line 462 "program_lexer.l"
2322 /* eat comments */ ;
2323 YY_BREAK
2324 case 175:
2325 YY_RULE_SETUP
2326 #line 463 "program_lexer.l"
2327 { return yytext[0]; }
2328 YY_BREAK
2329 case 176:
2330 YY_RULE_SETUP
2331 #line 464 "program_lexer.l"
2332 ECHO;
2333 YY_BREAK
2334 #line 2335 "lex.yy.c"
2335 case YY_STATE_EOF(INITIAL):
2336 yyterminate();
2337
2338 case YY_END_OF_BUFFER:
2339 {
2340 /* Amount of text matched not including the EOB char. */
2341 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2342
2343 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2344 *yy_cp = yyg->yy_hold_char;
2345 YY_RESTORE_YY_MORE_OFFSET
2346
2347 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2348 {
2349 /* We're scanning a new file or input source. It's
2350 * possible that this happened because the user
2351 * just pointed yyin at a new source and called
2352 * yylex(). If so, then we have to assure
2353 * consistency between YY_CURRENT_BUFFER and our
2354 * globals. Here is the right place to do so, because
2355 * this is the first action (other than possibly a
2356 * back-up) that will match for the new input source.
2357 */
2358 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2359 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2360 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2361 }
2362
2363 /* Note that here we test for yy_c_buf_p "<=" to the position
2364 * of the first EOB in the buffer, since yy_c_buf_p will
2365 * already have been incremented past the NUL character
2366 * (since all states make transitions on EOB to the
2367 * end-of-buffer state). Contrast this with the test
2368 * in input().
2369 */
2370 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2371 { /* This was really a NUL. */
2372 yy_state_type yy_next_state;
2373
2374 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2375
2376 yy_current_state = yy_get_previous_state( yyscanner );
2377
2378 /* Okay, we're now positioned to make the NUL
2379 * transition. We couldn't have
2380 * yy_get_previous_state() go ahead and do it
2381 * for us because it doesn't know how to deal
2382 * with the possibility of jamming (and we don't
2383 * want to build jamming into it because then it
2384 * will run more slowly).
2385 */
2386
2387 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2388
2389 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2390
2391 if ( yy_next_state )
2392 {
2393 /* Consume the NUL. */
2394 yy_cp = ++yyg->yy_c_buf_p;
2395 yy_current_state = yy_next_state;
2396 goto yy_match;
2397 }
2398
2399 else
2400 {
2401 yy_cp = yyg->yy_c_buf_p;
2402 goto yy_find_action;
2403 }
2404 }
2405
2406 else switch ( yy_get_next_buffer( yyscanner ) )
2407 {
2408 case EOB_ACT_END_OF_FILE:
2409 {
2410 yyg->yy_did_buffer_switch_on_eof = 0;
2411
2412 if ( yywrap(yyscanner ) )
2413 {
2414 /* Note: because we've taken care in
2415 * yy_get_next_buffer() to have set up
2416 * yytext, we can now set up
2417 * yy_c_buf_p so that if some total
2418 * hoser (like flex itself) wants to
2419 * call the scanner after we return the
2420 * YY_NULL, it'll still work - another
2421 * YY_NULL will get returned.
2422 */
2423 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2424
2425 yy_act = YY_STATE_EOF(YY_START);
2426 goto do_action;
2427 }
2428
2429 else
2430 {
2431 if ( ! yyg->yy_did_buffer_switch_on_eof )
2432 YY_NEW_FILE;
2433 }
2434 break;
2435 }
2436
2437 case EOB_ACT_CONTINUE_SCAN:
2438 yyg->yy_c_buf_p =
2439 yyg->yytext_ptr + yy_amount_of_matched_text;
2440
2441 yy_current_state = yy_get_previous_state( yyscanner );
2442
2443 yy_cp = yyg->yy_c_buf_p;
2444 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2445 goto yy_match;
2446
2447 case EOB_ACT_LAST_MATCH:
2448 yyg->yy_c_buf_p =
2449 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2450
2451 yy_current_state = yy_get_previous_state( yyscanner );
2452
2453 yy_cp = yyg->yy_c_buf_p;
2454 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2455 goto yy_find_action;
2456 }
2457 break;
2458 }
2459
2460 default:
2461 YY_FATAL_ERROR(
2462 "fatal flex scanner internal error--no action found" );
2463 } /* end of action switch */
2464 } /* end of scanning one token */
2465 } /* end of yylex */
2466
2467 /* yy_get_next_buffer - try to read in a new buffer
2468 *
2469 * Returns a code representing an action:
2470 * EOB_ACT_LAST_MATCH -
2471 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2472 * EOB_ACT_END_OF_FILE - end of file
2473 */
2474 static int yy_get_next_buffer (yyscan_t yyscanner)
2475 {
2476 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2477 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2478 register char *source = yyg->yytext_ptr;
2479 register int number_to_move, i;
2480 int ret_val;
2481
2482 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2483 YY_FATAL_ERROR(
2484 "fatal flex scanner internal error--end of buffer missed" );
2485
2486 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2487 { /* Don't try to fill the buffer, so this is an EOF. */
2488 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2489 {
2490 /* We matched a single character, the EOB, so
2491 * treat this as a final EOF.
2492 */
2493 return EOB_ACT_END_OF_FILE;
2494 }
2495
2496 else
2497 {
2498 /* We matched some text prior to the EOB, first
2499 * process it.
2500 */
2501 return EOB_ACT_LAST_MATCH;
2502 }
2503 }
2504
2505 /* Try to read more data. */
2506
2507 /* First move last chars to start of buffer. */
2508 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2509
2510 for ( i = 0; i < number_to_move; ++i )
2511 *(dest++) = *(source++);
2512
2513 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2514 /* don't do the read, it's not guaranteed to return an EOF,
2515 * just force an EOF
2516 */
2517 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2518
2519 else
2520 {
2521 int num_to_read =
2522 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2523
2524 while ( num_to_read <= 0 )
2525 { /* Not enough room in the buffer - grow it. */
2526
2527 /* just a shorter name for the current buffer */
2528 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2529
2530 int yy_c_buf_p_offset =
2531 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2532
2533 if ( b->yy_is_our_buffer )
2534 {
2535 int new_size = b->yy_buf_size * 2;
2536
2537 if ( new_size <= 0 )
2538 b->yy_buf_size += b->yy_buf_size / 8;
2539 else
2540 b->yy_buf_size *= 2;
2541
2542 b->yy_ch_buf = (char *)
2543 /* Include room in for 2 EOB chars. */
2544 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2545 }
2546 else
2547 /* Can't grow it, we don't own it. */
2548 b->yy_ch_buf = 0;
2549
2550 if ( ! b->yy_ch_buf )
2551 YY_FATAL_ERROR(
2552 "fatal error - scanner input buffer overflow" );
2553
2554 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2555
2556 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2557 number_to_move - 1;
2558
2559 }
2560
2561 if ( num_to_read > YY_READ_BUF_SIZE )
2562 num_to_read = YY_READ_BUF_SIZE;
2563
2564 /* Read in more data. */
2565 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2566 yyg->yy_n_chars, (size_t) num_to_read );
2567
2568 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2569 }
2570
2571 if ( yyg->yy_n_chars == 0 )
2572 {
2573 if ( number_to_move == YY_MORE_ADJ )
2574 {
2575 ret_val = EOB_ACT_END_OF_FILE;
2576 yyrestart(yyin ,yyscanner);
2577 }
2578
2579 else
2580 {
2581 ret_val = EOB_ACT_LAST_MATCH;
2582 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2583 YY_BUFFER_EOF_PENDING;
2584 }
2585 }
2586
2587 else
2588 ret_val = EOB_ACT_CONTINUE_SCAN;
2589
2590 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2591 /* Extend the array by 50%, plus the number we really need. */
2592 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2593 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2594 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2595 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2596 }
2597
2598 yyg->yy_n_chars += number_to_move;
2599 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2600 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2601
2602 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2603
2604 return ret_val;
2605 }
2606
2607 /* yy_get_previous_state - get the state just before the EOB char was reached */
2608
2609 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2610 {
2611 register yy_state_type yy_current_state;
2612 register char *yy_cp;
2613 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2614
2615 yy_current_state = yyg->yy_start;
2616
2617 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2618 {
2619 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2620 if ( yy_accept[yy_current_state] )
2621 {
2622 yyg->yy_last_accepting_state = yy_current_state;
2623 yyg->yy_last_accepting_cpos = yy_cp;
2624 }
2625 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2626 {
2627 yy_current_state = (int) yy_def[yy_current_state];
2628 if ( yy_current_state >= 645 )
2629 yy_c = yy_meta[(unsigned int) yy_c];
2630 }
2631 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2632 }
2633
2634 return yy_current_state;
2635 }
2636
2637 /* yy_try_NUL_trans - try to make a transition on the NUL character
2638 *
2639 * synopsis
2640 * next_state = yy_try_NUL_trans( current_state );
2641 */
2642 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2643 {
2644 register int yy_is_jam;
2645 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2646 register char *yy_cp = yyg->yy_c_buf_p;
2647
2648 register YY_CHAR yy_c = 1;
2649 if ( yy_accept[yy_current_state] )
2650 {
2651 yyg->yy_last_accepting_state = yy_current_state;
2652 yyg->yy_last_accepting_cpos = yy_cp;
2653 }
2654 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2655 {
2656 yy_current_state = (int) yy_def[yy_current_state];
2657 if ( yy_current_state >= 645 )
2658 yy_c = yy_meta[(unsigned int) yy_c];
2659 }
2660 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2661 yy_is_jam = (yy_current_state == 644);
2662
2663 return yy_is_jam ? 0 : yy_current_state;
2664 }
2665
2666 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
2667 {
2668 register char *yy_cp;
2669 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2670
2671 yy_cp = yyg->yy_c_buf_p;
2672
2673 /* undo effects of setting up yytext */
2674 *yy_cp = yyg->yy_hold_char;
2675
2676 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2677 { /* need to shift things up to make room */
2678 /* +2 for EOB chars. */
2679 register int number_to_move = yyg->yy_n_chars + 2;
2680 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2681 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2682 register char *source =
2683 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2684
2685 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2686 *--dest = *--source;
2687
2688 yy_cp += (int) (dest - source);
2689 yy_bp += (int) (dest - source);
2690 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2691 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2692
2693 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2694 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2695 }
2696
2697 *--yy_cp = (char) c;
2698
2699 yyg->yytext_ptr = yy_bp;
2700 yyg->yy_hold_char = *yy_cp;
2701 yyg->yy_c_buf_p = yy_cp;
2702 }
2703
2704 #ifndef YY_NO_INPUT
2705 #ifdef __cplusplus
2706 static int yyinput (yyscan_t yyscanner)
2707 #else
2708 static int input (yyscan_t yyscanner)
2709 #endif
2710
2711 {
2712 int c;
2713 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2714
2715 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2716
2717 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2718 {
2719 /* yy_c_buf_p now points to the character we want to return.
2720 * If this occurs *before* the EOB characters, then it's a
2721 * valid NUL; if not, then we've hit the end of the buffer.
2722 */
2723 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2724 /* This was really a NUL. */
2725 *yyg->yy_c_buf_p = '\0';
2726
2727 else
2728 { /* need more input */
2729 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2730 ++yyg->yy_c_buf_p;
2731
2732 switch ( yy_get_next_buffer( yyscanner ) )
2733 {
2734 case EOB_ACT_LAST_MATCH:
2735 /* This happens because yy_g_n_b()
2736 * sees that we've accumulated a
2737 * token and flags that we need to
2738 * try matching the token before
2739 * proceeding. But for input(),
2740 * there's no matching to consider.
2741 * So convert the EOB_ACT_LAST_MATCH
2742 * to EOB_ACT_END_OF_FILE.
2743 */
2744
2745 /* Reset buffer status. */
2746 yyrestart(yyin ,yyscanner);
2747
2748 /*FALLTHROUGH*/
2749
2750 case EOB_ACT_END_OF_FILE:
2751 {
2752 if ( yywrap(yyscanner ) )
2753 return EOF;
2754
2755 if ( ! yyg->yy_did_buffer_switch_on_eof )
2756 YY_NEW_FILE;
2757 #ifdef __cplusplus
2758 return yyinput(yyscanner);
2759 #else
2760 return input(yyscanner);
2761 #endif
2762 }
2763
2764 case EOB_ACT_CONTINUE_SCAN:
2765 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2766 break;
2767 }
2768 }
2769 }
2770
2771 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2772 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2773 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2774
2775 return c;
2776 }
2777 #endif /* ifndef YY_NO_INPUT */
2778
2779 /** Immediately switch to a different input stream.
2780 * @param input_file A readable stream.
2781 * @param yyscanner The scanner object.
2782 * @note This function does not reset the start condition to @c INITIAL .
2783 */
2784 void yyrestart (FILE * input_file , yyscan_t yyscanner)
2785 {
2786 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2787
2788 if ( ! YY_CURRENT_BUFFER ){
2789 yyensure_buffer_stack (yyscanner);
2790 YY_CURRENT_BUFFER_LVALUE =
2791 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2792 }
2793
2794 yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2795 yy_load_buffer_state(yyscanner );
2796 }
2797
2798 /** Switch to a different input buffer.
2799 * @param new_buffer The new input buffer.
2800 * @param yyscanner The scanner object.
2801 */
2802 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2803 {
2804 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2805
2806 /* TODO. We should be able to replace this entire function body
2807 * with
2808 * yypop_buffer_state();
2809 * yypush_buffer_state(new_buffer);
2810 */
2811 yyensure_buffer_stack (yyscanner);
2812 if ( YY_CURRENT_BUFFER == new_buffer )
2813 return;
2814
2815 if ( YY_CURRENT_BUFFER )
2816 {
2817 /* Flush out information for old buffer. */
2818 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2819 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2820 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2821 }
2822
2823 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2824 yy_load_buffer_state(yyscanner );
2825
2826 /* We don't actually know whether we did this switch during
2827 * EOF (yywrap()) processing, but the only time this flag
2828 * is looked at is after yywrap() is called, so it's safe
2829 * to go ahead and always set it.
2830 */
2831 yyg->yy_did_buffer_switch_on_eof = 1;
2832 }
2833
2834 static void yy_load_buffer_state (yyscan_t yyscanner)
2835 {
2836 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2837 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2838 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2839 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2840 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2841 }
2842
2843 /** Allocate and initialize an input buffer state.
2844 * @param file A readable stream.
2845 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2846 * @param yyscanner The scanner object.
2847 * @return the allocated buffer state.
2848 */
2849 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2850 {
2851 YY_BUFFER_STATE b;
2852
2853 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2854 if ( ! b )
2855 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2856
2857 b->yy_buf_size = size;
2858
2859 /* yy_ch_buf has to be 2 characters longer than the size given because
2860 * we need to put in 2 end-of-buffer characters.
2861 */
2862 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner );
2863 if ( ! b->yy_ch_buf )
2864 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2865
2866 b->yy_is_our_buffer = 1;
2867
2868 yy_init_buffer(b,file ,yyscanner);
2869
2870 return b;
2871 }
2872
2873 /** Destroy the buffer.
2874 * @param b a buffer created with yy_create_buffer()
2875 * @param yyscanner The scanner object.
2876 */
2877 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2878 {
2879 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2880
2881 if ( ! b )
2882 return;
2883
2884 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2885 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2886
2887 if ( b->yy_is_our_buffer )
2888 yyfree((void *) b->yy_ch_buf ,yyscanner );
2889
2890 yyfree((void *) b ,yyscanner );
2891 }
2892
2893 /* Initializes or reinitializes a buffer.
2894 * This function is sometimes called more than once on the same buffer,
2895 * such as during a yyrestart() or at EOF.
2896 */
2897 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2898
2899 {
2900 int oerrno = errno;
2901 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2902
2903 yy_flush_buffer(b ,yyscanner);
2904
2905 b->yy_input_file = file;
2906 b->yy_fill_buffer = 1;
2907
2908 /* If b is the current buffer, then yy_init_buffer was _probably_
2909 * called from yyrestart() or through yy_get_next_buffer.
2910 * In that case, we don't want to reset the lineno or column.
2911 */
2912 if (b != YY_CURRENT_BUFFER){
2913 b->yy_bs_lineno = 1;
2914 b->yy_bs_column = 0;
2915 }
2916
2917 b->yy_is_interactive = 0;
2918
2919 errno = oerrno;
2920 }
2921
2922 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2923 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2924 * @param yyscanner The scanner object.
2925 */
2926 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2927 {
2928 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2929 if ( ! b )
2930 return;
2931
2932 b->yy_n_chars = 0;
2933
2934 /* We always need two end-of-buffer characters. The first causes
2935 * a transition to the end-of-buffer state. The second causes
2936 * a jam in that state.
2937 */
2938 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2939 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2940
2941 b->yy_buf_pos = &b->yy_ch_buf[0];
2942
2943 b->yy_at_bol = 1;
2944 b->yy_buffer_status = YY_BUFFER_NEW;
2945
2946 if ( b == YY_CURRENT_BUFFER )
2947 yy_load_buffer_state(yyscanner );
2948 }
2949
2950 /** Pushes the new state onto the stack. The new state becomes
2951 * the current state. This function will allocate the stack
2952 * if necessary.
2953 * @param new_buffer The new state.
2954 * @param yyscanner The scanner object.
2955 */
2956 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2957 {
2958 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2959 if (new_buffer == NULL)
2960 return;
2961
2962 yyensure_buffer_stack(yyscanner);
2963
2964 /* This block is copied from yy_switch_to_buffer. */
2965 if ( YY_CURRENT_BUFFER )
2966 {
2967 /* Flush out information for old buffer. */
2968 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2969 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2970 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2971 }
2972
2973 /* Only push if top exists. Otherwise, replace top. */
2974 if (YY_CURRENT_BUFFER)
2975 yyg->yy_buffer_stack_top++;
2976 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2977
2978 /* copied from yy_switch_to_buffer. */
2979 yy_load_buffer_state(yyscanner );
2980 yyg->yy_did_buffer_switch_on_eof = 1;
2981 }
2982
2983 /** Removes and deletes the top of the stack, if present.
2984 * The next element becomes the new top.
2985 * @param yyscanner The scanner object.
2986 */
2987 void yypop_buffer_state (yyscan_t yyscanner)
2988 {
2989 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2990 if (!YY_CURRENT_BUFFER)
2991 return;
2992
2993 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2994 YY_CURRENT_BUFFER_LVALUE = NULL;
2995 if (yyg->yy_buffer_stack_top > 0)
2996 --yyg->yy_buffer_stack_top;
2997
2998 if (YY_CURRENT_BUFFER) {
2999 yy_load_buffer_state(yyscanner );
3000 yyg->yy_did_buffer_switch_on_eof = 1;
3001 }
3002 }
3003
3004 /* Allocates the stack if it does not exist.
3005 * Guarantees space for at least one push.
3006 */
3007 static void yyensure_buffer_stack (yyscan_t yyscanner)
3008 {
3009 int num_to_alloc;
3010 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3011
3012 if (!yyg->yy_buffer_stack) {
3013
3014 /* First allocation is just for 2 elements, since we don't know if this
3015 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3016 * immediate realloc on the next call.
3017 */
3018 num_to_alloc = 1;
3019 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
3020 (num_to_alloc * sizeof(struct yy_buffer_state*)
3021 , yyscanner);
3022 if ( ! yyg->yy_buffer_stack )
3023 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3024
3025 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3026
3027 yyg->yy_buffer_stack_max = num_to_alloc;
3028 yyg->yy_buffer_stack_top = 0;
3029 return;
3030 }
3031
3032 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3033
3034 /* Increase the buffer to prepare for a possible push. */
3035 int grow_size = 8 /* arbitrary grow size */;
3036
3037 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3038 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
3039 (yyg->yy_buffer_stack,
3040 num_to_alloc * sizeof(struct yy_buffer_state*)
3041 , yyscanner);
3042 if ( ! yyg->yy_buffer_stack )
3043 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3044
3045 /* zero only the new slots.*/
3046 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3047 yyg->yy_buffer_stack_max = num_to_alloc;
3048 }
3049 }
3050
3051 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3052 * @param base the character buffer
3053 * @param size the size in bytes of the character buffer
3054 * @param yyscanner The scanner object.
3055 * @return the newly allocated buffer state object.
3056 */
3057 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3058 {
3059 YY_BUFFER_STATE b;
3060
3061 if ( size < 2 ||
3062 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3063 base[size-1] != YY_END_OF_BUFFER_CHAR )
3064 /* They forgot to leave room for the EOB's. */
3065 return 0;
3066
3067 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3068 if ( ! b )
3069 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3070
3071 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3072 b->yy_buf_pos = b->yy_ch_buf = base;
3073 b->yy_is_our_buffer = 0;
3074 b->yy_input_file = 0;
3075 b->yy_n_chars = b->yy_buf_size;
3076 b->yy_is_interactive = 0;
3077 b->yy_at_bol = 1;
3078 b->yy_fill_buffer = 0;
3079 b->yy_buffer_status = YY_BUFFER_NEW;
3080
3081 yy_switch_to_buffer(b ,yyscanner );
3082
3083 return b;
3084 }
3085
3086 /** Setup the input buffer state to scan a string. The next call to yylex() will
3087 * scan from a @e copy of @a str.
3088 * @param yystr a NUL-terminated string to scan
3089 * @param yyscanner The scanner object.
3090 * @return the newly allocated buffer state object.
3091 * @note If you want to scan bytes that may contain NUL values, then use
3092 * yy_scan_bytes() instead.
3093 */
3094 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
3095 {
3096
3097 return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
3098 }
3099
3100 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
3101 * scan from a @e copy of @a bytes.
3102 * @param yybytes the byte buffer to scan
3103 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
3104 * @param yyscanner The scanner object.
3105 * @return the newly allocated buffer state object.
3106 */
3107 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3108 {
3109 YY_BUFFER_STATE b;
3110 char *buf;
3111 yy_size_t n;
3112 int i;
3113
3114 /* Get memory for full buffer, including space for trailing EOB's. */
3115 n = _yybytes_len + 2;
3116 buf = (char *) yyalloc(n ,yyscanner );
3117 if ( ! buf )
3118 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3119
3120 for ( i = 0; i < _yybytes_len; ++i )
3121 buf[i] = yybytes[i];
3122
3123 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3124
3125 b = yy_scan_buffer(buf,n ,yyscanner);
3126 if ( ! b )
3127 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3128
3129 /* It's okay to grow etc. this buffer, and we should throw it
3130 * away when we're done.
3131 */
3132 b->yy_is_our_buffer = 1;
3133
3134 return b;
3135 }
3136
3137 #ifndef YY_EXIT_FAILURE
3138 #define YY_EXIT_FAILURE 2
3139 #endif
3140
3141 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3142 {
3143 (void) fprintf( stderr, "%s\n", msg );
3144 exit( YY_EXIT_FAILURE );
3145 }
3146
3147 /* Redefine yyless() so it works in section 3 code. */
3148
3149 #undef yyless
3150 #define yyless(n) \
3151 do \
3152 { \
3153 /* Undo effects of setting up yytext. */ \
3154 int yyless_macro_arg = (n); \
3155 YY_LESS_LINENO(yyless_macro_arg);\
3156 yytext[yyleng] = yyg->yy_hold_char; \
3157 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3158 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3159 *yyg->yy_c_buf_p = '\0'; \
3160 yyleng = yyless_macro_arg; \
3161 } \
3162 while ( 0 )
3163
3164 /* Accessor methods (get/set functions) to struct members. */
3165
3166 /** Get the user-defined data for this scanner.
3167 * @param yyscanner The scanner object.
3168 */
3169 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
3170 {
3171 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3172 return yyextra;
3173 }
3174
3175 /** Get the current line number.
3176 * @param yyscanner The scanner object.
3177 */
3178 int yyget_lineno (yyscan_t yyscanner)
3179 {
3180 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3181
3182 if (! YY_CURRENT_BUFFER)
3183 return 0;
3184
3185 return yylineno;
3186 }
3187
3188 /** Get the current column number.
3189 * @param yyscanner The scanner object.
3190 */
3191 int yyget_column (yyscan_t yyscanner)
3192 {
3193 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3194
3195 if (! YY_CURRENT_BUFFER)
3196 return 0;
3197
3198 return yycolumn;
3199 }
3200
3201 /** Get the input stream.
3202 * @param yyscanner The scanner object.
3203 */
3204 FILE *yyget_in (yyscan_t yyscanner)
3205 {
3206 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3207 return yyin;
3208 }
3209
3210 /** Get the output stream.
3211 * @param yyscanner The scanner object.
3212 */
3213 FILE *yyget_out (yyscan_t yyscanner)
3214 {
3215 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3216 return yyout;
3217 }
3218
3219 /** Get the length of the current token.
3220 * @param yyscanner The scanner object.
3221 */
3222 int yyget_leng (yyscan_t yyscanner)
3223 {
3224 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3225 return yyleng;
3226 }
3227
3228 /** Get the current token.
3229 * @param yyscanner The scanner object.
3230 */
3231
3232 char *yyget_text (yyscan_t yyscanner)
3233 {
3234 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3235 return yytext;
3236 }
3237
3238 /** Set the user-defined data. This data is never touched by the scanner.
3239 * @param user_defined The data to be associated with this scanner.
3240 * @param yyscanner The scanner object.
3241 */
3242 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3243 {
3244 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3245 yyextra = user_defined ;
3246 }
3247
3248 /** Set the current line number.
3249 * @param line_number
3250 * @param yyscanner The scanner object.
3251 */
3252 void yyset_lineno (int line_number , yyscan_t yyscanner)
3253 {
3254 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3255
3256 /* lineno is only valid if an input buffer exists. */
3257 if (! YY_CURRENT_BUFFER )
3258 yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner);
3259
3260 yylineno = line_number;
3261 }
3262
3263 /** Set the current column.
3264 * @param line_number
3265 * @param yyscanner The scanner object.
3266 */
3267 void yyset_column (int column_no , yyscan_t yyscanner)
3268 {
3269 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3270
3271 /* column is only valid if an input buffer exists. */
3272 if (! YY_CURRENT_BUFFER )
3273 yy_fatal_error( "yyset_column called with no buffer" , yyscanner);
3274
3275 yycolumn = column_no;
3276 }
3277
3278 /** Set the input stream. This does not discard the current
3279 * input buffer.
3280 * @param in_str A readable stream.
3281 * @param yyscanner The scanner object.
3282 * @see yy_switch_to_buffer
3283 */
3284 void yyset_in (FILE * in_str , yyscan_t yyscanner)
3285 {
3286 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3287 yyin = in_str ;
3288 }
3289
3290 void yyset_out (FILE * out_str , yyscan_t yyscanner)
3291 {
3292 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3293 yyout = out_str ;
3294 }
3295
3296 int yyget_debug (yyscan_t yyscanner)
3297 {
3298 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3299 return yy_flex_debug;
3300 }
3301
3302 void yyset_debug (int bdebug , yyscan_t yyscanner)
3303 {
3304 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3305 yy_flex_debug = bdebug ;
3306 }
3307
3308 /* Accessor methods for yylval and yylloc */
3309
3310 YYSTYPE * yyget_lval (yyscan_t yyscanner)
3311 {
3312 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3313 return yylval;
3314 }
3315
3316 void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3317 {
3318 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3319 yylval = yylval_param;
3320 }
3321
3322 YYLTYPE *yyget_lloc (yyscan_t yyscanner)
3323 {
3324 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3325 return yylloc;
3326 }
3327
3328 void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3329 {
3330 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3331 yylloc = yylloc_param;
3332 }
3333
3334 /* User-visible API */
3335
3336 /* yylex_init is special because it creates the scanner itself, so it is
3337 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3338 * That's why we explicitly handle the declaration, instead of using our macros.
3339 */
3340
3341 int yylex_init(yyscan_t* ptr_yy_globals)
3342
3343 {
3344 if (ptr_yy_globals == NULL){
3345 errno = EINVAL;
3346 return 1;
3347 }
3348
3349 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
3350
3351 if (*ptr_yy_globals == NULL){
3352 errno = ENOMEM;
3353 return 1;
3354 }
3355
3356 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3357 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3358
3359 return yy_init_globals ( *ptr_yy_globals );
3360 }
3361
3362 /* yylex_init_extra has the same functionality as yylex_init, but follows the
3363 * convention of taking the scanner as the last argument. Note however, that
3364 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3365 * is the reason, too, why this function also must handle its own declaration).
3366 * The user defined value in the first argument will be available to yyalloc in
3367 * the yyextra field.
3368 */
3369
3370 int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3371
3372 {
3373 struct yyguts_t dummy_yyguts;
3374
3375 yyset_extra (yy_user_defined, &dummy_yyguts);
3376
3377 if (ptr_yy_globals == NULL){
3378 errno = EINVAL;
3379 return 1;
3380 }
3381
3382 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3383
3384 if (*ptr_yy_globals == NULL){
3385 errno = ENOMEM;
3386 return 1;
3387 }
3388
3389 /* By setting to 0xAA, we expose bugs in
3390 yy_init_globals. Leave at 0x00 for releases. */
3391 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3392
3393 yyset_extra (yy_user_defined, *ptr_yy_globals);
3394
3395 return yy_init_globals ( *ptr_yy_globals );
3396 }
3397
3398 static int yy_init_globals (yyscan_t yyscanner)
3399 {
3400 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3401 /* Initialization is the same as for the non-reentrant scanner.
3402 * This function is called from yylex_destroy(), so don't allocate here.
3403 */
3404
3405 yyg->yy_buffer_stack = 0;
3406 yyg->yy_buffer_stack_top = 0;
3407 yyg->yy_buffer_stack_max = 0;
3408 yyg->yy_c_buf_p = (char *) 0;
3409 yyg->yy_init = 0;
3410 yyg->yy_start = 0;
3411
3412 yyg->yy_start_stack_ptr = 0;
3413 yyg->yy_start_stack_depth = 0;
3414 yyg->yy_start_stack = NULL;
3415
3416 /* Defined in main.c */
3417 #ifdef YY_STDINIT
3418 yyin = stdin;
3419 yyout = stdout;
3420 #else
3421 yyin = (FILE *) 0;
3422 yyout = (FILE *) 0;
3423 #endif
3424
3425 /* For future reference: Set errno on error, since we are called by
3426 * yylex_init()
3427 */
3428 return 0;
3429 }
3430
3431 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
3432 int yylex_destroy (yyscan_t yyscanner)
3433 {
3434 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3435
3436 /* Pop the buffer stack, destroying each element. */
3437 while(YY_CURRENT_BUFFER){
3438 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3439 YY_CURRENT_BUFFER_LVALUE = NULL;
3440 yypop_buffer_state(yyscanner);
3441 }
3442
3443 /* Destroy the stack itself. */
3444 yyfree(yyg->yy_buffer_stack ,yyscanner);
3445 yyg->yy_buffer_stack = NULL;
3446
3447 /* Destroy the start condition stack. */
3448 yyfree(yyg->yy_start_stack ,yyscanner );
3449 yyg->yy_start_stack = NULL;
3450
3451 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3452 * yylex() is called, initialization will occur. */
3453 yy_init_globals( yyscanner);
3454
3455 /* Destroy the main struct (reentrant only). */
3456 yyfree ( yyscanner , yyscanner );
3457 yyscanner = NULL;
3458 return 0;
3459 }
3460
3461 /*
3462 * Internal utility routines.
3463 */
3464
3465 #ifndef yytext_ptr
3466 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3467 {
3468 register int i;
3469 for ( i = 0; i < n; ++i )
3470 s1[i] = s2[i];
3471 }
3472 #endif
3473
3474 #ifdef YY_NEED_STRLEN
3475 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3476 {
3477 register int n;
3478 for ( n = 0; s[n]; ++n )
3479 ;
3480
3481 return n;
3482 }
3483 #endif
3484
3485 void *yyalloc (yy_size_t size , yyscan_t yyscanner)
3486 {
3487 return (void *) malloc( size );
3488 }
3489
3490 void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3491 {
3492 /* The cast to (char *) in the following accommodates both
3493 * implementations that use char* generic pointers, and those
3494 * that use void* generic pointers. It works with the latter
3495 * because both ANSI C and C++ allow castless assignment from
3496 * any pointer type to void*, and deal with argument conversions
3497 * as though doing an assignment.
3498 */
3499 return (void *) realloc( (char *) ptr, size );
3500 }
3501
3502 void yyfree (void * ptr , yyscan_t yyscanner)
3503 {
3504 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
3505 }
3506
3507 #define YYTABLES_NAME "yytables"
3508
3509 #line 464 "program_lexer.l"
3510
3511
3512
3513 void
3514 _mesa_program_lexer_ctor(void **scanner, struct asm_parser_state *state,
3515 const char *string, size_t len)
3516 {
3517 yylex_init_extra(state,scanner);
3518 yy_scan_bytes(string,len,*scanner);
3519 }
3520
3521 void
3522 _mesa_program_lexer_dtor(void *scanner)
3523 {
3524 /* FINISHME: It's not clear to me whether or not the buffer state returned
3525 * FINISHME: by yy_scan_bytes in _mesa_program_lexer_ctor needs to be
3526 * FINISHME: explicitly destroyed here or not.
3527 */
3528 yylex_destroy(scanner);
3529 }
3530