michael@0: #line 17 "./glslang.l" michael@0: // michael@0: // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: // This file is auto-generated by generate_parser.sh. DO NOT EDIT! michael@0: michael@0: // Ignore errors in auto-generated code. michael@0: #if defined(__GNUC__) michael@0: #pragma GCC diagnostic ignored "-Wunused-function" michael@0: #pragma GCC diagnostic ignored "-Wunused-variable" michael@0: #pragma GCC diagnostic ignored "-Wswitch-enum" michael@0: #elif defined(_MSC_VER) michael@0: #pragma warning(disable: 4065) michael@0: #pragma warning(disable: 4189) michael@0: #pragma warning(disable: 4505) michael@0: #pragma warning(disable: 4701) michael@0: #endif michael@0: michael@0: michael@0: michael@0: #line 25 "./glslang_lex.cpp" michael@0: michael@0: #define YY_INT_ALIGNED short int michael@0: michael@0: /* A lexical scanner generated by flex */ michael@0: michael@0: #define FLEX_SCANNER michael@0: #define YY_FLEX_MAJOR_VERSION 2 michael@0: #define YY_FLEX_MINOR_VERSION 5 michael@0: #define YY_FLEX_SUBMINOR_VERSION 35 michael@0: #if YY_FLEX_SUBMINOR_VERSION > 0 michael@0: #define FLEX_BETA michael@0: #endif michael@0: michael@0: /* First, we deal with platform-specific or compiler-specific issues. */ michael@0: michael@0: /* begin standard C headers. */ michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: /* end standard C headers. */ michael@0: michael@0: /* flex integer type definitions */ michael@0: michael@0: #ifndef FLEXINT_H michael@0: #define FLEXINT_H michael@0: michael@0: /* C99 systems have . Non-C99 systems may or may not. */ michael@0: michael@0: #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L michael@0: michael@0: /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, michael@0: * if you want the limit (max/min) macros for int types. michael@0: */ michael@0: #ifndef __STDC_LIMIT_MACROS michael@0: #define __STDC_LIMIT_MACROS 1 michael@0: #endif michael@0: michael@0: #include michael@0: typedef int8_t flex_int8_t; michael@0: typedef uint8_t flex_uint8_t; michael@0: typedef int16_t flex_int16_t; michael@0: typedef uint16_t flex_uint16_t; michael@0: typedef int32_t flex_int32_t; michael@0: typedef uint32_t flex_uint32_t; michael@0: typedef uint64_t flex_uint64_t; michael@0: #else michael@0: typedef signed char flex_int8_t; michael@0: typedef short int flex_int16_t; michael@0: typedef int flex_int32_t; michael@0: typedef unsigned char flex_uint8_t; michael@0: typedef unsigned short int flex_uint16_t; michael@0: typedef unsigned int flex_uint32_t; michael@0: #endif /* ! C99 */ michael@0: michael@0: /* Limits of integral types. */ michael@0: #ifndef INT8_MIN michael@0: #define INT8_MIN (-128) michael@0: #endif michael@0: #ifndef INT16_MIN michael@0: #define INT16_MIN (-32767-1) michael@0: #endif michael@0: #ifndef INT32_MIN michael@0: #define INT32_MIN (-2147483647-1) michael@0: #endif michael@0: #ifndef INT8_MAX michael@0: #define INT8_MAX (127) michael@0: #endif michael@0: #ifndef INT16_MAX michael@0: #define INT16_MAX (32767) michael@0: #endif michael@0: #ifndef INT32_MAX michael@0: #define INT32_MAX (2147483647) michael@0: #endif michael@0: #ifndef UINT8_MAX michael@0: #define UINT8_MAX (255U) michael@0: #endif michael@0: #ifndef UINT16_MAX michael@0: #define UINT16_MAX (65535U) michael@0: #endif michael@0: #ifndef UINT32_MAX michael@0: #define UINT32_MAX (4294967295U) michael@0: #endif michael@0: michael@0: #endif /* ! FLEXINT_H */ michael@0: michael@0: #ifdef __cplusplus michael@0: michael@0: /* The "const" storage-class-modifier is valid. */ michael@0: #define YY_USE_CONST michael@0: michael@0: #else /* ! __cplusplus */ michael@0: michael@0: /* C99 requires __STDC__ to be defined as 1. */ michael@0: #if defined (__STDC__) michael@0: michael@0: #define YY_USE_CONST michael@0: michael@0: #endif /* defined (__STDC__) */ michael@0: #endif /* ! __cplusplus */ michael@0: michael@0: #ifdef YY_USE_CONST michael@0: #define yyconst const michael@0: #else michael@0: #define yyconst michael@0: #endif michael@0: michael@0: /* Returned upon end-of-file. */ michael@0: #define YY_NULL 0 michael@0: michael@0: /* Promotes a possibly negative, possibly signed char to an unsigned michael@0: * integer for use as an array index. If the signed char is negative, michael@0: * we want to instead treat it as an 8-bit unsigned char, hence the michael@0: * double cast. michael@0: */ michael@0: #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) michael@0: michael@0: /* An opaque pointer. */ michael@0: #ifndef YY_TYPEDEF_YY_SCANNER_T michael@0: #define YY_TYPEDEF_YY_SCANNER_T michael@0: typedef void* yyscan_t; michael@0: #endif michael@0: michael@0: /* For convenience, these vars (plus the bison vars far below) michael@0: are macros in the reentrant scanner. */ michael@0: #define yyin yyg->yyin_r michael@0: #define yyout yyg->yyout_r michael@0: #define yyextra yyg->yyextra_r michael@0: #define yyleng yyg->yyleng_r michael@0: #define yytext yyg->yytext_r michael@0: #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) michael@0: #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) michael@0: #define yy_flex_debug yyg->yy_flex_debug_r michael@0: michael@0: /* Enter a start condition. This macro really ought to take a parameter, michael@0: * but we do it the disgusting crufty way forced on us by the ()-less michael@0: * definition of BEGIN. michael@0: */ michael@0: #define BEGIN yyg->yy_start = 1 + 2 * michael@0: michael@0: /* Translate the current start state into a value that can be later handed michael@0: * to BEGIN to return to the state. The YYSTATE alias is for lex michael@0: * compatibility. michael@0: */ michael@0: #define YY_START ((yyg->yy_start - 1) / 2) michael@0: #define YYSTATE YY_START michael@0: michael@0: /* Action number for EOF rule of a given start state. */ michael@0: #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) michael@0: michael@0: /* Special action meaning "start processing a new file". */ michael@0: #define YY_NEW_FILE yyrestart(yyin ,yyscanner ) michael@0: michael@0: #define YY_END_OF_BUFFER_CHAR 0 michael@0: michael@0: /* Size of default input buffer. */ michael@0: #ifndef YY_BUF_SIZE michael@0: #define YY_BUF_SIZE 16384 michael@0: #endif michael@0: michael@0: /* The state buf must be large enough to hold one state per character in the main buffer. michael@0: */ michael@0: #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) michael@0: michael@0: #ifndef YY_TYPEDEF_YY_BUFFER_STATE michael@0: #define YY_TYPEDEF_YY_BUFFER_STATE michael@0: typedef struct yy_buffer_state *YY_BUFFER_STATE; michael@0: #endif michael@0: michael@0: #ifndef YY_TYPEDEF_YY_SIZE_T michael@0: #define YY_TYPEDEF_YY_SIZE_T michael@0: typedef size_t yy_size_t; michael@0: #endif michael@0: michael@0: #define EOB_ACT_CONTINUE_SCAN 0 michael@0: #define EOB_ACT_END_OF_FILE 1 michael@0: #define EOB_ACT_LAST_MATCH 2 michael@0: michael@0: /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires michael@0: * access to the local variable yy_act. Since yyless() is a macro, it would break michael@0: * existing scanners that call yyless() from OUTSIDE yylex. michael@0: * One obvious solution it to make yy_act a global. I tried that, and saw michael@0: * a 5% performance hit in a non-yylineno scanner, because yy_act is michael@0: * normally declared as a register variable-- so it is not worth it. michael@0: */ michael@0: #define YY_LESS_LINENO(n) \ michael@0: do { \ michael@0: yy_size_t yyl;\ michael@0: for ( yyl = n; yyl < yyleng; ++yyl )\ michael@0: if ( yytext[yyl] == '\n' )\ michael@0: --yylineno;\ michael@0: }while(0) michael@0: michael@0: /* Return all but the first "n" matched characters back to the input stream. */ michael@0: #define yyless(n) \ michael@0: do \ michael@0: { \ michael@0: /* Undo effects of setting up yytext. */ \ michael@0: int yyless_macro_arg = (n); \ michael@0: YY_LESS_LINENO(yyless_macro_arg);\ michael@0: *yy_cp = yyg->yy_hold_char; \ michael@0: YY_RESTORE_YY_MORE_OFFSET \ michael@0: yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ michael@0: YY_DO_BEFORE_ACTION; /* set up yytext again */ \ michael@0: } \ michael@0: while ( 0 ) michael@0: michael@0: #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) michael@0: michael@0: #ifndef YY_STRUCT_YY_BUFFER_STATE michael@0: #define YY_STRUCT_YY_BUFFER_STATE michael@0: struct yy_buffer_state michael@0: { michael@0: FILE *yy_input_file; michael@0: michael@0: char *yy_ch_buf; /* input buffer */ michael@0: char *yy_buf_pos; /* current position in input buffer */ michael@0: michael@0: /* Size of input buffer in bytes, not including room for EOB michael@0: * characters. michael@0: */ michael@0: yy_size_t yy_buf_size; michael@0: michael@0: /* Number of characters read into yy_ch_buf, not including EOB michael@0: * characters. michael@0: */ michael@0: yy_size_t yy_n_chars; michael@0: michael@0: /* Whether we "own" the buffer - i.e., we know we created it, michael@0: * and can realloc() it to grow it, and should free() it to michael@0: * delete it. michael@0: */ michael@0: int yy_is_our_buffer; michael@0: michael@0: /* Whether this is an "interactive" input source; if so, and michael@0: * if we're using stdio for input, then we want to use getc() michael@0: * instead of fread(), to make sure we stop fetching input after michael@0: * each newline. michael@0: */ michael@0: int yy_is_interactive; michael@0: michael@0: /* Whether we're considered to be at the beginning of a line. michael@0: * If so, '^' rules will be active on the next match, otherwise michael@0: * not. michael@0: */ michael@0: int yy_at_bol; michael@0: michael@0: int yy_bs_lineno; /**< The line count. */ michael@0: int yy_bs_column; /**< The column count. */ michael@0: michael@0: /* Whether to try to fill the input buffer when we reach the michael@0: * end of it. michael@0: */ michael@0: int yy_fill_buffer; michael@0: michael@0: int yy_buffer_status; michael@0: michael@0: #define YY_BUFFER_NEW 0 michael@0: #define YY_BUFFER_NORMAL 1 michael@0: /* When an EOF's been seen but there's still some text to process michael@0: * then we mark the buffer as YY_EOF_PENDING, to indicate that we michael@0: * shouldn't try reading from the input source any more. We might michael@0: * still have a bunch of tokens to match, though, because of michael@0: * possible backing-up. michael@0: * michael@0: * When we actually see the EOF, we change the status to "new" michael@0: * (via yyrestart()), so that the user can continue scanning by michael@0: * just pointing yyin at a new input file. michael@0: */ michael@0: #define YY_BUFFER_EOF_PENDING 2 michael@0: michael@0: }; michael@0: #endif /* !YY_STRUCT_YY_BUFFER_STATE */ michael@0: michael@0: /* We provide macros for accessing buffer states in case in the michael@0: * future we want to put the buffer states in a more general michael@0: * "scanner state". michael@0: * michael@0: * Returns the top of the stack, or NULL. michael@0: */ michael@0: #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ michael@0: ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ michael@0: : NULL) michael@0: michael@0: /* Same as previous macro, but useful when we know that the buffer stack is not michael@0: * NULL or when we need an lvalue. For internal use only. michael@0: */ michael@0: #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] michael@0: michael@0: void yyrestart (FILE *input_file ,yyscan_t yyscanner ); michael@0: void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); michael@0: YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); michael@0: void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); michael@0: void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); michael@0: void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); michael@0: void yypop_buffer_state (yyscan_t yyscanner ); michael@0: michael@0: static void yyensure_buffer_stack (yyscan_t yyscanner ); michael@0: static void yy_load_buffer_state (yyscan_t yyscanner ); michael@0: static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); michael@0: michael@0: #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) michael@0: michael@0: YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); michael@0: YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); michael@0: YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); michael@0: michael@0: void *yyalloc (yy_size_t ,yyscan_t yyscanner ); michael@0: void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); michael@0: void yyfree (void * ,yyscan_t yyscanner ); michael@0: michael@0: #define yy_new_buffer yy_create_buffer michael@0: michael@0: #define yy_set_interactive(is_interactive) \ michael@0: { \ michael@0: if ( ! YY_CURRENT_BUFFER ){ \ michael@0: yyensure_buffer_stack (yyscanner); \ michael@0: YY_CURRENT_BUFFER_LVALUE = \ michael@0: yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ michael@0: } \ michael@0: YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ michael@0: } michael@0: michael@0: #define yy_set_bol(at_bol) \ michael@0: { \ michael@0: if ( ! YY_CURRENT_BUFFER ){\ michael@0: yyensure_buffer_stack (yyscanner); \ michael@0: YY_CURRENT_BUFFER_LVALUE = \ michael@0: yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ michael@0: } \ michael@0: YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ michael@0: } michael@0: michael@0: #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) michael@0: michael@0: /* Begin user sect3 */ michael@0: michael@0: #define yywrap(n) 1 michael@0: #define YY_SKIP_YYWRAP michael@0: michael@0: typedef unsigned char YY_CHAR; michael@0: michael@0: typedef int yy_state_type; michael@0: michael@0: #define yytext_ptr yytext_r michael@0: michael@0: static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); michael@0: static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); michael@0: static int yy_get_next_buffer (yyscan_t yyscanner ); michael@0: static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); michael@0: michael@0: /* Done after the current pattern has been matched and before the michael@0: * corresponding action - sets up yytext. michael@0: */ michael@0: #define YY_DO_BEFORE_ACTION \ michael@0: yyg->yytext_ptr = yy_bp; \ michael@0: yyleng = (yy_size_t) (yy_cp - yy_bp); \ michael@0: yyg->yy_hold_char = *yy_cp; \ michael@0: *yy_cp = '\0'; \ michael@0: yyg->yy_c_buf_p = yy_cp; michael@0: michael@0: #define YY_NUM_RULES 147 michael@0: #define YY_END_OF_BUFFER 148 michael@0: /* This struct is not used in this scanner, michael@0: but its presence is necessary. */ michael@0: struct yy_trans_info michael@0: { michael@0: flex_int32_t yy_verify; michael@0: flex_int32_t yy_nxt; michael@0: }; michael@0: static yyconst flex_int16_t yy_accept[443] = michael@0: { 0, michael@0: 0, 0, 148, 146, 145, 145, 132, 138, 143, 127, michael@0: 128, 136, 135, 124, 133, 131, 137, 96, 96, 125, michael@0: 121, 139, 126, 140, 144, 93, 129, 130, 142, 93, michael@0: 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 93, 93, 93, 93, 93, 93, 93, 122, michael@0: 141, 123, 134, 118, 104, 123, 112, 107, 102, 110, michael@0: 100, 111, 101, 99, 103, 98, 95, 96, 0, 0, michael@0: 130, 122, 129, 119, 115, 117, 116, 120, 93, 108, michael@0: 114, 93, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: 93, 12, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: michael@0: 93, 93, 93, 93, 93, 15, 17, 93, 93, 93, michael@0: 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 93, 93, 109, 113, 0, 98, 0, 0, michael@0: 97, 94, 105, 106, 45, 93, 93, 93, 93, 93, michael@0: 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 93, 13, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 21, 93, 93, 93, 93, 93, 93, 93, michael@0: 93, 18, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: michael@0: 93, 93, 93, 93, 93, 0, 99, 0, 98, 93, michael@0: 23, 93, 93, 90, 93, 93, 93, 93, 93, 93, michael@0: 93, 16, 48, 93, 93, 93, 64, 93, 93, 53, michael@0: 68, 93, 93, 93, 93, 93, 93, 93, 93, 65, michael@0: 4, 28, 29, 30, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: 51, 24, 93, 93, 93, 93, 93, 93, 31, 32, michael@0: 33, 22, 93, 93, 93, 10, 37, 38, 39, 46, michael@0: 7, 93, 93, 93, 93, 77, 78, 79, 93, 25, michael@0: 69, 20, 80, 81, 82, 2, 74, 75, 76, 93, michael@0: michael@0: 19, 72, 93, 93, 34, 35, 36, 93, 93, 93, michael@0: 93, 93, 93, 93, 93, 93, 66, 93, 93, 93, michael@0: 93, 93, 93, 93, 93, 47, 93, 92, 93, 93, michael@0: 14, 93, 93, 93, 93, 67, 61, 56, 93, 93, michael@0: 93, 93, 93, 73, 52, 93, 59, 27, 93, 89, michael@0: 60, 44, 71, 54, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 55, 26, 93, 93, 93, 3, 93, 93, michael@0: 93, 93, 93, 49, 8, 93, 9, 93, 93, 11, michael@0: 62, 93, 93, 93, 57, 93, 93, 93, 93, 93, michael@0: 93, 50, 70, 58, 6, 63, 1, 91, 5, 83, michael@0: michael@0: 40, 84, 93, 93, 93, 93, 93, 93, 93, 93, michael@0: 93, 93, 93, 93, 41, 93, 93, 93, 93, 93, michael@0: 93, 93, 43, 93, 87, 93, 93, 93, 93, 93, michael@0: 85, 93, 86, 93, 93, 93, 93, 93, 93, 42, michael@0: 88, 0 michael@0: } ; michael@0: michael@0: static yyconst flex_int32_t yy_ec[256] = michael@0: { 0, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, michael@0: 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 2, 4, 1, 1, 1, 5, 6, 1, 7, michael@0: 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, michael@0: 18, 19, 20, 20, 20, 21, 21, 22, 23, 24, michael@0: 25, 26, 27, 1, 28, 28, 29, 30, 31, 28, michael@0: 32, 32, 32, 32, 32, 32, 32, 32, 33, 32, michael@0: 32, 34, 35, 32, 32, 32, 32, 36, 32, 32, michael@0: 37, 1, 38, 39, 32, 1, 40, 41, 42, 43, michael@0: michael@0: 44, 45, 46, 47, 48, 32, 49, 50, 51, 52, michael@0: 53, 54, 32, 55, 56, 57, 58, 59, 60, 61, michael@0: 62, 63, 64, 65, 66, 67, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1 michael@0: } ; michael@0: michael@0: static yyconst flex_int32_t yy_meta[68] = michael@0: { 0, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, michael@0: 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, michael@0: 2, 3, 3, 3, 3, 3, 1, 1, 1, 2, michael@0: 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, michael@0: 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, michael@0: 3, 3, 3, 1, 1, 1, 1 michael@0: } ; michael@0: michael@0: static yyconst flex_int16_t yy_base[445] = michael@0: { 0, michael@0: 0, 0, 587, 588, 588, 588, 561, 43, 64, 588, michael@0: 588, 560, 61, 588, 60, 58, 559, 77, 86, 557, michael@0: 588, 104, 557, 55, 588, 0, 588, 588, 75, 26, michael@0: 57, 82, 83, 73, 93, 528, 97, 95, 527, 44, michael@0: 71, 521, 104, 534, 110, 116, 35, 111, 530, 588, michael@0: 114, 588, 588, 588, 588, 588, 588, 588, 588, 588, michael@0: 588, 588, 588, 165, 588, 172, 202, 211, 233, 0, michael@0: 588, 588, 588, 551, 588, 588, 588, 550, 0, 588, michael@0: 588, 523, 516, 519, 527, 526, 513, 528, 515, 521, michael@0: 509, 506, 519, 506, 503, 503, 509, 497, 108, 502, michael@0: michael@0: 512, 498, 504, 507, 508, 0, 145, 507, 113, 493, michael@0: 506, 497, 499, 489, 503, 500, 502, 485, 490, 487, michael@0: 476, 157, 484, 489, 485, 487, 476, 479, 118, 484, michael@0: 476, 488, 70, 481, 588, 588, 246, 253, 270, 219, michael@0: 283, 0, 588, 588, 0, 473, 477, 486, 483, 467, michael@0: 467, 119, 482, 479, 479, 477, 474, 466, 472, 459, michael@0: 470, 456, 472, 0, 469, 457, 464, 461, 465, 458, michael@0: 447, 446, 459, 462, 459, 454, 445, 188, 450, 453, michael@0: 444, 441, 445, 451, 442, 433, 436, 434, 444, 430, michael@0: 428, 441, 427, 429, 426, 437, 436, 124, 431, 426, michael@0: michael@0: 415, 258, 433, 435, 424, 290, 297, 304, 311, 425, michael@0: 0, 423, 275, 0, 415, 413, 421, 410, 427, 416, michael@0: 316, 0, 0, 410, 420, 420, 0, 405, 319, 0, michael@0: 0, 407, 322, 408, 402, 401, 402, 401, 325, 0, michael@0: 0, 0, 0, 0, 397, 398, 403, 394, 407, 402, michael@0: 401, 393, 397, 389, 392, 396, 401, 387, 399, 390, michael@0: 0, 0, 396, 385, 385, 390, 389, 386, 0, 0, michael@0: 0, 0, 376, 388, 390, 0, 0, 0, 0, 0, michael@0: 0, 378, 379, 373, 383, 0, 0, 0, 374, 0, michael@0: 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, michael@0: michael@0: 0, 0, 379, 375, 0, 0, 0, 371, 367, 372, michael@0: 362, 375, 361, 374, 363, 370, 0, 368, 370, 354, michael@0: 356, 362, 368, 363, 351, 0, 353, 0, 352, 355, michael@0: 0, 344, 343, 343, 356, 0, 358, 0, 357, 356, michael@0: 341, 354, 341, 0, 0, 344, 0, 0, 336, 0, michael@0: 0, 0, 0, 0, 333, 344, 337, 343, 340, 335, michael@0: 327, 339, 0, 0, 332, 339, 328, 0, 337, 334, michael@0: 324, 329, 332, 0, 0, 332, 0, 330, 329, 0, michael@0: 0, 328, 314, 326, 0, 317, 338, 337, 336, 307, michael@0: 303, 0, 0, 0, 0, 0, 0, 0, 0, 328, michael@0: michael@0: 166, 325, 316, 299, 308, 310, 306, 308, 307, 306, michael@0: 309, 306, 256, 253, 0, 228, 238, 222, 235, 203, michael@0: 207, 204, 212, 191, 0, 201, 165, 167, 153, 161, michael@0: 0, 170, 0, 175, 151, 141, 100, 114, 59, 0, michael@0: 0, 588, 359, 113 michael@0: } ; michael@0: michael@0: static yyconst flex_int16_t yy_def[445] = michael@0: { 0, michael@0: 442, 1, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 443, 442, 442, 442, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 444, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 443, 442, michael@0: 442, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 442, 442, 442, 442, 442, 442, michael@0: 442, 444, 442, 442, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: michael@0: 443, 443, 443, 443, 443, 442, 442, 442, 442, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, michael@0: 443, 0, 442, 442 michael@0: } ; michael@0: michael@0: static yyconst flex_int16_t yy_nxt[656] = michael@0: { 0, michael@0: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, michael@0: 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, michael@0: 19, 20, 21, 22, 23, 24, 25, 26, 26, 26, michael@0: 26, 26, 26, 26, 26, 26, 27, 28, 29, 30, michael@0: 31, 32, 33, 34, 35, 36, 37, 38, 26, 39, michael@0: 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, michael@0: 26, 26, 26, 50, 51, 52, 53, 55, 56, 57, michael@0: 60, 62, 64, 64, 64, 64, 64, 64, 64, 77, michael@0: 78, 82, 83, 110, 63, 61, 129, 111, 58, 66, michael@0: 130, 67, 67, 67, 67, 67, 67, 68, 66, 80, michael@0: michael@0: 68, 68, 68, 68, 68, 68, 68, 69, 72, 84, michael@0: 112, 85, 70, 81, 142, 86, 69, 203, 441, 204, michael@0: 69, 87, 94, 113, 95, 73, 90, 74, 75, 69, michael@0: 91, 88, 97, 96, 89, 92, 103, 70, 135, 106, michael@0: 98, 93, 99, 115, 104, 100, 107, 162, 440, 119, michael@0: 131, 101, 439, 108, 132, 105, 120, 121, 116, 125, michael@0: 163, 117, 126, 133, 176, 198, 122, 123, 264, 124, michael@0: 127, 438, 177, 199, 216, 217, 265, 128, 136, 64, michael@0: 64, 64, 64, 64, 64, 64, 138, 138, 138, 138, michael@0: 138, 138, 138, 437, 170, 137, 190, 171, 172, 406, michael@0: michael@0: 407, 173, 139, 174, 242, 243, 244, 436, 137, 435, michael@0: 434, 191, 433, 432, 66, 139, 67, 67, 67, 67, michael@0: 67, 67, 68, 66, 431, 68, 68, 68, 68, 68, michael@0: 68, 68, 69, 141, 141, 141, 141, 141, 141, 141, michael@0: 430, 69, 140, 429, 140, 69, 428, 141, 141, 141, michael@0: 141, 141, 141, 141, 69, 206, 427, 206, 426, 425, michael@0: 207, 207, 207, 207, 207, 207, 207, 138, 138, 138, michael@0: 138, 138, 138, 138, 269, 270, 271, 424, 423, 208, michael@0: 422, 208, 421, 139, 209, 209, 209, 209, 209, 209, michael@0: 209, 277, 278, 279, 420, 419, 139, 141, 141, 141, michael@0: michael@0: 141, 141, 141, 141, 207, 207, 207, 207, 207, 207, michael@0: 207, 207, 207, 207, 207, 207, 207, 207, 209, 209, michael@0: 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, michael@0: 209, 209, 286, 287, 288, 293, 294, 295, 297, 298, michael@0: 299, 305, 306, 307, 387, 388, 389, 418, 417, 416, michael@0: 415, 414, 413, 412, 411, 410, 409, 390, 408, 391, michael@0: 79, 79, 405, 404, 403, 402, 401, 400, 399, 398, michael@0: 397, 396, 395, 394, 393, 392, 386, 385, 384, 383, michael@0: 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, michael@0: 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, michael@0: michael@0: 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, michael@0: 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, michael@0: 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, michael@0: 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, michael@0: 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, michael@0: 312, 311, 310, 309, 308, 304, 303, 302, 301, 300, michael@0: 296, 292, 291, 290, 289, 285, 284, 283, 282, 281, michael@0: 280, 276, 275, 274, 273, 272, 268, 267, 266, 263, michael@0: 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, michael@0: 252, 251, 250, 249, 248, 247, 246, 245, 241, 240, michael@0: michael@0: 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, michael@0: 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, michael@0: 219, 218, 215, 214, 213, 212, 211, 210, 205, 202, michael@0: 201, 200, 197, 196, 195, 194, 193, 192, 189, 188, michael@0: 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, michael@0: 175, 169, 168, 167, 166, 165, 164, 161, 160, 159, michael@0: 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, michael@0: 148, 147, 146, 145, 144, 143, 134, 118, 114, 109, michael@0: 102, 76, 71, 65, 59, 54, 442, 3, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442 michael@0: } ; michael@0: michael@0: static yyconst flex_int16_t yy_chk[656] = michael@0: { 0, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, michael@0: 1, 1, 1, 1, 1, 1, 1, 8, 8, 9, michael@0: 13, 15, 16, 16, 16, 16, 16, 16, 16, 24, michael@0: 24, 30, 30, 40, 15, 13, 47, 40, 9, 18, michael@0: 47, 18, 18, 18, 18, 18, 18, 18, 19, 29, michael@0: michael@0: 19, 19, 19, 19, 19, 19, 19, 18, 22, 31, michael@0: 41, 31, 18, 29, 444, 31, 19, 133, 439, 133, michael@0: 18, 32, 34, 41, 34, 22, 33, 22, 22, 19, michael@0: 33, 32, 35, 34, 32, 33, 37, 18, 51, 38, michael@0: 35, 33, 35, 43, 37, 35, 38, 99, 438, 45, michael@0: 48, 35, 437, 38, 48, 37, 45, 45, 43, 46, michael@0: 99, 43, 46, 48, 109, 129, 45, 45, 198, 45, michael@0: 46, 436, 109, 129, 152, 152, 198, 46, 51, 64, michael@0: 64, 64, 64, 64, 64, 64, 66, 66, 66, 66, michael@0: 66, 66, 66, 435, 107, 64, 122, 107, 107, 401, michael@0: michael@0: 401, 107, 66, 107, 178, 178, 178, 434, 64, 432, michael@0: 430, 122, 429, 428, 67, 66, 67, 67, 67, 67, michael@0: 67, 67, 67, 68, 427, 68, 68, 68, 68, 68, michael@0: 68, 68, 67, 140, 140, 140, 140, 140, 140, 140, michael@0: 426, 68, 69, 424, 69, 67, 423, 69, 69, 69, michael@0: 69, 69, 69, 69, 68, 137, 422, 137, 421, 420, michael@0: 137, 137, 137, 137, 137, 137, 137, 138, 138, 138, michael@0: 138, 138, 138, 138, 202, 202, 202, 419, 418, 139, michael@0: 417, 139, 416, 138, 139, 139, 139, 139, 139, 139, michael@0: 139, 213, 213, 213, 414, 413, 138, 141, 141, 141, michael@0: michael@0: 141, 141, 141, 141, 206, 206, 206, 206, 206, 206, michael@0: 206, 207, 207, 207, 207, 207, 207, 207, 208, 208, michael@0: 208, 208, 208, 208, 208, 209, 209, 209, 209, 209, michael@0: 209, 209, 221, 221, 221, 229, 229, 229, 233, 233, michael@0: 233, 239, 239, 239, 372, 372, 372, 412, 411, 410, michael@0: 409, 408, 407, 406, 405, 404, 403, 372, 402, 372, michael@0: 443, 443, 400, 391, 390, 389, 388, 387, 386, 384, michael@0: 383, 382, 379, 378, 376, 373, 371, 370, 369, 367, michael@0: 366, 365, 362, 361, 360, 359, 358, 357, 356, 355, michael@0: 349, 346, 343, 342, 341, 340, 339, 337, 335, 334, michael@0: michael@0: 333, 332, 330, 329, 327, 325, 324, 323, 322, 321, michael@0: 320, 319, 318, 316, 315, 314, 313, 312, 311, 310, michael@0: 309, 308, 304, 303, 300, 289, 285, 284, 283, 282, michael@0: 275, 274, 273, 268, 267, 266, 265, 264, 263, 260, michael@0: 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, michael@0: 249, 248, 247, 246, 245, 238, 237, 236, 235, 234, michael@0: 232, 228, 226, 225, 224, 220, 219, 218, 217, 216, michael@0: 215, 212, 210, 205, 204, 203, 201, 200, 199, 197, michael@0: 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, michael@0: 186, 185, 184, 183, 182, 181, 180, 179, 177, 176, michael@0: michael@0: 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, michael@0: 165, 163, 162, 161, 160, 159, 158, 157, 156, 155, michael@0: 154, 153, 151, 150, 149, 148, 147, 146, 134, 132, michael@0: 131, 130, 128, 127, 126, 125, 124, 123, 121, 120, michael@0: 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, michael@0: 108, 105, 104, 103, 102, 101, 100, 98, 97, 96, michael@0: 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, michael@0: 85, 84, 83, 82, 78, 74, 49, 44, 42, 39, michael@0: 36, 23, 20, 17, 12, 7, 3, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, michael@0: 442, 442, 442, 442, 442 michael@0: } ; michael@0: michael@0: /* Table of booleans, true if rule could match eol. */ michael@0: static yyconst flex_int32_t yy_rule_can_match_eol[148] = michael@0: { 0, michael@0: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, michael@0: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, michael@0: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, michael@0: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, michael@0: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, michael@0: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, michael@0: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, michael@0: 0, 0, 0, 0, 0, 1, 0, 0, }; michael@0: michael@0: /* The intent behind this definition is that it'll catch michael@0: * any uses of REJECT which flex missed. michael@0: */ michael@0: #define REJECT reject_used_but_not_detected michael@0: #define yymore() yymore_used_but_not_detected michael@0: #define YY_MORE_ADJ 0 michael@0: #define YY_RESTORE_YY_MORE_OFFSET michael@0: /* michael@0: // michael@0: // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: This file contains the Lex specification for GLSL ES. michael@0: Based on ANSI C grammar, Lex specification: michael@0: http://www.lysator.liu.se/c/ANSI-C-grammar-l.html michael@0: michael@0: IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh, michael@0: WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp). michael@0: */ michael@0: michael@0: #include "compiler/glslang.h" michael@0: #include "compiler/ParseHelper.h" michael@0: #include "compiler/preprocessor/Token.h" michael@0: #include "compiler/util.h" michael@0: #include "glslang_tab.h" michael@0: michael@0: /* windows only pragma */ michael@0: #ifdef _MSC_VER michael@0: #pragma warning(disable : 4102) michael@0: #endif michael@0: michael@0: #define YY_USER_ACTION \ michael@0: yylloc->first_file = yylloc->last_file = yycolumn; \ michael@0: yylloc->first_line = yylloc->last_line = yylineno; michael@0: michael@0: #define YY_INPUT(buf, result, max_size) \ michael@0: result = string_input(buf, max_size, yyscanner); michael@0: michael@0: static yy_size_t string_input(char* buf, yy_size_t max_size, yyscan_t yyscanner); michael@0: static int check_type(yyscan_t yyscanner); michael@0: static int reserved_word(yyscan_t yyscanner); michael@0: michael@0: #define INITIAL 0 michael@0: michael@0: #define YY_EXTRA_TYPE TParseContext* michael@0: michael@0: /* Holds the entire state of the reentrant scanner. */ michael@0: struct yyguts_t michael@0: { michael@0: michael@0: /* User-defined. Not touched by flex. */ michael@0: YY_EXTRA_TYPE yyextra_r; michael@0: michael@0: /* The rest are the same as the globals declared in the non-reentrant scanner. */ michael@0: FILE *yyin_r, *yyout_r; michael@0: size_t yy_buffer_stack_top; /**< index of top of stack. */ michael@0: size_t yy_buffer_stack_max; /**< capacity of stack. */ michael@0: YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ michael@0: char yy_hold_char; michael@0: yy_size_t yy_n_chars; michael@0: yy_size_t yyleng_r; michael@0: char *yy_c_buf_p; michael@0: int yy_init; michael@0: int yy_start; michael@0: int yy_did_buffer_switch_on_eof; michael@0: int yy_start_stack_ptr; michael@0: int yy_start_stack_depth; michael@0: int *yy_start_stack; michael@0: yy_state_type yy_last_accepting_state; michael@0: char* yy_last_accepting_cpos; michael@0: michael@0: int yylineno_r; michael@0: int yy_flex_debug_r; michael@0: michael@0: char *yytext_r; michael@0: int yy_more_flag; michael@0: int yy_more_len; michael@0: michael@0: YYSTYPE * yylval_r; michael@0: michael@0: YYLTYPE * yylloc_r; michael@0: michael@0: }; /* end struct yyguts_t */ michael@0: michael@0: static int yy_init_globals (yyscan_t yyscanner ); michael@0: michael@0: /* This must go here because YYSTYPE and YYLTYPE are included michael@0: * from bison output in section 1.*/ michael@0: # define yylval yyg->yylval_r michael@0: michael@0: # define yylloc yyg->yylloc_r michael@0: michael@0: int yylex_init (yyscan_t* scanner); michael@0: michael@0: int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); michael@0: michael@0: /* Accessor methods to globals. michael@0: These are made visible to non-reentrant scanners for convenience. */ michael@0: michael@0: int yylex_destroy (yyscan_t yyscanner ); michael@0: michael@0: int yyget_debug (yyscan_t yyscanner ); michael@0: michael@0: void yyset_debug (int debug_flag ,yyscan_t yyscanner ); michael@0: michael@0: YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); michael@0: michael@0: void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); michael@0: michael@0: FILE *yyget_in (yyscan_t yyscanner ); michael@0: michael@0: void yyset_in (FILE * in_str ,yyscan_t yyscanner ); michael@0: michael@0: FILE *yyget_out (yyscan_t yyscanner ); michael@0: michael@0: void yyset_out (FILE * out_str ,yyscan_t yyscanner ); michael@0: michael@0: yy_size_t yyget_leng (yyscan_t yyscanner ); michael@0: michael@0: char *yyget_text (yyscan_t yyscanner ); michael@0: michael@0: int yyget_lineno (yyscan_t yyscanner ); michael@0: michael@0: void yyset_lineno (int line_number ,yyscan_t yyscanner ); michael@0: michael@0: YYSTYPE * yyget_lval (yyscan_t yyscanner ); michael@0: michael@0: void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); michael@0: michael@0: YYLTYPE *yyget_lloc (yyscan_t yyscanner ); michael@0: michael@0: void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); michael@0: michael@0: /* Macros after this point can all be overridden by user definitions in michael@0: * section 1. michael@0: */ michael@0: michael@0: #ifndef YY_SKIP_YYWRAP michael@0: #ifdef __cplusplus michael@0: extern "C" int yywrap (yyscan_t yyscanner ); michael@0: #else michael@0: extern int yywrap (yyscan_t yyscanner ); michael@0: #endif michael@0: #endif michael@0: michael@0: #ifndef yytext_ptr michael@0: static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); michael@0: #endif michael@0: michael@0: #ifdef YY_NEED_STRLEN michael@0: static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); michael@0: #endif michael@0: michael@0: #ifndef YY_NO_INPUT michael@0: michael@0: #ifdef __cplusplus michael@0: static int yyinput (yyscan_t yyscanner ); michael@0: #else michael@0: static int input (yyscan_t yyscanner ); michael@0: #endif michael@0: michael@0: #endif michael@0: michael@0: /* Amount of stuff to slurp up with each read. */ michael@0: #ifndef YY_READ_BUF_SIZE michael@0: #define YY_READ_BUF_SIZE 8192 michael@0: #endif michael@0: michael@0: /* Copy whatever the last rule matched to the standard output. */ michael@0: #ifndef ECHO michael@0: /* This used to be an fputs(), but since the string might contain NUL's, michael@0: * we now use fwrite(). michael@0: */ michael@0: #define ECHO fwrite( yytext, yyleng, 1, yyout ) michael@0: #endif michael@0: michael@0: /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, michael@0: * is returned in "result". michael@0: */ michael@0: #ifndef YY_INPUT michael@0: #define YY_INPUT(buf,result,max_size) \ michael@0: if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ michael@0: { \ michael@0: int c = '*'; \ michael@0: yy_size_t n; \ michael@0: for ( n = 0; n < max_size && \ michael@0: (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ michael@0: buf[n] = (char) c; \ michael@0: if ( c == '\n' ) \ michael@0: buf[n++] = (char) c; \ michael@0: if ( c == EOF && ferror( yyin ) ) \ michael@0: YY_FATAL_ERROR( "input in flex scanner failed" ); \ michael@0: result = n; \ michael@0: } \ michael@0: else \ michael@0: { \ michael@0: errno=0; \ michael@0: while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ michael@0: { \ michael@0: if( errno != EINTR) \ michael@0: { \ michael@0: YY_FATAL_ERROR( "input in flex scanner failed" ); \ michael@0: break; \ michael@0: } \ michael@0: errno=0; \ michael@0: clearerr(yyin); \ michael@0: } \ michael@0: }\ michael@0: \ michael@0: michael@0: #endif michael@0: michael@0: /* No semi-colon after return; correct usage is to write "yyterminate();" - michael@0: * we don't want an extra ';' after the "return" because that will cause michael@0: * some compilers to complain about unreachable statements. michael@0: */ michael@0: #ifndef yyterminate michael@0: #define yyterminate() return YY_NULL michael@0: #endif michael@0: michael@0: /* Number of entries by which start-condition stack grows. */ michael@0: #ifndef YY_START_STACK_INCR michael@0: #define YY_START_STACK_INCR 25 michael@0: #endif michael@0: michael@0: /* Report a fatal error. */ michael@0: #ifndef YY_FATAL_ERROR michael@0: #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) michael@0: #endif michael@0: michael@0: /* end tables serialization structures and prototypes */ michael@0: michael@0: /* Default declaration of generated scanner - a define so the user can michael@0: * easily add parameters. michael@0: */ michael@0: #ifndef YY_DECL michael@0: #define YY_DECL_IS_OURS 1 michael@0: michael@0: extern int yylex \ michael@0: (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); michael@0: michael@0: #define YY_DECL int yylex \ michael@0: (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) michael@0: #endif /* !YY_DECL */ michael@0: michael@0: /* Code executed at the beginning of each rule, after yytext and yyleng michael@0: * have been set up. michael@0: */ michael@0: #ifndef YY_USER_ACTION michael@0: #define YY_USER_ACTION michael@0: #endif michael@0: michael@0: /* Code executed at the end of each rule. */ michael@0: #ifndef YY_BREAK michael@0: #define YY_BREAK break; michael@0: #endif michael@0: michael@0: #define YY_RULE_SETUP \ michael@0: YY_USER_ACTION michael@0: michael@0: /** The main scanner function which does all the work. michael@0: */ michael@0: YY_DECL michael@0: { michael@0: register yy_state_type yy_current_state; michael@0: register char *yy_cp, *yy_bp; michael@0: register int yy_act; michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: yylval = yylval_param; michael@0: michael@0: yylloc = yylloc_param; michael@0: michael@0: if ( !yyg->yy_init ) michael@0: { michael@0: yyg->yy_init = 1; michael@0: michael@0: #ifdef YY_USER_INIT michael@0: YY_USER_INIT; michael@0: #endif michael@0: michael@0: if ( ! yyg->yy_start ) michael@0: yyg->yy_start = 1; /* first start state */ michael@0: michael@0: if ( ! yyin ) michael@0: yyin = stdin; michael@0: michael@0: if ( ! yyout ) michael@0: yyout = stdout; michael@0: michael@0: if ( ! YY_CURRENT_BUFFER ) { michael@0: yyensure_buffer_stack (yyscanner); michael@0: YY_CURRENT_BUFFER_LVALUE = michael@0: yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); michael@0: } michael@0: michael@0: yy_load_buffer_state(yyscanner ); michael@0: } michael@0: michael@0: while ( 1 ) /* loops until end-of-file is reached */ michael@0: { michael@0: yy_cp = yyg->yy_c_buf_p; michael@0: michael@0: /* Support of yytext. */ michael@0: *yy_cp = yyg->yy_hold_char; michael@0: michael@0: /* yy_bp points to the position in yy_ch_buf of the start of michael@0: * the current run. michael@0: */ michael@0: yy_bp = yy_cp; michael@0: michael@0: yy_current_state = yyg->yy_start; michael@0: yy_match: michael@0: do michael@0: { michael@0: register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; michael@0: if ( yy_accept[yy_current_state] ) michael@0: { michael@0: yyg->yy_last_accepting_state = yy_current_state; michael@0: yyg->yy_last_accepting_cpos = yy_cp; michael@0: } michael@0: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) michael@0: { michael@0: yy_current_state = (int) yy_def[yy_current_state]; michael@0: if ( yy_current_state >= 443 ) michael@0: yy_c = yy_meta[(unsigned int) yy_c]; michael@0: } michael@0: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; michael@0: ++yy_cp; michael@0: } michael@0: while ( yy_current_state != 442 ); michael@0: yy_cp = yyg->yy_last_accepting_cpos; michael@0: yy_current_state = yyg->yy_last_accepting_state; michael@0: michael@0: yy_find_action: michael@0: yy_act = yy_accept[yy_current_state]; michael@0: michael@0: YY_DO_BEFORE_ACTION; michael@0: michael@0: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) michael@0: { michael@0: yy_size_t yyl; michael@0: for ( yyl = 0; yyl < yyleng; ++yyl ) michael@0: if ( yytext[yyl] == '\n' ) michael@0: michael@0: do{ yylineno++; michael@0: yycolumn=0; michael@0: }while(0) michael@0: ; michael@0: } michael@0: michael@0: do_action: /* This label is used only to access EOF actions. */ michael@0: michael@0: switch ( yy_act ) michael@0: { /* beginning of action switch */ michael@0: case 0: /* must back up */ michael@0: /* undo the effects of YY_DO_BEFORE_ACTION */ michael@0: *yy_cp = yyg->yy_hold_char; michael@0: yy_cp = yyg->yy_last_accepting_cpos; michael@0: yy_current_state = yyg->yy_last_accepting_state; michael@0: goto yy_find_action; michael@0: michael@0: case 1: michael@0: YY_RULE_SETUP michael@0: { return INVARIANT; } michael@0: YY_BREAK michael@0: case 2: michael@0: YY_RULE_SETUP michael@0: { return HIGH_PRECISION; } michael@0: YY_BREAK michael@0: case 3: michael@0: YY_RULE_SETUP michael@0: { return MEDIUM_PRECISION; } michael@0: YY_BREAK michael@0: case 4: michael@0: YY_RULE_SETUP michael@0: { return LOW_PRECISION; } michael@0: YY_BREAK michael@0: case 5: michael@0: YY_RULE_SETUP michael@0: { return PRECISION; } michael@0: YY_BREAK michael@0: case 6: michael@0: YY_RULE_SETUP michael@0: { return ATTRIBUTE; } michael@0: YY_BREAK michael@0: case 7: michael@0: YY_RULE_SETUP michael@0: { return CONST_QUAL; } michael@0: YY_BREAK michael@0: case 8: michael@0: YY_RULE_SETUP michael@0: { return UNIFORM; } michael@0: YY_BREAK michael@0: case 9: michael@0: YY_RULE_SETUP michael@0: { return VARYING; } michael@0: YY_BREAK michael@0: case 10: michael@0: YY_RULE_SETUP michael@0: { return BREAK; } michael@0: YY_BREAK michael@0: case 11: michael@0: YY_RULE_SETUP michael@0: { return CONTINUE; } michael@0: YY_BREAK michael@0: case 12: michael@0: YY_RULE_SETUP michael@0: { return DO; } michael@0: YY_BREAK michael@0: case 13: michael@0: YY_RULE_SETUP michael@0: { return FOR; } michael@0: YY_BREAK michael@0: case 14: michael@0: YY_RULE_SETUP michael@0: { return WHILE; } michael@0: YY_BREAK michael@0: case 15: michael@0: YY_RULE_SETUP michael@0: { return IF; } michael@0: YY_BREAK michael@0: case 16: michael@0: YY_RULE_SETUP michael@0: { return ELSE; } michael@0: YY_BREAK michael@0: case 17: michael@0: YY_RULE_SETUP michael@0: { return IN_QUAL; } michael@0: YY_BREAK michael@0: case 18: michael@0: YY_RULE_SETUP michael@0: { return OUT_QUAL; } michael@0: YY_BREAK michael@0: case 19: michael@0: YY_RULE_SETUP michael@0: { return INOUT_QUAL; } michael@0: YY_BREAK michael@0: case 20: michael@0: YY_RULE_SETUP michael@0: { return FLOAT_TYPE; } michael@0: YY_BREAK michael@0: case 21: michael@0: YY_RULE_SETUP michael@0: { return INT_TYPE; } michael@0: YY_BREAK michael@0: case 22: michael@0: YY_RULE_SETUP michael@0: { return VOID_TYPE; } michael@0: YY_BREAK michael@0: case 23: michael@0: YY_RULE_SETUP michael@0: { return BOOL_TYPE; } michael@0: YY_BREAK michael@0: case 24: michael@0: YY_RULE_SETUP michael@0: { yylval->lex.b = true; return BOOLCONSTANT; } michael@0: YY_BREAK michael@0: case 25: michael@0: YY_RULE_SETUP michael@0: { yylval->lex.b = false; return BOOLCONSTANT; } michael@0: YY_BREAK michael@0: case 26: michael@0: YY_RULE_SETUP michael@0: { return DISCARD; } michael@0: YY_BREAK michael@0: case 27: michael@0: YY_RULE_SETUP michael@0: { return RETURN; } michael@0: YY_BREAK michael@0: case 28: michael@0: YY_RULE_SETUP michael@0: { return MATRIX2; } michael@0: YY_BREAK michael@0: case 29: michael@0: YY_RULE_SETUP michael@0: { return MATRIX3; } michael@0: YY_BREAK michael@0: case 30: michael@0: YY_RULE_SETUP michael@0: { return MATRIX4; } michael@0: YY_BREAK michael@0: case 31: michael@0: YY_RULE_SETUP michael@0: { return VEC2; } michael@0: YY_BREAK michael@0: case 32: michael@0: YY_RULE_SETUP michael@0: { return VEC3; } michael@0: YY_BREAK michael@0: case 33: michael@0: YY_RULE_SETUP michael@0: { return VEC4; } michael@0: YY_BREAK michael@0: case 34: michael@0: YY_RULE_SETUP michael@0: { return IVEC2; } michael@0: YY_BREAK michael@0: case 35: michael@0: YY_RULE_SETUP michael@0: { return IVEC3; } michael@0: YY_BREAK michael@0: case 36: michael@0: YY_RULE_SETUP michael@0: { return IVEC4; } michael@0: YY_BREAK michael@0: case 37: michael@0: YY_RULE_SETUP michael@0: { return BVEC2; } michael@0: YY_BREAK michael@0: case 38: michael@0: YY_RULE_SETUP michael@0: { return BVEC3; } michael@0: YY_BREAK michael@0: case 39: michael@0: YY_RULE_SETUP michael@0: { return BVEC4; } michael@0: YY_BREAK michael@0: case 40: michael@0: YY_RULE_SETUP michael@0: { return SAMPLER2D; } michael@0: YY_BREAK michael@0: case 41: michael@0: YY_RULE_SETUP michael@0: { return SAMPLERCUBE; } michael@0: YY_BREAK michael@0: case 42: michael@0: YY_RULE_SETUP michael@0: { return SAMPLER_EXTERNAL_OES; } michael@0: YY_BREAK michael@0: case 43: michael@0: YY_RULE_SETUP michael@0: { return SAMPLER2DRECT; } michael@0: YY_BREAK michael@0: case 44: michael@0: YY_RULE_SETUP michael@0: { return STRUCT; } michael@0: YY_BREAK michael@0: case 45: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 46: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 47: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 48: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 49: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 50: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 51: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 52: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 53: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 54: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 55: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 56: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 57: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 58: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 59: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 60: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 61: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 62: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 63: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 64: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 65: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 66: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 67: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 68: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 69: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 70: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 71: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 72: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 73: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 74: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 75: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 76: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 77: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 78: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 79: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 80: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 81: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 82: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 83: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 84: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 85: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 86: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 87: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 88: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 89: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 90: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 91: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 92: michael@0: YY_RULE_SETUP michael@0: { return reserved_word(yyscanner); } michael@0: YY_BREAK michael@0: case 93: michael@0: YY_RULE_SETUP michael@0: { michael@0: yylval->lex.string = NewPoolTString(yytext); michael@0: return check_type(yyscanner); michael@0: } michael@0: YY_BREAK michael@0: case 94: michael@0: YY_RULE_SETUP michael@0: { yylval->lex.i = static_cast(strtol(yytext, 0, 0)); return INTCONSTANT; } michael@0: YY_BREAK michael@0: case 95: michael@0: YY_RULE_SETUP michael@0: { yylval->lex.i = static_cast(strtol(yytext, 0, 0)); return INTCONSTANT; } michael@0: YY_BREAK michael@0: case 96: michael@0: YY_RULE_SETUP michael@0: { yylval->lex.i = static_cast(strtol(yytext, 0, 0)); return INTCONSTANT; } michael@0: YY_BREAK michael@0: case 97: michael@0: YY_RULE_SETUP michael@0: { yylval->lex.f = static_cast(atof_dot(yytext)); return FLOATCONSTANT; } michael@0: YY_BREAK michael@0: case 98: michael@0: YY_RULE_SETUP michael@0: { yylval->lex.f = static_cast(atof_dot(yytext)); return FLOATCONSTANT; } michael@0: YY_BREAK michael@0: case 99: michael@0: YY_RULE_SETUP michael@0: { yylval->lex.f = static_cast(atof_dot(yytext)); return FLOATCONSTANT; } michael@0: YY_BREAK michael@0: case 100: michael@0: YY_RULE_SETUP michael@0: { return ADD_ASSIGN; } michael@0: YY_BREAK michael@0: case 101: michael@0: YY_RULE_SETUP michael@0: { return SUB_ASSIGN; } michael@0: YY_BREAK michael@0: case 102: michael@0: YY_RULE_SETUP michael@0: { return MUL_ASSIGN; } michael@0: YY_BREAK michael@0: case 103: michael@0: YY_RULE_SETUP michael@0: { return DIV_ASSIGN; } michael@0: YY_BREAK michael@0: case 104: michael@0: YY_RULE_SETUP michael@0: { return MOD_ASSIGN; } michael@0: YY_BREAK michael@0: case 105: michael@0: YY_RULE_SETUP michael@0: { return LEFT_ASSIGN; } michael@0: YY_BREAK michael@0: case 106: michael@0: YY_RULE_SETUP michael@0: { return RIGHT_ASSIGN; } michael@0: YY_BREAK michael@0: case 107: michael@0: YY_RULE_SETUP michael@0: { return AND_ASSIGN; } michael@0: YY_BREAK michael@0: case 108: michael@0: YY_RULE_SETUP michael@0: { return XOR_ASSIGN; } michael@0: YY_BREAK michael@0: case 109: michael@0: YY_RULE_SETUP michael@0: { return OR_ASSIGN; } michael@0: YY_BREAK michael@0: case 110: michael@0: YY_RULE_SETUP michael@0: { return INC_OP; } michael@0: YY_BREAK michael@0: case 111: michael@0: YY_RULE_SETUP michael@0: { return DEC_OP; } michael@0: YY_BREAK michael@0: case 112: michael@0: YY_RULE_SETUP michael@0: { return AND_OP; } michael@0: YY_BREAK michael@0: case 113: michael@0: YY_RULE_SETUP michael@0: { return OR_OP; } michael@0: YY_BREAK michael@0: case 114: michael@0: YY_RULE_SETUP michael@0: { return XOR_OP; } michael@0: YY_BREAK michael@0: case 115: michael@0: YY_RULE_SETUP michael@0: { return LE_OP; } michael@0: YY_BREAK michael@0: case 116: michael@0: YY_RULE_SETUP michael@0: { return GE_OP; } michael@0: YY_BREAK michael@0: case 117: michael@0: YY_RULE_SETUP michael@0: { return EQ_OP; } michael@0: YY_BREAK michael@0: case 118: michael@0: YY_RULE_SETUP michael@0: { return NE_OP; } michael@0: YY_BREAK michael@0: case 119: michael@0: YY_RULE_SETUP michael@0: { return LEFT_OP; } michael@0: YY_BREAK michael@0: case 120: michael@0: YY_RULE_SETUP michael@0: { return RIGHT_OP; } michael@0: YY_BREAK michael@0: case 121: michael@0: YY_RULE_SETUP michael@0: { return SEMICOLON; } michael@0: YY_BREAK michael@0: case 122: michael@0: YY_RULE_SETUP michael@0: { return LEFT_BRACE; } michael@0: YY_BREAK michael@0: case 123: michael@0: YY_RULE_SETUP michael@0: { return RIGHT_BRACE; } michael@0: YY_BREAK michael@0: case 124: michael@0: YY_RULE_SETUP michael@0: { return COMMA; } michael@0: YY_BREAK michael@0: case 125: michael@0: YY_RULE_SETUP michael@0: { return COLON; } michael@0: YY_BREAK michael@0: case 126: michael@0: YY_RULE_SETUP michael@0: { return EQUAL; } michael@0: YY_BREAK michael@0: case 127: michael@0: YY_RULE_SETUP michael@0: { return LEFT_PAREN; } michael@0: YY_BREAK michael@0: case 128: michael@0: YY_RULE_SETUP michael@0: { return RIGHT_PAREN; } michael@0: YY_BREAK michael@0: case 129: michael@0: YY_RULE_SETUP michael@0: { return LEFT_BRACKET; } michael@0: YY_BREAK michael@0: case 130: michael@0: YY_RULE_SETUP michael@0: { return RIGHT_BRACKET; } michael@0: YY_BREAK michael@0: case 131: michael@0: YY_RULE_SETUP michael@0: { return DOT; } michael@0: YY_BREAK michael@0: case 132: michael@0: YY_RULE_SETUP michael@0: { return BANG; } michael@0: YY_BREAK michael@0: case 133: michael@0: YY_RULE_SETUP michael@0: { return DASH; } michael@0: YY_BREAK michael@0: case 134: michael@0: YY_RULE_SETUP michael@0: { return TILDE; } michael@0: YY_BREAK michael@0: case 135: michael@0: YY_RULE_SETUP michael@0: { return PLUS; } michael@0: YY_BREAK michael@0: case 136: michael@0: YY_RULE_SETUP michael@0: { return STAR; } michael@0: YY_BREAK michael@0: case 137: michael@0: YY_RULE_SETUP michael@0: { return SLASH; } michael@0: YY_BREAK michael@0: case 138: michael@0: YY_RULE_SETUP michael@0: { return PERCENT; } michael@0: YY_BREAK michael@0: case 139: michael@0: YY_RULE_SETUP michael@0: { return LEFT_ANGLE; } michael@0: YY_BREAK michael@0: case 140: michael@0: YY_RULE_SETUP michael@0: { return RIGHT_ANGLE; } michael@0: YY_BREAK michael@0: case 141: michael@0: YY_RULE_SETUP michael@0: { return VERTICAL_BAR; } michael@0: YY_BREAK michael@0: case 142: michael@0: YY_RULE_SETUP michael@0: { return CARET; } michael@0: YY_BREAK michael@0: case 143: michael@0: YY_RULE_SETUP michael@0: { return AMPERSAND; } michael@0: YY_BREAK michael@0: case 144: michael@0: YY_RULE_SETUP michael@0: { return QUESTION; } michael@0: YY_BREAK michael@0: case 145: michael@0: /* rule 145 can match eol */ michael@0: YY_RULE_SETUP michael@0: { } michael@0: YY_BREAK michael@0: case YY_STATE_EOF(INITIAL): michael@0: { yyterminate(); } michael@0: YY_BREAK michael@0: case 146: michael@0: YY_RULE_SETUP michael@0: { assert(false); return 0; } michael@0: YY_BREAK michael@0: case 147: michael@0: YY_RULE_SETUP michael@0: ECHO; michael@0: YY_BREAK michael@0: michael@0: case YY_END_OF_BUFFER: michael@0: { michael@0: /* Amount of text matched not including the EOB char. */ michael@0: int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; michael@0: michael@0: /* Undo the effects of YY_DO_BEFORE_ACTION. */ michael@0: *yy_cp = yyg->yy_hold_char; michael@0: YY_RESTORE_YY_MORE_OFFSET michael@0: michael@0: if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) michael@0: { michael@0: /* We're scanning a new file or input source. It's michael@0: * possible that this happened because the user michael@0: * just pointed yyin at a new source and called michael@0: * yylex(). If so, then we have to assure michael@0: * consistency between YY_CURRENT_BUFFER and our michael@0: * globals. Here is the right place to do so, because michael@0: * this is the first action (other than possibly a michael@0: * back-up) that will match for the new input source. michael@0: */ michael@0: yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; michael@0: } michael@0: michael@0: /* Note that here we test for yy_c_buf_p "<=" to the position michael@0: * of the first EOB in the buffer, since yy_c_buf_p will michael@0: * already have been incremented past the NUL character michael@0: * (since all states make transitions on EOB to the michael@0: * end-of-buffer state). Contrast this with the test michael@0: * in input(). michael@0: */ michael@0: if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) michael@0: { /* This was really a NUL. */ michael@0: yy_state_type yy_next_state; michael@0: michael@0: yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; michael@0: michael@0: yy_current_state = yy_get_previous_state( yyscanner ); michael@0: michael@0: /* Okay, we're now positioned to make the NUL michael@0: * transition. We couldn't have michael@0: * yy_get_previous_state() go ahead and do it michael@0: * for us because it doesn't know how to deal michael@0: * with the possibility of jamming (and we don't michael@0: * want to build jamming into it because then it michael@0: * will run more slowly). michael@0: */ michael@0: michael@0: yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); michael@0: michael@0: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; michael@0: michael@0: if ( yy_next_state ) michael@0: { michael@0: /* Consume the NUL. */ michael@0: yy_cp = ++yyg->yy_c_buf_p; michael@0: yy_current_state = yy_next_state; michael@0: goto yy_match; michael@0: } michael@0: michael@0: else michael@0: { michael@0: yy_cp = yyg->yy_last_accepting_cpos; michael@0: yy_current_state = yyg->yy_last_accepting_state; michael@0: goto yy_find_action; michael@0: } michael@0: } michael@0: michael@0: else switch ( yy_get_next_buffer( yyscanner ) ) michael@0: { michael@0: case EOB_ACT_END_OF_FILE: michael@0: { michael@0: yyg->yy_did_buffer_switch_on_eof = 0; michael@0: michael@0: if ( yywrap(yyscanner ) ) michael@0: { michael@0: /* Note: because we've taken care in michael@0: * yy_get_next_buffer() to have set up michael@0: * yytext, we can now set up michael@0: * yy_c_buf_p so that if some total michael@0: * hoser (like flex itself) wants to michael@0: * call the scanner after we return the michael@0: * YY_NULL, it'll still work - another michael@0: * YY_NULL will get returned. michael@0: */ michael@0: yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; michael@0: michael@0: yy_act = YY_STATE_EOF(YY_START); michael@0: goto do_action; michael@0: } michael@0: michael@0: else michael@0: { michael@0: if ( ! yyg->yy_did_buffer_switch_on_eof ) michael@0: YY_NEW_FILE; michael@0: } michael@0: break; michael@0: } michael@0: michael@0: case EOB_ACT_CONTINUE_SCAN: michael@0: yyg->yy_c_buf_p = michael@0: yyg->yytext_ptr + yy_amount_of_matched_text; michael@0: michael@0: yy_current_state = yy_get_previous_state( yyscanner ); michael@0: michael@0: yy_cp = yyg->yy_c_buf_p; michael@0: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; michael@0: goto yy_match; michael@0: michael@0: case EOB_ACT_LAST_MATCH: michael@0: yyg->yy_c_buf_p = michael@0: &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; michael@0: michael@0: yy_current_state = yy_get_previous_state( yyscanner ); michael@0: michael@0: yy_cp = yyg->yy_c_buf_p; michael@0: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; michael@0: goto yy_find_action; michael@0: } michael@0: break; michael@0: } michael@0: michael@0: default: michael@0: YY_FATAL_ERROR( michael@0: "fatal flex scanner internal error--no action found" ); michael@0: } /* end of action switch */ michael@0: } /* end of scanning one token */ michael@0: } /* end of yylex */ michael@0: michael@0: /* yy_get_next_buffer - try to read in a new buffer michael@0: * michael@0: * Returns a code representing an action: michael@0: * EOB_ACT_LAST_MATCH - michael@0: * EOB_ACT_CONTINUE_SCAN - continue scanning from current position michael@0: * EOB_ACT_END_OF_FILE - end of file michael@0: */ michael@0: static int yy_get_next_buffer (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; michael@0: register char *source = yyg->yytext_ptr; michael@0: register int number_to_move, i; michael@0: int ret_val; michael@0: michael@0: if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) michael@0: YY_FATAL_ERROR( michael@0: "fatal flex scanner internal error--end of buffer missed" ); michael@0: michael@0: if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) michael@0: { /* Don't try to fill the buffer, so this is an EOF. */ michael@0: if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) michael@0: { michael@0: /* We matched a single character, the EOB, so michael@0: * treat this as a final EOF. michael@0: */ michael@0: return EOB_ACT_END_OF_FILE; michael@0: } michael@0: michael@0: else michael@0: { michael@0: /* We matched some text prior to the EOB, first michael@0: * process it. michael@0: */ michael@0: return EOB_ACT_LAST_MATCH; michael@0: } michael@0: } michael@0: michael@0: /* Try to read more data. */ michael@0: michael@0: /* First move last chars to start of buffer. */ michael@0: number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; michael@0: michael@0: for ( i = 0; i < number_to_move; ++i ) michael@0: *(dest++) = *(source++); michael@0: michael@0: if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) michael@0: /* don't do the read, it's not guaranteed to return an EOF, michael@0: * just force an EOF michael@0: */ michael@0: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; michael@0: michael@0: else michael@0: { michael@0: yy_size_t num_to_read = michael@0: YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; michael@0: michael@0: while ( num_to_read <= 0 ) michael@0: { /* Not enough room in the buffer - grow it. */ michael@0: michael@0: /* just a shorter name for the current buffer */ michael@0: YY_BUFFER_STATE b = YY_CURRENT_BUFFER; michael@0: michael@0: int yy_c_buf_p_offset = michael@0: (int) (yyg->yy_c_buf_p - b->yy_ch_buf); michael@0: michael@0: if ( b->yy_is_our_buffer ) michael@0: { michael@0: yy_size_t new_size = b->yy_buf_size * 2; michael@0: michael@0: if ( new_size <= 0 ) michael@0: b->yy_buf_size += b->yy_buf_size / 8; michael@0: else michael@0: b->yy_buf_size *= 2; michael@0: michael@0: b->yy_ch_buf = (char *) michael@0: /* Include room in for 2 EOB chars. */ michael@0: yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); michael@0: } michael@0: else michael@0: /* Can't grow it, we don't own it. */ michael@0: b->yy_ch_buf = 0; michael@0: michael@0: if ( ! b->yy_ch_buf ) michael@0: YY_FATAL_ERROR( michael@0: "fatal error - scanner input buffer overflow" ); michael@0: michael@0: yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; michael@0: michael@0: num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - michael@0: number_to_move - 1; michael@0: michael@0: } michael@0: michael@0: if ( num_to_read > YY_READ_BUF_SIZE ) michael@0: num_to_read = YY_READ_BUF_SIZE; michael@0: michael@0: /* Read in more data. */ michael@0: YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), michael@0: yyg->yy_n_chars, num_to_read ); michael@0: michael@0: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; michael@0: } michael@0: michael@0: if ( yyg->yy_n_chars == 0 ) michael@0: { michael@0: if ( number_to_move == YY_MORE_ADJ ) michael@0: { michael@0: ret_val = EOB_ACT_END_OF_FILE; michael@0: yyrestart(yyin ,yyscanner); michael@0: } michael@0: michael@0: else michael@0: { michael@0: ret_val = EOB_ACT_LAST_MATCH; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = michael@0: YY_BUFFER_EOF_PENDING; michael@0: } michael@0: } michael@0: michael@0: else michael@0: ret_val = EOB_ACT_CONTINUE_SCAN; michael@0: michael@0: if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { michael@0: /* Extend the array by 50%, plus the number we really need. */ michael@0: yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); michael@0: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); michael@0: if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) michael@0: YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); michael@0: } michael@0: michael@0: yyg->yy_n_chars += number_to_move; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; michael@0: michael@0: yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; michael@0: michael@0: return ret_val; michael@0: } michael@0: michael@0: /* yy_get_previous_state - get the state just before the EOB char was reached */ michael@0: michael@0: static yy_state_type yy_get_previous_state (yyscan_t yyscanner) michael@0: { michael@0: register yy_state_type yy_current_state; michael@0: register char *yy_cp; michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: yy_current_state = yyg->yy_start; michael@0: michael@0: for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) michael@0: { michael@0: register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); michael@0: if ( yy_accept[yy_current_state] ) michael@0: { michael@0: yyg->yy_last_accepting_state = yy_current_state; michael@0: yyg->yy_last_accepting_cpos = yy_cp; michael@0: } michael@0: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) michael@0: { michael@0: yy_current_state = (int) yy_def[yy_current_state]; michael@0: if ( yy_current_state >= 443 ) michael@0: yy_c = yy_meta[(unsigned int) yy_c]; michael@0: } michael@0: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; michael@0: } michael@0: michael@0: return yy_current_state; michael@0: } michael@0: michael@0: /* yy_try_NUL_trans - try to make a transition on the NUL character michael@0: * michael@0: * synopsis michael@0: * next_state = yy_try_NUL_trans( current_state ); michael@0: */ michael@0: static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) michael@0: { michael@0: register int yy_is_jam; michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ michael@0: register char *yy_cp = yyg->yy_c_buf_p; michael@0: michael@0: register YY_CHAR yy_c = 1; michael@0: if ( yy_accept[yy_current_state] ) michael@0: { michael@0: yyg->yy_last_accepting_state = yy_current_state; michael@0: yyg->yy_last_accepting_cpos = yy_cp; michael@0: } michael@0: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) michael@0: { michael@0: yy_current_state = (int) yy_def[yy_current_state]; michael@0: if ( yy_current_state >= 443 ) michael@0: yy_c = yy_meta[(unsigned int) yy_c]; michael@0: } michael@0: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; michael@0: yy_is_jam = (yy_current_state == 442); michael@0: michael@0: return yy_is_jam ? 0 : yy_current_state; michael@0: } michael@0: michael@0: #ifndef YY_NO_INPUT michael@0: #ifdef __cplusplus michael@0: static int yyinput (yyscan_t yyscanner) michael@0: #else michael@0: static int input (yyscan_t yyscanner) michael@0: #endif michael@0: michael@0: { michael@0: int c; michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: *yyg->yy_c_buf_p = yyg->yy_hold_char; michael@0: michael@0: if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) michael@0: { michael@0: /* yy_c_buf_p now points to the character we want to return. michael@0: * If this occurs *before* the EOB characters, then it's a michael@0: * valid NUL; if not, then we've hit the end of the buffer. michael@0: */ michael@0: if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) michael@0: /* This was really a NUL. */ michael@0: *yyg->yy_c_buf_p = '\0'; michael@0: michael@0: else michael@0: { /* need more input */ michael@0: yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; michael@0: ++yyg->yy_c_buf_p; michael@0: michael@0: switch ( yy_get_next_buffer( yyscanner ) ) michael@0: { michael@0: case EOB_ACT_LAST_MATCH: michael@0: /* This happens because yy_g_n_b() michael@0: * sees that we've accumulated a michael@0: * token and flags that we need to michael@0: * try matching the token before michael@0: * proceeding. But for input(), michael@0: * there's no matching to consider. michael@0: * So convert the EOB_ACT_LAST_MATCH michael@0: * to EOB_ACT_END_OF_FILE. michael@0: */ michael@0: michael@0: /* Reset buffer status. */ michael@0: yyrestart(yyin ,yyscanner); michael@0: michael@0: /*FALLTHROUGH*/ michael@0: michael@0: case EOB_ACT_END_OF_FILE: michael@0: { michael@0: if ( yywrap(yyscanner ) ) michael@0: return EOF; michael@0: michael@0: if ( ! yyg->yy_did_buffer_switch_on_eof ) michael@0: YY_NEW_FILE; michael@0: #ifdef __cplusplus michael@0: return yyinput(yyscanner); michael@0: #else michael@0: return input(yyscanner); michael@0: #endif michael@0: } michael@0: michael@0: case EOB_ACT_CONTINUE_SCAN: michael@0: yyg->yy_c_buf_p = yyg->yytext_ptr + offset; michael@0: break; michael@0: } michael@0: } michael@0: } michael@0: michael@0: c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ michael@0: *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ michael@0: yyg->yy_hold_char = *++yyg->yy_c_buf_p; michael@0: michael@0: if ( c == '\n' ) michael@0: michael@0: do{ yylineno++; michael@0: yycolumn=0; michael@0: }while(0) michael@0: ; michael@0: michael@0: return c; michael@0: } michael@0: #endif /* ifndef YY_NO_INPUT */ michael@0: michael@0: /** Immediately switch to a different input stream. michael@0: * @param input_file A readable stream. michael@0: * @param yyscanner The scanner object. michael@0: * @note This function does not reset the start condition to @c INITIAL . michael@0: */ michael@0: void yyrestart (FILE * input_file , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: if ( ! YY_CURRENT_BUFFER ){ michael@0: yyensure_buffer_stack (yyscanner); michael@0: YY_CURRENT_BUFFER_LVALUE = michael@0: yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); michael@0: } michael@0: michael@0: yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); michael@0: yy_load_buffer_state(yyscanner ); michael@0: } michael@0: michael@0: /** Switch to a different input buffer. michael@0: * @param new_buffer The new input buffer. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: /* TODO. We should be able to replace this entire function body michael@0: * with michael@0: * yypop_buffer_state(); michael@0: * yypush_buffer_state(new_buffer); michael@0: */ michael@0: yyensure_buffer_stack (yyscanner); michael@0: if ( YY_CURRENT_BUFFER == new_buffer ) michael@0: return; michael@0: michael@0: if ( YY_CURRENT_BUFFER ) michael@0: { michael@0: /* Flush out information for old buffer. */ michael@0: *yyg->yy_c_buf_p = yyg->yy_hold_char; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; michael@0: } michael@0: michael@0: YY_CURRENT_BUFFER_LVALUE = new_buffer; michael@0: yy_load_buffer_state(yyscanner ); michael@0: michael@0: /* We don't actually know whether we did this switch during michael@0: * EOF (yywrap()) processing, but the only time this flag michael@0: * is looked at is after yywrap() is called, so it's safe michael@0: * to go ahead and always set it. michael@0: */ michael@0: yyg->yy_did_buffer_switch_on_eof = 1; michael@0: } michael@0: michael@0: static void yy_load_buffer_state (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; michael@0: yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; michael@0: yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; michael@0: yyg->yy_hold_char = *yyg->yy_c_buf_p; michael@0: } michael@0: michael@0: /** Allocate and initialize an input buffer state. michael@0: * @param file A readable stream. michael@0: * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. michael@0: * @param yyscanner The scanner object. michael@0: * @return the allocated buffer state. michael@0: */ michael@0: YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) michael@0: { michael@0: YY_BUFFER_STATE b; michael@0: michael@0: b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); michael@0: if ( ! b ) michael@0: YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); michael@0: michael@0: b->yy_buf_size = size; michael@0: michael@0: /* yy_ch_buf has to be 2 characters longer than the size given because michael@0: * we need to put in 2 end-of-buffer characters. michael@0: */ michael@0: b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner ); michael@0: if ( ! b->yy_ch_buf ) michael@0: YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); michael@0: michael@0: b->yy_is_our_buffer = 1; michael@0: michael@0: yy_init_buffer(b,file ,yyscanner); michael@0: michael@0: return b; michael@0: } michael@0: michael@0: /** Destroy the buffer. michael@0: * @param b a buffer created with yy_create_buffer() michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: if ( ! b ) michael@0: return; michael@0: michael@0: if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ michael@0: YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; michael@0: michael@0: if ( b->yy_is_our_buffer ) michael@0: yyfree((void *) b->yy_ch_buf ,yyscanner ); michael@0: michael@0: yyfree((void *) b ,yyscanner ); michael@0: } michael@0: michael@0: /* Initializes or reinitializes a buffer. michael@0: * This function is sometimes called more than once on the same buffer, michael@0: * such as during a yyrestart() or at EOF. michael@0: */ michael@0: static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) michael@0: michael@0: { michael@0: int oerrno = errno; michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: yy_flush_buffer(b ,yyscanner); michael@0: michael@0: b->yy_input_file = file; michael@0: b->yy_fill_buffer = 1; michael@0: michael@0: /* If b is the current buffer, then yy_init_buffer was _probably_ michael@0: * called from yyrestart() or through yy_get_next_buffer. michael@0: * In that case, we don't want to reset the lineno or column. michael@0: */ michael@0: if (b != YY_CURRENT_BUFFER){ michael@0: b->yy_bs_lineno = 1; michael@0: b->yy_bs_column = 0; michael@0: } michael@0: michael@0: b->yy_is_interactive = 0; michael@0: michael@0: errno = oerrno; michael@0: } michael@0: michael@0: /** Discard all buffered characters. On the next scan, YY_INPUT will be called. michael@0: * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: if ( ! b ) michael@0: return; michael@0: michael@0: b->yy_n_chars = 0; michael@0: michael@0: /* We always need two end-of-buffer characters. The first causes michael@0: * a transition to the end-of-buffer state. The second causes michael@0: * a jam in that state. michael@0: */ michael@0: b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; michael@0: b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; michael@0: michael@0: b->yy_buf_pos = &b->yy_ch_buf[0]; michael@0: michael@0: b->yy_at_bol = 1; michael@0: b->yy_buffer_status = YY_BUFFER_NEW; michael@0: michael@0: if ( b == YY_CURRENT_BUFFER ) michael@0: yy_load_buffer_state(yyscanner ); michael@0: } michael@0: michael@0: /** Pushes the new state onto the stack. The new state becomes michael@0: * the current state. This function will allocate the stack michael@0: * if necessary. michael@0: * @param new_buffer The new state. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: if (new_buffer == NULL) michael@0: return; michael@0: michael@0: yyensure_buffer_stack(yyscanner); michael@0: michael@0: /* This block is copied from yy_switch_to_buffer. */ michael@0: if ( YY_CURRENT_BUFFER ) michael@0: { michael@0: /* Flush out information for old buffer. */ michael@0: *yyg->yy_c_buf_p = yyg->yy_hold_char; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; michael@0: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; michael@0: } michael@0: michael@0: /* Only push if top exists. Otherwise, replace top. */ michael@0: if (YY_CURRENT_BUFFER) michael@0: yyg->yy_buffer_stack_top++; michael@0: YY_CURRENT_BUFFER_LVALUE = new_buffer; michael@0: michael@0: /* copied from yy_switch_to_buffer. */ michael@0: yy_load_buffer_state(yyscanner ); michael@0: yyg->yy_did_buffer_switch_on_eof = 1; michael@0: } michael@0: michael@0: /** Removes and deletes the top of the stack, if present. michael@0: * The next element becomes the new top. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: void yypop_buffer_state (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: if (!YY_CURRENT_BUFFER) michael@0: return; michael@0: michael@0: yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); michael@0: YY_CURRENT_BUFFER_LVALUE = NULL; michael@0: if (yyg->yy_buffer_stack_top > 0) michael@0: --yyg->yy_buffer_stack_top; michael@0: michael@0: if (YY_CURRENT_BUFFER) { michael@0: yy_load_buffer_state(yyscanner ); michael@0: yyg->yy_did_buffer_switch_on_eof = 1; michael@0: } michael@0: } michael@0: michael@0: /* Allocates the stack if it does not exist. michael@0: * Guarantees space for at least one push. michael@0: */ michael@0: static void yyensure_buffer_stack (yyscan_t yyscanner) michael@0: { michael@0: yy_size_t num_to_alloc; michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: if (!yyg->yy_buffer_stack) { michael@0: michael@0: /* First allocation is just for 2 elements, since we don't know if this michael@0: * scanner will even need a stack. We use 2 instead of 1 to avoid an michael@0: * immediate realloc on the next call. michael@0: */ michael@0: num_to_alloc = 1; michael@0: yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc michael@0: (num_to_alloc * sizeof(struct yy_buffer_state*) michael@0: , yyscanner); michael@0: if ( ! yyg->yy_buffer_stack ) michael@0: YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); michael@0: michael@0: memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); michael@0: michael@0: yyg->yy_buffer_stack_max = num_to_alloc; michael@0: yyg->yy_buffer_stack_top = 0; michael@0: return; michael@0: } michael@0: michael@0: if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ michael@0: michael@0: /* Increase the buffer to prepare for a possible push. */ michael@0: int grow_size = 8 /* arbitrary grow size */; michael@0: michael@0: num_to_alloc = yyg->yy_buffer_stack_max + grow_size; michael@0: yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc michael@0: (yyg->yy_buffer_stack, michael@0: num_to_alloc * sizeof(struct yy_buffer_state*) michael@0: , yyscanner); michael@0: if ( ! yyg->yy_buffer_stack ) michael@0: YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); michael@0: michael@0: /* zero only the new slots.*/ michael@0: memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); michael@0: yyg->yy_buffer_stack_max = num_to_alloc; michael@0: } michael@0: } michael@0: michael@0: /** Setup the input buffer state to scan directly from a user-specified character buffer. michael@0: * @param base the character buffer michael@0: * @param size the size in bytes of the character buffer michael@0: * @param yyscanner The scanner object. michael@0: * @return the newly allocated buffer state object. michael@0: */ michael@0: YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) michael@0: { michael@0: YY_BUFFER_STATE b; michael@0: michael@0: if ( size < 2 || michael@0: base[size-2] != YY_END_OF_BUFFER_CHAR || michael@0: base[size-1] != YY_END_OF_BUFFER_CHAR ) michael@0: /* They forgot to leave room for the EOB's. */ michael@0: return 0; michael@0: michael@0: b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); michael@0: if ( ! b ) michael@0: YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); michael@0: michael@0: b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ michael@0: b->yy_buf_pos = b->yy_ch_buf = base; michael@0: b->yy_is_our_buffer = 0; michael@0: b->yy_input_file = 0; michael@0: b->yy_n_chars = b->yy_buf_size; michael@0: b->yy_is_interactive = 0; michael@0: b->yy_at_bol = 1; michael@0: b->yy_fill_buffer = 0; michael@0: b->yy_buffer_status = YY_BUFFER_NEW; michael@0: michael@0: yy_switch_to_buffer(b ,yyscanner ); michael@0: michael@0: return b; michael@0: } michael@0: michael@0: /** Setup the input buffer state to scan a string. The next call to yylex() will michael@0: * scan from a @e copy of @a str. michael@0: * @param yystr a NUL-terminated string to scan michael@0: * @param yyscanner The scanner object. michael@0: * @return the newly allocated buffer state object. michael@0: * @note If you want to scan bytes that may contain NUL values, then use michael@0: * yy_scan_bytes() instead. michael@0: */ michael@0: YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) michael@0: { michael@0: michael@0: return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); michael@0: } michael@0: michael@0: /** Setup the input buffer state to scan the given bytes. The next call to yylex() will michael@0: * scan from a @e copy of @a bytes. michael@0: * @param bytes the byte buffer to scan michael@0: * @param len the number of bytes in the buffer pointed to by @a bytes. michael@0: * @param yyscanner The scanner object. michael@0: * @return the newly allocated buffer state object. michael@0: */ michael@0: YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) michael@0: { michael@0: YY_BUFFER_STATE b; michael@0: char *buf; michael@0: yy_size_t n, i; michael@0: michael@0: /* Get memory for full buffer, including space for trailing EOB's. */ michael@0: n = _yybytes_len + 2; michael@0: buf = (char *) yyalloc(n ,yyscanner ); michael@0: if ( ! buf ) michael@0: YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); michael@0: michael@0: for ( i = 0; i < _yybytes_len; ++i ) michael@0: buf[i] = yybytes[i]; michael@0: michael@0: buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; michael@0: michael@0: b = yy_scan_buffer(buf,n ,yyscanner); michael@0: if ( ! b ) michael@0: YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); michael@0: michael@0: /* It's okay to grow etc. this buffer, and we should throw it michael@0: * away when we're done. michael@0: */ michael@0: b->yy_is_our_buffer = 1; michael@0: michael@0: return b; michael@0: } michael@0: michael@0: #ifndef YY_EXIT_FAILURE michael@0: #define YY_EXIT_FAILURE 2 michael@0: #endif michael@0: michael@0: static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) michael@0: { michael@0: (void) fprintf( stderr, "%s\n", msg ); michael@0: exit( YY_EXIT_FAILURE ); michael@0: } michael@0: michael@0: /* Redefine yyless() so it works in section 3 code. */ michael@0: michael@0: #undef yyless michael@0: #define yyless(n) \ michael@0: do \ michael@0: { \ michael@0: /* Undo effects of setting up yytext. */ \ michael@0: int yyless_macro_arg = (n); \ michael@0: YY_LESS_LINENO(yyless_macro_arg);\ michael@0: yytext[yyleng] = yyg->yy_hold_char; \ michael@0: yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ michael@0: yyg->yy_hold_char = *yyg->yy_c_buf_p; \ michael@0: *yyg->yy_c_buf_p = '\0'; \ michael@0: yyleng = yyless_macro_arg; \ michael@0: } \ michael@0: while ( 0 ) michael@0: michael@0: /* Accessor methods (get/set functions) to struct members. */ michael@0: michael@0: /** Get the user-defined data for this scanner. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: return yyextra; michael@0: } michael@0: michael@0: /** Get the current line number. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: int yyget_lineno (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: if (! YY_CURRENT_BUFFER) michael@0: return 0; michael@0: michael@0: return yylineno; michael@0: } michael@0: michael@0: /** Get the current column number. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: int yyget_column (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: if (! YY_CURRENT_BUFFER) michael@0: return 0; michael@0: michael@0: return yycolumn; michael@0: } michael@0: michael@0: /** Get the input stream. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: FILE *yyget_in (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: return yyin; michael@0: } michael@0: michael@0: /** Get the output stream. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: FILE *yyget_out (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: return yyout; michael@0: } michael@0: michael@0: /** Get the length of the current token. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: yy_size_t yyget_leng (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: return yyleng; michael@0: } michael@0: michael@0: /** Get the current token. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: michael@0: char *yyget_text (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: return yytext; michael@0: } michael@0: michael@0: /** Set the user-defined data. This data is never touched by the scanner. michael@0: * @param user_defined The data to be associated with this scanner. michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: yyextra = user_defined ; michael@0: } michael@0: michael@0: /** Set the current line number. michael@0: * @param line_number michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: void yyset_lineno (int line_number , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: /* lineno is only valid if an input buffer exists. */ michael@0: if (! YY_CURRENT_BUFFER ) michael@0: yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); michael@0: michael@0: yylineno = line_number; michael@0: } michael@0: michael@0: /** Set the current column. michael@0: * @param line_number michael@0: * @param yyscanner The scanner object. michael@0: */ michael@0: void yyset_column (int column_no , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: /* column is only valid if an input buffer exists. */ michael@0: if (! YY_CURRENT_BUFFER ) michael@0: yy_fatal_error( "yyset_column called with no buffer" , yyscanner); michael@0: michael@0: yycolumn = column_no; michael@0: } michael@0: michael@0: /** Set the input stream. This does not discard the current michael@0: * input buffer. michael@0: * @param in_str A readable stream. michael@0: * @param yyscanner The scanner object. michael@0: * @see yy_switch_to_buffer michael@0: */ michael@0: void yyset_in (FILE * in_str , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: yyin = in_str ; michael@0: } michael@0: michael@0: void yyset_out (FILE * out_str , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: yyout = out_str ; michael@0: } michael@0: michael@0: int yyget_debug (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: return yy_flex_debug; michael@0: } michael@0: michael@0: void yyset_debug (int bdebug , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: yy_flex_debug = bdebug ; michael@0: } michael@0: michael@0: /* Accessor methods for yylval and yylloc */ michael@0: michael@0: YYSTYPE * yyget_lval (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: return yylval; michael@0: } michael@0: michael@0: void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: yylval = yylval_param; michael@0: } michael@0: michael@0: YYLTYPE *yyget_lloc (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: return yylloc; michael@0: } michael@0: michael@0: void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: yylloc = yylloc_param; michael@0: } michael@0: michael@0: /* User-visible API */ michael@0: michael@0: /* yylex_init is special because it creates the scanner itself, so it is michael@0: * the ONLY reentrant function that doesn't take the scanner as the last argument. michael@0: * That's why we explicitly handle the declaration, instead of using our macros. michael@0: */ michael@0: michael@0: int yylex_init(yyscan_t* ptr_yy_globals) michael@0: michael@0: { michael@0: if (ptr_yy_globals == NULL){ michael@0: errno = EINVAL; michael@0: return 1; michael@0: } michael@0: michael@0: *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); michael@0: michael@0: if (*ptr_yy_globals == NULL){ michael@0: errno = ENOMEM; michael@0: return 1; michael@0: } michael@0: michael@0: /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ michael@0: memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); michael@0: michael@0: return yy_init_globals ( *ptr_yy_globals ); michael@0: } michael@0: michael@0: /* yylex_init_extra has the same functionality as yylex_init, but follows the michael@0: * convention of taking the scanner as the last argument. Note however, that michael@0: * this is a *pointer* to a scanner, as it will be allocated by this call (and michael@0: * is the reason, too, why this function also must handle its own declaration). michael@0: * The user defined value in the first argument will be available to yyalloc in michael@0: * the yyextra field. michael@0: */ michael@0: michael@0: int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) michael@0: michael@0: { michael@0: struct yyguts_t dummy_yyguts; michael@0: michael@0: yyset_extra (yy_user_defined, &dummy_yyguts); michael@0: michael@0: if (ptr_yy_globals == NULL){ michael@0: errno = EINVAL; michael@0: return 1; michael@0: } michael@0: michael@0: *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); michael@0: michael@0: if (*ptr_yy_globals == NULL){ michael@0: errno = ENOMEM; michael@0: return 1; michael@0: } michael@0: michael@0: /* By setting to 0xAA, we expose bugs in michael@0: yy_init_globals. Leave at 0x00 for releases. */ michael@0: memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); michael@0: michael@0: yyset_extra (yy_user_defined, *ptr_yy_globals); michael@0: michael@0: return yy_init_globals ( *ptr_yy_globals ); michael@0: } michael@0: michael@0: static int yy_init_globals (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: /* Initialization is the same as for the non-reentrant scanner. michael@0: * This function is called from yylex_destroy(), so don't allocate here. michael@0: */ michael@0: michael@0: yyg->yy_buffer_stack = 0; michael@0: yyg->yy_buffer_stack_top = 0; michael@0: yyg->yy_buffer_stack_max = 0; michael@0: yyg->yy_c_buf_p = (char *) 0; michael@0: yyg->yy_init = 0; michael@0: yyg->yy_start = 0; michael@0: michael@0: yyg->yy_start_stack_ptr = 0; michael@0: yyg->yy_start_stack_depth = 0; michael@0: yyg->yy_start_stack = NULL; michael@0: michael@0: /* Defined in main.c */ michael@0: #ifdef YY_STDINIT michael@0: yyin = stdin; michael@0: yyout = stdout; michael@0: #else michael@0: yyin = (FILE *) 0; michael@0: yyout = (FILE *) 0; michael@0: #endif michael@0: michael@0: /* For future reference: Set errno on error, since we are called by michael@0: * yylex_init() michael@0: */ michael@0: return 0; michael@0: } michael@0: michael@0: /* yylex_destroy is for both reentrant and non-reentrant scanners. */ michael@0: int yylex_destroy (yyscan_t yyscanner) michael@0: { michael@0: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; michael@0: michael@0: /* Pop the buffer stack, destroying each element. */ michael@0: while(YY_CURRENT_BUFFER){ michael@0: yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); michael@0: YY_CURRENT_BUFFER_LVALUE = NULL; michael@0: yypop_buffer_state(yyscanner); michael@0: } michael@0: michael@0: /* Destroy the stack itself. */ michael@0: yyfree(yyg->yy_buffer_stack ,yyscanner); michael@0: yyg->yy_buffer_stack = NULL; michael@0: michael@0: /* Destroy the start condition stack. */ michael@0: yyfree(yyg->yy_start_stack ,yyscanner ); michael@0: yyg->yy_start_stack = NULL; michael@0: michael@0: /* Reset the globals. This is important in a non-reentrant scanner so the next time michael@0: * yylex() is called, initialization will occur. */ michael@0: yy_init_globals( yyscanner); michael@0: michael@0: /* Destroy the main struct (reentrant only). */ michael@0: yyfree ( yyscanner , yyscanner ); michael@0: yyscanner = NULL; michael@0: return 0; michael@0: } michael@0: michael@0: /* michael@0: * Internal utility routines. michael@0: */ michael@0: michael@0: #ifndef yytext_ptr michael@0: static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) michael@0: { michael@0: register int i; michael@0: for ( i = 0; i < n; ++i ) michael@0: s1[i] = s2[i]; michael@0: } michael@0: #endif michael@0: michael@0: #ifdef YY_NEED_STRLEN michael@0: static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) michael@0: { michael@0: register int n; michael@0: for ( n = 0; s[n]; ++n ) michael@0: ; michael@0: michael@0: return n; michael@0: } michael@0: #endif michael@0: michael@0: void *yyalloc (yy_size_t size , yyscan_t yyscanner) michael@0: { michael@0: return (void *) malloc( size ); michael@0: } michael@0: michael@0: void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) michael@0: { michael@0: /* The cast to (char *) in the following accommodates both michael@0: * implementations that use char* generic pointers, and those michael@0: * that use void* generic pointers. It works with the latter michael@0: * because both ANSI C and C++ allow castless assignment from michael@0: * any pointer type to void*, and deal with argument conversions michael@0: * as though doing an assignment. michael@0: */ michael@0: return (void *) realloc( (char *) ptr, size ); michael@0: } michael@0: michael@0: void yyfree (void * ptr , yyscan_t yyscanner) michael@0: { michael@0: free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ michael@0: } michael@0: michael@0: #define YYTABLES_NAME "yytables" michael@0: michael@0: yy_size_t string_input(char* buf, yy_size_t max_size, yyscan_t yyscanner) { michael@0: pp::Token token; michael@0: yyget_extra(yyscanner)->preprocessor.lex(&token); michael@0: yy_size_t len = token.type == pp::Token::LAST ? 0 : token.text.size(); michael@0: if (len < max_size) michael@0: memcpy(buf, token.text.c_str(), len); michael@0: yyset_column(token.location.file,yyscanner); michael@0: yyset_lineno(token.location.line,yyscanner); michael@0: michael@0: if (len >= max_size) michael@0: YY_FATAL_ERROR("Input buffer overflow"); michael@0: else if (len > 0) michael@0: buf[len++] = ' '; michael@0: return len; michael@0: } michael@0: michael@0: int check_type(yyscan_t yyscanner) { michael@0: struct yyguts_t* yyg = (struct yyguts_t*) yyscanner; michael@0: michael@0: int token = IDENTIFIER; michael@0: TSymbol* symbol = yyextra->symbolTable.find(yytext); michael@0: if (symbol && symbol->isVariable()) { michael@0: TVariable* variable = static_cast(symbol); michael@0: if (variable->isUserType()) michael@0: token = TYPE_NAME; michael@0: } michael@0: yylval->lex.symbol = symbol; michael@0: return token; michael@0: } michael@0: michael@0: int reserved_word(yyscan_t yyscanner) { michael@0: struct yyguts_t* yyg = (struct yyguts_t*) yyscanner; michael@0: michael@0: yyextra->error(*yylloc, "Illegal use of reserved word", yytext, ""); michael@0: yyextra->recover(); michael@0: return 0; michael@0: } michael@0: michael@0: int glslang_initialize(TParseContext* context) { michael@0: yyscan_t scanner = NULL; michael@0: if (yylex_init_extra(context,&scanner)) michael@0: return 1; michael@0: michael@0: context->scanner = scanner; michael@0: return 0; michael@0: } michael@0: michael@0: int glslang_finalize(TParseContext* context) { michael@0: yyscan_t scanner = context->scanner; michael@0: if (scanner == NULL) return 0; michael@0: michael@0: context->scanner = NULL; michael@0: yylex_destroy(scanner); michael@0: michael@0: return 0; michael@0: } michael@0: michael@0: int glslang_scan(size_t count, const char* const string[], const int length[], michael@0: TParseContext* context) { michael@0: yyrestart(NULL,context->scanner); michael@0: yyset_column(0,context->scanner); michael@0: yyset_lineno(1,context->scanner); michael@0: michael@0: // Initialize preprocessor. michael@0: if (!context->preprocessor.init(count, string, length)) michael@0: return 1; michael@0: michael@0: // Define extension macros. michael@0: const TExtensionBehavior& extBehavior = context->extensionBehavior(); michael@0: for (TExtensionBehavior::const_iterator iter = extBehavior.begin(); michael@0: iter != extBehavior.end(); ++iter) { michael@0: context->preprocessor.predefineMacro(iter->first.c_str(), 1); michael@0: } michael@0: if (context->fragmentPrecisionHigh) michael@0: context->preprocessor.predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1); michael@0: michael@0: return 0; michael@0: } michael@0: