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