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