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