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