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