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