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