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