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