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