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