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