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