Last active
June 17, 2025 06:36
-
-
Save mike2718/406a9507b9c905b3528a985644089f3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/cmake/search-dirs.cmake b/cmake/search-dirs.cmake | |
| index 0eacd81a2..009e849a5 100644 | |
| --- a/cmake/search-dirs.cmake | |
| +++ b/cmake/search-dirs.cmake | |
| @@ -2,34 +2,35 @@ | |
| # libs. You can specify the path also using -D<VAR> from commandline. | |
| # The location, where the bison executable can be found | |
| -#SET (BISON_EXECUTABLE "${CMAKE_SOURCE_DIR}/../win_flex_bison-latest/win_bison.exe") | |
| +SET (BISON_EXECUTABLE "${CMAKE_SOURCE_DIR}/../win_flex_bison-latest/win_bison.exe") | |
| -# The location, where to find the crypto++ header-files | |
| -#SET (BOOSTROOT "${CMAKE_SOURCE_DIR}/../boost_1_70_0") | |
| +# The location, where to find the boost header-files | |
| +SET (BOOSTROOT "${CMAKE_SOURCE_DIR}/../boost_1_86_0") | |
| # The location, where to find the crypto++ header-files | |
| -#SET (CRYTOPP_HEADER_PATH "${CMAKE_SOURCE_DIR}/../cryptopp") | |
| +SET (CRYTOPP_HEADER_PATH "${CMAKE_SOURCE_DIR}/../cryptopp890") | |
| +SET (CRYPTOPP_INCLUDE_PREFIX "${CMAKE_SOURCE_DIR}/../cryptopp890") | |
| # The location, where the linkable output of crypto++ compilation can be found. | |
| -#SET (CRYTOPP_LIB_SEARCH_PATH "${CMAKE_SOURCE_DIR}/../cryptopp/Win32/Output/Debug") | |
| +SET (CRYTOPP_LIB_SEARCH_PATH "${CMAKE_SOURCE_DIR}/../cryptopp890/Win32/Output/Release") | |
| # The location, where the flex executable can be found | |
| -#SET (FLEX_EXECUTABLE "${CMAKE_SOURCE_DIR}/../win_flex_bison-latest/win_flex.exe") | |
| +SET (FLEX_EXECUTABLE "${CMAKE_SOURCE_DIR}/../win_flex_bison-latest/win_flex.exe") | |
| # The location, where the headers of libgeoip can be found. | |
| -#SET (GEOIP_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/../geoip-api-c-master/libGeoIP") | |
| +SET (GEOIP_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/../geoip-api-c-master/libGeoIP") | |
| # The location, where to find libpng headers. | |
| -#SET (PNG_HEADER_DIR "${CMAKE_SOURCE_DIR}/../lpng1626") | |
| +SET (PNG_HEADER_DIR "${CMAKE_SOURCE_DIR}/../lpng1648") | |
| # The location, where to find libpng. | |
| -#SET (PNG_LIB_DIR "${CMAKE_SOURCE_DIR}/../lpng1626/projects/vstudio/Debug") | |
| +SET (PNG_LIB_DIR "${CMAKE_SOURCE_DIR}/../lpng1648/projects/vstudio/Release") | |
| # The location, where you extracted wx-sources | |
| -#SET (wxWidgets_ROOT_DIR "${CMAKE_SOURCE_DIR}/../wxWidgets") | |
| +SET (wxWidgets_ROOT_DIR "${CMAKE_SOURCE_DIR}/../wxWidgets-3.0.5") | |
| # The location, where to find zlib. | |
| -#SET (ZLIB_ROOT "${CMAKE_SOURCE_DIR}/../zlib-1.2.8") | |
| +SET (ZLIB_ROOT "${CMAKE_SOURCE_DIR}/../zlib-1.3.1") | |
| if (BISON_EXECUTABLE) | |
| set (SEARCH_DIR_BISON ${BISON_EXECUTABLE}) | |
| diff --git a/src/IP2Country.cpp b/src/IP2Country.cpp | |
| index 7504c089f..63879b0c6 100644 | |
| --- a/src/IP2Country.cpp | |
| +++ b/src/IP2Country.cpp | |
| @@ -40,6 +40,7 @@ | |
| // Contact: mjames@gmail.com | |
| // | |
| +#include "IP2Country.h" | |
| #include "config.h" // Needed for ENABLE_IP2COUNTRY | |
| #ifdef _MSC_VER | |
| @@ -67,8 +68,7 @@ | |
| #include <wx/intl.h> | |
| #include <wx/image.h> | |
| -#include <GeoIP.h> | |
| -#include "IP2Country.h" | |
| +//#include <GeoIP.h> | |
| CIP2Country::CIP2Country(const wxString& configDir) | |
| { | |
| diff --git a/src/IPFilterScanner.cpp b/src/IPFilterScanner.cpp | |
| index 9859bd588..63d58a9a5 100644 | |
| --- a/src/IPFilterScanner.cpp | |
| +++ b/src/IPFilterScanner.cpp | |
| @@ -8,11 +8,17 @@ | |
| #define yy_create_buffer yyip_create_buffer | |
| #define yy_delete_buffer yyip_delete_buffer | |
| -#define yy_flex_debug yyip_flex_debug | |
| +#define yy_scan_buffer yyip_scan_buffer | |
| +#define yy_scan_string yyip_scan_string | |
| +#define yy_scan_bytes yyip_scan_bytes | |
| #define yy_init_buffer yyip_init_buffer | |
| #define yy_flush_buffer yyip_flush_buffer | |
| #define yy_load_buffer_state yyip_load_buffer_state | |
| #define yy_switch_to_buffer yyip_switch_to_buffer | |
| +#define yypush_buffer_state yyippush_buffer_state | |
| +#define yypop_buffer_state yyippop_buffer_state | |
| +#define yyensure_buffer_stack yyipensure_buffer_stack | |
| +#define yy_flex_debug yyip_flex_debug | |
| #define yyin yyipin | |
| #define yyleng yyipleng | |
| #define yylex yyiplex | |
| @@ -27,12 +33,246 @@ | |
| #define FLEX_SCANNER | |
| #define YY_FLEX_MAJOR_VERSION 2 | |
| -#define YY_FLEX_MINOR_VERSION 5 | |
| -#define YY_FLEX_SUBMINOR_VERSION 39 | |
| +#define YY_FLEX_MINOR_VERSION 6 | |
| +#define YY_FLEX_SUBMINOR_VERSION 4 | |
| #if YY_FLEX_SUBMINOR_VERSION > 0 | |
| #define FLEX_BETA | |
| #endif | |
| +#ifdef yy_create_buffer | |
| +#define yyip_create_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_create_buffer yyip_create_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_delete_buffer | |
| +#define yyip_delete_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_delete_buffer yyip_delete_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_scan_buffer | |
| +#define yyip_scan_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_scan_buffer yyip_scan_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_scan_string | |
| +#define yyip_scan_string_ALREADY_DEFINED | |
| +#else | |
| +#define yy_scan_string yyip_scan_string | |
| +#endif | |
| + | |
| +#ifdef yy_scan_bytes | |
| +#define yyip_scan_bytes_ALREADY_DEFINED | |
| +#else | |
| +#define yy_scan_bytes yyip_scan_bytes | |
| +#endif | |
| + | |
| +#ifdef yy_init_buffer | |
| +#define yyip_init_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_init_buffer yyip_init_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_flush_buffer | |
| +#define yyip_flush_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_flush_buffer yyip_flush_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_load_buffer_state | |
| +#define yyip_load_buffer_state_ALREADY_DEFINED | |
| +#else | |
| +#define yy_load_buffer_state yyip_load_buffer_state | |
| +#endif | |
| + | |
| +#ifdef yy_switch_to_buffer | |
| +#define yyip_switch_to_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_switch_to_buffer yyip_switch_to_buffer | |
| +#endif | |
| + | |
| +#ifdef yypush_buffer_state | |
| +#define yyippush_buffer_state_ALREADY_DEFINED | |
| +#else | |
| +#define yypush_buffer_state yyippush_buffer_state | |
| +#endif | |
| + | |
| +#ifdef yypop_buffer_state | |
| +#define yyippop_buffer_state_ALREADY_DEFINED | |
| +#else | |
| +#define yypop_buffer_state yyippop_buffer_state | |
| +#endif | |
| + | |
| +#ifdef yyensure_buffer_stack | |
| +#define yyipensure_buffer_stack_ALREADY_DEFINED | |
| +#else | |
| +#define yyensure_buffer_stack yyipensure_buffer_stack | |
| +#endif | |
| + | |
| +#ifdef yylex | |
| +#define yyiplex_ALREADY_DEFINED | |
| +#else | |
| +#define yylex yyiplex | |
| +#endif | |
| + | |
| +#ifdef yyrestart | |
| +#define yyiprestart_ALREADY_DEFINED | |
| +#else | |
| +#define yyrestart yyiprestart | |
| +#endif | |
| + | |
| +#ifdef yylex_init | |
| +#define yyiplex_init_ALREADY_DEFINED | |
| +#else | |
| +#define yylex_init yyiplex_init | |
| +#endif | |
| + | |
| +#ifdef yylex_init_extra | |
| +#define yyiplex_init_extra_ALREADY_DEFINED | |
| +#else | |
| +#define yylex_init_extra yyiplex_init_extra | |
| +#endif | |
| + | |
| +#ifdef yylex_destroy | |
| +#define yyiplex_destroy_ALREADY_DEFINED | |
| +#else | |
| +#define yylex_destroy yyiplex_destroy | |
| +#endif | |
| + | |
| +#ifdef yyget_debug | |
| +#define yyipget_debug_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_debug yyipget_debug | |
| +#endif | |
| + | |
| +#ifdef yyset_debug | |
| +#define yyipset_debug_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_debug yyipset_debug | |
| +#endif | |
| + | |
| +#ifdef yyget_extra | |
| +#define yyipget_extra_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_extra yyipget_extra | |
| +#endif | |
| + | |
| +#ifdef yyset_extra | |
| +#define yyipset_extra_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_extra yyipset_extra | |
| +#endif | |
| + | |
| +#ifdef yyget_in | |
| +#define yyipget_in_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_in yyipget_in | |
| +#endif | |
| + | |
| +#ifdef yyset_in | |
| +#define yyipset_in_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_in yyipset_in | |
| +#endif | |
| + | |
| +#ifdef yyget_out | |
| +#define yyipget_out_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_out yyipget_out | |
| +#endif | |
| + | |
| +#ifdef yyset_out | |
| +#define yyipset_out_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_out yyipset_out | |
| +#endif | |
| + | |
| +#ifdef yyget_leng | |
| +#define yyipget_leng_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_leng yyipget_leng | |
| +#endif | |
| + | |
| +#ifdef yyget_text | |
| +#define yyipget_text_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_text yyipget_text | |
| +#endif | |
| + | |
| +#ifdef yyget_lineno | |
| +#define yyipget_lineno_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_lineno yyipget_lineno | |
| +#endif | |
| + | |
| +#ifdef yyset_lineno | |
| +#define yyipset_lineno_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_lineno yyipset_lineno | |
| +#endif | |
| + | |
| +#ifdef yywrap | |
| +#define yyipwrap_ALREADY_DEFINED | |
| +#else | |
| +#define yywrap yyipwrap | |
| +#endif | |
| + | |
| +#ifdef yyalloc | |
| +#define yyipalloc_ALREADY_DEFINED | |
| +#else | |
| +#define yyalloc yyipalloc | |
| +#endif | |
| + | |
| +#ifdef yyrealloc | |
| +#define yyiprealloc_ALREADY_DEFINED | |
| +#else | |
| +#define yyrealloc yyiprealloc | |
| +#endif | |
| + | |
| +#ifdef yyfree | |
| +#define yyipfree_ALREADY_DEFINED | |
| +#else | |
| +#define yyfree yyipfree | |
| +#endif | |
| + | |
| +#ifdef yytext | |
| +#define yyiptext_ALREADY_DEFINED | |
| +#else | |
| +#define yytext yyiptext | |
| +#endif | |
| + | |
| +#ifdef yyleng | |
| +#define yyipleng_ALREADY_DEFINED | |
| +#else | |
| +#define yyleng yyipleng | |
| +#endif | |
| + | |
| +#ifdef yyin | |
| +#define yyipin_ALREADY_DEFINED | |
| +#else | |
| +#define yyin yyipin | |
| +#endif | |
| + | |
| +#ifdef yyout | |
| +#define yyipout_ALREADY_DEFINED | |
| +#else | |
| +#define yyout yyipout | |
| +#endif | |
| + | |
| +#ifdef yy_flex_debug | |
| +#define yyip_flex_debug_ALREADY_DEFINED | |
| +#else | |
| +#define yy_flex_debug yyip_flex_debug | |
| +#endif | |
| + | |
| +#ifdef yylineno | |
| +#define yyiplineno_ALREADY_DEFINED | |
| +#else | |
| +#define yylineno yyiplineno | |
| +#endif | |
| + | |
| /* First, we deal with platform-specific or compiler-specific issues. */ | |
| /* begin standard C headers. */ | |
| @@ -74,6 +314,7 @@ typedef unsigned char flex_uint8_t; | |
| typedef unsigned short int flex_uint16_t; | |
| typedef unsigned int flex_uint32_t; | |
| +#include <stdint.h> | |
| /* Limits of integral types. */ | |
| #ifndef INT8_MIN | |
| #define INT8_MIN (-128) | |
| @@ -103,65 +344,61 @@ typedef unsigned int flex_uint32_t; | |
| #define UINT32_MAX (4294967295U) | |
| #endif | |
| +#ifndef SIZE_MAX | |
| +#define SIZE_MAX (~(size_t)0) | |
| +#endif | |
| + | |
| #endif /* ! C99 */ | |
| #endif /* ! FLEXINT_H */ | |
| -#ifdef __cplusplus | |
| - | |
| -/* The "const" storage-class-modifier is valid. */ | |
| -#define YY_USE_CONST | |
| +/* begin standard C++ headers. */ | |
| -#else /* ! __cplusplus */ | |
| - | |
| -/* C99 requires __STDC__ to be defined as 1. */ | |
| -#if defined (__STDC__) | |
| - | |
| -#define YY_USE_CONST | |
| - | |
| -#endif /* defined (__STDC__) */ | |
| -#endif /* ! __cplusplus */ | |
| - | |
| -#ifdef YY_USE_CONST | |
| +/* TODO: this is always defined, so inline it */ | |
| #define yyconst const | |
| + | |
| +#if defined(__GNUC__) && __GNUC__ >= 3 | |
| +#define yynoreturn __attribute__((__noreturn__)) | |
| #else | |
| -#define yyconst | |
| +#define yynoreturn | |
| #endif | |
| /* Returned upon end-of-file. */ | |
| #define YY_NULL 0 | |
| -/* Promotes a possibly negative, possibly signed char to an unsigned | |
| - * integer for use as an array index. If the signed char is negative, | |
| - * we want to instead treat it as an 8-bit unsigned char, hence the | |
| - * double cast. | |
| +/* Promotes a possibly negative, possibly signed char to an | |
| + * integer in range [0..255] for use as an array index. | |
| */ | |
| -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) | |
| +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) | |
| /* Enter a start condition. This macro really ought to take a parameter, | |
| * but we do it the disgusting crufty way forced on us by the ()-less | |
| * definition of BEGIN. | |
| */ | |
| #define BEGIN (yy_start) = 1 + 2 * | |
| - | |
| /* Translate the current start state into a value that can be later handed | |
| * to BEGIN to return to the state. The YYSTATE alias is for lex | |
| * compatibility. | |
| */ | |
| #define YY_START (((yy_start) - 1) / 2) | |
| #define YYSTATE YY_START | |
| - | |
| /* Action number for EOF rule of a given start state. */ | |
| #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | |
| - | |
| /* Special action meaning "start processing a new file". */ | |
| -#define YY_NEW_FILE yyiprestart(yyipin ) | |
| - | |
| +#define YY_NEW_FILE yyrestart( yyin ) | |
| #define YY_END_OF_BUFFER_CHAR 0 | |
| /* Size of default input buffer. */ | |
| #ifndef YY_BUF_SIZE | |
| +#ifdef __ia64__ | |
| +/* On IA-64, the buffer size is 16k, not 8k. | |
| + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. | |
| + * Ditto for the __ia64__ case accordingly. | |
| + */ | |
| +#define YY_BUF_SIZE 32768 | |
| +#else | |
| #define YY_BUF_SIZE 16384 | |
| +#endif /* __ia64__ */ | |
| #endif | |
| /* The state buf must be large enough to hold one state per character in the main buffer. | |
| @@ -178,9 +415,9 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; | |
| typedef size_t yy_size_t; | |
| #endif | |
| -extern yy_size_t yyipleng; | |
| +extern int yyleng; | |
| -extern FILE *yyipin, *yyipout; | |
| +extern FILE *yyin, *yyout; | |
| #define EOB_ACT_CONTINUE_SCAN 0 | |
| #define EOB_ACT_END_OF_FILE 1 | |
| @@ -193,16 +430,15 @@ extern FILE *yyipin, *yyipout; | |
| #define yyless(n) \ | |
| do \ | |
| { \ | |
| - /* Undo effects of setting up yyiptext. */ \ | |
| + /* Undo effects of setting up yytext. */ \ | |
| int yyless_macro_arg = (n); \ | |
| YY_LESS_LINENO(yyless_macro_arg);\ | |
| *yy_cp = (yy_hold_char); \ | |
| YY_RESTORE_YY_MORE_OFFSET \ | |
| (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ | |
| - YY_DO_BEFORE_ACTION; /* set up yyiptext again */ \ | |
| + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ | |
| } \ | |
| while ( 0 ) | |
| - | |
| #define unput(c) yyunput( c, (yytext_ptr) ) | |
| #ifndef YY_STRUCT_YY_BUFFER_STATE | |
| @@ -217,12 +453,12 @@ struct yy_buffer_state | |
| /* Size of input buffer in bytes, not including room for EOB | |
| * characters. | |
| */ | |
| - yy_size_t yy_buf_size; | |
| + int yy_buf_size; | |
| /* Number of characters read into yy_ch_buf, not including EOB | |
| * characters. | |
| */ | |
| - yy_size_t yy_n_chars; | |
| + int yy_n_chars; | |
| /* Whether we "own" the buffer - i.e., we know we created it, | |
| * and can realloc() it to grow it, and should free() it to | |
| @@ -262,8 +498,8 @@ struct yy_buffer_state | |
| * possible backing-up. | |
| * | |
| * When we actually see the EOF, we change the status to "new" | |
| - * (via yyiprestart()), so that the user can continue scanning by | |
| - * just pointing yyipin at a new input file. | |
| + * (via yyrestart()), so that the user can continue scanning by | |
| + * just pointing yyin at a new input file. | |
| */ | |
| #define YY_BUFFER_EOF_PENDING 2 | |
| @@ -273,7 +509,7 @@ struct yy_buffer_state | |
| /* Stack of input buffers. */ | |
| static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ | |
| static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ | |
| -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |
| +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ | |
| /* We provide macros for accessing buffer states in case in the | |
| * future we want to put the buffer states in a more general | |
| @@ -284,106 +520,101 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |
| #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ | |
| ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ | |
| : NULL) | |
| - | |
| /* Same as previous macro, but useful when we know that the buffer stack is not | |
| * NULL or when we need an lvalue. For internal use only. | |
| */ | |
| #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] | |
| -/* yy_hold_char holds the character lost when yyiptext is formed. */ | |
| +/* yy_hold_char holds the character lost when yytext is formed. */ | |
| static char yy_hold_char; | |
| -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ | |
| -yy_size_t yyipleng; | |
| +static size_t yy_n_chars; /* number of characters read into yy_ch_buf */ | |
| +int yyleng; | |
| /* Points to current character in buffer. */ | |
| -static char *yy_c_buf_p = (char *) 0; | |
| +static char *yy_c_buf_p = NULL; | |
| static int yy_init = 0; /* whether we need to initialize */ | |
| static int yy_start = 0; /* start state number */ | |
| -/* Flag which is used to allow yyipwrap()'s to do buffer switches | |
| - * instead of setting up a fresh yyipin. A bit of a hack ... | |
| +/* Flag which is used to allow yywrap()'s to do buffer switches | |
| + * instead of setting up a fresh yyin. A bit of a hack ... | |
| */ | |
| static int yy_did_buffer_switch_on_eof; | |
| -void yyiprestart (FILE *input_file ); | |
| -void yyip_switch_to_buffer (YY_BUFFER_STATE new_buffer ); | |
| -YY_BUFFER_STATE yyip_create_buffer (FILE *file,int size ); | |
| -void yyip_delete_buffer (YY_BUFFER_STATE b ); | |
| -void yyip_flush_buffer (YY_BUFFER_STATE b ); | |
| -void yyippush_buffer_state (YY_BUFFER_STATE new_buffer ); | |
| -void yyippop_buffer_state (void ); | |
| - | |
| -static void yyipensure_buffer_stack (void ); | |
| -static void yyip_load_buffer_state (void ); | |
| -static void yyip_init_buffer (YY_BUFFER_STATE b,FILE *file ); | |
| +void yyrestart ( FILE *input_file ); | |
| +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); | |
| +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); | |
| +void yy_delete_buffer ( YY_BUFFER_STATE b ); | |
| +void yy_flush_buffer ( YY_BUFFER_STATE b ); | |
| +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); | |
| +void yypop_buffer_state ( void ); | |
| -#define YY_FLUSH_BUFFER yyip_flush_buffer(YY_CURRENT_BUFFER ) | |
| +static void yyensure_buffer_stack ( void ); | |
| +static void yy_load_buffer_state ( void ); | |
| +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); | |
| +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) | |
| -YY_BUFFER_STATE yyip_scan_buffer (char *base,yy_size_t size ); | |
| -YY_BUFFER_STATE yyip_scan_string (yyconst char *yy_str ); | |
| -YY_BUFFER_STATE yyip_scan_bytes (yyconst char *bytes,yy_size_t len ); | |
| +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); | |
| +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); | |
| +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); | |
| -void *yyipalloc (yy_size_t ); | |
| -void *yyiprealloc (void *,yy_size_t ); | |
| -void yyipfree (void * ); | |
| - | |
| -#define yy_new_buffer yyip_create_buffer | |
| +void *yyalloc ( yy_size_t ); | |
| +void *yyrealloc ( void *, yy_size_t ); | |
| +void yyfree ( void * ); | |
| +#define yy_new_buffer yy_create_buffer | |
| #define yy_set_interactive(is_interactive) \ | |
| { \ | |
| if ( ! YY_CURRENT_BUFFER ){ \ | |
| - yyipensure_buffer_stack (); \ | |
| + yyensure_buffer_stack (); \ | |
| YY_CURRENT_BUFFER_LVALUE = \ | |
| - yyip_create_buffer(yyipin,YY_BUF_SIZE ); \ | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); \ | |
| } \ | |
| YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ | |
| } | |
| - | |
| #define yy_set_bol(at_bol) \ | |
| { \ | |
| if ( ! YY_CURRENT_BUFFER ){\ | |
| - yyipensure_buffer_stack (); \ | |
| + yyensure_buffer_stack (); \ | |
| YY_CURRENT_BUFFER_LVALUE = \ | |
| - yyip_create_buffer(yyipin,YY_BUF_SIZE ); \ | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); \ | |
| } \ | |
| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ | |
| } | |
| - | |
| #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | |
| /* Begin user sect3 */ | |
| -#define yyipwrap() 1 | |
| +#define yyipwrap() (/*CONSTCOND*/1) | |
| #define YY_SKIP_YYWRAP | |
| +typedef flex_uint8_t YY_CHAR; | |
| -typedef unsigned char YY_CHAR; | |
| - | |
| -FILE *yyipin = (FILE *) 0, *yyipout = (FILE *) 0; | |
| +FILE *yyin = NULL, *yyout = NULL; | |
| typedef int yy_state_type; | |
| -extern int yyiplineno; | |
| - | |
| -int yyiplineno = 1; | |
| +extern int yylineno; | |
| +int yylineno = 1; | |
| -extern char *yyiptext; | |
| -#define yytext_ptr yyiptext | |
| +extern char *yytext; | |
| +#ifdef yytext_ptr | |
| +#undef yytext_ptr | |
| +#endif | |
| +#define yytext_ptr yytext | |
| -static yy_state_type yy_get_previous_state (void ); | |
| -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); | |
| -static int yy_get_next_buffer (void ); | |
| -static void yy_fatal_error (yyconst char msg[] ); | |
| +static yy_state_type yy_get_previous_state ( void ); | |
| +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); | |
| +static int yy_get_next_buffer ( void ); | |
| +static void yynoreturn yy_fatal_error ( const char* msg ); | |
| /* Done after the current pattern has been matched and before the | |
| - * corresponding action - sets up yyiptext. | |
| + * corresponding action - sets up yytext. | |
| */ | |
| #define YY_DO_BEFORE_ACTION \ | |
| (yytext_ptr) = yy_bp; \ | |
| - yyipleng = (size_t) (yy_cp - yy_bp); \ | |
| + yyleng = (int) (yy_cp - yy_bp); \ | |
| (yy_hold_char) = *yy_cp; \ | |
| *yy_cp = '\0'; \ | |
| (yy_c_buf_p) = yy_cp; | |
| - | |
| #define YY_NUM_RULES 6 | |
| #define YY_END_OF_BUFFER 7 | |
| /* This struct is not used in this scanner, | |
| @@ -393,7 +624,7 @@ struct yy_trans_info | |
| flex_int32_t yy_verify; | |
| flex_int32_t yy_nxt; | |
| }; | |
| -static yyconst flex_int16_t yy_accept[169] = | |
| +static const flex_int16_t yy_accept[169] = | |
| { 0, | |
| 0, 0, 7, 6, 6, 4, 5, 5, 2, 5, | |
| 5, 0, 4, 0, 0, 0, 2, 0, 2, 2, | |
| @@ -415,7 +646,7 @@ static yyconst flex_int16_t yy_accept[169] = | |
| 1, 1, 1, 1, 1, 1, 1, 0 | |
| } ; | |
| -static yyconst flex_int32_t yy_ec[256] = | |
| +static const YY_CHAR yy_ec[256] = | |
| { 0, | |
| 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, | |
| 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, | |
| @@ -447,12 +678,12 @@ static yyconst flex_int32_t yy_ec[256] = | |
| 1, 1, 1, 1, 1 | |
| } ; | |
| -static yyconst flex_int32_t yy_meta[10] = | |
| +static const YY_CHAR yy_meta[10] = | |
| { 0, | |
| 1, 1, 2, 1, 1, 1, 1, 1, 1 | |
| } ; | |
| -static yyconst flex_int16_t yy_base[173] = | |
| +static const flex_int16_t yy_base[173] = | |
| { 0, | |
| 0, 3, 231, 232, 11, 232, 221, 14, 220, 17, | |
| 25, 0, 232, 219, 0, 0, 218, 0, 217, 33, | |
| @@ -475,7 +706,7 @@ static yyconst flex_int16_t yy_base[173] = | |
| 27, 0 | |
| } ; | |
| -static yyconst flex_int16_t yy_def[173] = | |
| +static const flex_int16_t yy_def[173] = | |
| { 0, | |
| 169, 168, 168, 168, 168, 168, 170, 168, 171, 170, | |
| 170, 5, 168, 170, 11, 8, 171, 10, 171, 171, | |
| @@ -498,7 +729,7 @@ static yyconst flex_int16_t yy_def[173] = | |
| 168, 168 | |
| } ; | |
| -static yyconst flex_int16_t yy_nxt[242] = | |
| +static const flex_int16_t yy_nxt[242] = | |
| { 0, | |
| 130, 5, 6, 7, 8, 6, 9, 7, 7, 7, | |
| 10, 11, 12, 13, 14, 16, 13, 17, 14, 14, | |
| @@ -529,7 +760,7 @@ static yyconst flex_int16_t yy_nxt[242] = | |
| 168 | |
| } ; | |
| -static yyconst flex_int16_t yy_chk[242] = | |
| +static const flex_int16_t yy_chk[242] = | |
| { 0, | |
| 172, 1, 1, 2, 2, 2, 2, 2, 2, 2, | |
| 2, 2, 5, 5, 8, 8, 8, 8, 8, 8, | |
| @@ -563,8 +794,8 @@ static yyconst flex_int16_t yy_chk[242] = | |
| static yy_state_type yy_last_accepting_state; | |
| static char *yy_last_accepting_cpos; | |
| -extern int yyip_flex_debug; | |
| -int yyip_flex_debug = 0; | |
| +extern int yy_flex_debug; | |
| +int yy_flex_debug = 0; | |
| /* The intent behind this definition is that it'll catch | |
| * any uses of REJECT which flex missed. | |
| @@ -573,7 +804,7 @@ int yyip_flex_debug = 0; | |
| #define yymore() yymore_used_but_not_detected | |
| #define YY_MORE_ADJ 0 | |
| #define YY_RESTORE_YY_MORE_OFFSET | |
| -char *yyiptext; | |
| +char *yytext; | |
| #line 1 "./IPFilterScanner.l" | |
| #line 2 "./IPFilterScanner.l" | |
| // | |
| @@ -672,7 +903,8 @@ static bool ScanInt(const char * buf, uint32 & a) | |
| return true; | |
| } | |
| -#line 676 "IPFilterScanner.cpp" | |
| +#line 906 "IPFilterScanner.cpp" | |
| +#line 907 "IPFilterScanner.cpp" | |
| #define INITIAL 0 | |
| @@ -688,36 +920,36 @@ static bool ScanInt(const char * buf, uint32 & a) | |
| #define YY_EXTRA_TYPE void * | |
| #endif | |
| -static int yy_init_globals (void ); | |
| +static int yy_init_globals ( void ); | |
| /* Accessor methods to globals. | |
| These are made visible to non-reentrant scanners for convenience. */ | |
| -int yyiplex_destroy (void ); | |
| +int yylex_destroy ( void ); | |
| -int yyipget_debug (void ); | |
| +int yyget_debug ( void ); | |
| -void yyipset_debug (int debug_flag ); | |
| +void yyset_debug ( int debug_flag ); | |
| -YY_EXTRA_TYPE yyipget_extra (void ); | |
| +YY_EXTRA_TYPE yyget_extra ( void ); | |
| -void yyipset_extra (YY_EXTRA_TYPE user_defined ); | |
| +void yyset_extra ( YY_EXTRA_TYPE user_defined ); | |
| -FILE *yyipget_in (void ); | |
| +FILE *yyget_in ( void ); | |
| -void yyipset_in (FILE * in_str ); | |
| +void yyset_in ( FILE * _in_str ); | |
| -FILE *yyipget_out (void ); | |
| +FILE *yyget_out ( void ); | |
| -void yyipset_out (FILE * out_str ); | |
| +void yyset_out ( FILE * _out_str ); | |
| -yy_size_t yyipget_leng (void ); | |
| + int yyget_leng ( void ); | |
| -char *yyipget_text (void ); | |
| +char *yyget_text ( void ); | |
| -int yyipget_lineno (void ); | |
| +int yyget_lineno ( void ); | |
| -void yyipset_lineno (int line_number ); | |
| +void yyset_lineno ( int _line_number ); | |
| /* Macros after this point can all be overridden by user definitions in | |
| * section 1. | |
| @@ -725,33 +957,41 @@ void yyipset_lineno (int line_number ); | |
| #ifndef YY_SKIP_YYWRAP | |
| #ifdef __cplusplus | |
| -extern "C" int yyipwrap (void ); | |
| +extern "C" int yywrap ( void ); | |
| #else | |
| -extern int yyipwrap (void ); | |
| +extern int yywrap ( void ); | |
| #endif | |
| #endif | |
| +#ifndef YY_NO_UNPUT | |
| + | |
| +#endif | |
| + | |
| #ifndef yytext_ptr | |
| -static void yy_flex_strncpy (char *,yyconst char *,int ); | |
| +static void yy_flex_strncpy ( char *, const char *, int ); | |
| #endif | |
| #ifdef YY_NEED_STRLEN | |
| -static int yy_flex_strlen (yyconst char * ); | |
| +static int yy_flex_strlen ( const char * ); | |
| #endif | |
| #ifndef YY_NO_INPUT | |
| - | |
| #ifdef __cplusplus | |
| -static int yyinput (void ); | |
| +static int yyinput ( void ); | |
| #else | |
| -static int input (void ); | |
| +static int input ( void ); | |
| #endif | |
| #endif | |
| /* Amount of stuff to slurp up with each read. */ | |
| #ifndef YY_READ_BUF_SIZE | |
| +#ifdef __ia64__ | |
| +/* On IA-64, the buffer size is 16k, not 8k */ | |
| +#define YY_READ_BUF_SIZE 16384 | |
| +#else | |
| #define YY_READ_BUF_SIZE 8192 | |
| +#endif /* __ia64__ */ | |
| #endif | |
| /* Copy whatever the last rule matched to the standard output. */ | |
| @@ -759,7 +999,7 @@ static int input (void ); | |
| /* This used to be an fputs(), but since the string might contain NUL's, | |
| * we now use fwrite(). | |
| */ | |
| -#define ECHO do { if (fwrite( yyiptext, yyipleng, 1, yyipout )) {} } while (0) | |
| +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) | |
| #endif | |
| /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | |
| @@ -770,20 +1010,20 @@ static int input (void ); | |
| if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ | |
| { \ | |
| int c = '*'; \ | |
| - size_t n; \ | |
| + int n; \ | |
| for ( n = 0; n < max_size && \ | |
| - (c = getc( yyipin )) != EOF && c != '\n'; ++n ) \ | |
| + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ | |
| buf[n] = (char) c; \ | |
| if ( c == '\n' ) \ | |
| buf[n++] = (char) c; \ | |
| - if ( c == EOF && ferror( yyipin ) ) \ | |
| + if ( c == EOF && ferror( yyin ) ) \ | |
| YY_FATAL_ERROR( "input in flex scanner failed" ); \ | |
| result = n; \ | |
| } \ | |
| else \ | |
| { \ | |
| errno=0; \ | |
| - while ( (result = fread(buf, 1, max_size, yyipin))==0 && ferror(yyipin)) \ | |
| + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ | |
| { \ | |
| if( errno != EINTR) \ | |
| { \ | |
| @@ -791,7 +1031,7 @@ static int input (void ); | |
| break; \ | |
| } \ | |
| errno=0; \ | |
| - clearerr(yyipin); \ | |
| + clearerr(yyin); \ | |
| } \ | |
| }\ | |
| \ | |
| @@ -824,12 +1064,12 @@ static int input (void ); | |
| #ifndef YY_DECL | |
| #define YY_DECL_IS_OURS 1 | |
| -extern int yyiplex (void); | |
| +extern int yylex (void); | |
| -#define YY_DECL int yyiplex (void) | |
| +#define YY_DECL int yylex (void) | |
| #endif /* !YY_DECL */ | |
| -/* Code executed at the beginning of each rule, after yyiptext and yyipleng | |
| +/* Code executed at the beginning of each rule, after yytext and yyleng | |
| * have been set up. | |
| */ | |
| #ifndef YY_USER_ACTION | |
| @@ -838,22 +1078,22 @@ extern int yyiplex (void); | |
| /* Code executed at the end of each rule. */ | |
| #ifndef YY_BREAK | |
| -#define YY_BREAK break; | |
| +#define YY_BREAK /*LINTED*/break; | |
| #endif | |
| #define YY_RULE_SETUP \ | |
| - if ( yyipleng > 0 ) \ | |
| + if ( yyleng > 0 ) \ | |
| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | |
| - (yyiptext[yyipleng - 1] == '\n'); \ | |
| + (yytext[yyleng - 1] == '\n'); \ | |
| YY_USER_ACTION | |
| /** The main scanner function which does all the work. | |
| */ | |
| YY_DECL | |
| { | |
| - register yy_state_type yy_current_state; | |
| - register char *yy_cp, *yy_bp; | |
| - register int yy_act; | |
| + yy_state_type yy_current_state; | |
| + char *yy_cp, *yy_bp; | |
| + int yy_act; | |
| if ( !(yy_init) ) | |
| { | |
| @@ -866,32 +1106,32 @@ YY_DECL | |
| if ( ! (yy_start) ) | |
| (yy_start) = 1; /* first start state */ | |
| - if ( ! yyipin ) | |
| - yyipin = stdin; | |
| + if ( ! yyin ) | |
| + yyin = stdin; | |
| - if ( ! yyipout ) | |
| - yyipout = stdout; | |
| + if ( ! yyout ) | |
| + yyout = stdout; | |
| if ( ! YY_CURRENT_BUFFER ) { | |
| - yyipensure_buffer_stack (); | |
| + yyensure_buffer_stack (); | |
| YY_CURRENT_BUFFER_LVALUE = | |
| - yyip_create_buffer(yyipin,YY_BUF_SIZE ); | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); | |
| } | |
| - yyip_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| } | |
| { | |
| #line 106 "./IPFilterScanner.l" | |
| -#line 889 "IPFilterScanner.cpp" | |
| +#line 1128 "IPFilterScanner.cpp" | |
| - while ( 1 ) /* loops until end-of-file is reached */ | |
| + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ | |
| { | |
| yy_cp = (yy_c_buf_p); | |
| - /* Support of yyiptext. */ | |
| + /* Support of yytext. */ | |
| *yy_cp = (yy_hold_char); | |
| /* yy_bp points to the position in yy_ch_buf of the start of | |
| @@ -904,7 +1144,7 @@ YY_DECL | |
| yy_match: | |
| do | |
| { | |
| - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; | |
| + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -914,9 +1154,9 @@ yy_match: | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 169 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| ++yy_cp; | |
| } | |
| while ( yy_base[yy_current_state] != 232 ); | |
| @@ -950,7 +1190,7 @@ YY_RULE_SETUP | |
| /* PeerGuardian filter line | |
| <IPStart> - <IPEnd> , <AccessLevel> , <Description> | |
| */ | |
| - char * ip1 = yyiptext; | |
| + char * ip1 = yytext; | |
| char * ip2 = strchr(ip1 + 7, '-') + 1; | |
| char * acc = strchr(ip2 + 7, ',') + 1; | |
| char * dsc = strchr(acc + 1, ',') + 1; | |
| @@ -977,14 +1217,14 @@ YY_RULE_SETUP | |
| /* AntiP2P filter line | |
| <Description> : <IPStart> - <IPEnd> | |
| */ | |
| - char * ip1 = strrchr(yyiptext, ':'); | |
| + char * ip1 = strrchr(yytext, ':'); | |
| *ip1++ = 0; // remove : and terminate comment | |
| char * ip2 = strchr(ip1 + 7, '-') + 1; | |
| if (!ScanIP(ip1, IPStart) || !ScanIP(ip2, IPEnd)) { | |
| yyip_Bad++; | |
| } else { | |
| IPLevel = 0; | |
| - IPDescription = yyiptext; | |
| + IPDescription = yytext; | |
| return 1; | |
| } | |
| } | |
| @@ -1003,7 +1243,7 @@ YY_RULE_SETUP | |
| { | |
| /* Bad line */ | |
| yyip_Bad++; | |
| - AddDebugLogLineN(logIPFilter, CFormat(wxT("error in line %d: %s")) % yyip_Line % wxString(char2unicode(yyiptext))); | |
| + AddDebugLogLineN(logIPFilter, CFormat(wxT("error in line %d: %s")) % yyip_Line % wxString(char2unicode(yytext))); | |
| } | |
| YY_BREAK | |
| case 6: | |
| @@ -1011,7 +1251,7 @@ YY_RULE_SETUP | |
| #line 155 "./IPFilterScanner.l" | |
| ECHO; | |
| YY_BREAK | |
| -#line 1015 "IPFilterScanner.cpp" | |
| +#line 1254 "IPFilterScanner.cpp" | |
| case YY_STATE_EOF(INITIAL): | |
| yyterminate(); | |
| @@ -1028,15 +1268,15 @@ case YY_STATE_EOF(INITIAL): | |
| { | |
| /* We're scanning a new file or input source. It's | |
| * possible that this happened because the user | |
| - * just pointed yyipin at a new source and called | |
| - * yyiplex(). If so, then we have to assure | |
| + * just pointed yyin at a new source and called | |
| + * yylex(). If so, then we have to assure | |
| * consistency between YY_CURRENT_BUFFER and our | |
| * globals. Here is the right place to do so, because | |
| * this is the first action (other than possibly a | |
| * back-up) that will match for the new input source. | |
| */ | |
| (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | |
| - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyipin; | |
| + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; | |
| YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; | |
| } | |
| @@ -1089,11 +1329,11 @@ case YY_STATE_EOF(INITIAL): | |
| { | |
| (yy_did_buffer_switch_on_eof) = 0; | |
| - if ( yyipwrap( ) ) | |
| + if ( yywrap( ) ) | |
| { | |
| /* Note: because we've taken care in | |
| * yy_get_next_buffer() to have set up | |
| - * yyiptext, we can now set up | |
| + * yytext, we can now set up | |
| * yy_c_buf_p so that if some total | |
| * hoser (like flex itself) wants to | |
| * call the scanner after we return the | |
| @@ -1143,7 +1383,7 @@ case YY_STATE_EOF(INITIAL): | |
| } /* end of action switch */ | |
| } /* end of scanning one token */ | |
| } /* end of user's declarations */ | |
| -} /* end of yyiplex */ | |
| +} /* end of yylex */ | |
| /* yy_get_next_buffer - try to read in a new buffer | |
| * | |
| @@ -1154,9 +1394,9 @@ case YY_STATE_EOF(INITIAL): | |
| */ | |
| static int yy_get_next_buffer (void) | |
| { | |
| - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | |
| - register char *source = (yytext_ptr); | |
| - register int number_to_move, i; | |
| + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | |
| + char *source = (yytext_ptr); | |
| + int number_to_move, i; | |
| int ret_val; | |
| if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) | |
| @@ -1185,7 +1425,7 @@ static int yy_get_next_buffer (void) | |
| /* Try to read more data. */ | |
| /* First move last chars to start of buffer. */ | |
| - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; | |
| + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); | |
| for ( i = 0; i < number_to_move; ++i ) | |
| *(dest++) = *(source++); | |
| @@ -1198,7 +1438,7 @@ static int yy_get_next_buffer (void) | |
| else | |
| { | |
| - yy_size_t num_to_read = | |
| + int num_to_read = | |
| YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; | |
| while ( num_to_read <= 0 ) | |
| @@ -1212,7 +1452,7 @@ static int yy_get_next_buffer (void) | |
| if ( b->yy_is_our_buffer ) | |
| { | |
| - yy_size_t new_size = b->yy_buf_size * 2; | |
| + int new_size = b->yy_buf_size * 2; | |
| if ( new_size <= 0 ) | |
| b->yy_buf_size += b->yy_buf_size / 8; | |
| @@ -1221,11 +1461,12 @@ static int yy_get_next_buffer (void) | |
| b->yy_ch_buf = (char *) | |
| /* Include room in for 2 EOB chars. */ | |
| - yyiprealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); | |
| + yyrealloc( (void *) b->yy_ch_buf, | |
| + (yy_size_t) (b->yy_buf_size + 2) ); | |
| } | |
| else | |
| /* Can't grow it, we don't own it. */ | |
| - b->yy_ch_buf = 0; | |
| + b->yy_ch_buf = NULL; | |
| if ( ! b->yy_ch_buf ) | |
| YY_FATAL_ERROR( | |
| @@ -1253,7 +1494,7 @@ static int yy_get_next_buffer (void) | |
| if ( number_to_move == YY_MORE_ADJ ) | |
| { | |
| ret_val = EOB_ACT_END_OF_FILE; | |
| - yyiprestart(yyipin ); | |
| + yyrestart( yyin ); | |
| } | |
| else | |
| @@ -1267,12 +1508,15 @@ static int yy_get_next_buffer (void) | |
| else | |
| ret_val = EOB_ACT_CONTINUE_SCAN; | |
| - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { | |
| + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { | |
| /* Extend the array by 50%, plus the number we really need. */ | |
| - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); | |
| - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyiprealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); | |
| + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); | |
| + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( | |
| + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); | |
| if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) | |
| YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); | |
| + /* "- 2" to take care of EOB's */ | |
| + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); | |
| } | |
| (yy_n_chars) += number_to_move; | |
| @@ -1288,15 +1532,15 @@ static int yy_get_next_buffer (void) | |
| static yy_state_type yy_get_previous_state (void) | |
| { | |
| - register yy_state_type yy_current_state; | |
| - register char *yy_cp; | |
| + yy_state_type yy_current_state; | |
| + char *yy_cp; | |
| yy_current_state = (yy_start); | |
| yy_current_state += YY_AT_BOL(); | |
| for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) | |
| { | |
| - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | |
| + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -1306,9 +1550,9 @@ static int yy_get_next_buffer (void) | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 169 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| } | |
| return yy_current_state; | |
| @@ -1321,10 +1565,10 @@ static int yy_get_next_buffer (void) | |
| */ | |
| static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) | |
| { | |
| - register int yy_is_jam; | |
| - register char *yy_cp = (yy_c_buf_p); | |
| + int yy_is_jam; | |
| + char *yy_cp = (yy_c_buf_p); | |
| - register YY_CHAR yy_c = 1; | |
| + YY_CHAR yy_c = 1; | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -1334,14 +1578,18 @@ static int yy_get_next_buffer (void) | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 169 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| yy_is_jam = (yy_current_state == 168); | |
| return yy_is_jam ? 0 : yy_current_state; | |
| } | |
| +#ifndef YY_NO_UNPUT | |
| + | |
| +#endif | |
| + | |
| #ifndef YY_NO_INPUT | |
| #ifdef __cplusplus | |
| static int yyinput (void) | |
| @@ -1366,7 +1614,7 @@ static int yy_get_next_buffer (void) | |
| else | |
| { /* need more input */ | |
| - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); | |
| + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); | |
| ++(yy_c_buf_p); | |
| switch ( yy_get_next_buffer( ) ) | |
| @@ -1383,14 +1631,14 @@ static int yy_get_next_buffer (void) | |
| */ | |
| /* Reset buffer status. */ | |
| - yyiprestart(yyipin ); | |
| + yyrestart( yyin ); | |
| /*FALLTHROUGH*/ | |
| case EOB_ACT_END_OF_FILE: | |
| { | |
| - if ( yyipwrap( ) ) | |
| - return EOF; | |
| + if ( yywrap( ) ) | |
| + return 0; | |
| if ( ! (yy_did_buffer_switch_on_eof) ) | |
| YY_NEW_FILE; | |
| @@ -1409,7 +1657,7 @@ static int yy_get_next_buffer (void) | |
| } | |
| c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ | |
| - *(yy_c_buf_p) = '\0'; /* preserve yyiptext */ | |
| + *(yy_c_buf_p) = '\0'; /* preserve yytext */ | |
| (yy_hold_char) = *++(yy_c_buf_p); | |
| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); | |
| @@ -1423,32 +1671,32 @@ static int yy_get_next_buffer (void) | |
| * | |
| * @note This function does not reset the start condition to @c INITIAL . | |
| */ | |
| - void yyiprestart (FILE * input_file ) | |
| + void yyrestart (FILE * input_file ) | |
| { | |
| if ( ! YY_CURRENT_BUFFER ){ | |
| - yyipensure_buffer_stack (); | |
| + yyensure_buffer_stack (); | |
| YY_CURRENT_BUFFER_LVALUE = | |
| - yyip_create_buffer(yyipin,YY_BUF_SIZE ); | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); | |
| } | |
| - yyip_init_buffer(YY_CURRENT_BUFFER,input_file ); | |
| - yyip_load_buffer_state( ); | |
| + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); | |
| + yy_load_buffer_state( ); | |
| } | |
| /** Switch to a different input buffer. | |
| * @param new_buffer The new input buffer. | |
| * | |
| */ | |
| - void yyip_switch_to_buffer (YY_BUFFER_STATE new_buffer ) | |
| + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) | |
| { | |
| /* TODO. We should be able to replace this entire function body | |
| * with | |
| - * yyippop_buffer_state(); | |
| - * yyippush_buffer_state(new_buffer); | |
| + * yypop_buffer_state(); | |
| + * yypush_buffer_state(new_buffer); | |
| */ | |
| - yyipensure_buffer_stack (); | |
| + yyensure_buffer_stack (); | |
| if ( YY_CURRENT_BUFFER == new_buffer ) | |
| return; | |
| @@ -1461,21 +1709,21 @@ static int yy_get_next_buffer (void) | |
| } | |
| YY_CURRENT_BUFFER_LVALUE = new_buffer; | |
| - yyip_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| /* We don't actually know whether we did this switch during | |
| - * EOF (yyipwrap()) processing, but the only time this flag | |
| - * is looked at is after yyipwrap() is called, so it's safe | |
| + * EOF (yywrap()) processing, but the only time this flag | |
| + * is looked at is after yywrap() is called, so it's safe | |
| * to go ahead and always set it. | |
| */ | |
| (yy_did_buffer_switch_on_eof) = 1; | |
| } | |
| -static void yyip_load_buffer_state (void) | |
| +static void yy_load_buffer_state (void) | |
| { | |
| (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | |
| (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; | |
| - yyipin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; | |
| + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; | |
| (yy_hold_char) = *(yy_c_buf_p); | |
| } | |
| @@ -1485,35 +1733,35 @@ static void yyip_load_buffer_state (void) | |
| * | |
| * @return the allocated buffer state. | |
| */ | |
| - YY_BUFFER_STATE yyip_create_buffer (FILE * file, int size ) | |
| + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) | |
| { | |
| YY_BUFFER_STATE b; | |
| - b = (YY_BUFFER_STATE) yyipalloc(sizeof( struct yy_buffer_state ) ); | |
| + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); | |
| if ( ! b ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in yyip_create_buffer()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
| b->yy_buf_size = size; | |
| /* yy_ch_buf has to be 2 characters longer than the size given because | |
| * we need to put in 2 end-of-buffer characters. | |
| */ | |
| - b->yy_ch_buf = (char *) yyipalloc(b->yy_buf_size + 2 ); | |
| + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); | |
| if ( ! b->yy_ch_buf ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in yyip_create_buffer()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
| b->yy_is_our_buffer = 1; | |
| - yyip_init_buffer(b,file ); | |
| + yy_init_buffer( b, file ); | |
| return b; | |
| } | |
| /** Destroy the buffer. | |
| - * @param b a buffer created with yyip_create_buffer() | |
| + * @param b a buffer created with yy_create_buffer() | |
| * | |
| */ | |
| - void yyip_delete_buffer (YY_BUFFER_STATE b ) | |
| + void yy_delete_buffer (YY_BUFFER_STATE b ) | |
| { | |
| if ( ! b ) | |
| @@ -1523,27 +1771,27 @@ static void yyip_load_buffer_state (void) | |
| YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; | |
| if ( b->yy_is_our_buffer ) | |
| - yyipfree((void *) b->yy_ch_buf ); | |
| + yyfree( (void *) b->yy_ch_buf ); | |
| - yyipfree((void *) b ); | |
| + yyfree( (void *) b ); | |
| } | |
| /* Initializes or reinitializes a buffer. | |
| * This function is sometimes called more than once on the same buffer, | |
| - * such as during a yyiprestart() or at EOF. | |
| + * such as during a yyrestart() or at EOF. | |
| */ | |
| - static void yyip_init_buffer (YY_BUFFER_STATE b, FILE * file ) | |
| + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) | |
| { | |
| int oerrno = errno; | |
| - yyip_flush_buffer(b ); | |
| + yy_flush_buffer( b ); | |
| b->yy_input_file = file; | |
| b->yy_fill_buffer = 1; | |
| - /* If b is the current buffer, then yyip_init_buffer was _probably_ | |
| - * called from yyiprestart() or through yy_get_next_buffer. | |
| + /* If b is the current buffer, then yy_init_buffer was _probably_ | |
| + * called from yyrestart() or through yy_get_next_buffer. | |
| * In that case, we don't want to reset the lineno or column. | |
| */ | |
| if (b != YY_CURRENT_BUFFER){ | |
| @@ -1560,7 +1808,7 @@ static void yyip_load_buffer_state (void) | |
| * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. | |
| * | |
| */ | |
| - void yyip_flush_buffer (YY_BUFFER_STATE b ) | |
| + void yy_flush_buffer (YY_BUFFER_STATE b ) | |
| { | |
| if ( ! b ) | |
| return; | |
| @@ -1580,7 +1828,7 @@ static void yyip_load_buffer_state (void) | |
| b->yy_buffer_status = YY_BUFFER_NEW; | |
| if ( b == YY_CURRENT_BUFFER ) | |
| - yyip_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| } | |
| /** Pushes the new state onto the stack. The new state becomes | |
| @@ -1589,14 +1837,14 @@ static void yyip_load_buffer_state (void) | |
| * @param new_buffer The new state. | |
| * | |
| */ | |
| -void yyippush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| { | |
| if (new_buffer == NULL) | |
| return; | |
| - yyipensure_buffer_stack(); | |
| + yyensure_buffer_stack(); | |
| - /* This block is copied from yyip_switch_to_buffer. */ | |
| + /* This block is copied from yy_switch_to_buffer. */ | |
| if ( YY_CURRENT_BUFFER ) | |
| { | |
| /* Flush out information for old buffer. */ | |
| @@ -1610,8 +1858,8 @@ void yyippush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| (yy_buffer_stack_top)++; | |
| YY_CURRENT_BUFFER_LVALUE = new_buffer; | |
| - /* copied from yyip_switch_to_buffer. */ | |
| - yyip_load_buffer_state( ); | |
| + /* copied from yy_switch_to_buffer. */ | |
| + yy_load_buffer_state( ); | |
| (yy_did_buffer_switch_on_eof) = 1; | |
| } | |
| @@ -1619,18 +1867,18 @@ void yyippush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| * The next element becomes the new top. | |
| * | |
| */ | |
| -void yyippop_buffer_state (void) | |
| +void yypop_buffer_state (void) | |
| { | |
| if (!YY_CURRENT_BUFFER) | |
| return; | |
| - yyip_delete_buffer(YY_CURRENT_BUFFER ); | |
| + yy_delete_buffer(YY_CURRENT_BUFFER ); | |
| YY_CURRENT_BUFFER_LVALUE = NULL; | |
| if ((yy_buffer_stack_top) > 0) | |
| --(yy_buffer_stack_top); | |
| if (YY_CURRENT_BUFFER) { | |
| - yyip_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| (yy_did_buffer_switch_on_eof) = 1; | |
| } | |
| } | |
| @@ -1638,7 +1886,7 @@ void yyippop_buffer_state (void) | |
| /* Allocates the stack if it does not exist. | |
| * Guarantees space for at least one push. | |
| */ | |
| -static void yyipensure_buffer_stack (void) | |
| +static void yyensure_buffer_stack (void) | |
| { | |
| yy_size_t num_to_alloc; | |
| @@ -1648,12 +1896,12 @@ static void yyipensure_buffer_stack (void) | |
| * scanner will even need a stack. We use 2 instead of 1 to avoid an | |
| * immediate realloc on the next call. | |
| */ | |
| - num_to_alloc = 1; | |
| - (yy_buffer_stack) = (struct yy_buffer_state**)yyipalloc | |
| + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ | |
| + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc | |
| (num_to_alloc * sizeof(struct yy_buffer_state*) | |
| ); | |
| if ( ! (yy_buffer_stack) ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in yyipensure_buffer_stack()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); | |
| memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); | |
| @@ -1665,15 +1913,15 @@ static void yyipensure_buffer_stack (void) | |
| if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ | |
| /* Increase the buffer to prepare for a possible push. */ | |
| - int grow_size = 8 /* arbitrary grow size */; | |
| + yy_size_t grow_size = 8 /* arbitrary grow size */; | |
| num_to_alloc = (yy_buffer_stack_max) + grow_size; | |
| - (yy_buffer_stack) = (struct yy_buffer_state**)yyiprealloc | |
| + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc | |
| ((yy_buffer_stack), | |
| num_to_alloc * sizeof(struct yy_buffer_state*) | |
| ); | |
| if ( ! (yy_buffer_stack) ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in yyipensure_buffer_stack()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); | |
| /* zero only the new slots.*/ | |
| memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); | |
| @@ -1687,7 +1935,7 @@ static void yyipensure_buffer_stack (void) | |
| * | |
| * @return the newly allocated buffer state object. | |
| */ | |
| -YY_BUFFER_STATE yyip_scan_buffer (char * base, yy_size_t size ) | |
| +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) | |
| { | |
| YY_BUFFER_STATE b; | |
| @@ -1695,69 +1943,69 @@ YY_BUFFER_STATE yyip_scan_buffer (char * base, yy_size_t size ) | |
| base[size-2] != YY_END_OF_BUFFER_CHAR || | |
| base[size-1] != YY_END_OF_BUFFER_CHAR ) | |
| /* They forgot to leave room for the EOB's. */ | |
| - return 0; | |
| + return NULL; | |
| - b = (YY_BUFFER_STATE) yyipalloc(sizeof( struct yy_buffer_state ) ); | |
| + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); | |
| if ( ! b ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in yyip_scan_buffer()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); | |
| - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ | |
| + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ | |
| b->yy_buf_pos = b->yy_ch_buf = base; | |
| b->yy_is_our_buffer = 0; | |
| - b->yy_input_file = 0; | |
| + b->yy_input_file = NULL; | |
| b->yy_n_chars = b->yy_buf_size; | |
| b->yy_is_interactive = 0; | |
| b->yy_at_bol = 1; | |
| b->yy_fill_buffer = 0; | |
| b->yy_buffer_status = YY_BUFFER_NEW; | |
| - yyip_switch_to_buffer(b ); | |
| + yy_switch_to_buffer( b ); | |
| return b; | |
| } | |
| -/** Setup the input buffer state to scan a string. The next call to yyiplex() will | |
| +/** Setup the input buffer state to scan a string. The next call to yylex() will | |
| * scan from a @e copy of @a str. | |
| * @param yystr a NUL-terminated string to scan | |
| * | |
| * @return the newly allocated buffer state object. | |
| * @note If you want to scan bytes that may contain NUL values, then use | |
| - * yyip_scan_bytes() instead. | |
| + * yy_scan_bytes() instead. | |
| */ | |
| -YY_BUFFER_STATE yyip_scan_string (yyconst char * yystr ) | |
| +YY_BUFFER_STATE yy_scan_string (const char * yystr ) | |
| { | |
| - return yyip_scan_bytes(yystr,strlen(yystr) ); | |
| + return yy_scan_bytes( yystr, (int) strlen(yystr) ); | |
| } | |
| -/** Setup the input buffer state to scan the given bytes. The next call to yyiplex() will | |
| +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will | |
| * scan from a @e copy of @a bytes. | |
| * @param yybytes the byte buffer to scan | |
| * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. | |
| * | |
| * @return the newly allocated buffer state object. | |
| */ | |
| -YY_BUFFER_STATE yyip_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) | |
| +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) | |
| { | |
| YY_BUFFER_STATE b; | |
| char *buf; | |
| yy_size_t n; | |
| - yy_size_t i; | |
| + int i; | |
| /* Get memory for full buffer, including space for trailing EOB's. */ | |
| - n = _yybytes_len + 2; | |
| - buf = (char *) yyipalloc(n ); | |
| + n = (yy_size_t) (_yybytes_len + 2); | |
| + buf = (char *) yyalloc( n ); | |
| if ( ! buf ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in yyip_scan_bytes()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); | |
| for ( i = 0; i < _yybytes_len; ++i ) | |
| buf[i] = yybytes[i]; | |
| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; | |
| - b = yyip_scan_buffer(buf,n ); | |
| + b = yy_scan_buffer( buf, n ); | |
| if ( ! b ) | |
| - YY_FATAL_ERROR( "bad buffer in yyip_scan_bytes()" ); | |
| + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); | |
| /* It's okay to grow etc. this buffer, and we should throw it | |
| * away when we're done. | |
| @@ -1771,9 +2019,9 @@ YY_BUFFER_STATE yyip_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_le | |
| #define YY_EXIT_FAILURE 2 | |
| #endif | |
| -static void yy_fatal_error (yyconst char* msg ) | |
| +static void yynoreturn yy_fatal_error (const char* msg ) | |
| { | |
| - (void) fprintf( stderr, "%s\n", msg ); | |
| + fprintf( stderr, "%s\n", msg ); | |
| exit( YY_EXIT_FAILURE ); | |
| } | |
| @@ -1783,14 +2031,14 @@ static void yy_fatal_error (yyconst char* msg ) | |
| #define yyless(n) \ | |
| do \ | |
| { \ | |
| - /* Undo effects of setting up yyiptext. */ \ | |
| + /* Undo effects of setting up yytext. */ \ | |
| int yyless_macro_arg = (n); \ | |
| YY_LESS_LINENO(yyless_macro_arg);\ | |
| - yyiptext[yyipleng] = (yy_hold_char); \ | |
| - (yy_c_buf_p) = yyiptext + yyless_macro_arg; \ | |
| + yytext[yyleng] = (yy_hold_char); \ | |
| + (yy_c_buf_p) = yytext + yyless_macro_arg; \ | |
| (yy_hold_char) = *(yy_c_buf_p); \ | |
| *(yy_c_buf_p) = '\0'; \ | |
| - yyipleng = yyless_macro_arg; \ | |
| + yyleng = yyless_macro_arg; \ | |
| } \ | |
| while ( 0 ) | |
| @@ -1799,126 +2047,126 @@ static void yy_fatal_error (yyconst char* msg ) | |
| /** Get the current line number. | |
| * | |
| */ | |
| -int yyipget_lineno (void) | |
| +int yyget_lineno (void) | |
| { | |
| - return yyiplineno; | |
| + return yylineno; | |
| } | |
| /** Get the input stream. | |
| * | |
| */ | |
| -FILE *yyipget_in (void) | |
| +FILE *yyget_in (void) | |
| { | |
| - return yyipin; | |
| + return yyin; | |
| } | |
| /** Get the output stream. | |
| * | |
| */ | |
| -FILE *yyipget_out (void) | |
| +FILE *yyget_out (void) | |
| { | |
| - return yyipout; | |
| + return yyout; | |
| } | |
| /** Get the length of the current token. | |
| * | |
| */ | |
| -yy_size_t yyipget_leng (void) | |
| +int yyget_leng (void) | |
| { | |
| - return yyipleng; | |
| + return yyleng; | |
| } | |
| /** Get the current token. | |
| * | |
| */ | |
| -char *yyipget_text (void) | |
| +char *yyget_text (void) | |
| { | |
| - return yyiptext; | |
| + return yytext; | |
| } | |
| /** Set the current line number. | |
| - * @param line_number | |
| + * @param _line_number line number | |
| * | |
| */ | |
| -void yyipset_lineno (int line_number ) | |
| +void yyset_lineno (int _line_number ) | |
| { | |
| - yyiplineno = line_number; | |
| + yylineno = _line_number; | |
| } | |
| /** Set the input stream. This does not discard the current | |
| * input buffer. | |
| - * @param in_str A readable stream. | |
| + * @param _in_str A readable stream. | |
| * | |
| - * @see yyip_switch_to_buffer | |
| + * @see yy_switch_to_buffer | |
| */ | |
| -void yyipset_in (FILE * in_str ) | |
| +void yyset_in (FILE * _in_str ) | |
| { | |
| - yyipin = in_str ; | |
| + yyin = _in_str ; | |
| } | |
| -void yyipset_out (FILE * out_str ) | |
| +void yyset_out (FILE * _out_str ) | |
| { | |
| - yyipout = out_str ; | |
| + yyout = _out_str ; | |
| } | |
| -int yyipget_debug (void) | |
| +int yyget_debug (void) | |
| { | |
| - return yyip_flex_debug; | |
| + return yy_flex_debug; | |
| } | |
| -void yyipset_debug (int bdebug ) | |
| +void yyset_debug (int _bdebug ) | |
| { | |
| - yyip_flex_debug = bdebug ; | |
| + yy_flex_debug = _bdebug ; | |
| } | |
| static int yy_init_globals (void) | |
| { | |
| /* Initialization is the same as for the non-reentrant scanner. | |
| - * This function is called from yyiplex_destroy(), so don't allocate here. | |
| + * This function is called from yylex_destroy(), so don't allocate here. | |
| */ | |
| - (yy_buffer_stack) = 0; | |
| + (yy_buffer_stack) = NULL; | |
| (yy_buffer_stack_top) = 0; | |
| (yy_buffer_stack_max) = 0; | |
| - (yy_c_buf_p) = (char *) 0; | |
| + (yy_c_buf_p) = NULL; | |
| (yy_init) = 0; | |
| (yy_start) = 0; | |
| /* Defined in main.c */ | |
| #ifdef YY_STDINIT | |
| - yyipin = stdin; | |
| - yyipout = stdout; | |
| + yyin = stdin; | |
| + yyout = stdout; | |
| #else | |
| - yyipin = (FILE *) 0; | |
| - yyipout = (FILE *) 0; | |
| + yyin = NULL; | |
| + yyout = NULL; | |
| #endif | |
| /* For future reference: Set errno on error, since we are called by | |
| - * yyiplex_init() | |
| + * yylex_init() | |
| */ | |
| return 0; | |
| } | |
| -/* yyiplex_destroy is for both reentrant and non-reentrant scanners. */ | |
| -int yyiplex_destroy (void) | |
| +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ | |
| +int yylex_destroy (void) | |
| { | |
| /* Pop the buffer stack, destroying each element. */ | |
| while(YY_CURRENT_BUFFER){ | |
| - yyip_delete_buffer(YY_CURRENT_BUFFER ); | |
| + yy_delete_buffer( YY_CURRENT_BUFFER ); | |
| YY_CURRENT_BUFFER_LVALUE = NULL; | |
| - yyippop_buffer_state(); | |
| + yypop_buffer_state(); | |
| } | |
| /* Destroy the stack itself. */ | |
| - yyipfree((yy_buffer_stack) ); | |
| + yyfree((yy_buffer_stack) ); | |
| (yy_buffer_stack) = NULL; | |
| /* Reset the globals. This is important in a non-reentrant scanner so the next time | |
| - * yyiplex() is called, initialization will occur. */ | |
| + * yylex() is called, initialization will occur. */ | |
| yy_init_globals( ); | |
| return 0; | |
| @@ -1929,18 +2177,19 @@ int yyiplex_destroy (void) | |
| */ | |
| #ifndef yytext_ptr | |
| -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) | |
| +static void yy_flex_strncpy (char* s1, const char * s2, int n ) | |
| { | |
| - register int i; | |
| + | |
| + int i; | |
| for ( i = 0; i < n; ++i ) | |
| s1[i] = s2[i]; | |
| } | |
| #endif | |
| #ifdef YY_NEED_STRLEN | |
| -static int yy_flex_strlen (yyconst char * s ) | |
| +static int yy_flex_strlen (const char * s ) | |
| { | |
| - register int n; | |
| + int n; | |
| for ( n = 0; s[n]; ++n ) | |
| ; | |
| @@ -1948,13 +2197,14 @@ static int yy_flex_strlen (yyconst char * s ) | |
| } | |
| #endif | |
| -void *yyipalloc (yy_size_t size ) | |
| +void *yyalloc (yy_size_t size ) | |
| { | |
| - return (void *) malloc( size ); | |
| + return malloc(size); | |
| } | |
| -void *yyiprealloc (void * ptr, yy_size_t size ) | |
| +void *yyrealloc (void * ptr, yy_size_t size ) | |
| { | |
| + | |
| /* The cast to (char *) in the following accommodates both | |
| * implementations that use char* generic pointers, and those | |
| * that use void* generic pointers. It works with the latter | |
| @@ -1962,12 +2212,12 @@ void *yyiprealloc (void * ptr, yy_size_t size ) | |
| * any pointer type to void*, and deal with argument conversions | |
| * as though doing an assignment. | |
| */ | |
| - return (void *) realloc( (char *) ptr, size ); | |
| + return realloc(ptr, size); | |
| } | |
| -void yyipfree (void * ptr ) | |
| +void yyfree (void * ptr ) | |
| { | |
| - free( (char *) ptr ); /* see yyiprealloc() for (char *) cast */ | |
| + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ | |
| } | |
| #define YYTABLES_NAME "yytables" | |
| @@ -1975,4 +2225,3 @@ void yyipfree (void * ptr ) | |
| #line 155 "./IPFilterScanner.l" | |
| - | |
| diff --git a/src/Parser.cpp b/src/Parser.cpp | |
| index f322cc703..c9f5d744f 100644 | |
| --- a/src/Parser.cpp | |
| +++ b/src/Parser.cpp | |
| @@ -1,8 +1,9 @@ | |
| -/* A Bison parser, made by GNU Bison 3.0.4. */ | |
| +/* A Bison parser, made by GNU Bison 3.8.2. */ | |
| /* Bison implementation for Yacc-like parsers in C | |
| - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. | |
| + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, | |
| + Inc. | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| @@ -15,7 +16,7 @@ | |
| GNU General Public License for more details. | |
| You should have received a copy of the GNU General Public License | |
| - along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
| + along with this program. If not, see <https://www.gnu.org/licenses/>. */ | |
| /* As a special exception, you may create a larger work that contains | |
| part or all of the Bison parser skeleton and distribute that work | |
| @@ -33,6 +34,10 @@ | |
| /* C LALR(1) parser skeleton written by Richard Stallman, by | |
| simplifying the original so-called "semantic" parser. */ | |
| +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, | |
| + especially those whose name start with YY_ or yy_. They are | |
| + private implementation details that can be changed or removed. */ | |
| + | |
| /* All symbols defined below should begin with yy or YY, to avoid | |
| infringing on user name space. This should be done even for local | |
| variables, as they might otherwise be expanded by user macros. | |
| @@ -40,11 +45,11 @@ | |
| define necessary library symbols; they are noted "INFRINGES ON | |
| USER NAME SPACE" below. */ | |
| -/* Identify Bison output. */ | |
| -#define YYBISON 1 | |
| +/* Identify Bison output, and Bison version. */ | |
| +#define YYBISON 30802 | |
| -/* Bison version. */ | |
| -#define YYBISON_VERSION "3.0.4" | |
| +/* Bison version string. */ | |
| +#define YYBISON_VERSION "3.8.2" | |
| /* Skeleton name. */ | |
| #define YYSKELETON_NAME "yacc.c" | |
| @@ -61,8 +66,8 @@ | |
| -/* Copy the first part of user declarations. */ | |
| -#line 1 "./Parser.y" /* yacc.c:339 */ | |
| +/* First part of user prologue. */ | |
| +#line 1 "./Parser.y" | |
| #include "SearchExpr.h" | |
| #include "Scanner.h" | |
| @@ -81,104 +86,139 @@ int yyerror(const char* errstr); | |
| int yyerror(wxString errstr); | |
| -#line 85 "Parser.cpp" /* yacc.c:339 */ | |
| +#line 90 "Parser.cpp" | |
| +# ifndef YY_CAST | |
| +# ifdef __cplusplus | |
| +# define YY_CAST(Type, Val) static_cast<Type> (Val) | |
| +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) | |
| +# else | |
| +# define YY_CAST(Type, Val) ((Type) (Val)) | |
| +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) | |
| +# endif | |
| +# endif | |
| # ifndef YY_NULLPTR | |
| -# if defined __cplusplus && 201103L <= __cplusplus | |
| -# define YY_NULLPTR nullptr | |
| +# if defined __cplusplus | |
| +# if 201103L <= __cplusplus | |
| +# define YY_NULLPTR nullptr | |
| +# else | |
| +# define YY_NULLPTR 0 | |
| +# endif | |
| # else | |
| -# define YY_NULLPTR 0 | |
| +# define YY_NULLPTR ((void*)0) | |
| # endif | |
| # endif | |
| -/* Enabling verbose error messages. */ | |
| -#ifdef YYERROR_VERBOSE | |
| -# undef YYERROR_VERBOSE | |
| -# define YYERROR_VERBOSE 1 | |
| -#else | |
| -# define YYERROR_VERBOSE 0 | |
| -#endif | |
| - | |
| -/* In a future release of Bison, this section will be replaced | |
| - by #include "Parser.hpp". */ | |
| -#ifndef YY_YY_PARSER_HPP_INCLUDED | |
| -# define YY_YY_PARSER_HPP_INCLUDED | |
| -/* Debug traces. */ | |
| -#ifndef YYDEBUG | |
| -# define YYDEBUG 1 | |
| -#endif | |
| -#if YYDEBUG | |
| -extern int yydebug; | |
| -#endif | |
| - | |
| -/* Token type. */ | |
| -#ifndef YYTOKENTYPE | |
| -# define YYTOKENTYPE | |
| - enum yytokentype | |
| - { | |
| - TOK_STRING = 258, | |
| - TOK_AND = 259, | |
| - TOK_OR = 260, | |
| - TOK_NOT = 261, | |
| - TOK_ED2K_LINK = 262 | |
| - }; | |
| -#endif | |
| - | |
| -/* Value type. */ | |
| -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
| - | |
| -union YYSTYPE | |
| +#include "Parser.hpp" | |
| +/* Symbol kind. */ | |
| +enum yysymbol_kind_t | |
| { | |
| -#line 20 "./Parser.y" /* yacc.c:355 */ | |
| - | |
| - wxString* pstr; | |
| - CSearchExpr* pexpr; | |
| - | |
| -#line 138 "Parser.cpp" /* yacc.c:355 */ | |
| + YYSYMBOL_YYEMPTY = -2, | |
| + YYSYMBOL_YYEOF = 0, /* "end of file" */ | |
| + YYSYMBOL_YYerror = 1, /* error */ | |
| + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ | |
| + YYSYMBOL_TOK_STRING = 3, /* TOK_STRING */ | |
| + YYSYMBOL_TOK_AND = 4, /* TOK_AND */ | |
| + YYSYMBOL_TOK_OR = 5, /* TOK_OR */ | |
| + YYSYMBOL_TOK_NOT = 6, /* TOK_NOT */ | |
| + YYSYMBOL_TOK_ED2K_LINK = 7, /* TOK_ED2K_LINK */ | |
| + YYSYMBOL_8_ = 8, /* '(' */ | |
| + YYSYMBOL_9_ = 9, /* ')' */ | |
| + YYSYMBOL_YYACCEPT = 10, /* $accept */ | |
| + YYSYMBOL_action = 11, /* action */ | |
| + YYSYMBOL_searchexpr = 12, /* searchexpr */ | |
| + YYSYMBOL_and_strings = 13 /* and_strings */ | |
| }; | |
| +typedef enum yysymbol_kind_t yysymbol_kind_t; | |
| -typedef union YYSTYPE YYSTYPE; | |
| -# define YYSTYPE_IS_TRIVIAL 1 | |
| -# define YYSTYPE_IS_DECLARED 1 | |
| -#endif | |
| -extern YYSTYPE yylval; | |
| -int yyparse (void); | |
| +#ifdef short | |
| +# undef short | |
| +#endif | |
| -#endif /* !YY_YY_PARSER_HPP_INCLUDED */ | |
| +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure | |
| + <limits.h> and (if available) <stdint.h> are included | |
| + so that the code can choose integer types of a good width. */ | |
| -/* Copy the second part of user declarations. */ | |
| +#ifndef __PTRDIFF_MAX__ | |
| +# include <limits.h> /* INFRINGES ON USER NAME SPACE */ | |
| +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ | |
| +# include <stdint.h> /* INFRINGES ON USER NAME SPACE */ | |
| +# define YY_STDINT_H | |
| +# endif | |
| +#endif | |
| -#line 155 "Parser.cpp" /* yacc.c:358 */ | |
| +/* Narrow types that promote to a signed type and that can represent a | |
| + signed or unsigned integer of at least N bits. In tables they can | |
| + save space and decrease cache pressure. Promoting to a signed type | |
| + helps avoid bugs in integer arithmetic. */ | |
| -#ifdef short | |
| -# undef short | |
| +#ifdef __INT_LEAST8_MAX__ | |
| +typedef __INT_LEAST8_TYPE__ yytype_int8; | |
| +#elif defined YY_STDINT_H | |
| +typedef int_least8_t yytype_int8; | |
| +#else | |
| +typedef signed char yytype_int8; | |
| #endif | |
| -#ifdef YYTYPE_UINT8 | |
| -typedef YYTYPE_UINT8 yytype_uint8; | |
| +#ifdef __INT_LEAST16_MAX__ | |
| +typedef __INT_LEAST16_TYPE__ yytype_int16; | |
| +#elif defined YY_STDINT_H | |
| +typedef int_least16_t yytype_int16; | |
| #else | |
| -typedef unsigned char yytype_uint8; | |
| +typedef short yytype_int16; | |
| #endif | |
| -#ifdef YYTYPE_INT8 | |
| -typedef YYTYPE_INT8 yytype_int8; | |
| -#else | |
| -typedef signed char yytype_int8; | |
| +/* Work around bug in HP-UX 11.23, which defines these macros | |
| + incorrectly for preprocessor constants. This workaround can likely | |
| + be removed in 2023, as HPE has promised support for HP-UX 11.23 | |
| + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of | |
| + <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ | |
| +#ifdef __hpux | |
| +# undef UINT_LEAST8_MAX | |
| +# undef UINT_LEAST16_MAX | |
| +# define UINT_LEAST8_MAX 255 | |
| +# define UINT_LEAST16_MAX 65535 | |
| #endif | |
| -#ifdef YYTYPE_UINT16 | |
| -typedef YYTYPE_UINT16 yytype_uint16; | |
| +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ | |
| +typedef __UINT_LEAST8_TYPE__ yytype_uint8; | |
| +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ | |
| + && UINT_LEAST8_MAX <= INT_MAX) | |
| +typedef uint_least8_t yytype_uint8; | |
| +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX | |
| +typedef unsigned char yytype_uint8; | |
| #else | |
| -typedef unsigned short int yytype_uint16; | |
| +typedef short yytype_uint8; | |
| #endif | |
| -#ifdef YYTYPE_INT16 | |
| -typedef YYTYPE_INT16 yytype_int16; | |
| +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ | |
| +typedef __UINT_LEAST16_TYPE__ yytype_uint16; | |
| +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ | |
| + && UINT_LEAST16_MAX <= INT_MAX) | |
| +typedef uint_least16_t yytype_uint16; | |
| +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX | |
| +typedef unsigned short yytype_uint16; | |
| #else | |
| -typedef short int yytype_int16; | |
| +typedef int yytype_uint16; | |
| +#endif | |
| + | |
| +#ifndef YYPTRDIFF_T | |
| +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ | |
| +# define YYPTRDIFF_T __PTRDIFF_TYPE__ | |
| +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ | |
| +# elif defined PTRDIFF_MAX | |
| +# ifndef ptrdiff_t | |
| +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
| +# endif | |
| +# define YYPTRDIFF_T ptrdiff_t | |
| +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX | |
| +# else | |
| +# define YYPTRDIFF_T long | |
| +# define YYPTRDIFF_MAXIMUM LONG_MAX | |
| +# endif | |
| #endif | |
| #ifndef YYSIZE_T | |
| @@ -186,15 +226,28 @@ typedef short int yytype_int16; | |
| # define YYSIZE_T __SIZE_TYPE__ | |
| # elif defined size_t | |
| # define YYSIZE_T size_t | |
| -# elif ! defined YYSIZE_T | |
| +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ | |
| # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
| # define YYSIZE_T size_t | |
| # else | |
| -# define YYSIZE_T unsigned int | |
| +# define YYSIZE_T unsigned | |
| # endif | |
| #endif | |
| -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) | |
| +#define YYSIZE_MAXIMUM \ | |
| + YY_CAST (YYPTRDIFF_T, \ | |
| + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ | |
| + ? YYPTRDIFF_MAXIMUM \ | |
| + : YY_CAST (YYSIZE_T, -1))) | |
| + | |
| +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | |
| + | |
| + | |
| +/* Stored state numbers (used for stacks). */ | |
| +typedef yytype_int8 yy_state_t; | |
| + | |
| +/* State numbers in computations. */ | |
| +typedef int yy_state_fast_t; | |
| #ifndef YY_ | |
| # if defined YYENABLE_NLS && YYENABLE_NLS | |
| @@ -208,47 +261,43 @@ typedef short int yytype_int16; | |
| # endif | |
| #endif | |
| -#ifndef YY_ATTRIBUTE | |
| -# if (defined __GNUC__ \ | |
| - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ | |
| - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C | |
| -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) | |
| -# else | |
| -# define YY_ATTRIBUTE(Spec) /* empty */ | |
| -# endif | |
| -#endif | |
| #ifndef YY_ATTRIBUTE_PURE | |
| -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) | |
| +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) | |
| +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) | |
| +# else | |
| +# define YY_ATTRIBUTE_PURE | |
| +# endif | |
| #endif | |
| #ifndef YY_ATTRIBUTE_UNUSED | |
| -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) | |
| -#endif | |
| - | |
| -#if !defined _Noreturn \ | |
| - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) | |
| -# if defined _MSC_VER && 1200 <= _MSC_VER | |
| -# define _Noreturn __declspec (noreturn) | |
| +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) | |
| +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) | |
| # else | |
| -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) | |
| +# define YY_ATTRIBUTE_UNUSED | |
| # endif | |
| #endif | |
| /* Suppress unused-variable warnings by "using" E. */ | |
| #if ! defined lint || defined __GNUC__ | |
| -# define YYUSE(E) ((void) (E)) | |
| +# define YY_USE(E) ((void) (E)) | |
| #else | |
| -# define YYUSE(E) /* empty */ | |
| +# define YY_USE(E) /* empty */ | |
| #endif | |
| -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ | |
| /* Suppress an incorrect diagnostic about yylval being uninitialized. */ | |
| -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | |
| - _Pragma ("GCC diagnostic push") \ | |
| - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ | |
| +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ | |
| +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 | |
| +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | |
| + _Pragma ("GCC diagnostic push") \ | |
| + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") | |
| +# else | |
| +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | |
| + _Pragma ("GCC diagnostic push") \ | |
| + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ | |
| _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") | |
| -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ | |
| +# endif | |
| +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ | |
| _Pragma ("GCC diagnostic pop") | |
| #else | |
| # define YY_INITIAL_VALUE(Value) Value | |
| @@ -261,8 +310,22 @@ typedef short int yytype_int16; | |
| # define YY_INITIAL_VALUE(Value) /* Nothing. */ | |
| #endif | |
| +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ | |
| +# define YY_IGNORE_USELESS_CAST_BEGIN \ | |
| + _Pragma ("GCC diagnostic push") \ | |
| + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") | |
| +# define YY_IGNORE_USELESS_CAST_END \ | |
| + _Pragma ("GCC diagnostic pop") | |
| +#endif | |
| +#ifndef YY_IGNORE_USELESS_CAST_BEGIN | |
| +# define YY_IGNORE_USELESS_CAST_BEGIN | |
| +# define YY_IGNORE_USELESS_CAST_END | |
| +#endif | |
| + | |
| + | |
| +#define YY_ASSERT(E) ((void) (0 && (E))) | |
| -#if ! defined yyoverflow || YYERROR_VERBOSE | |
| +#if !defined yyoverflow | |
| /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
| @@ -327,8 +390,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ | |
| # endif | |
| # endif | |
| # endif | |
| -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ | |
| - | |
| +#endif /* !defined yyoverflow */ | |
| #if (! defined yyoverflow \ | |
| && (! defined __cplusplus \ | |
| @@ -337,17 +399,17 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ | |
| /* A type that is properly aligned for any stack member. */ | |
| union yyalloc | |
| { | |
| - yytype_int16 yyss_alloc; | |
| + yy_state_t yyss_alloc; | |
| YYSTYPE yyvs_alloc; | |
| }; | |
| /* The size of the maximum gap between one aligned stack and the next. */ | |
| -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) | |
| +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) | |
| /* The size of an array large to enough to hold all stacks, each with | |
| N elements. */ | |
| # define YYSTACK_BYTES(N) \ | |
| - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ | |
| + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ | |
| + YYSTACK_GAP_MAXIMUM) | |
| # define YYCOPY_NEEDED 1 | |
| @@ -360,11 +422,11 @@ union yyalloc | |
| # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ | |
| do \ | |
| { \ | |
| - YYSIZE_T yynewbytes; \ | |
| + YYPTRDIFF_T yynewbytes; \ | |
| YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | |
| Stack = &yyptr->Stack_alloc; \ | |
| - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
| - yyptr += yynewbytes / sizeof (*yyptr); \ | |
| + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
| + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ | |
| } \ | |
| while (0) | |
| @@ -376,12 +438,12 @@ union yyalloc | |
| # ifndef YYCOPY | |
| # if defined __GNUC__ && 1 < __GNUC__ | |
| # define YYCOPY(Dst, Src, Count) \ | |
| - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) | |
| + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) | |
| # else | |
| # define YYCOPY(Dst, Src, Count) \ | |
| do \ | |
| { \ | |
| - YYSIZE_T yyi; \ | |
| + YYPTRDIFF_T yyi; \ | |
| for (yyi = 0; yyi < (Count); yyi++) \ | |
| (Dst)[yyi] = (Src)[yyi]; \ | |
| } \ | |
| @@ -404,17 +466,20 @@ union yyalloc | |
| /* YYNSTATES -- Number of states. */ | |
| #define YYNSTATES 28 | |
| -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned | |
| - by yylex, with out-of-bounds checking. */ | |
| -#define YYUNDEFTOK 2 | |
| +/* YYMAXUTOK -- Last valid token kind. */ | |
| #define YYMAXUTOK 262 | |
| -#define YYTRANSLATE(YYX) \ | |
| - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | |
| + | |
| +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM | |
| + as returned by yylex, with out-of-bounds checking. */ | |
| +#define YYTRANSLATE(YYX) \ | |
| + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | |
| + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | |
| + : YYSYMBOL_YYUNDEF) | |
| /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM | |
| - as returned by yylex, without out-of-bounds checking. */ | |
| -static const yytype_uint8 yytranslate[] = | |
| + as returned by yylex. */ | |
| +static const yytype_int8 yytranslate[] = | |
| { | |
| 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
| @@ -446,7 +511,7 @@ static const yytype_uint8 yytranslate[] = | |
| }; | |
| #if YYDEBUG | |
| - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ | |
| +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ | |
| static const yytype_uint8 yyrline[] = | |
| { | |
| 0, 39, 39, 45, 54, 63, 64, 74, 84, 94, | |
| @@ -454,38 +519,42 @@ static const yytype_uint8 yyrline[] = | |
| }; | |
| #endif | |
| -#if YYDEBUG || YYERROR_VERBOSE || 0 | |
| +/** Accessing symbol of state STATE. */ | |
| +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) | |
| + | |
| +#if YYDEBUG || 0 | |
| +/* The user-facing name of the symbol whose (internal) number is | |
| + YYSYMBOL. No bounds checking. */ | |
| +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; | |
| + | |
| /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | |
| First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | |
| static const char *const yytname[] = | |
| { | |
| - "$end", "error", "$undefined", "TOK_STRING", "TOK_AND", "TOK_OR", | |
| - "TOK_NOT", "TOK_ED2K_LINK", "'('", "')'", "$accept", "action", | |
| - "searchexpr", "and_strings", YY_NULLPTR | |
| + "\"end of file\"", "error", "\"invalid token\"", "TOK_STRING", | |
| + "TOK_AND", "TOK_OR", "TOK_NOT", "TOK_ED2K_LINK", "'('", "')'", "$accept", | |
| + "action", "searchexpr", "and_strings", YY_NULLPTR | |
| }; | |
| -#endif | |
| -# ifdef YYPRINT | |
| -/* YYTOKNUM[NUM] -- (External) token number corresponding to the | |
| - (internal) symbol number NUM (which must be that of a token). */ | |
| -static const yytype_uint16 yytoknum[] = | |
| +static const char * | |
| +yysymbol_name (yysymbol_kind_t yysymbol) | |
| { | |
| - 0, 256, 257, 258, 259, 260, 261, 262, 40, 41 | |
| -}; | |
| -# endif | |
| + return yytname[yysymbol]; | |
| +} | |
| +#endif | |
| -#define YYPACT_NINF -7 | |
| +#define YYPACT_NINF (-7) | |
| -#define yypact_value_is_default(Yystate) \ | |
| - (!!((Yystate) == (-7))) | |
| +#define yypact_value_is_default(Yyn) \ | |
| + ((Yyn) == YYPACT_NINF) | |
| -#define YYTABLE_NINF -3 | |
| +#define YYTABLE_NINF (-3) | |
| -#define yytable_value_is_error(Yytable_value) \ | |
| +#define yytable_value_is_error(Yyn) \ | |
| 0 | |
| - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
| - STATE-NUM. */ | |
| +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
| + STATE-NUM. */ | |
| static const yytype_int8 yypact[] = | |
| { | |
| 38, -7, 1, 2, 6, -7, 13, 15, 34, 29, | |
| @@ -493,31 +562,31 @@ static const yytype_int8 yypact[] = | |
| -7, -7, -7, 30, -7, 4, -7, -7 | |
| }; | |
| - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. | |
| - Performed when YYTABLE does not specify something else to do. Zero | |
| - means the default is an error. */ | |
| -static const yytype_uint8 yydefact[] = | |
| +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. | |
| + Performed when YYTABLE does not specify something else to do. Zero | |
| + means the default is an error. */ | |
| +static const yytype_int8 yydefact[] = | |
| { | |
| 0, 17, 0, 0, 0, 3, 0, 0, 0, 5, | |
| 14, 15, 16, 12, 0, 1, 4, 0, 0, 0, | |
| 18, 13, 9, 6, 10, 7, 11, 8 | |
| }; | |
| - /* YYPGOTO[NTERM-NUM]. */ | |
| +/* YYPGOTO[NTERM-NUM]. */ | |
| static const yytype_int8 yypgoto[] = | |
| { | |
| -7, -7, -6, -7 | |
| }; | |
| - /* YYDEFGOTO[NTERM-NUM]. */ | |
| +/* YYDEFGOTO[NTERM-NUM]. */ | |
| static const yytype_int8 yydefgoto[] = | |
| { | |
| - -1, 7, 8, 9 | |
| + 0, 7, 8, 9 | |
| }; | |
| - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If | |
| - positive, shift that token. If negative, reduce the rule whose | |
| - number is the opposite. If YYTABLE_NINF, syntax error. */ | |
| +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If | |
| + positive, shift that token. If negative, reduce the rule whose | |
| + number is the opposite. If YYTABLE_NINF, syntax error. */ | |
| static const yytype_int8 yytable[] = | |
| { | |
| 14, 21, 10, 11, 17, 18, 19, 12, 17, 22, | |
| @@ -538,63 +607,63 @@ static const yytype_int8 yycheck[] = | |
| 6, -1, 8 | |
| }; | |
| - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | |
| - symbol of state STATE-NUM. */ | |
| -static const yytype_uint8 yystos[] = | |
| +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of | |
| + state STATE-NUM. */ | |
| +static const yytype_int8 yystos[] = | |
| { | |
| 0, 3, 4, 5, 6, 7, 8, 11, 12, 13, | |
| 1, 1, 1, 1, 12, 0, 1, 4, 5, 6, | |
| 3, 1, 9, 12, 1, 12, 1, 12 | |
| }; | |
| - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
| -static const yytype_uint8 yyr1[] = | |
| +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ | |
| +static const yytype_int8 yyr1[] = | |
| { | |
| 0, 10, 11, 11, 11, 12, 12, 12, 12, 12, | |
| 12, 12, 12, 12, 12, 12, 12, 13, 13 | |
| }; | |
| - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ | |
| -static const yytype_uint8 yyr2[] = | |
| +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ | |
| +static const yytype_int8 yyr2[] = | |
| { | |
| 0, 2, 1, 1, 2, 1, 3, 3, 3, 3, | |
| 3, 3, 2, 3, 2, 2, 2, 1, 2 | |
| }; | |
| +enum { YYENOMEM = -2 }; | |
| + | |
| #define yyerrok (yyerrstatus = 0) | |
| #define yyclearin (yychar = YYEMPTY) | |
| -#define YYEMPTY (-2) | |
| -#define YYEOF 0 | |
| #define YYACCEPT goto yyacceptlab | |
| #define YYABORT goto yyabortlab | |
| #define YYERROR goto yyerrorlab | |
| +#define YYNOMEM goto yyexhaustedlab | |
| #define YYRECOVERING() (!!yyerrstatus) | |
| -#define YYBACKUP(Token, Value) \ | |
| -do \ | |
| - if (yychar == YYEMPTY) \ | |
| - { \ | |
| - yychar = (Token); \ | |
| - yylval = (Value); \ | |
| - YYPOPSTACK (yylen); \ | |
| - yystate = *yyssp; \ | |
| - goto yybackup; \ | |
| - } \ | |
| - else \ | |
| - { \ | |
| - yyerror (YY_("syntax error: cannot back up")); \ | |
| - YYERROR; \ | |
| - } \ | |
| -while (0) | |
| - | |
| -/* Error token number */ | |
| -#define YYTERROR 1 | |
| -#define YYERRCODE 256 | |
| - | |
| +#define YYBACKUP(Token, Value) \ | |
| + do \ | |
| + if (yychar == YYEMPTY) \ | |
| + { \ | |
| + yychar = (Token); \ | |
| + yylval = (Value); \ | |
| + YYPOPSTACK (yylen); \ | |
| + yystate = *yyssp; \ | |
| + goto yybackup; \ | |
| + } \ | |
| + else \ | |
| + { \ | |
| + yyerror (YY_("syntax error: cannot back up")); \ | |
| + YYERROR; \ | |
| + } \ | |
| + while (0) | |
| + | |
| +/* Backward compatibility with an undocumented macro. | |
| + Use YYerror or YYUNDEF. */ | |
| +#define YYERRCODE YYUNDEF | |
| /* Enable debugging if requested. */ | |
| @@ -611,55 +680,52 @@ do { \ | |
| YYFPRINTF Args; \ | |
| } while (0) | |
| -/* This macro is provided for backward compatibility. */ | |
| -#ifndef YY_LOCATION_PRINT | |
| -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
| -#endif | |
| -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ | |
| + | |
| +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ | |
| do { \ | |
| if (yydebug) \ | |
| { \ | |
| YYFPRINTF (stderr, "%s ", Title); \ | |
| yy_symbol_print (stderr, \ | |
| - Type, Value); \ | |
| + Kind, Value); \ | |
| YYFPRINTF (stderr, "\n"); \ | |
| } \ | |
| } while (0) | |
| -/*----------------------------------------. | |
| -| Print this symbol's value on YYOUTPUT. | | |
| -`----------------------------------------*/ | |
| +/*-----------------------------------. | |
| +| Print this symbol's value on YYO. | | |
| +`-----------------------------------*/ | |
| static void | |
| -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
| +yy_symbol_value_print (FILE *yyo, | |
| + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) | |
| { | |
| - FILE *yyo = yyoutput; | |
| - YYUSE (yyo); | |
| + FILE *yyoutput = yyo; | |
| + YY_USE (yyoutput); | |
| if (!yyvaluep) | |
| return; | |
| -# ifdef YYPRINT | |
| - if (yytype < YYNTOKENS) | |
| - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
| -# endif | |
| - YYUSE (yytype); | |
| + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
| + YY_USE (yykind); | |
| + YY_IGNORE_MAYBE_UNINITIALIZED_END | |
| } | |
| -/*--------------------------------. | |
| -| Print this symbol on YYOUTPUT. | | |
| -`--------------------------------*/ | |
| +/*---------------------------. | |
| +| Print this symbol on YYO. | | |
| +`---------------------------*/ | |
| static void | |
| -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
| +yy_symbol_print (FILE *yyo, | |
| + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) | |
| { | |
| - YYFPRINTF (yyoutput, "%s %s (", | |
| - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); | |
| + YYFPRINTF (yyo, "%s %s (", | |
| + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); | |
| - yy_symbol_value_print (yyoutput, yytype, yyvaluep); | |
| - YYFPRINTF (yyoutput, ")"); | |
| + yy_symbol_value_print (yyo, yykind, yyvaluep); | |
| + YYFPRINTF (yyo, ")"); | |
| } | |
| /*------------------------------------------------------------------. | |
| @@ -668,7 +734,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
| `------------------------------------------------------------------*/ | |
| static void | |
| -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) | |
| +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) | |
| { | |
| YYFPRINTF (stderr, "Stack now"); | |
| for (; yybottom <= yytop; yybottom++) | |
| @@ -691,21 +757,21 @@ do { \ | |
| `------------------------------------------------*/ | |
| static void | |
| -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) | |
| +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, | |
| + int yyrule) | |
| { | |
| - unsigned long int yylno = yyrline[yyrule]; | |
| + int yylno = yyrline[yyrule]; | |
| int yynrhs = yyr2[yyrule]; | |
| int yyi; | |
| - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", | |
| + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", | |
| yyrule - 1, yylno); | |
| /* The symbols being reduced. */ | |
| for (yyi = 0; yyi < yynrhs; yyi++) | |
| { | |
| YYFPRINTF (stderr, " $%d = ", yyi + 1); | |
| yy_symbol_print (stderr, | |
| - yystos[yyssp[yyi + 1 - yynrhs]], | |
| - &(yyvsp[(yyi + 1) - (yynrhs)]) | |
| - ); | |
| + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), | |
| + &yyvsp[(yyi + 1) - (yynrhs)]); | |
| YYFPRINTF (stderr, "\n"); | |
| } | |
| } | |
| @@ -720,8 +786,8 @@ do { \ | |
| multiple parsers can coexist. */ | |
| int yydebug; | |
| #else /* !YYDEBUG */ | |
| -# define YYDPRINTF(Args) | |
| -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) | |
| +# define YYDPRINTF(Args) ((void) 0) | |
| +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) | |
| # define YY_STACK_PRINT(Bottom, Top) | |
| # define YY_REDUCE_PRINT(Rule) | |
| #endif /* !YYDEBUG */ | |
| @@ -744,249 +810,30 @@ int yydebug; | |
| #endif | |
| -#if YYERROR_VERBOSE | |
| -# ifndef yystrlen | |
| -# if defined __GLIBC__ && defined _STRING_H | |
| -# define yystrlen strlen | |
| -# else | |
| -/* Return the length of YYSTR. */ | |
| -static YYSIZE_T | |
| -yystrlen (const char *yystr) | |
| -{ | |
| - YYSIZE_T yylen; | |
| - for (yylen = 0; yystr[yylen]; yylen++) | |
| - continue; | |
| - return yylen; | |
| -} | |
| -# endif | |
| -# endif | |
| -# ifndef yystpcpy | |
| -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE | |
| -# define yystpcpy stpcpy | |
| -# else | |
| -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
| - YYDEST. */ | |
| -static char * | |
| -yystpcpy (char *yydest, const char *yysrc) | |
| -{ | |
| - char *yyd = yydest; | |
| - const char *yys = yysrc; | |
| - while ((*yyd++ = *yys++) != '\0') | |
| - continue; | |
| - | |
| - return yyd - 1; | |
| -} | |
| -# endif | |
| -# endif | |
| - | |
| -# ifndef yytnamerr | |
| -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
| - quotes and backslashes, so that it's suitable for yyerror. The | |
| - heuristic is that double-quoting is unnecessary unless the string | |
| - contains an apostrophe, a comma, or backslash (other than | |
| - backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
| - null, do not copy; instead, return the length of what the result | |
| - would have been. */ | |
| -static YYSIZE_T | |
| -yytnamerr (char *yyres, const char *yystr) | |
| -{ | |
| - if (*yystr == '"') | |
| - { | |
| - YYSIZE_T yyn = 0; | |
| - char const *yyp = yystr; | |
| - | |
| - for (;;) | |
| - switch (*++yyp) | |
| - { | |
| - case '\'': | |
| - case ',': | |
| - goto do_not_strip_quotes; | |
| - | |
| - case '\\': | |
| - if (*++yyp != '\\') | |
| - goto do_not_strip_quotes; | |
| - /* Fall through. */ | |
| - default: | |
| - if (yyres) | |
| - yyres[yyn] = *yyp; | |
| - yyn++; | |
| - break; | |
| - | |
| - case '"': | |
| - if (yyres) | |
| - yyres[yyn] = '\0'; | |
| - return yyn; | |
| - } | |
| - do_not_strip_quotes: ; | |
| - } | |
| - | |
| - if (! yyres) | |
| - return yystrlen (yystr); | |
| - | |
| - return yystpcpy (yyres, yystr) - yyres; | |
| -} | |
| -# endif | |
| - | |
| -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message | |
| - about the unexpected token YYTOKEN for the state stack whose top is | |
| - YYSSP. | |
| - | |
| - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is | |
| - not large enough to hold the message. In that case, also set | |
| - *YYMSG_ALLOC to the required number of bytes. Return 2 if the | |
| - required number of bytes is too large to store. */ | |
| -static int | |
| -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |
| - yytype_int16 *yyssp, int yytoken) | |
| -{ | |
| - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); | |
| - YYSIZE_T yysize = yysize0; | |
| - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | |
| - /* Internationalized format string. */ | |
| - const char *yyformat = YY_NULLPTR; | |
| - /* Arguments of yyformat. */ | |
| - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
| - /* Number of reported tokens (one for the "unexpected", one per | |
| - "expected"). */ | |
| - int yycount = 0; | |
| - | |
| - /* There are many possibilities here to consider: | |
| - - If this state is a consistent state with a default action, then | |
| - the only way this function was invoked is if the default action | |
| - is an error action. In that case, don't check for expected | |
| - tokens because there are none. | |
| - - The only way there can be no lookahead present (in yychar) is if | |
| - this state is a consistent state with a default action. Thus, | |
| - detecting the absence of a lookahead is sufficient to determine | |
| - that there is no unexpected or expected token to report. In that | |
| - case, just report a simple "syntax error". | |
| - - Don't assume there isn't a lookahead just because this state is a | |
| - consistent state with a default action. There might have been a | |
| - previous inconsistent state, consistent state with a non-default | |
| - action, or user semantic action that manipulated yychar. | |
| - - Of course, the expected token list depends on states to have | |
| - correct lookahead information, and it depends on the parser not | |
| - to perform extra reductions after fetching a lookahead from the | |
| - scanner and before detecting a syntax error. Thus, state merging | |
| - (from LALR or IELR) and default reductions corrupt the expected | |
| - token list. However, the list is correct for canonical LR with | |
| - one exception: it will still contain any token that will not be | |
| - accepted due to an error action in a later state. | |
| - */ | |
| - if (yytoken != YYEMPTY) | |
| - { | |
| - int yyn = yypact[*yyssp]; | |
| - yyarg[yycount++] = yytname[yytoken]; | |
| - if (!yypact_value_is_default (yyn)) | |
| - { | |
| - /* Start YYX at -YYN if negative to avoid negative indexes in | |
| - YYCHECK. In other words, skip the first -YYN actions for | |
| - this state because they are default actions. */ | |
| - int yyxbegin = yyn < 0 ? -yyn : 0; | |
| - /* Stay within bounds of both yycheck and yytname. */ | |
| - int yychecklim = YYLAST - yyn + 1; | |
| - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | |
| - int yyx; | |
| - | |
| - for (yyx = yyxbegin; yyx < yyxend; ++yyx) | |
| - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR | |
| - && !yytable_value_is_error (yytable[yyx + yyn])) | |
| - { | |
| - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | |
| - { | |
| - yycount = 1; | |
| - yysize = yysize0; | |
| - break; | |
| - } | |
| - yyarg[yycount++] = yytname[yyx]; | |
| - { | |
| - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); | |
| - if (! (yysize <= yysize1 | |
| - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
| - return 2; | |
| - yysize = yysize1; | |
| - } | |
| - } | |
| - } | |
| - } | |
| - | |
| - switch (yycount) | |
| - { | |
| -# define YYCASE_(N, S) \ | |
| - case N: \ | |
| - yyformat = S; \ | |
| - break | |
| - YYCASE_(0, YY_("syntax error")); | |
| - YYCASE_(1, YY_("syntax error, unexpected %s")); | |
| - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | |
| - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | |
| - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | |
| - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | |
| -# undef YYCASE_ | |
| - } | |
| - | |
| - { | |
| - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); | |
| - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
| - return 2; | |
| - yysize = yysize1; | |
| - } | |
| - | |
| - if (*yymsg_alloc < yysize) | |
| - { | |
| - *yymsg_alloc = 2 * yysize; | |
| - if (! (yysize <= *yymsg_alloc | |
| - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) | |
| - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; | |
| - return 1; | |
| - } | |
| - | |
| - /* Avoid sprintf, as that infringes on the user's name space. | |
| - Don't have undefined behavior even if the translation | |
| - produced a string with the wrong number of "%s"s. */ | |
| - { | |
| - char *yyp = *yymsg; | |
| - int yyi = 0; | |
| - while ((*yyp = *yyformat) != '\0') | |
| - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | |
| - { | |
| - yyp += yytnamerr (yyp, yyarg[yyi++]); | |
| - yyformat += 2; | |
| - } | |
| - else | |
| - { | |
| - yyp++; | |
| - yyformat++; | |
| - } | |
| - } | |
| - return 0; | |
| -} | |
| -#endif /* YYERROR_VERBOSE */ | |
| /*-----------------------------------------------. | |
| | Release the memory associated to this symbol. | | |
| `-----------------------------------------------*/ | |
| static void | |
| -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) | |
| +yydestruct (const char *yymsg, | |
| + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) | |
| { | |
| - YYUSE (yyvaluep); | |
| + YY_USE (yyvaluep); | |
| if (!yymsg) | |
| yymsg = "Deleting"; | |
| - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
| + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); | |
| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
| - YYUSE (yytype); | |
| + YY_USE (yykind); | |
| YY_IGNORE_MAYBE_UNINITIALIZED_END | |
| } | |
| - | |
| - | |
| -/* The lookahead symbol. */ | |
| +/* Lookahead token kind. */ | |
| int yychar; | |
| /* The semantic value of the lookahead symbol. */ | |
| @@ -995,6 +842,8 @@ YYSTYPE yylval; | |
| int yynerrs; | |
| + | |
| + | |
| /*----------. | |
| | yyparse. | | |
| `----------*/ | |
| @@ -1002,43 +851,36 @@ int yynerrs; | |
| int | |
| yyparse (void) | |
| { | |
| - int yystate; | |
| + yy_state_fast_t yystate = 0; | |
| /* Number of tokens to shift before error messages enabled. */ | |
| - int yyerrstatus; | |
| - | |
| - /* The stacks and their tools: | |
| - 'yyss': related to states. | |
| - 'yyvs': related to semantic values. | |
| + int yyerrstatus = 0; | |
| - Refer to the stacks through separate pointers, to allow yyoverflow | |
| + /* Refer to the stacks through separate pointers, to allow yyoverflow | |
| to reallocate them elsewhere. */ | |
| - /* The state stack. */ | |
| - yytype_int16 yyssa[YYINITDEPTH]; | |
| - yytype_int16 *yyss; | |
| - yytype_int16 *yyssp; | |
| + /* Their size. */ | |
| + YYPTRDIFF_T yystacksize = YYINITDEPTH; | |
| - /* The semantic value stack. */ | |
| - YYSTYPE yyvsa[YYINITDEPTH]; | |
| - YYSTYPE *yyvs; | |
| - YYSTYPE *yyvsp; | |
| + /* The state stack: array, bottom, top. */ | |
| + yy_state_t yyssa[YYINITDEPTH]; | |
| + yy_state_t *yyss = yyssa; | |
| + yy_state_t *yyssp = yyss; | |
| - YYSIZE_T yystacksize; | |
| + /* The semantic value stack: array, bottom, top. */ | |
| + YYSTYPE yyvsa[YYINITDEPTH]; | |
| + YYSTYPE *yyvs = yyvsa; | |
| + YYSTYPE *yyvsp = yyvs; | |
| int yyn; | |
| + /* The return value of yyparse. */ | |
| int yyresult; | |
| - /* Lookahead token as an internal (translated) token number. */ | |
| - int yytoken = 0; | |
| + /* Lookahead symbol kind. */ | |
| + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; | |
| /* The variables used to return semantic value and location from the | |
| action routines. */ | |
| YYSTYPE yyval; | |
| -#if YYERROR_VERBOSE | |
| - /* Buffer for error messages, and its allocated size. */ | |
| - char yymsgbuf[128]; | |
| - char *yymsg = yymsgbuf; | |
| - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
| -#endif | |
| + | |
| #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) | |
| @@ -1046,71 +888,75 @@ yyparse (void) | |
| Keep to zero when no symbol should be popped. */ | |
| int yylen = 0; | |
| - yyssp = yyss = yyssa; | |
| - yyvsp = yyvs = yyvsa; | |
| - yystacksize = YYINITDEPTH; | |
| - | |
| YYDPRINTF ((stderr, "Starting parse\n")); | |
| - yystate = 0; | |
| - yyerrstatus = 0; | |
| - yynerrs = 0; | |
| yychar = YYEMPTY; /* Cause a token to be read. */ | |
| + | |
| goto yysetstate; | |
| + | |
| /*------------------------------------------------------------. | |
| -| yynewstate -- Push a new state, which is found in yystate. | | |
| +| yynewstate -- push a new state, which is found in yystate. | | |
| `------------------------------------------------------------*/ | |
| - yynewstate: | |
| +yynewstate: | |
| /* In all cases, when you get here, the value and location stacks | |
| have just been pushed. So pushing a state here evens the stacks. */ | |
| yyssp++; | |
| - yysetstate: | |
| - *yyssp = yystate; | |
| + | |
| +/*--------------------------------------------------------------------. | |
| +| yysetstate -- set current state (the top of the stack) to yystate. | | |
| +`--------------------------------------------------------------------*/ | |
| +yysetstate: | |
| + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
| + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); | |
| + YY_IGNORE_USELESS_CAST_BEGIN | |
| + *yyssp = YY_CAST (yy_state_t, yystate); | |
| + YY_IGNORE_USELESS_CAST_END | |
| + YY_STACK_PRINT (yyss, yyssp); | |
| if (yyss + yystacksize - 1 <= yyssp) | |
| +#if !defined yyoverflow && !defined YYSTACK_RELOCATE | |
| + YYNOMEM; | |
| +#else | |
| { | |
| /* Get the current used size of the three stacks, in elements. */ | |
| - YYSIZE_T yysize = yyssp - yyss + 1; | |
| + YYPTRDIFF_T yysize = yyssp - yyss + 1; | |
| -#ifdef yyoverflow | |
| +# if defined yyoverflow | |
| { | |
| /* Give user a chance to reallocate the stack. Use copies of | |
| these so that the &'s don't force the real ones into | |
| memory. */ | |
| + yy_state_t *yyss1 = yyss; | |
| YYSTYPE *yyvs1 = yyvs; | |
| - yytype_int16 *yyss1 = yyss; | |
| /* Each stack pointer address is followed by the size of the | |
| data in use in that stack, in bytes. This used to be a | |
| conditional around just the two extra args, but that might | |
| be undefined if yyoverflow is a macro. */ | |
| yyoverflow (YY_("memory exhausted"), | |
| - &yyss1, yysize * sizeof (*yyssp), | |
| - &yyvs1, yysize * sizeof (*yyvsp), | |
| + &yyss1, yysize * YYSIZEOF (*yyssp), | |
| + &yyvs1, yysize * YYSIZEOF (*yyvsp), | |
| &yystacksize); | |
| - | |
| yyss = yyss1; | |
| yyvs = yyvs1; | |
| } | |
| -#else /* no yyoverflow */ | |
| -# ifndef YYSTACK_RELOCATE | |
| - goto yyexhaustedlab; | |
| -# else | |
| +# else /* defined YYSTACK_RELOCATE */ | |
| /* Extend the stack our own way. */ | |
| if (YYMAXDEPTH <= yystacksize) | |
| - goto yyexhaustedlab; | |
| + YYNOMEM; | |
| yystacksize *= 2; | |
| if (YYMAXDEPTH < yystacksize) | |
| yystacksize = YYMAXDEPTH; | |
| { | |
| - yytype_int16 *yyss1 = yyss; | |
| + yy_state_t *yyss1 = yyss; | |
| union yyalloc *yyptr = | |
| - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
| + YY_CAST (union yyalloc *, | |
| + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); | |
| if (! yyptr) | |
| - goto yyexhaustedlab; | |
| + YYNOMEM; | |
| YYSTACK_RELOCATE (yyss_alloc, yyss); | |
| YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
| # undef YYSTACK_RELOCATE | |
| @@ -1118,30 +964,31 @@ yyparse (void) | |
| YYSTACK_FREE (yyss1); | |
| } | |
| # endif | |
| -#endif /* no yyoverflow */ | |
| yyssp = yyss + yysize - 1; | |
| yyvsp = yyvs + yysize - 1; | |
| - YYDPRINTF ((stderr, "Stack size increased to %lu\n", | |
| - (unsigned long int) yystacksize)); | |
| + YY_IGNORE_USELESS_CAST_BEGIN | |
| + YYDPRINTF ((stderr, "Stack size increased to %ld\n", | |
| + YY_CAST (long, yystacksize))); | |
| + YY_IGNORE_USELESS_CAST_END | |
| if (yyss + yystacksize - 1 <= yyssp) | |
| YYABORT; | |
| } | |
| +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ | |
| - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
| if (yystate == YYFINAL) | |
| YYACCEPT; | |
| goto yybackup; | |
| + | |
| /*-----------. | |
| | yybackup. | | |
| `-----------*/ | |
| yybackup: | |
| - | |
| /* Do appropriate processing given the current state. Read a | |
| lookahead token if we need one and don't already have one. */ | |
| @@ -1152,18 +999,29 @@ yybackup: | |
| /* Not known => get a lookahead token if don't already have one. */ | |
| - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ | |
| + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ | |
| if (yychar == YYEMPTY) | |
| { | |
| - YYDPRINTF ((stderr, "Reading a token: ")); | |
| + YYDPRINTF ((stderr, "Reading a token\n")); | |
| yychar = yylex (); | |
| } | |
| if (yychar <= YYEOF) | |
| { | |
| - yychar = yytoken = YYEOF; | |
| + yychar = YYEOF; | |
| + yytoken = YYSYMBOL_YYEOF; | |
| YYDPRINTF ((stderr, "Now at end of input.\n")); | |
| } | |
| + else if (yychar == YYerror) | |
| + { | |
| + /* The scanner already issued an error message, process directly | |
| + to error recovery. But do not keep the error token as | |
| + lookahead, it is too special and may lead us to an endless | |
| + loop in error recovery. */ | |
| + yychar = YYUNDEF; | |
| + yytoken = YYSYMBOL_YYerror; | |
| + goto yyerrlab1; | |
| + } | |
| else | |
| { | |
| yytoken = YYTRANSLATE (yychar); | |
| @@ -1191,15 +1049,13 @@ yybackup: | |
| /* Shift the lookahead token. */ | |
| YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); | |
| - | |
| - /* Discard the shifted token. */ | |
| - yychar = YYEMPTY; | |
| - | |
| yystate = yyn; | |
| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
| *++yyvsp = yylval; | |
| YY_IGNORE_MAYBE_UNINITIALIZED_END | |
| + /* Discard the shifted token. */ | |
| + yychar = YYEMPTY; | |
| goto yynewstate; | |
| @@ -1214,7 +1070,7 @@ yydefault: | |
| /*-----------------------------. | |
| -| yyreduce -- Do a reduction. | | |
| +| yyreduce -- do a reduction. | | |
| `-----------------------------*/ | |
| yyreduce: | |
| /* yyn is the number of a rule to reduce with. */ | |
| @@ -1234,41 +1090,41 @@ yyreduce: | |
| YY_REDUCE_PRINT (yyn); | |
| switch (yyn) | |
| { | |
| - case 2: | |
| -#line 40 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 2: /* action: searchexpr */ | |
| +#line 40 "./Parser.y" | |
| + { | |
| ParsedSearchExpression((yyvsp[0].pexpr)); | |
| delete (yyvsp[0].pexpr); | |
| return 0; | |
| } | |
| -#line 1245 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1101 "Parser.cpp" | |
| break; | |
| - case 3: | |
| -#line 46 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 3: /* action: TOK_ED2K_LINK */ | |
| +#line 46 "./Parser.y" | |
| + { | |
| CSearchExpr* pexpr = new CSearchExpr(*(yyvsp[0].pstr)); | |
| ParsedSearchExpression(pexpr); | |
| delete pexpr; | |
| delete (yyvsp[0].pstr); | |
| return 0; | |
| } | |
| -#line 1257 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1113 "Parser.cpp" | |
| break; | |
| - case 4: | |
| -#line 55 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 4: /* action: searchexpr error */ | |
| +#line 55 "./Parser.y" | |
| + { | |
| yyerror(wxT("Undefined search expression error")); | |
| delete (yyvsp[-1].pexpr); | |
| return 1; | |
| } | |
| -#line 1267 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1123 "Parser.cpp" | |
| break; | |
| - case 6: | |
| -#line 65 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 6: /* searchexpr: searchexpr TOK_AND searchexpr */ | |
| +#line 65 "./Parser.y" | |
| + { | |
| CSearchExpr* pexpr = new CSearchExpr; | |
| pexpr->Add(SEARCHOP_AND); | |
| pexpr->Add((yyvsp[-2].pexpr)); | |
| @@ -1277,12 +1133,12 @@ yyreduce: | |
| delete (yyvsp[-2].pexpr); | |
| delete (yyvsp[0].pexpr); | |
| } | |
| -#line 1281 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1137 "Parser.cpp" | |
| break; | |
| - case 7: | |
| -#line 75 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 7: /* searchexpr: searchexpr TOK_OR searchexpr */ | |
| +#line 75 "./Parser.y" | |
| + { | |
| CSearchExpr* pexpr = new CSearchExpr; | |
| pexpr->Add(SEARCHOP_OR); | |
| pexpr->Add((yyvsp[-2].pexpr)); | |
| @@ -1291,12 +1147,12 @@ yyreduce: | |
| delete (yyvsp[-2].pexpr); | |
| delete (yyvsp[0].pexpr); | |
| } | |
| -#line 1295 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1151 "Parser.cpp" | |
| break; | |
| - case 8: | |
| -#line 85 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 8: /* searchexpr: searchexpr TOK_NOT searchexpr */ | |
| +#line 85 "./Parser.y" | |
| + { | |
| CSearchExpr* pexpr = new CSearchExpr; | |
| pexpr->Add(SEARCHOP_NOT); | |
| pexpr->Add((yyvsp[-2].pexpr)); | |
| @@ -1305,95 +1161,95 @@ yyreduce: | |
| delete (yyvsp[-2].pexpr); | |
| delete (yyvsp[0].pexpr); | |
| } | |
| -#line 1309 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1165 "Parser.cpp" | |
| break; | |
| - case 9: | |
| -#line 95 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 9: /* searchexpr: '(' searchexpr ')' */ | |
| +#line 95 "./Parser.y" | |
| + { | |
| (yyval.pexpr) = (yyvsp[-1].pexpr); | |
| } | |
| -#line 1317 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1173 "Parser.cpp" | |
| break; | |
| - case 10: | |
| -#line 100 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 10: /* searchexpr: searchexpr TOK_OR error */ | |
| +#line 100 "./Parser.y" | |
| + { | |
| yyerror(wxT("Missing right operand for OR on search expression")); | |
| delete (yyvsp[-2].pexpr); | |
| return 1; | |
| } | |
| -#line 1327 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1183 "Parser.cpp" | |
| break; | |
| - case 11: | |
| -#line 106 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 11: /* searchexpr: searchexpr TOK_NOT error */ | |
| +#line 106 "./Parser.y" | |
| + { | |
| yyerror(wxT("Missing operand for NOT on search expression")); | |
| delete (yyvsp[-2].pexpr); | |
| return 1; | |
| } | |
| -#line 1337 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1193 "Parser.cpp" | |
| break; | |
| - case 12: | |
| -#line 112 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 12: /* searchexpr: '(' error */ | |
| +#line 112 "./Parser.y" | |
| + { | |
| yyerror(wxT("Missing left parenthesis on search expression")); | |
| return 1; | |
| } | |
| -#line 1346 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1202 "Parser.cpp" | |
| break; | |
| - case 13: | |
| -#line 117 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 13: /* searchexpr: '(' searchexpr error */ | |
| +#line 117 "./Parser.y" | |
| + { | |
| yyerror(wxT("Missing closing parenthesis on search expression")); | |
| delete (yyvsp[-1].pexpr); | |
| return 1; | |
| } | |
| -#line 1356 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1212 "Parser.cpp" | |
| break; | |
| - case 14: | |
| -#line 123 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 14: /* searchexpr: TOK_AND error */ | |
| +#line 123 "./Parser.y" | |
| + { | |
| yyerror(wxT("Missing left operand for AND on search expression")); | |
| return 1; | |
| } | |
| -#line 1365 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1221 "Parser.cpp" | |
| break; | |
| - case 15: | |
| -#line 128 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 15: /* searchexpr: TOK_OR error */ | |
| +#line 128 "./Parser.y" | |
| + { | |
| yyerror(wxT("Missing left operand for OR on search expression")); | |
| return 1; | |
| } | |
| -#line 1374 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1230 "Parser.cpp" | |
| break; | |
| - case 16: | |
| -#line 133 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 16: /* searchexpr: TOK_NOT error */ | |
| +#line 133 "./Parser.y" | |
| + { | |
| yyerror(wxT("Missing left operand for NOT on search expression (?)")); | |
| return 1; | |
| } | |
| -#line 1383 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1239 "Parser.cpp" | |
| break; | |
| - case 17: | |
| -#line 140 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 17: /* and_strings: TOK_STRING */ | |
| +#line 140 "./Parser.y" | |
| + { | |
| (yyval.pexpr) = new CSearchExpr(*(yyvsp[0].pstr)); | |
| delete (yyvsp[0].pstr); | |
| } | |
| -#line 1392 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1248 "Parser.cpp" | |
| break; | |
| - case 18: | |
| -#line 145 "./Parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 18: /* and_strings: and_strings TOK_STRING */ | |
| +#line 145 "./Parser.y" | |
| + { | |
| /*$1->Concatenate($2); | |
| delete $2;*/ | |
| CSearchExpr* pexpr = new CSearchExpr; | |
| @@ -1404,11 +1260,12 @@ yyreduce: | |
| delete (yyvsp[-1].pexpr); | |
| delete (yyvsp[0].pstr); | |
| } | |
| -#line 1408 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1264 "Parser.cpp" | |
| break; | |
| -#line 1412 "Parser.cpp" /* yacc.c:1646 */ | |
| +#line 1268 "Parser.cpp" | |
| + | |
| default: break; | |
| } | |
| /* User semantic actions sometimes alter yychar, and that requires | |
| @@ -1422,25 +1279,23 @@ yyreduce: | |
| case of YYERROR or YYBACKUP, subsequent parser actions might lead | |
| to an incorrect destructor call or verbose syntax error message | |
| before the lookahead is translated. */ | |
| - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); | |
| + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); | |
| YYPOPSTACK (yylen); | |
| yylen = 0; | |
| - YY_STACK_PRINT (yyss, yyssp); | |
| *++yyvsp = yyval; | |
| /* Now 'shift' the result of the reduction. Determine what state | |
| that goes to, based on the state we popped back to and the rule | |
| number reduced by. */ | |
| - | |
| - yyn = yyr1[yyn]; | |
| - | |
| - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | |
| - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
| - yystate = yytable[yystate]; | |
| - else | |
| - yystate = yydefgoto[yyn - YYNTOKENS]; | |
| + { | |
| + const int yylhs = yyr1[yyn] - YYNTOKENS; | |
| + const int yyi = yypgoto[yylhs] + *yyssp; | |
| + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp | |
| + ? yytable[yyi] | |
| + : yydefgoto[yylhs]); | |
| + } | |
| goto yynewstate; | |
| @@ -1451,50 +1306,14 @@ yyreduce: | |
| yyerrlab: | |
| /* Make sure we have latest lookahead translation. See comments at | |
| user semantic actions for why this is necessary. */ | |
| - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); | |
| - | |
| + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); | |
| /* If not already recovering from an error, report this error. */ | |
| if (!yyerrstatus) | |
| { | |
| ++yynerrs; | |
| -#if ! YYERROR_VERBOSE | |
| yyerror (YY_("syntax error")); | |
| -#else | |
| -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ | |
| - yyssp, yytoken) | |
| - { | |
| - char const *yymsgp = YY_("syntax error"); | |
| - int yysyntax_error_status; | |
| - yysyntax_error_status = YYSYNTAX_ERROR; | |
| - if (yysyntax_error_status == 0) | |
| - yymsgp = yymsg; | |
| - else if (yysyntax_error_status == 1) | |
| - { | |
| - if (yymsg != yymsgbuf) | |
| - YYSTACK_FREE (yymsg); | |
| - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); | |
| - if (!yymsg) | |
| - { | |
| - yymsg = yymsgbuf; | |
| - yymsg_alloc = sizeof yymsgbuf; | |
| - yysyntax_error_status = 2; | |
| - } | |
| - else | |
| - { | |
| - yysyntax_error_status = YYSYNTAX_ERROR; | |
| - yymsgp = yymsg; | |
| - } | |
| - } | |
| - yyerror (yymsgp); | |
| - if (yysyntax_error_status == 2) | |
| - goto yyexhaustedlab; | |
| - } | |
| -# undef YYSYNTAX_ERROR | |
| -#endif | |
| } | |
| - | |
| - | |
| if (yyerrstatus == 3) | |
| { | |
| /* If just tried and failed to reuse lookahead token after an | |
| @@ -1523,12 +1342,11 @@ yyerrlab: | |
| | yyerrorlab -- error raised explicitly by YYERROR. | | |
| `---------------------------------------------------*/ | |
| yyerrorlab: | |
| - | |
| - /* Pacify compilers like GCC when the user code never invokes | |
| - YYERROR and the label yyerrorlab therefore never appears in user | |
| - code. */ | |
| - if (/*CONSTCOND*/ 0) | |
| - goto yyerrorlab; | |
| + /* Pacify compilers when the user code never invokes YYERROR and the | |
| + label yyerrorlab therefore never appears in user code. */ | |
| + if (0) | |
| + YYERROR; | |
| + ++yynerrs; | |
| /* Do not reclaim the symbols of the rule whose action triggered | |
| this YYERROR. */ | |
| @@ -1545,13 +1363,14 @@ yyerrorlab: | |
| yyerrlab1: | |
| yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
| + /* Pop stack until we find a state that shifts the error token. */ | |
| for (;;) | |
| { | |
| yyn = yypact[yystate]; | |
| if (!yypact_value_is_default (yyn)) | |
| { | |
| - yyn += YYTERROR; | |
| - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
| + yyn += YYSYMBOL_YYerror; | |
| + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) | |
| { | |
| yyn = yytable[yyn]; | |
| if (0 < yyn) | |
| @@ -1565,7 +1384,7 @@ yyerrlab1: | |
| yydestruct ("Error: popping", | |
| - yystos[yystate], yyvsp); | |
| + YY_ACCESSING_SYMBOL (yystate), yyvsp); | |
| YYPOPSTACK (1); | |
| yystate = *yyssp; | |
| YY_STACK_PRINT (yyss, yyssp); | |
| @@ -1577,7 +1396,7 @@ yyerrlab1: | |
| /* Shift the error token. */ | |
| - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); | |
| + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); | |
| yystate = yyn; | |
| goto yynewstate; | |
| @@ -1588,26 +1407,30 @@ yyerrlab1: | |
| `-------------------------------------*/ | |
| yyacceptlab: | |
| yyresult = 0; | |
| - goto yyreturn; | |
| + goto yyreturnlab; | |
| + | |
| /*-----------------------------------. | |
| | yyabortlab -- YYABORT comes here. | | |
| `-----------------------------------*/ | |
| yyabortlab: | |
| yyresult = 1; | |
| - goto yyreturn; | |
| + goto yyreturnlab; | |
| -#if !defined yyoverflow || YYERROR_VERBOSE | |
| -/*-------------------------------------------------. | |
| -| yyexhaustedlab -- memory exhaustion comes here. | | |
| -`-------------------------------------------------*/ | |
| + | |
| +/*-----------------------------------------------------------. | |
| +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | | |
| +`-----------------------------------------------------------*/ | |
| yyexhaustedlab: | |
| yyerror (YY_("memory exhausted")); | |
| yyresult = 2; | |
| - /* Fall through. */ | |
| -#endif | |
| + goto yyreturnlab; | |
| + | |
| -yyreturn: | |
| +/*----------------------------------------------------------. | |
| +| yyreturnlab -- parsing is finished, clean up and return. | | |
| +`----------------------------------------------------------*/ | |
| +yyreturnlab: | |
| if (yychar != YYEMPTY) | |
| { | |
| /* Make sure we have latest lookahead translation. See comments at | |
| @@ -1623,20 +1446,18 @@ yyreturn: | |
| while (yyssp != yyss) | |
| { | |
| yydestruct ("Cleanup: popping", | |
| - yystos[*yyssp], yyvsp); | |
| + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); | |
| YYPOPSTACK (1); | |
| } | |
| #ifndef yyoverflow | |
| if (yyss != yyssa) | |
| YYSTACK_FREE (yyss); | |
| #endif | |
| -#if YYERROR_VERBOSE | |
| - if (yymsg != yymsgbuf) | |
| - YYSTACK_FREE (yymsg); | |
| -#endif | |
| + | |
| return yyresult; | |
| } | |
| -#line 158 "./Parser.y" /* yacc.c:1906 */ | |
| + | |
| +#line 158 "./Parser.y" | |
| int yyerror(const char* errstr) | |
| diff --git a/src/Parser.hpp b/src/Parser.hpp | |
| index 10bc992f9..210f27fc9 100644 | |
| --- a/src/Parser.hpp | |
| +++ b/src/Parser.hpp | |
| @@ -1,8 +1,9 @@ | |
| -/* A Bison parser, made by GNU Bison 3.0.4. */ | |
| +/* A Bison parser, made by GNU Bison 3.8.2. */ | |
| /* Bison interface for Yacc-like parsers in C | |
| - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. | |
| + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, | |
| + Inc. | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| @@ -15,7 +16,7 @@ | |
| GNU General Public License for more details. | |
| You should have received a copy of the GNU General Public License | |
| - along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
| + along with this program. If not, see <https://www.gnu.org/licenses/>. */ | |
| /* As a special exception, you may create a larger work that contains | |
| part or all of the Bison parser skeleton and distribute that work | |
| @@ -30,6 +31,10 @@ | |
| This special exception was added by the Free Software Foundation in | |
| version 2.2 of Bison. */ | |
| +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, | |
| + especially those whose name start with YY_ or yy_. They are | |
| + private implementation details that can be changed or removed. */ | |
| + | |
| #ifndef YY_YY_PARSER_HPP_INCLUDED | |
| # define YY_YY_PARSER_HPP_INCLUDED | |
| /* Debug traces. */ | |
| @@ -40,32 +45,36 @@ | |
| extern int yydebug; | |
| #endif | |
| -/* Token type. */ | |
| +/* Token kinds. */ | |
| #ifndef YYTOKENTYPE | |
| # define YYTOKENTYPE | |
| enum yytokentype | |
| { | |
| - TOK_STRING = 258, | |
| - TOK_AND = 259, | |
| - TOK_OR = 260, | |
| - TOK_NOT = 261, | |
| - TOK_ED2K_LINK = 262 | |
| + YYEMPTY = -2, | |
| + YYEOF = 0, /* "end of file" */ | |
| + YYerror = 256, /* error */ | |
| + YYUNDEF = 257, /* "invalid token" */ | |
| + TOK_STRING = 258, /* TOK_STRING */ | |
| + TOK_AND = 259, /* TOK_AND */ | |
| + TOK_OR = 260, /* TOK_OR */ | |
| + TOK_NOT = 261, /* TOK_NOT */ | |
| + TOK_ED2K_LINK = 262 /* TOK_ED2K_LINK */ | |
| }; | |
| + typedef enum yytokentype yytoken_kind_t; | |
| #endif | |
| /* Value type. */ | |
| #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
| - | |
| union YYSTYPE | |
| { | |
| -#line 20 "./Parser.y" /* yacc.c:1909 */ | |
| +#line 20 "./Parser.y" | |
| wxString* pstr; | |
| CSearchExpr* pexpr; | |
| -#line 67 "Parser.hpp" /* yacc.c:1909 */ | |
| -}; | |
| +#line 76 "Parser.hpp" | |
| +}; | |
| typedef union YYSTYPE YYSTYPE; | |
| # define YYSTYPE_IS_TRIVIAL 1 | |
| # define YYSTYPE_IS_DECLARED 1 | |
| @@ -74,6 +83,8 @@ typedef union YYSTYPE YYSTYPE; | |
| extern YYSTYPE yylval; | |
| + | |
| int yyparse (void); | |
| + | |
| #endif /* !YY_YY_PARSER_HPP_INCLUDED */ | |
| diff --git a/src/Scanner.cpp b/src/Scanner.cpp | |
| index a55e0e15c..791a8e614 100644 | |
| --- a/src/Scanner.cpp | |
| +++ b/src/Scanner.cpp | |
| @@ -8,8 +8,8 @@ | |
| #define FLEX_SCANNER | |
| #define YY_FLEX_MAJOR_VERSION 2 | |
| -#define YY_FLEX_MINOR_VERSION 5 | |
| -#define YY_FLEX_SUBMINOR_VERSION 39 | |
| +#define YY_FLEX_MINOR_VERSION 6 | |
| +#define YY_FLEX_SUBMINOR_VERSION 4 | |
| #if YY_FLEX_SUBMINOR_VERSION > 0 | |
| #define FLEX_BETA | |
| #endif | |
| @@ -55,6 +55,7 @@ typedef unsigned char flex_uint8_t; | |
| typedef unsigned short int flex_uint16_t; | |
| typedef unsigned int flex_uint32_t; | |
| +#include <stdint.h> | |
| /* Limits of integral types. */ | |
| #ifndef INT8_MIN | |
| #define INT8_MIN (-128) | |
| @@ -84,65 +85,61 @@ typedef unsigned int flex_uint32_t; | |
| #define UINT32_MAX (4294967295U) | |
| #endif | |
| +#ifndef SIZE_MAX | |
| +#define SIZE_MAX (~(size_t)0) | |
| +#endif | |
| + | |
| #endif /* ! C99 */ | |
| #endif /* ! FLEXINT_H */ | |
| -#ifdef __cplusplus | |
| - | |
| -/* The "const" storage-class-modifier is valid. */ | |
| -#define YY_USE_CONST | |
| - | |
| -#else /* ! __cplusplus */ | |
| +/* begin standard C++ headers. */ | |
| -/* C99 requires __STDC__ to be defined as 1. */ | |
| -#if defined (__STDC__) | |
| - | |
| -#define YY_USE_CONST | |
| - | |
| -#endif /* defined (__STDC__) */ | |
| -#endif /* ! __cplusplus */ | |
| - | |
| -#ifdef YY_USE_CONST | |
| +/* TODO: this is always defined, so inline it */ | |
| #define yyconst const | |
| + | |
| +#if defined(__GNUC__) && __GNUC__ >= 3 | |
| +#define yynoreturn __attribute__((__noreturn__)) | |
| #else | |
| -#define yyconst | |
| +#define yynoreturn | |
| #endif | |
| /* Returned upon end-of-file. */ | |
| #define YY_NULL 0 | |
| -/* Promotes a possibly negative, possibly signed char to an unsigned | |
| - * integer for use as an array index. If the signed char is negative, | |
| - * we want to instead treat it as an 8-bit unsigned char, hence the | |
| - * double cast. | |
| +/* Promotes a possibly negative, possibly signed char to an | |
| + * integer in range [0..255] for use as an array index. | |
| */ | |
| -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) | |
| +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) | |
| /* Enter a start condition. This macro really ought to take a parameter, | |
| * but we do it the disgusting crufty way forced on us by the ()-less | |
| * definition of BEGIN. | |
| */ | |
| #define BEGIN (yy_start) = 1 + 2 * | |
| - | |
| /* Translate the current start state into a value that can be later handed | |
| * to BEGIN to return to the state. The YYSTATE alias is for lex | |
| * compatibility. | |
| */ | |
| #define YY_START (((yy_start) - 1) / 2) | |
| #define YYSTATE YY_START | |
| - | |
| /* Action number for EOF rule of a given start state. */ | |
| #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | |
| - | |
| /* Special action meaning "start processing a new file". */ | |
| -#define YY_NEW_FILE yyrestart(yyin ) | |
| - | |
| +#define YY_NEW_FILE yyrestart( yyin ) | |
| #define YY_END_OF_BUFFER_CHAR 0 | |
| /* Size of default input buffer. */ | |
| #ifndef YY_BUF_SIZE | |
| +#ifdef __ia64__ | |
| +/* On IA-64, the buffer size is 16k, not 8k. | |
| + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. | |
| + * Ditto for the __ia64__ case accordingly. | |
| + */ | |
| +#define YY_BUF_SIZE 32768 | |
| +#else | |
| #define YY_BUF_SIZE 16384 | |
| +#endif /* __ia64__ */ | |
| #endif | |
| /* The state buf must be large enough to hold one state per character in the main buffer. | |
| @@ -159,7 +156,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; | |
| typedef size_t yy_size_t; | |
| #endif | |
| -extern yy_size_t yyleng; | |
| +extern int yyleng; | |
| extern FILE *yyin, *yyout; | |
| @@ -183,7 +180,6 @@ extern FILE *yyin, *yyout; | |
| YY_DO_BEFORE_ACTION; /* set up yytext again */ \ | |
| } \ | |
| while ( 0 ) | |
| - | |
| #define unput(c) yyunput( c, (yytext_ptr) ) | |
| #ifndef YY_STRUCT_YY_BUFFER_STATE | |
| @@ -198,12 +194,12 @@ struct yy_buffer_state | |
| /* Size of input buffer in bytes, not including room for EOB | |
| * characters. | |
| */ | |
| - yy_size_t yy_buf_size; | |
| + int yy_buf_size; | |
| /* Number of characters read into yy_ch_buf, not including EOB | |
| * characters. | |
| */ | |
| - yy_size_t yy_n_chars; | |
| + int yy_n_chars; | |
| /* Whether we "own" the buffer - i.e., we know we created it, | |
| * and can realloc() it to grow it, and should free() it to | |
| @@ -254,7 +250,7 @@ struct yy_buffer_state | |
| /* Stack of input buffers. */ | |
| static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ | |
| static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ | |
| -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |
| +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ | |
| /* We provide macros for accessing buffer states in case in the | |
| * future we want to put the buffer states in a more general | |
| @@ -265,7 +261,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |
| #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ | |
| ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ | |
| : NULL) | |
| - | |
| /* Same as previous macro, but useful when we know that the buffer stack is not | |
| * NULL or when we need an lvalue. For internal use only. | |
| */ | |
| @@ -273,11 +268,11 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |
| /* yy_hold_char holds the character lost when yytext is formed. */ | |
| static char yy_hold_char; | |
| -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ | |
| -yy_size_t yyleng; | |
| +static size_t yy_n_chars; /* number of characters read into yy_ch_buf */ | |
| +int yyleng; | |
| /* Points to current character in buffer. */ | |
| -static char *yy_c_buf_p = (char *) 0; | |
| +static char *yy_c_buf_p = NULL; | |
| static int yy_init = 0; /* whether we need to initialize */ | |
| static int yy_start = 0; /* start state number */ | |
| @@ -286,85 +281,81 @@ static int yy_start = 0; /* start state number */ | |
| */ | |
| static int yy_did_buffer_switch_on_eof; | |
| -void yyrestart (FILE *input_file ); | |
| -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); | |
| -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); | |
| -void yy_delete_buffer (YY_BUFFER_STATE b ); | |
| -void yy_flush_buffer (YY_BUFFER_STATE b ); | |
| -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); | |
| -void yypop_buffer_state (void ); | |
| - | |
| -static void yyensure_buffer_stack (void ); | |
| -static void yy_load_buffer_state (void ); | |
| -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); | |
| +void yyrestart ( FILE *input_file ); | |
| +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); | |
| +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); | |
| +void yy_delete_buffer ( YY_BUFFER_STATE b ); | |
| +void yy_flush_buffer ( YY_BUFFER_STATE b ); | |
| +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); | |
| +void yypop_buffer_state ( void ); | |
| -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) | |
| +static void yyensure_buffer_stack ( void ); | |
| +static void yy_load_buffer_state ( void ); | |
| +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); | |
| +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) | |
| -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); | |
| -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); | |
| -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); | |
| +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); | |
| +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); | |
| +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); | |
| -void *yyalloc (yy_size_t ); | |
| -void *yyrealloc (void *,yy_size_t ); | |
| -void yyfree (void * ); | |
| +void *yyalloc ( yy_size_t ); | |
| +void *yyrealloc ( void *, yy_size_t ); | |
| +void yyfree ( void * ); | |
| #define yy_new_buffer yy_create_buffer | |
| - | |
| #define yy_set_interactive(is_interactive) \ | |
| { \ | |
| if ( ! YY_CURRENT_BUFFER ){ \ | |
| yyensure_buffer_stack (); \ | |
| YY_CURRENT_BUFFER_LVALUE = \ | |
| - yy_create_buffer(yyin,YY_BUF_SIZE ); \ | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); \ | |
| } \ | |
| YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ | |
| } | |
| - | |
| #define yy_set_bol(at_bol) \ | |
| { \ | |
| if ( ! YY_CURRENT_BUFFER ){\ | |
| yyensure_buffer_stack (); \ | |
| YY_CURRENT_BUFFER_LVALUE = \ | |
| - yy_create_buffer(yyin,YY_BUF_SIZE ); \ | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); \ | |
| } \ | |
| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ | |
| } | |
| - | |
| #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | |
| /* Begin user sect3 */ | |
| -#define yywrap() 1 | |
| +#define yywrap() (/*CONSTCOND*/1) | |
| #define YY_SKIP_YYWRAP | |
| +typedef flex_uint8_t YY_CHAR; | |
| -typedef unsigned char YY_CHAR; | |
| - | |
| -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; | |
| +FILE *yyin = NULL, *yyout = NULL; | |
| typedef int yy_state_type; | |
| extern int yylineno; | |
| - | |
| int yylineno = 1; | |
| extern char *yytext; | |
| +#ifdef yytext_ptr | |
| +#undef yytext_ptr | |
| +#endif | |
| #define yytext_ptr yytext | |
| -static yy_state_type yy_get_previous_state (void ); | |
| -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); | |
| -static int yy_get_next_buffer (void ); | |
| -static void yy_fatal_error (yyconst char msg[] ); | |
| +static yy_state_type yy_get_previous_state ( void ); | |
| +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); | |
| +static int yy_get_next_buffer ( void ); | |
| +static void yynoreturn yy_fatal_error ( const char* msg ); | |
| /* Done after the current pattern has been matched and before the | |
| * corresponding action - sets up yytext. | |
| */ | |
| #define YY_DO_BEFORE_ACTION \ | |
| (yytext_ptr) = yy_bp; \ | |
| - yyleng = (size_t) (yy_cp - yy_bp); \ | |
| + yyleng = (int) (yy_cp - yy_bp); \ | |
| (yy_hold_char) = *yy_cp; \ | |
| *yy_cp = '\0'; \ | |
| (yy_c_buf_p) = yy_cp; | |
| - | |
| #define YY_NUM_RULES 9 | |
| #define YY_END_OF_BUFFER 10 | |
| /* This struct is not used in this scanner, | |
| @@ -374,7 +365,7 @@ struct yy_trans_info | |
| flex_int32_t yy_verify; | |
| flex_int32_t yy_nxt; | |
| }; | |
| -static yyconst flex_int16_t yy_accept[57] = | |
| +static const flex_int16_t yy_accept[57] = | |
| { 0, | |
| 6, 6, 10, 6, 6, 1, 7, 8, 6, 6, | |
| 6, 6, 6, 6, 6, 2, 6, 3, 4, 6, | |
| @@ -384,7 +375,7 @@ static yyconst flex_int16_t yy_accept[57] = | |
| 6, 6, 6, 6, 5, 0 | |
| } ; | |
| -static yyconst flex_int32_t yy_ec[256] = | |
| +static const YY_CHAR yy_ec[256] = | |
| { 0, | |
| 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, | |
| 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| @@ -416,13 +407,13 @@ static yyconst flex_int32_t yy_ec[256] = | |
| 1, 1, 1, 1, 1 | |
| } ; | |
| -static yyconst flex_int32_t yy_meta[18] = | |
| +static const YY_CHAR yy_meta[18] = | |
| { 0, | |
| 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, | |
| 1, 1, 1, 1, 1, 1, 1 | |
| } ; | |
| -static yyconst flex_int16_t yy_base[58] = | |
| +static const flex_int16_t yy_base[58] = | |
| { 0, | |
| 0, 0, 45, 0, 0, 370, 370, 370, 31, 25, | |
| 23, 20, 0, 24, 17, 0, 19, 0, 0, 8, | |
| @@ -432,7 +423,7 @@ static yyconst flex_int16_t yy_base[58] = | |
| 320, 331, 342, 353, 0, 370, 19 | |
| } ; | |
| -static yyconst flex_int16_t yy_def[58] = | |
| +static const flex_int16_t yy_def[58] = | |
| { 0, | |
| 56, 1, 56, 57, 57, 56, 56, 56, 57, 57, | |
| 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, | |
| @@ -442,7 +433,7 @@ static yyconst flex_int16_t yy_def[58] = | |
| 57, 57, 57, 57, 57, 0, 56 | |
| } ; | |
| -static yyconst flex_int16_t yy_nxt[388] = | |
| +static const flex_int16_t yy_nxt[388] = | |
| { 0, | |
| 4, 5, 6, 7, 8, 4, 4, 4, 9, 4, | |
| 10, 11, 4, 4, 4, 12, 4, 24, 24, 13, | |
| @@ -488,7 +479,7 @@ static yyconst flex_int16_t yy_nxt[388] = | |
| 56, 56, 56, 56, 56, 56, 56 | |
| } ; | |
| -static yyconst flex_int16_t yy_chk[388] = | |
| +static const flex_int16_t yy_chk[388] = | |
| { 0, | |
| 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 1, 1, 1, 1, 1, 1, 1, 23, 23, 57, | |
| @@ -589,7 +580,8 @@ static char* _pszLexStr; | |
| void LexInit(const wxString& pszInput); | |
| void LexFree(); | |
| -#line 593 "Scanner.cpp" | |
| +#line 583 "Scanner.cpp" | |
| +#line 584 "Scanner.cpp" | |
| #define INITIAL 0 | |
| @@ -605,36 +597,36 @@ void LexFree(); | |
| #define YY_EXTRA_TYPE void * | |
| #endif | |
| -static int yy_init_globals (void ); | |
| +static int yy_init_globals ( void ); | |
| /* Accessor methods to globals. | |
| These are made visible to non-reentrant scanners for convenience. */ | |
| -int yylex_destroy (void ); | |
| +int yylex_destroy ( void ); | |
| -int yyget_debug (void ); | |
| +int yyget_debug ( void ); | |
| -void yyset_debug (int debug_flag ); | |
| +void yyset_debug ( int debug_flag ); | |
| -YY_EXTRA_TYPE yyget_extra (void ); | |
| +YY_EXTRA_TYPE yyget_extra ( void ); | |
| -void yyset_extra (YY_EXTRA_TYPE user_defined ); | |
| +void yyset_extra ( YY_EXTRA_TYPE user_defined ); | |
| -FILE *yyget_in (void ); | |
| +FILE *yyget_in ( void ); | |
| -void yyset_in (FILE * in_str ); | |
| +void yyset_in ( FILE * _in_str ); | |
| -FILE *yyget_out (void ); | |
| +FILE *yyget_out ( void ); | |
| -void yyset_out (FILE * out_str ); | |
| +void yyset_out ( FILE * _out_str ); | |
| -yy_size_t yyget_leng (void ); | |
| + int yyget_leng ( void ); | |
| -char *yyget_text (void ); | |
| +char *yyget_text ( void ); | |
| -int yyget_lineno (void ); | |
| +int yyget_lineno ( void ); | |
| -void yyset_lineno (int line_number ); | |
| +void yyset_lineno ( int _line_number ); | |
| /* Macros after this point can all be overridden by user definitions in | |
| * section 1. | |
| @@ -642,35 +634,43 @@ void yyset_lineno (int line_number ); | |
| #ifndef YY_SKIP_YYWRAP | |
| #ifdef __cplusplus | |
| -extern "C" int yywrap (void ); | |
| +extern "C" int yywrap ( void ); | |
| #else | |
| -extern int yywrap (void ); | |
| +extern int yywrap ( void ); | |
| #endif | |
| #endif | |
| - static void yyunput (int c,char *buf_ptr ); | |
| +#ifndef YY_NO_UNPUT | |
| + | |
| + static void yyunput ( int c, char *buf_ptr ); | |
| + | |
| +#endif | |
| #ifndef yytext_ptr | |
| -static void yy_flex_strncpy (char *,yyconst char *,int ); | |
| +static void yy_flex_strncpy ( char *, const char *, int ); | |
| #endif | |
| #ifdef YY_NEED_STRLEN | |
| -static int yy_flex_strlen (yyconst char * ); | |
| +static int yy_flex_strlen ( const char * ); | |
| #endif | |
| #ifndef YY_NO_INPUT | |
| - | |
| #ifdef __cplusplus | |
| -static int yyinput (void ); | |
| +static int yyinput ( void ); | |
| #else | |
| -static int input (void ); | |
| +static int input ( void ); | |
| #endif | |
| #endif | |
| /* Amount of stuff to slurp up with each read. */ | |
| #ifndef YY_READ_BUF_SIZE | |
| +#ifdef __ia64__ | |
| +/* On IA-64, the buffer size is 16k, not 8k */ | |
| +#define YY_READ_BUF_SIZE 16384 | |
| +#else | |
| #define YY_READ_BUF_SIZE 8192 | |
| +#endif /* __ia64__ */ | |
| #endif | |
| /* Copy whatever the last rule matched to the standard output. */ | |
| @@ -678,7 +678,7 @@ static int input (void ); | |
| /* This used to be an fputs(), but since the string might contain NUL's, | |
| * we now use fwrite(). | |
| */ | |
| -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) | |
| +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) | |
| #endif | |
| /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | |
| @@ -689,7 +689,7 @@ static int input (void ); | |
| if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ | |
| { \ | |
| int c = '*'; \ | |
| - size_t n; \ | |
| + int n; \ | |
| for ( n = 0; n < max_size && \ | |
| (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ | |
| buf[n] = (char) c; \ | |
| @@ -702,7 +702,7 @@ static int input (void ); | |
| else \ | |
| { \ | |
| errno=0; \ | |
| - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ | |
| + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ | |
| { \ | |
| if( errno != EINTR) \ | |
| { \ | |
| @@ -757,7 +757,7 @@ extern int yylex (void); | |
| /* Code executed at the end of each rule. */ | |
| #ifndef YY_BREAK | |
| -#define YY_BREAK break; | |
| +#define YY_BREAK /*LINTED*/break; | |
| #endif | |
| #define YY_RULE_SETUP \ | |
| @@ -767,9 +767,9 @@ extern int yylex (void); | |
| */ | |
| YY_DECL | |
| { | |
| - register yy_state_type yy_current_state; | |
| - register char *yy_cp, *yy_bp; | |
| - register int yy_act; | |
| + yy_state_type yy_current_state; | |
| + char *yy_cp, *yy_bp; | |
| + int yy_act; | |
| if ( !(yy_init) ) | |
| { | |
| @@ -791,19 +791,19 @@ YY_DECL | |
| if ( ! YY_CURRENT_BUFFER ) { | |
| yyensure_buffer_stack (); | |
| YY_CURRENT_BUFFER_LVALUE = | |
| - yy_create_buffer(yyin,YY_BUF_SIZE ); | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); | |
| } | |
| - yy_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| } | |
| { | |
| #line 47 "./Scanner.l" | |
| -#line 805 "Scanner.cpp" | |
| +#line 804 "Scanner.cpp" | |
| - while ( 1 ) /* loops until end-of-file is reached */ | |
| + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ | |
| { | |
| yy_cp = (yy_c_buf_p); | |
| @@ -819,7 +819,7 @@ YY_DECL | |
| yy_match: | |
| do | |
| { | |
| - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; | |
| + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -829,9 +829,9 @@ yy_match: | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 57 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| ++yy_cp; | |
| } | |
| while ( yy_base[yy_current_state] != 370 ); | |
| @@ -1013,7 +1013,7 @@ YY_RULE_SETUP | |
| #line 171 "./Scanner.l" | |
| ECHO; | |
| YY_BREAK | |
| -#line 1017 "Scanner.cpp" | |
| +#line 1016 "Scanner.cpp" | |
| case YY_STATE_EOF(INITIAL): | |
| yyterminate(); | |
| @@ -1091,7 +1091,7 @@ case YY_STATE_EOF(INITIAL): | |
| { | |
| (yy_did_buffer_switch_on_eof) = 0; | |
| - if ( yywrap( ) ) | |
| + if ( yywrap( ) ) | |
| { | |
| /* Note: because we've taken care in | |
| * yy_get_next_buffer() to have set up | |
| @@ -1156,9 +1156,9 @@ case YY_STATE_EOF(INITIAL): | |
| */ | |
| static int yy_get_next_buffer (void) | |
| { | |
| - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | |
| - register char *source = (yytext_ptr); | |
| - register int number_to_move, i; | |
| + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | |
| + char *source = (yytext_ptr); | |
| + int number_to_move, i; | |
| int ret_val; | |
| if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) | |
| @@ -1187,7 +1187,7 @@ static int yy_get_next_buffer (void) | |
| /* Try to read more data. */ | |
| /* First move last chars to start of buffer. */ | |
| - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; | |
| + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); | |
| for ( i = 0; i < number_to_move; ++i ) | |
| *(dest++) = *(source++); | |
| @@ -1200,7 +1200,7 @@ static int yy_get_next_buffer (void) | |
| else | |
| { | |
| - yy_size_t num_to_read = | |
| + int num_to_read = | |
| YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; | |
| while ( num_to_read <= 0 ) | |
| @@ -1214,7 +1214,7 @@ static int yy_get_next_buffer (void) | |
| if ( b->yy_is_our_buffer ) | |
| { | |
| - yy_size_t new_size = b->yy_buf_size * 2; | |
| + int new_size = b->yy_buf_size * 2; | |
| if ( new_size <= 0 ) | |
| b->yy_buf_size += b->yy_buf_size / 8; | |
| @@ -1223,11 +1223,12 @@ static int yy_get_next_buffer (void) | |
| b->yy_ch_buf = (char *) | |
| /* Include room in for 2 EOB chars. */ | |
| - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); | |
| + yyrealloc( (void *) b->yy_ch_buf, | |
| + (yy_size_t) (b->yy_buf_size + 2) ); | |
| } | |
| else | |
| /* Can't grow it, we don't own it. */ | |
| - b->yy_ch_buf = 0; | |
| + b->yy_ch_buf = NULL; | |
| if ( ! b->yy_ch_buf ) | |
| YY_FATAL_ERROR( | |
| @@ -1255,7 +1256,7 @@ static int yy_get_next_buffer (void) | |
| if ( number_to_move == YY_MORE_ADJ ) | |
| { | |
| ret_val = EOB_ACT_END_OF_FILE; | |
| - yyrestart(yyin ); | |
| + yyrestart( yyin ); | |
| } | |
| else | |
| @@ -1269,12 +1270,15 @@ static int yy_get_next_buffer (void) | |
| else | |
| ret_val = EOB_ACT_CONTINUE_SCAN; | |
| - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { | |
| + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { | |
| /* Extend the array by 50%, plus the number we really need. */ | |
| - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); | |
| - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); | |
| + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); | |
| + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( | |
| + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); | |
| if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) | |
| YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); | |
| + /* "- 2" to take care of EOB's */ | |
| + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); | |
| } | |
| (yy_n_chars) += number_to_move; | |
| @@ -1290,14 +1294,14 @@ static int yy_get_next_buffer (void) | |
| static yy_state_type yy_get_previous_state (void) | |
| { | |
| - register yy_state_type yy_current_state; | |
| - register char *yy_cp; | |
| + yy_state_type yy_current_state; | |
| + char *yy_cp; | |
| yy_current_state = (yy_start); | |
| for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) | |
| { | |
| - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | |
| + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -1307,9 +1311,9 @@ static int yy_get_next_buffer (void) | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 57 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| } | |
| return yy_current_state; | |
| @@ -1322,10 +1326,10 @@ static int yy_get_next_buffer (void) | |
| */ | |
| static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) | |
| { | |
| - register int yy_is_jam; | |
| - register char *yy_cp = (yy_c_buf_p); | |
| + int yy_is_jam; | |
| + char *yy_cp = (yy_c_buf_p); | |
| - register YY_CHAR yy_c = 1; | |
| + YY_CHAR yy_c = 1; | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -1335,17 +1339,19 @@ static int yy_get_next_buffer (void) | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 57 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| yy_is_jam = (yy_current_state == 56); | |
| return yy_is_jam ? 0 : yy_current_state; | |
| } | |
| - static void yyunput (int c, register char * yy_bp ) | |
| +#ifndef YY_NO_UNPUT | |
| + | |
| + static void yyunput (int c, char * yy_bp ) | |
| { | |
| - register char *yy_cp; | |
| + char *yy_cp; | |
| yy_cp = (yy_c_buf_p); | |
| @@ -1355,10 +1361,10 @@ static int yy_get_next_buffer (void) | |
| if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) | |
| { /* need to shift things up to make room */ | |
| /* +2 for EOB chars. */ | |
| - register yy_size_t number_to_move = (yy_n_chars) + 2; | |
| - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ | |
| + int number_to_move = (yy_n_chars) + 2; | |
| + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ | |
| YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; | |
| - register char *source = | |
| + char *source = | |
| &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; | |
| while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) | |
| @@ -1367,7 +1373,7 @@ static int yy_get_next_buffer (void) | |
| yy_cp += (int) (dest - source); | |
| yy_bp += (int) (dest - source); | |
| YY_CURRENT_BUFFER_LVALUE->yy_n_chars = | |
| - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; | |
| + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; | |
| if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) | |
| YY_FATAL_ERROR( "flex scanner push-back overflow" ); | |
| @@ -1380,6 +1386,8 @@ static int yy_get_next_buffer (void) | |
| (yy_c_buf_p) = yy_cp; | |
| } | |
| +#endif | |
| + | |
| #ifndef YY_NO_INPUT | |
| #ifdef __cplusplus | |
| static int yyinput (void) | |
| @@ -1404,7 +1412,7 @@ static int yy_get_next_buffer (void) | |
| else | |
| { /* need more input */ | |
| - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); | |
| + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); | |
| ++(yy_c_buf_p); | |
| switch ( yy_get_next_buffer( ) ) | |
| @@ -1421,14 +1429,14 @@ static int yy_get_next_buffer (void) | |
| */ | |
| /* Reset buffer status. */ | |
| - yyrestart(yyin ); | |
| + yyrestart( yyin ); | |
| /*FALLTHROUGH*/ | |
| case EOB_ACT_END_OF_FILE: | |
| { | |
| - if ( yywrap( ) ) | |
| - return EOF; | |
| + if ( yywrap( ) ) | |
| + return 0; | |
| if ( ! (yy_did_buffer_switch_on_eof) ) | |
| YY_NEW_FILE; | |
| @@ -1465,11 +1473,11 @@ static int yy_get_next_buffer (void) | |
| if ( ! YY_CURRENT_BUFFER ){ | |
| yyensure_buffer_stack (); | |
| YY_CURRENT_BUFFER_LVALUE = | |
| - yy_create_buffer(yyin,YY_BUF_SIZE ); | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); | |
| } | |
| - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); | |
| - yy_load_buffer_state( ); | |
| + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); | |
| + yy_load_buffer_state( ); | |
| } | |
| /** Switch to a different input buffer. | |
| @@ -1497,7 +1505,7 @@ static int yy_get_next_buffer (void) | |
| } | |
| YY_CURRENT_BUFFER_LVALUE = new_buffer; | |
| - yy_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| /* We don't actually know whether we did this switch during | |
| * EOF (yywrap()) processing, but the only time this flag | |
| @@ -1525,7 +1533,7 @@ static void yy_load_buffer_state (void) | |
| { | |
| YY_BUFFER_STATE b; | |
| - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); | |
| + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); | |
| if ( ! b ) | |
| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
| @@ -1534,13 +1542,13 @@ static void yy_load_buffer_state (void) | |
| /* yy_ch_buf has to be 2 characters longer than the size given because | |
| * we need to put in 2 end-of-buffer characters. | |
| */ | |
| - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); | |
| + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); | |
| if ( ! b->yy_ch_buf ) | |
| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
| b->yy_is_our_buffer = 1; | |
| - yy_init_buffer(b,file ); | |
| + yy_init_buffer( b, file ); | |
| return b; | |
| } | |
| @@ -1559,9 +1567,9 @@ static void yy_load_buffer_state (void) | |
| YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; | |
| if ( b->yy_is_our_buffer ) | |
| - yyfree((void *) b->yy_ch_buf ); | |
| + yyfree( (void *) b->yy_ch_buf ); | |
| - yyfree((void *) b ); | |
| + yyfree( (void *) b ); | |
| } | |
| /* Initializes or reinitializes a buffer. | |
| @@ -1573,7 +1581,7 @@ static void yy_load_buffer_state (void) | |
| { | |
| int oerrno = errno; | |
| - yy_flush_buffer(b ); | |
| + yy_flush_buffer( b ); | |
| b->yy_input_file = file; | |
| b->yy_fill_buffer = 1; | |
| @@ -1616,7 +1624,7 @@ static void yy_load_buffer_state (void) | |
| b->yy_buffer_status = YY_BUFFER_NEW; | |
| if ( b == YY_CURRENT_BUFFER ) | |
| - yy_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| } | |
| /** Pushes the new state onto the stack. The new state becomes | |
| @@ -1647,7 +1655,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| YY_CURRENT_BUFFER_LVALUE = new_buffer; | |
| /* copied from yy_switch_to_buffer. */ | |
| - yy_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| (yy_did_buffer_switch_on_eof) = 1; | |
| } | |
| @@ -1666,7 +1674,7 @@ void yypop_buffer_state (void) | |
| --(yy_buffer_stack_top); | |
| if (YY_CURRENT_BUFFER) { | |
| - yy_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| (yy_did_buffer_switch_on_eof) = 1; | |
| } | |
| } | |
| @@ -1684,7 +1692,7 @@ static void yyensure_buffer_stack (void) | |
| * scanner will even need a stack. We use 2 instead of 1 to avoid an | |
| * immediate realloc on the next call. | |
| */ | |
| - num_to_alloc = 1; | |
| + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ | |
| (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc | |
| (num_to_alloc * sizeof(struct yy_buffer_state*) | |
| ); | |
| @@ -1701,7 +1709,7 @@ static void yyensure_buffer_stack (void) | |
| if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ | |
| /* Increase the buffer to prepare for a possible push. */ | |
| - int grow_size = 8 /* arbitrary grow size */; | |
| + yy_size_t grow_size = 8 /* arbitrary grow size */; | |
| num_to_alloc = (yy_buffer_stack_max) + grow_size; | |
| (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc | |
| @@ -1731,23 +1739,23 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) | |
| base[size-2] != YY_END_OF_BUFFER_CHAR || | |
| base[size-1] != YY_END_OF_BUFFER_CHAR ) | |
| /* They forgot to leave room for the EOB's. */ | |
| - return 0; | |
| + return NULL; | |
| - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); | |
| + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); | |
| if ( ! b ) | |
| YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); | |
| - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ | |
| + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ | |
| b->yy_buf_pos = b->yy_ch_buf = base; | |
| b->yy_is_our_buffer = 0; | |
| - b->yy_input_file = 0; | |
| + b->yy_input_file = NULL; | |
| b->yy_n_chars = b->yy_buf_size; | |
| b->yy_is_interactive = 0; | |
| b->yy_at_bol = 1; | |
| b->yy_fill_buffer = 0; | |
| b->yy_buffer_status = YY_BUFFER_NEW; | |
| - yy_switch_to_buffer(b ); | |
| + yy_switch_to_buffer( b ); | |
| return b; | |
| } | |
| @@ -1760,10 +1768,10 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) | |
| * @note If you want to scan bytes that may contain NUL values, then use | |
| * yy_scan_bytes() instead. | |
| */ | |
| -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) | |
| +YY_BUFFER_STATE yy_scan_string (const char * yystr ) | |
| { | |
| - return yy_scan_bytes(yystr,strlen(yystr) ); | |
| + return yy_scan_bytes( yystr, (int) strlen(yystr) ); | |
| } | |
| /** Setup the input buffer state to scan the given bytes. The next call to yylex() will | |
| @@ -1773,16 +1781,16 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) | |
| * | |
| * @return the newly allocated buffer state object. | |
| */ | |
| -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) | |
| +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) | |
| { | |
| YY_BUFFER_STATE b; | |
| char *buf; | |
| yy_size_t n; | |
| - yy_size_t i; | |
| + int i; | |
| /* Get memory for full buffer, including space for trailing EOB's. */ | |
| - n = _yybytes_len + 2; | |
| - buf = (char *) yyalloc(n ); | |
| + n = (yy_size_t) (_yybytes_len + 2); | |
| + buf = (char *) yyalloc( n ); | |
| if ( ! buf ) | |
| YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); | |
| @@ -1791,7 +1799,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len | |
| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; | |
| - b = yy_scan_buffer(buf,n ); | |
| + b = yy_scan_buffer( buf, n ); | |
| if ( ! b ) | |
| YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); | |
| @@ -1807,9 +1815,9 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len | |
| #define YY_EXIT_FAILURE 2 | |
| #endif | |
| -static void yy_fatal_error (yyconst char* msg ) | |
| +static void yynoreturn yy_fatal_error (const char* msg ) | |
| { | |
| - (void) fprintf( stderr, "%s\n", msg ); | |
| + fprintf( stderr, "%s\n", msg ); | |
| exit( YY_EXIT_FAILURE ); | |
| } | |
| @@ -1860,7 +1868,7 @@ FILE *yyget_out (void) | |
| /** Get the length of the current token. | |
| * | |
| */ | |
| -yy_size_t yyget_leng (void) | |
| +int yyget_leng (void) | |
| { | |
| return yyleng; | |
| } | |
| @@ -1875,29 +1883,29 @@ char *yyget_text (void) | |
| } | |
| /** Set the current line number. | |
| - * @param line_number | |
| + * @param _line_number line number | |
| * | |
| */ | |
| -void yyset_lineno (int line_number ) | |
| +void yyset_lineno (int _line_number ) | |
| { | |
| - yylineno = line_number; | |
| + yylineno = _line_number; | |
| } | |
| /** Set the input stream. This does not discard the current | |
| * input buffer. | |
| - * @param in_str A readable stream. | |
| + * @param _in_str A readable stream. | |
| * | |
| * @see yy_switch_to_buffer | |
| */ | |
| -void yyset_in (FILE * in_str ) | |
| +void yyset_in (FILE * _in_str ) | |
| { | |
| - yyin = in_str ; | |
| + yyin = _in_str ; | |
| } | |
| -void yyset_out (FILE * out_str ) | |
| +void yyset_out (FILE * _out_str ) | |
| { | |
| - yyout = out_str ; | |
| + yyout = _out_str ; | |
| } | |
| int yyget_debug (void) | |
| @@ -1905,9 +1913,9 @@ int yyget_debug (void) | |
| return yy_flex_debug; | |
| } | |
| -void yyset_debug (int bdebug ) | |
| +void yyset_debug (int _bdebug ) | |
| { | |
| - yy_flex_debug = bdebug ; | |
| + yy_flex_debug = _bdebug ; | |
| } | |
| static int yy_init_globals (void) | |
| @@ -1916,10 +1924,10 @@ static int yy_init_globals (void) | |
| * This function is called from yylex_destroy(), so don't allocate here. | |
| */ | |
| - (yy_buffer_stack) = 0; | |
| + (yy_buffer_stack) = NULL; | |
| (yy_buffer_stack_top) = 0; | |
| (yy_buffer_stack_max) = 0; | |
| - (yy_c_buf_p) = (char *) 0; | |
| + (yy_c_buf_p) = NULL; | |
| (yy_init) = 0; | |
| (yy_start) = 0; | |
| @@ -1928,8 +1936,8 @@ static int yy_init_globals (void) | |
| yyin = stdin; | |
| yyout = stdout; | |
| #else | |
| - yyin = (FILE *) 0; | |
| - yyout = (FILE *) 0; | |
| + yyin = NULL; | |
| + yyout = NULL; | |
| #endif | |
| /* For future reference: Set errno on error, since we are called by | |
| @@ -1944,7 +1952,7 @@ int yylex_destroy (void) | |
| /* Pop the buffer stack, destroying each element. */ | |
| while(YY_CURRENT_BUFFER){ | |
| - yy_delete_buffer(YY_CURRENT_BUFFER ); | |
| + yy_delete_buffer( YY_CURRENT_BUFFER ); | |
| YY_CURRENT_BUFFER_LVALUE = NULL; | |
| yypop_buffer_state(); | |
| } | |
| @@ -1965,18 +1973,19 @@ int yylex_destroy (void) | |
| */ | |
| #ifndef yytext_ptr | |
| -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) | |
| +static void yy_flex_strncpy (char* s1, const char * s2, int n ) | |
| { | |
| - register int i; | |
| + | |
| + int i; | |
| for ( i = 0; i < n; ++i ) | |
| s1[i] = s2[i]; | |
| } | |
| #endif | |
| #ifdef YY_NEED_STRLEN | |
| -static int yy_flex_strlen (yyconst char * s ) | |
| +static int yy_flex_strlen (const char * s ) | |
| { | |
| - register int n; | |
| + int n; | |
| for ( n = 0; s[n]; ++n ) | |
| ; | |
| @@ -1986,11 +1995,12 @@ static int yy_flex_strlen (yyconst char * s ) | |
| void *yyalloc (yy_size_t size ) | |
| { | |
| - return (void *) malloc( size ); | |
| + return malloc(size); | |
| } | |
| void *yyrealloc (void * ptr, yy_size_t size ) | |
| { | |
| + | |
| /* The cast to (char *) in the following accommodates both | |
| * implementations that use char* generic pointers, and those | |
| * that use void* generic pointers. It works with the latter | |
| @@ -1998,12 +2008,12 @@ void *yyrealloc (void * ptr, yy_size_t size ) | |
| * any pointer type to void*, and deal with argument conversions | |
| * as though doing an assignment. | |
| */ | |
| - return (void *) realloc( (char *) ptr, size ); | |
| + return realloc(ptr, size); | |
| } | |
| void yyfree (void * ptr ) | |
| { | |
| - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ | |
| + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ | |
| } | |
| #define YYTABLES_NAME "yytables" | |
| @@ -2011,7 +2021,6 @@ void yyfree (void * ptr ) | |
| #line 171 "./Scanner.l" | |
| - | |
| static void ReadLexBuff(char* pcBuff, size_t& riResult, size_t uMaxSize) | |
| { | |
| wxASSERT( _pszLexBuff != NULL ); | |
| diff --git a/src/Scanner.h b/src/Scanner.h | |
| index 08ef78456..88a4465a8 100644 | |
| --- a/src/Scanner.h | |
| +++ b/src/Scanner.h | |
| @@ -12,8 +12,8 @@ | |
| #define FLEX_SCANNER | |
| #define YY_FLEX_MAJOR_VERSION 2 | |
| -#define YY_FLEX_MINOR_VERSION 5 | |
| -#define YY_FLEX_SUBMINOR_VERSION 39 | |
| +#define YY_FLEX_MINOR_VERSION 6 | |
| +#define YY_FLEX_SUBMINOR_VERSION 4 | |
| #if YY_FLEX_SUBMINOR_VERSION > 0 | |
| #define FLEX_BETA | |
| #endif | |
| @@ -88,34 +88,36 @@ typedef unsigned int flex_uint32_t; | |
| #define UINT32_MAX (4294967295U) | |
| #endif | |
| +#ifndef SIZE_MAX | |
| +#define SIZE_MAX (~(size_t)0) | |
| +#endif | |
| + | |
| #endif /* ! C99 */ | |
| #endif /* ! FLEXINT_H */ | |
| -#ifdef __cplusplus | |
| - | |
| -/* The "const" storage-class-modifier is valid. */ | |
| -#define YY_USE_CONST | |
| - | |
| -#else /* ! __cplusplus */ | |
| - | |
| -/* C99 requires __STDC__ to be defined as 1. */ | |
| -#if defined (__STDC__) | |
| - | |
| -#define YY_USE_CONST | |
| - | |
| -#endif /* defined (__STDC__) */ | |
| -#endif /* ! __cplusplus */ | |
| +/* begin standard C++ headers. */ | |
| -#ifdef YY_USE_CONST | |
| +/* TODO: this is always defined, so inline it */ | |
| #define yyconst const | |
| + | |
| +#if defined(__GNUC__) && __GNUC__ >= 3 | |
| +#define yynoreturn __attribute__((__noreturn__)) | |
| #else | |
| -#define yyconst | |
| +#define yynoreturn | |
| #endif | |
| /* Size of default input buffer. */ | |
| #ifndef YY_BUF_SIZE | |
| +#ifdef __ia64__ | |
| +/* On IA-64, the buffer size is 16k, not 8k. | |
| + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. | |
| + * Ditto for the __ia64__ case accordingly. | |
| + */ | |
| +#define YY_BUF_SIZE 32768 | |
| +#else | |
| #define YY_BUF_SIZE 16384 | |
| +#endif /* __ia64__ */ | |
| #endif | |
| #ifndef YY_TYPEDEF_YY_BUFFER_STATE | |
| @@ -128,7 +130,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; | |
| typedef size_t yy_size_t; | |
| #endif | |
| -extern yy_size_t yyleng; | |
| +extern int yyleng; | |
| extern FILE *yyin, *yyout; | |
| @@ -144,12 +146,12 @@ struct yy_buffer_state | |
| /* Size of input buffer in bytes, not including room for EOB | |
| * characters. | |
| */ | |
| - yy_size_t yy_buf_size; | |
| + int yy_buf_size; | |
| /* Number of characters read into yy_ch_buf, not including EOB | |
| * characters. | |
| */ | |
| - yy_size_t yy_n_chars; | |
| + int yy_n_chars; | |
| /* Whether we "own" the buffer - i.e., we know we created it, | |
| * and can realloc() it to grow it, and should free() it to | |
| @@ -183,30 +185,33 @@ struct yy_buffer_state | |
| }; | |
| #endif /* !YY_STRUCT_YY_BUFFER_STATE */ | |
| -void yyrestart (FILE *input_file ); | |
| -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); | |
| -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); | |
| -void yy_delete_buffer (YY_BUFFER_STATE b ); | |
| -void yy_flush_buffer (YY_BUFFER_STATE b ); | |
| -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); | |
| -void yypop_buffer_state (void ); | |
| +void yyrestart ( FILE *input_file ); | |
| +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); | |
| +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); | |
| +void yy_delete_buffer ( YY_BUFFER_STATE b ); | |
| +void yy_flush_buffer ( YY_BUFFER_STATE b ); | |
| +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); | |
| +void yypop_buffer_state ( void ); | |
| -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); | |
| -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); | |
| -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); | |
| +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); | |
| +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); | |
| +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); | |
| -void *yyalloc (yy_size_t ); | |
| -void *yyrealloc (void *,yy_size_t ); | |
| -void yyfree (void * ); | |
| +void *yyalloc ( yy_size_t ); | |
| +void *yyrealloc ( void *, yy_size_t ); | |
| +void yyfree ( void * ); | |
| /* Begin user sect3 */ | |
| -#define yywrap() 1 | |
| +#define yywrap() (/*CONSTCOND*/1) | |
| #define YY_SKIP_YYWRAP | |
| extern int yylineno; | |
| extern char *yytext; | |
| +#ifdef yytext_ptr | |
| +#undef yytext_ptr | |
| +#endif | |
| #define yytext_ptr yytext | |
| #ifdef YY_HEADER_EXPORT_START_CONDITIONS | |
| @@ -229,31 +234,31 @@ extern char *yytext; | |
| /* Accessor methods to globals. | |
| These are made visible to non-reentrant scanners for convenience. */ | |
| -int yylex_destroy (void ); | |
| +int yylex_destroy ( void ); | |
| -int yyget_debug (void ); | |
| +int yyget_debug ( void ); | |
| -void yyset_debug (int debug_flag ); | |
| +void yyset_debug ( int debug_flag ); | |
| -YY_EXTRA_TYPE yyget_extra (void ); | |
| +YY_EXTRA_TYPE yyget_extra ( void ); | |
| -void yyset_extra (YY_EXTRA_TYPE user_defined ); | |
| +void yyset_extra ( YY_EXTRA_TYPE user_defined ); | |
| -FILE *yyget_in (void ); | |
| +FILE *yyget_in ( void ); | |
| -void yyset_in (FILE * in_str ); | |
| +void yyset_in ( FILE * _in_str ); | |
| -FILE *yyget_out (void ); | |
| +FILE *yyget_out ( void ); | |
| -void yyset_out (FILE * out_str ); | |
| +void yyset_out ( FILE * _out_str ); | |
| -yy_size_t yyget_leng (void ); | |
| + int yyget_leng ( void ); | |
| -char *yyget_text (void ); | |
| +char *yyget_text ( void ); | |
| -int yyget_lineno (void ); | |
| +int yyget_lineno ( void ); | |
| -void yyset_lineno (int line_number ); | |
| +void yyset_lineno ( int _line_number ); | |
| /* Macros after this point can all be overridden by user definitions in | |
| * section 1. | |
| @@ -261,18 +266,18 @@ void yyset_lineno (int line_number ); | |
| #ifndef YY_SKIP_YYWRAP | |
| #ifdef __cplusplus | |
| -extern "C" int yywrap (void ); | |
| +extern "C" int yywrap ( void ); | |
| #else | |
| -extern int yywrap (void ); | |
| +extern int yywrap ( void ); | |
| #endif | |
| #endif | |
| #ifndef yytext_ptr | |
| -static void yy_flex_strncpy (char *,yyconst char *,int ); | |
| +static void yy_flex_strncpy ( char *, const char *, int ); | |
| #endif | |
| #ifdef YY_NEED_STRLEN | |
| -static int yy_flex_strlen (yyconst char * ); | |
| +static int yy_flex_strlen ( const char * ); | |
| #endif | |
| #ifndef YY_NO_INPUT | |
| @@ -281,7 +286,12 @@ static int yy_flex_strlen (yyconst char * ); | |
| /* Amount of stuff to slurp up with each read. */ | |
| #ifndef YY_READ_BUF_SIZE | |
| +#ifdef __ia64__ | |
| +/* On IA-64, the buffer size is 16k, not 8k */ | |
| +#define YY_READ_BUF_SIZE 16384 | |
| +#else | |
| #define YY_READ_BUF_SIZE 8192 | |
| +#endif /* __ia64__ */ | |
| #endif | |
| /* Number of entries by which start-condition stack grows. */ | |
| @@ -314,9 +324,154 @@ extern int yylex (void); | |
| #undef YY_DECL | |
| #endif | |
| +#ifndef yy_create_buffer_ALREADY_DEFINED | |
| +#undef yy_create_buffer | |
| +#endif | |
| +#ifndef yy_delete_buffer_ALREADY_DEFINED | |
| +#undef yy_delete_buffer | |
| +#endif | |
| +#ifndef yy_scan_buffer_ALREADY_DEFINED | |
| +#undef yy_scan_buffer | |
| +#endif | |
| +#ifndef yy_scan_string_ALREADY_DEFINED | |
| +#undef yy_scan_string | |
| +#endif | |
| +#ifndef yy_scan_bytes_ALREADY_DEFINED | |
| +#undef yy_scan_bytes | |
| +#endif | |
| +#ifndef yy_init_buffer_ALREADY_DEFINED | |
| +#undef yy_init_buffer | |
| +#endif | |
| +#ifndef yy_flush_buffer_ALREADY_DEFINED | |
| +#undef yy_flush_buffer | |
| +#endif | |
| +#ifndef yy_load_buffer_state_ALREADY_DEFINED | |
| +#undef yy_load_buffer_state | |
| +#endif | |
| +#ifndef yy_switch_to_buffer_ALREADY_DEFINED | |
| +#undef yy_switch_to_buffer | |
| +#endif | |
| +#ifndef yypush_buffer_state_ALREADY_DEFINED | |
| +#undef yypush_buffer_state | |
| +#endif | |
| +#ifndef yypop_buffer_state_ALREADY_DEFINED | |
| +#undef yypop_buffer_state | |
| +#endif | |
| +#ifndef yyensure_buffer_stack_ALREADY_DEFINED | |
| +#undef yyensure_buffer_stack | |
| +#endif | |
| +#ifndef yylex_ALREADY_DEFINED | |
| +#undef yylex | |
| +#endif | |
| +#ifndef yyrestart_ALREADY_DEFINED | |
| +#undef yyrestart | |
| +#endif | |
| +#ifndef yylex_init_ALREADY_DEFINED | |
| +#undef yylex_init | |
| +#endif | |
| +#ifndef yylex_init_extra_ALREADY_DEFINED | |
| +#undef yylex_init_extra | |
| +#endif | |
| +#ifndef yylex_destroy_ALREADY_DEFINED | |
| +#undef yylex_destroy | |
| +#endif | |
| +#ifndef yyget_debug_ALREADY_DEFINED | |
| +#undef yyget_debug | |
| +#endif | |
| +#ifndef yyset_debug_ALREADY_DEFINED | |
| +#undef yyset_debug | |
| +#endif | |
| +#ifndef yyget_extra_ALREADY_DEFINED | |
| +#undef yyget_extra | |
| +#endif | |
| +#ifndef yyset_extra_ALREADY_DEFINED | |
| +#undef yyset_extra | |
| +#endif | |
| +#ifndef yyget_in_ALREADY_DEFINED | |
| +#undef yyget_in | |
| +#endif | |
| +#ifndef yyset_in_ALREADY_DEFINED | |
| +#undef yyset_in | |
| +#endif | |
| +#ifndef yyget_out_ALREADY_DEFINED | |
| +#undef yyget_out | |
| +#endif | |
| +#ifndef yyset_out_ALREADY_DEFINED | |
| +#undef yyset_out | |
| +#endif | |
| +#ifndef yyget_leng_ALREADY_DEFINED | |
| +#undef yyget_leng | |
| +#endif | |
| +#ifndef yyget_text_ALREADY_DEFINED | |
| +#undef yyget_text | |
| +#endif | |
| +#ifndef yyget_lineno_ALREADY_DEFINED | |
| +#undef yyget_lineno | |
| +#endif | |
| +#ifndef yyset_lineno_ALREADY_DEFINED | |
| +#undef yyset_lineno | |
| +#endif | |
| +#ifndef yyget_column_ALREADY_DEFINED | |
| +#undef yyget_column | |
| +#endif | |
| +#ifndef yyset_column_ALREADY_DEFINED | |
| +#undef yyset_column | |
| +#endif | |
| +#ifndef yywrap_ALREADY_DEFINED | |
| +#undef yywrap | |
| +#endif | |
| +#ifndef yyget_lval_ALREADY_DEFINED | |
| +#undef yyget_lval | |
| +#endif | |
| +#ifndef yyset_lval_ALREADY_DEFINED | |
| +#undef yyset_lval | |
| +#endif | |
| +#ifndef yyget_lloc_ALREADY_DEFINED | |
| +#undef yyget_lloc | |
| +#endif | |
| +#ifndef yyset_lloc_ALREADY_DEFINED | |
| +#undef yyset_lloc | |
| +#endif | |
| +#ifndef yyalloc_ALREADY_DEFINED | |
| +#undef yyalloc | |
| +#endif | |
| +#ifndef yyrealloc_ALREADY_DEFINED | |
| +#undef yyrealloc | |
| +#endif | |
| +#ifndef yyfree_ALREADY_DEFINED | |
| +#undef yyfree | |
| +#endif | |
| +#ifndef yytext_ALREADY_DEFINED | |
| +#undef yytext | |
| +#endif | |
| +#ifndef yyleng_ALREADY_DEFINED | |
| +#undef yyleng | |
| +#endif | |
| +#ifndef yyin_ALREADY_DEFINED | |
| +#undef yyin | |
| +#endif | |
| +#ifndef yyout_ALREADY_DEFINED | |
| +#undef yyout | |
| +#endif | |
| +#ifndef yy_flex_debug_ALREADY_DEFINED | |
| +#undef yy_flex_debug | |
| +#endif | |
| +#ifndef yylineno_ALREADY_DEFINED | |
| +#undef yylineno | |
| +#endif | |
| +#ifndef yytables_fload_ALREADY_DEFINED | |
| +#undef yytables_fload | |
| +#endif | |
| +#ifndef yytables_destroy_ALREADY_DEFINED | |
| +#undef yytables_destroy | |
| +#endif | |
| +#ifndef yyTABLES_NAME_ALREADY_DEFINED | |
| +#undef yyTABLES_NAME | |
| +#endif | |
| + | |
| #line 171 "./Scanner.l" | |
| -#line 321 "./Scanner.h" | |
| +#line 476 "./Scanner.h" | |
| #undef yyIN_HEADER | |
| #endif /* yyHEADER_H */ | |
| diff --git a/src/webserver/src/php_lexer.c b/src/webserver/src/php_lexer.c | |
| index 215cb8e67..f81dfd179 100644 | |
| --- a/src/webserver/src/php_lexer.c | |
| +++ b/src/webserver/src/php_lexer.c | |
| @@ -8,11 +8,17 @@ | |
| #define yy_create_buffer php_create_buffer | |
| #define yy_delete_buffer php_delete_buffer | |
| -#define yy_flex_debug php_flex_debug | |
| +#define yy_scan_buffer php_scan_buffer | |
| +#define yy_scan_string php_scan_string | |
| +#define yy_scan_bytes php_scan_bytes | |
| #define yy_init_buffer php_init_buffer | |
| #define yy_flush_buffer php_flush_buffer | |
| #define yy_load_buffer_state php_load_buffer_state | |
| #define yy_switch_to_buffer php_switch_to_buffer | |
| +#define yypush_buffer_state phppush_buffer_state | |
| +#define yypop_buffer_state phppop_buffer_state | |
| +#define yyensure_buffer_stack phpensure_buffer_stack | |
| +#define yy_flex_debug php_flex_debug | |
| #define yyin phpin | |
| #define yyleng phpleng | |
| #define yylex phplex | |
| @@ -27,12 +33,246 @@ | |
| #define FLEX_SCANNER | |
| #define YY_FLEX_MAJOR_VERSION 2 | |
| -#define YY_FLEX_MINOR_VERSION 5 | |
| -#define YY_FLEX_SUBMINOR_VERSION 39 | |
| +#define YY_FLEX_MINOR_VERSION 6 | |
| +#define YY_FLEX_SUBMINOR_VERSION 4 | |
| #if YY_FLEX_SUBMINOR_VERSION > 0 | |
| #define FLEX_BETA | |
| #endif | |
| +#ifdef yy_create_buffer | |
| +#define php_create_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_create_buffer php_create_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_delete_buffer | |
| +#define php_delete_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_delete_buffer php_delete_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_scan_buffer | |
| +#define php_scan_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_scan_buffer php_scan_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_scan_string | |
| +#define php_scan_string_ALREADY_DEFINED | |
| +#else | |
| +#define yy_scan_string php_scan_string | |
| +#endif | |
| + | |
| +#ifdef yy_scan_bytes | |
| +#define php_scan_bytes_ALREADY_DEFINED | |
| +#else | |
| +#define yy_scan_bytes php_scan_bytes | |
| +#endif | |
| + | |
| +#ifdef yy_init_buffer | |
| +#define php_init_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_init_buffer php_init_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_flush_buffer | |
| +#define php_flush_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_flush_buffer php_flush_buffer | |
| +#endif | |
| + | |
| +#ifdef yy_load_buffer_state | |
| +#define php_load_buffer_state_ALREADY_DEFINED | |
| +#else | |
| +#define yy_load_buffer_state php_load_buffer_state | |
| +#endif | |
| + | |
| +#ifdef yy_switch_to_buffer | |
| +#define php_switch_to_buffer_ALREADY_DEFINED | |
| +#else | |
| +#define yy_switch_to_buffer php_switch_to_buffer | |
| +#endif | |
| + | |
| +#ifdef yypush_buffer_state | |
| +#define phppush_buffer_state_ALREADY_DEFINED | |
| +#else | |
| +#define yypush_buffer_state phppush_buffer_state | |
| +#endif | |
| + | |
| +#ifdef yypop_buffer_state | |
| +#define phppop_buffer_state_ALREADY_DEFINED | |
| +#else | |
| +#define yypop_buffer_state phppop_buffer_state | |
| +#endif | |
| + | |
| +#ifdef yyensure_buffer_stack | |
| +#define phpensure_buffer_stack_ALREADY_DEFINED | |
| +#else | |
| +#define yyensure_buffer_stack phpensure_buffer_stack | |
| +#endif | |
| + | |
| +#ifdef yylex | |
| +#define phplex_ALREADY_DEFINED | |
| +#else | |
| +#define yylex phplex | |
| +#endif | |
| + | |
| +#ifdef yyrestart | |
| +#define phprestart_ALREADY_DEFINED | |
| +#else | |
| +#define yyrestart phprestart | |
| +#endif | |
| + | |
| +#ifdef yylex_init | |
| +#define phplex_init_ALREADY_DEFINED | |
| +#else | |
| +#define yylex_init phplex_init | |
| +#endif | |
| + | |
| +#ifdef yylex_init_extra | |
| +#define phplex_init_extra_ALREADY_DEFINED | |
| +#else | |
| +#define yylex_init_extra phplex_init_extra | |
| +#endif | |
| + | |
| +#ifdef yylex_destroy | |
| +#define phplex_destroy_ALREADY_DEFINED | |
| +#else | |
| +#define yylex_destroy phplex_destroy | |
| +#endif | |
| + | |
| +#ifdef yyget_debug | |
| +#define phpget_debug_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_debug phpget_debug | |
| +#endif | |
| + | |
| +#ifdef yyset_debug | |
| +#define phpset_debug_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_debug phpset_debug | |
| +#endif | |
| + | |
| +#ifdef yyget_extra | |
| +#define phpget_extra_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_extra phpget_extra | |
| +#endif | |
| + | |
| +#ifdef yyset_extra | |
| +#define phpset_extra_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_extra phpset_extra | |
| +#endif | |
| + | |
| +#ifdef yyget_in | |
| +#define phpget_in_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_in phpget_in | |
| +#endif | |
| + | |
| +#ifdef yyset_in | |
| +#define phpset_in_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_in phpset_in | |
| +#endif | |
| + | |
| +#ifdef yyget_out | |
| +#define phpget_out_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_out phpget_out | |
| +#endif | |
| + | |
| +#ifdef yyset_out | |
| +#define phpset_out_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_out phpset_out | |
| +#endif | |
| + | |
| +#ifdef yyget_leng | |
| +#define phpget_leng_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_leng phpget_leng | |
| +#endif | |
| + | |
| +#ifdef yyget_text | |
| +#define phpget_text_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_text phpget_text | |
| +#endif | |
| + | |
| +#ifdef yyget_lineno | |
| +#define phpget_lineno_ALREADY_DEFINED | |
| +#else | |
| +#define yyget_lineno phpget_lineno | |
| +#endif | |
| + | |
| +#ifdef yyset_lineno | |
| +#define phpset_lineno_ALREADY_DEFINED | |
| +#else | |
| +#define yyset_lineno phpset_lineno | |
| +#endif | |
| + | |
| +#ifdef yywrap | |
| +#define phpwrap_ALREADY_DEFINED | |
| +#else | |
| +#define yywrap phpwrap | |
| +#endif | |
| + | |
| +#ifdef yyalloc | |
| +#define phpalloc_ALREADY_DEFINED | |
| +#else | |
| +#define yyalloc phpalloc | |
| +#endif | |
| + | |
| +#ifdef yyrealloc | |
| +#define phprealloc_ALREADY_DEFINED | |
| +#else | |
| +#define yyrealloc phprealloc | |
| +#endif | |
| + | |
| +#ifdef yyfree | |
| +#define phpfree_ALREADY_DEFINED | |
| +#else | |
| +#define yyfree phpfree | |
| +#endif | |
| + | |
| +#ifdef yytext | |
| +#define phptext_ALREADY_DEFINED | |
| +#else | |
| +#define yytext phptext | |
| +#endif | |
| + | |
| +#ifdef yyleng | |
| +#define phpleng_ALREADY_DEFINED | |
| +#else | |
| +#define yyleng phpleng | |
| +#endif | |
| + | |
| +#ifdef yyin | |
| +#define phpin_ALREADY_DEFINED | |
| +#else | |
| +#define yyin phpin | |
| +#endif | |
| + | |
| +#ifdef yyout | |
| +#define phpout_ALREADY_DEFINED | |
| +#else | |
| +#define yyout phpout | |
| +#endif | |
| + | |
| +#ifdef yy_flex_debug | |
| +#define php_flex_debug_ALREADY_DEFINED | |
| +#else | |
| +#define yy_flex_debug php_flex_debug | |
| +#endif | |
| + | |
| +#ifdef yylineno | |
| +#define phplineno_ALREADY_DEFINED | |
| +#else | |
| +#define yylineno phplineno | |
| +#endif | |
| + | |
| /* First, we deal with platform-specific or compiler-specific issues. */ | |
| /* begin standard C headers. */ | |
| @@ -74,6 +314,7 @@ typedef unsigned char flex_uint8_t; | |
| typedef unsigned short int flex_uint16_t; | |
| typedef unsigned int flex_uint32_t; | |
| +#include <stdint.h> | |
| /* Limits of integral types. */ | |
| #ifndef INT8_MIN | |
| #define INT8_MIN (-128) | |
| @@ -103,65 +344,61 @@ typedef unsigned int flex_uint32_t; | |
| #define UINT32_MAX (4294967295U) | |
| #endif | |
| +#ifndef SIZE_MAX | |
| +#define SIZE_MAX (~(size_t)0) | |
| +#endif | |
| + | |
| #endif /* ! C99 */ | |
| #endif /* ! FLEXINT_H */ | |
| -#ifdef __cplusplus | |
| - | |
| -/* The "const" storage-class-modifier is valid. */ | |
| -#define YY_USE_CONST | |
| +/* begin standard C++ headers. */ | |
| -#else /* ! __cplusplus */ | |
| - | |
| -/* C99 requires __STDC__ to be defined as 1. */ | |
| -#if defined (__STDC__) | |
| - | |
| -#define YY_USE_CONST | |
| - | |
| -#endif /* defined (__STDC__) */ | |
| -#endif /* ! __cplusplus */ | |
| - | |
| -#ifdef YY_USE_CONST | |
| +/* TODO: this is always defined, so inline it */ | |
| #define yyconst const | |
| + | |
| +#if defined(__GNUC__) && __GNUC__ >= 3 | |
| +#define yynoreturn __attribute__((__noreturn__)) | |
| #else | |
| -#define yyconst | |
| +#define yynoreturn | |
| #endif | |
| /* Returned upon end-of-file. */ | |
| #define YY_NULL 0 | |
| -/* Promotes a possibly negative, possibly signed char to an unsigned | |
| - * integer for use as an array index. If the signed char is negative, | |
| - * we want to instead treat it as an 8-bit unsigned char, hence the | |
| - * double cast. | |
| +/* Promotes a possibly negative, possibly signed char to an | |
| + * integer in range [0..255] for use as an array index. | |
| */ | |
| -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) | |
| +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) | |
| /* Enter a start condition. This macro really ought to take a parameter, | |
| * but we do it the disgusting crufty way forced on us by the ()-less | |
| * definition of BEGIN. | |
| */ | |
| #define BEGIN (yy_start) = 1 + 2 * | |
| - | |
| /* Translate the current start state into a value that can be later handed | |
| * to BEGIN to return to the state. The YYSTATE alias is for lex | |
| * compatibility. | |
| */ | |
| #define YY_START (((yy_start) - 1) / 2) | |
| #define YYSTATE YY_START | |
| - | |
| /* Action number for EOF rule of a given start state. */ | |
| #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | |
| - | |
| /* Special action meaning "start processing a new file". */ | |
| -#define YY_NEW_FILE phprestart(phpin ) | |
| - | |
| +#define YY_NEW_FILE yyrestart( yyin ) | |
| #define YY_END_OF_BUFFER_CHAR 0 | |
| /* Size of default input buffer. */ | |
| #ifndef YY_BUF_SIZE | |
| +#ifdef __ia64__ | |
| +/* On IA-64, the buffer size is 16k, not 8k. | |
| + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. | |
| + * Ditto for the __ia64__ case accordingly. | |
| + */ | |
| +#define YY_BUF_SIZE 32768 | |
| +#else | |
| #define YY_BUF_SIZE 16384 | |
| +#endif /* __ia64__ */ | |
| #endif | |
| /* The state buf must be large enough to hold one state per character in the main buffer. | |
| @@ -178,9 +415,9 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; | |
| typedef size_t yy_size_t; | |
| #endif | |
| -extern yy_size_t phpleng; | |
| +extern int yyleng; | |
| -extern FILE *phpin, *phpout; | |
| +extern FILE *yyin, *yyout; | |
| #define EOB_ACT_CONTINUE_SCAN 0 | |
| #define EOB_ACT_END_OF_FILE 1 | |
| @@ -188,40 +425,39 @@ extern FILE *phpin, *phpout; | |
| /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires | |
| * access to the local variable yy_act. Since yyless() is a macro, it would break | |
| - * existing scanners that call yyless() from OUTSIDE phplex. | |
| + * existing scanners that call yyless() from OUTSIDE yylex. | |
| * One obvious solution it to make yy_act a global. I tried that, and saw | |
| - * a 5% performance hit in a non-phplineno scanner, because yy_act is | |
| + * a 5% performance hit in a non-yylineno scanner, because yy_act is | |
| * normally declared as a register variable-- so it is not worth it. | |
| */ | |
| #define YY_LESS_LINENO(n) \ | |
| do { \ | |
| int yyl;\ | |
| - for ( yyl = n; yyl < phpleng; ++yyl )\ | |
| - if ( phptext[yyl] == '\n' )\ | |
| - --phplineno;\ | |
| + for ( yyl = n; yyl < yyleng; ++yyl )\ | |
| + if ( yytext[yyl] == '\n' )\ | |
| + --yylineno;\ | |
| }while(0) | |
| #define YY_LINENO_REWIND_TO(dst) \ | |
| do {\ | |
| const char *p;\ | |
| for ( p = yy_cp-1; p >= (dst); --p)\ | |
| if ( *p == '\n' )\ | |
| - --phplineno;\ | |
| + --yylineno;\ | |
| }while(0) | |
| /* Return all but the first "n" matched characters back to the input stream. */ | |
| #define yyless(n) \ | |
| do \ | |
| { \ | |
| - /* Undo effects of setting up phptext. */ \ | |
| + /* Undo effects of setting up yytext. */ \ | |
| int yyless_macro_arg = (n); \ | |
| YY_LESS_LINENO(yyless_macro_arg);\ | |
| *yy_cp = (yy_hold_char); \ | |
| YY_RESTORE_YY_MORE_OFFSET \ | |
| (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ | |
| - YY_DO_BEFORE_ACTION; /* set up phptext again */ \ | |
| + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ | |
| } \ | |
| while ( 0 ) | |
| - | |
| #define unput(c) yyunput( c, (yytext_ptr) ) | |
| #ifndef YY_STRUCT_YY_BUFFER_STATE | |
| @@ -236,12 +472,12 @@ struct yy_buffer_state | |
| /* Size of input buffer in bytes, not including room for EOB | |
| * characters. | |
| */ | |
| - yy_size_t yy_buf_size; | |
| + int yy_buf_size; | |
| /* Number of characters read into yy_ch_buf, not including EOB | |
| * characters. | |
| */ | |
| - yy_size_t yy_n_chars; | |
| + int yy_n_chars; | |
| /* Whether we "own" the buffer - i.e., we know we created it, | |
| * and can realloc() it to grow it, and should free() it to | |
| @@ -281,8 +517,8 @@ struct yy_buffer_state | |
| * possible backing-up. | |
| * | |
| * When we actually see the EOF, we change the status to "new" | |
| - * (via phprestart()), so that the user can continue scanning by | |
| - * just pointing phpin at a new input file. | |
| + * (via yyrestart()), so that the user can continue scanning by | |
| + * just pointing yyin at a new input file. | |
| */ | |
| #define YY_BUFFER_EOF_PENDING 2 | |
| @@ -292,7 +528,7 @@ struct yy_buffer_state | |
| /* Stack of input buffers. */ | |
| static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ | |
| static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ | |
| -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |
| +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ | |
| /* We provide macros for accessing buffer states in case in the | |
| * future we want to put the buffer states in a more general | |
| @@ -303,102 +539,98 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |
| #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ | |
| ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ | |
| : NULL) | |
| - | |
| /* Same as previous macro, but useful when we know that the buffer stack is not | |
| * NULL or when we need an lvalue. For internal use only. | |
| */ | |
| #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] | |
| -/* yy_hold_char holds the character lost when phptext is formed. */ | |
| +/* yy_hold_char holds the character lost when yytext is formed. */ | |
| static char yy_hold_char; | |
| -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ | |
| -yy_size_t phpleng; | |
| +static size_t yy_n_chars; /* number of characters read into yy_ch_buf */ | |
| +int yyleng; | |
| /* Points to current character in buffer. */ | |
| -static char *yy_c_buf_p = (char *) 0; | |
| +static char *yy_c_buf_p = NULL; | |
| static int yy_init = 0; /* whether we need to initialize */ | |
| static int yy_start = 0; /* start state number */ | |
| -/* Flag which is used to allow phpwrap()'s to do buffer switches | |
| - * instead of setting up a fresh phpin. A bit of a hack ... | |
| +/* Flag which is used to allow yywrap()'s to do buffer switches | |
| + * instead of setting up a fresh yyin. A bit of a hack ... | |
| */ | |
| static int yy_did_buffer_switch_on_eof; | |
| -void phprestart (FILE *input_file ); | |
| -void php_switch_to_buffer (YY_BUFFER_STATE new_buffer ); | |
| -YY_BUFFER_STATE php_create_buffer (FILE *file,int size ); | |
| -void php_delete_buffer (YY_BUFFER_STATE b ); | |
| -void php_flush_buffer (YY_BUFFER_STATE b ); | |
| -void phppush_buffer_state (YY_BUFFER_STATE new_buffer ); | |
| -void phppop_buffer_state (void ); | |
| - | |
| -static void phpensure_buffer_stack (void ); | |
| -static void php_load_buffer_state (void ); | |
| -static void php_init_buffer (YY_BUFFER_STATE b,FILE *file ); | |
| +void yyrestart ( FILE *input_file ); | |
| +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); | |
| +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); | |
| +void yy_delete_buffer ( YY_BUFFER_STATE b ); | |
| +void yy_flush_buffer ( YY_BUFFER_STATE b ); | |
| +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); | |
| +void yypop_buffer_state ( void ); | |
| -#define YY_FLUSH_BUFFER php_flush_buffer(YY_CURRENT_BUFFER ) | |
| +static void yyensure_buffer_stack ( void ); | |
| +static void yy_load_buffer_state ( void ); | |
| +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); | |
| +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) | |
| -YY_BUFFER_STATE php_scan_buffer (char *base,yy_size_t size ); | |
| -YY_BUFFER_STATE php_scan_string (yyconst char *yy_str ); | |
| -YY_BUFFER_STATE php_scan_bytes (yyconst char *bytes,yy_size_t len ); | |
| +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); | |
| +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); | |
| +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); | |
| -void *phpalloc (yy_size_t ); | |
| -void *phprealloc (void *,yy_size_t ); | |
| -void phpfree (void * ); | |
| - | |
| -#define yy_new_buffer php_create_buffer | |
| +void *yyalloc ( yy_size_t ); | |
| +void *yyrealloc ( void *, yy_size_t ); | |
| +void yyfree ( void * ); | |
| +#define yy_new_buffer yy_create_buffer | |
| #define yy_set_interactive(is_interactive) \ | |
| { \ | |
| if ( ! YY_CURRENT_BUFFER ){ \ | |
| - phpensure_buffer_stack (); \ | |
| + yyensure_buffer_stack (); \ | |
| YY_CURRENT_BUFFER_LVALUE = \ | |
| - php_create_buffer(phpin,YY_BUF_SIZE ); \ | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); \ | |
| } \ | |
| YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ | |
| } | |
| - | |
| #define yy_set_bol(at_bol) \ | |
| { \ | |
| if ( ! YY_CURRENT_BUFFER ){\ | |
| - phpensure_buffer_stack (); \ | |
| + yyensure_buffer_stack (); \ | |
| YY_CURRENT_BUFFER_LVALUE = \ | |
| - php_create_buffer(phpin,YY_BUF_SIZE ); \ | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); \ | |
| } \ | |
| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ | |
| } | |
| - | |
| #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | |
| -typedef unsigned char YY_CHAR; | |
| +typedef flex_uint8_t YY_CHAR; | |
| -FILE *phpin = (FILE *) 0, *phpout = (FILE *) 0; | |
| +FILE *yyin = NULL, *yyout = NULL; | |
| typedef int yy_state_type; | |
| -extern int phplineno; | |
| +extern int yylineno; | |
| +int yylineno = 1; | |
| -int phplineno = 1; | |
| - | |
| -extern char *phptext; | |
| -#define yytext_ptr phptext | |
| +extern char *yytext; | |
| +#ifdef yytext_ptr | |
| +#undef yytext_ptr | |
| +#endif | |
| +#define yytext_ptr yytext | |
| -static yy_state_type yy_get_previous_state (void ); | |
| -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); | |
| -static int yy_get_next_buffer (void ); | |
| -static void yy_fatal_error (yyconst char msg[] ); | |
| +static yy_state_type yy_get_previous_state ( void ); | |
| +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); | |
| +static int yy_get_next_buffer ( void ); | |
| +static void yynoreturn yy_fatal_error ( const char* msg ); | |
| /* Done after the current pattern has been matched and before the | |
| - * corresponding action - sets up phptext. | |
| + * corresponding action - sets up yytext. | |
| */ | |
| #define YY_DO_BEFORE_ACTION \ | |
| (yytext_ptr) = yy_bp; \ | |
| (yytext_ptr) -= (yy_more_len); \ | |
| - phpleng = (size_t) (yy_cp - (yytext_ptr)); \ | |
| + yyleng = (int) (yy_cp - (yytext_ptr)); \ | |
| (yy_hold_char) = *yy_cp; \ | |
| *yy_cp = '\0'; \ | |
| (yy_c_buf_p) = yy_cp; | |
| - | |
| #define YY_NUM_RULES 79 | |
| #define YY_END_OF_BUFFER 80 | |
| /* This struct is not used in this scanner, | |
| @@ -408,7 +640,7 @@ struct yy_trans_info | |
| flex_int32_t yy_verify; | |
| flex_int32_t yy_nxt; | |
| }; | |
| -static yyconst flex_int16_t yy_accept[276] = | |
| +static const flex_int16_t yy_accept[276] = | |
| { 0, | |
| 0, 0, 0, 0, 0, 0, 59, 59, 80, 78, | |
| 77, 77, 78, 78, 65, 78, 78, 78, 78, 78, | |
| @@ -442,7 +674,7 @@ static yyconst flex_int16_t yy_accept[276] = | |
| 4, 71, 20, 18, 0 | |
| } ; | |
| -static yyconst flex_int32_t yy_ec[256] = | |
| +static const YY_CHAR yy_ec[256] = | |
| { 0, | |
| 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, | |
| 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, | |
| @@ -474,7 +706,7 @@ static yyconst flex_int32_t yy_ec[256] = | |
| 1, 1, 1, 1, 1 | |
| } ; | |
| -static yyconst flex_int32_t yy_meta[52] = | |
| +static const YY_CHAR yy_meta[52] = | |
| { 0, | |
| 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, | |
| 1, 3, 1, 1, 1, 1, 3, 3, 1, 4, | |
| @@ -484,7 +716,7 @@ static yyconst flex_int32_t yy_meta[52] = | |
| 1 | |
| } ; | |
| -static yyconst flex_int16_t yy_base[287] = | |
| +static const flex_int16_t yy_base[287] = | |
| { 0, | |
| 0, 0, 343, 342, 49, 50, 54, 55, 356, 359, | |
| 359, 359, 332, 51, 359, 0, 331, 48, 48, 59, | |
| @@ -519,7 +751,7 @@ static yyconst flex_int16_t yy_base[287] = | |
| 199, 205, 207, 210, 213, 216 | |
| } ; | |
| -static yyconst flex_int16_t yy_def[287] = | |
| +static const flex_int16_t yy_def[287] = | |
| { 0, | |
| 275, 1, 276, 276, 277, 277, 276, 276, 275, 275, | |
| 275, 275, 275, 278, 275, 279, 275, 275, 280, 275, | |
| @@ -554,7 +786,7 @@ static yyconst flex_int16_t yy_def[287] = | |
| 275, 275, 275, 275, 275, 275 | |
| } ; | |
| -static yyconst flex_int16_t yy_nxt[411] = | |
| +static const flex_int16_t yy_nxt[411] = | |
| { 0, | |
| 10, 11, 12, 11, 11, 13, 14, 15, 16, 17, | |
| 18, 19, 20, 10, 21, 22, 23, 24, 25, 26, | |
| @@ -603,7 +835,7 @@ static yyconst flex_int16_t yy_nxt[411] = | |
| 275, 275, 275, 275, 275, 275, 275, 275, 275, 275 | |
| } ; | |
| -static yyconst flex_int16_t yy_chk[411] = | |
| +static const flex_int16_t yy_chk[411] = | |
| { 0, | |
| 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| @@ -653,7 +885,7 @@ static yyconst flex_int16_t yy_chk[411] = | |
| } ; | |
| /* Table of booleans, true if rule could match eol. */ | |
| -static yyconst flex_int32_t yy_rule_can_match_eol[80] = | |
| +static const flex_int32_t yy_rule_can_match_eol[80] = | |
| { 0, | |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| @@ -664,8 +896,8 @@ static yyconst flex_int32_t yy_rule_can_match_eol[80] = | |
| static yy_state_type yy_last_accepting_state; | |
| static char *yy_last_accepting_cpos; | |
| -extern int php_flex_debug; | |
| -int php_flex_debug = 0; | |
| +extern int yy_flex_debug; | |
| +int yy_flex_debug = 0; | |
| /* The intent behind this definition is that it'll catch | |
| * any uses of REJECT which flex missed. | |
| @@ -676,7 +908,7 @@ static int yy_more_len = 0; | |
| #define yymore() ((yy_more_flag) = 1) | |
| #define YY_MORE_ADJ (yy_more_len) | |
| #define YY_RESTORE_YY_MORE_OFFSET | |
| -char *phptext; | |
| +char *yytext; | |
| #line 1 "php_lexer.l" | |
| #line 2 "php_lexer.l" | |
| // | |
| @@ -711,32 +943,31 @@ char *phptext; | |
| void php_set_input_buffer(char *buf, int len) | |
| { | |
| - php_delete_buffer(YY_CURRENT_BUFFER); | |
| - php_scan_bytes(buf,len); | |
| + yy_delete_buffer(YY_CURRENT_BUFFER); | |
| + yy_scan_bytes(buf, len); | |
| } | |
| -int phpwrap(void); | |
| +int yywrap(void); | |
| #define MAX_INCLUDE_DEPTH 10 | |
| YY_BUFFER_STATE php_include_stack[MAX_INCLUDE_DEPTH]; | |
| int php_include_stack_ptr = 0; | |
| -int phpwrap(void) | |
| +int yywrap(void) | |
| { | |
| if ( --php_include_stack_ptr < 0 ) { | |
| return 1; | |
| } else { | |
| - php_delete_buffer(YY_CURRENT_BUFFER ); | |
| - php_switch_to_buffer(php_include_stack[php_include_stack_ptr] ); | |
| + yy_delete_buffer( YY_CURRENT_BUFFER ); | |
| + yy_switch_to_buffer(php_include_stack[php_include_stack_ptr] ); | |
| } | |
| return 0; | |
| } | |
| +#line 968 "php_lexer.c" | |
| - | |
| - | |
| -#line 740 "php_lexer.c" | |
| +#line 970 "php_lexer.c" | |
| #define INITIAL 0 | |
| #define BLOCK_COMMENT 1 | |
| @@ -755,36 +986,36 @@ int phpwrap(void) | |
| #define YY_EXTRA_TYPE void * | |
| #endif | |
| -static int yy_init_globals (void ); | |
| +static int yy_init_globals ( void ); | |
| /* Accessor methods to globals. | |
| These are made visible to non-reentrant scanners for convenience. */ | |
| -int phplex_destroy (void ); | |
| +int yylex_destroy ( void ); | |
| -int phpget_debug (void ); | |
| +int yyget_debug ( void ); | |
| -void phpset_debug (int debug_flag ); | |
| +void yyset_debug ( int debug_flag ); | |
| -YY_EXTRA_TYPE phpget_extra (void ); | |
| +YY_EXTRA_TYPE yyget_extra ( void ); | |
| -void phpset_extra (YY_EXTRA_TYPE user_defined ); | |
| +void yyset_extra ( YY_EXTRA_TYPE user_defined ); | |
| -FILE *phpget_in (void ); | |
| +FILE *yyget_in ( void ); | |
| -void phpset_in (FILE * in_str ); | |
| +void yyset_in ( FILE * _in_str ); | |
| -FILE *phpget_out (void ); | |
| +FILE *yyget_out ( void ); | |
| -void phpset_out (FILE * out_str ); | |
| +void yyset_out ( FILE * _out_str ); | |
| -yy_size_t phpget_leng (void ); | |
| + int yyget_leng ( void ); | |
| -char *phpget_text (void ); | |
| +char *yyget_text ( void ); | |
| -int phpget_lineno (void ); | |
| +int yyget_lineno ( void ); | |
| -void phpset_lineno (int line_number ); | |
| +void yyset_lineno ( int _line_number ); | |
| /* Macros after this point can all be overridden by user definitions in | |
| * section 1. | |
| @@ -792,26 +1023,29 @@ void phpset_lineno (int line_number ); | |
| #ifndef YY_SKIP_YYWRAP | |
| #ifdef __cplusplus | |
| -extern "C" int phpwrap (void ); | |
| +extern "C" int yywrap ( void ); | |
| #else | |
| -extern int phpwrap (void ); | |
| +extern int yywrap ( void ); | |
| #endif | |
| #endif | |
| +#ifndef YY_NO_UNPUT | |
| + | |
| +#endif | |
| + | |
| #ifndef yytext_ptr | |
| -static void yy_flex_strncpy (char *,yyconst char *,int ); | |
| +static void yy_flex_strncpy ( char *, const char *, int ); | |
| #endif | |
| #ifdef YY_NEED_STRLEN | |
| -static int yy_flex_strlen (yyconst char * ); | |
| +static int yy_flex_strlen ( const char * ); | |
| #endif | |
| #ifndef YY_NO_INPUT | |
| - | |
| #ifdef __cplusplus | |
| -static int yyinput (void ); | |
| +static int yyinput ( void ); | |
| #else | |
| -static int input (void ); | |
| +static int input ( void ); | |
| #endif | |
| #endif | |
| @@ -822,7 +1056,12 @@ static int input (void ); | |
| /* Amount of stuff to slurp up with each read. */ | |
| #ifndef YY_READ_BUF_SIZE | |
| +#ifdef __ia64__ | |
| +/* On IA-64, the buffer size is 16k, not 8k */ | |
| +#define YY_READ_BUF_SIZE 16384 | |
| +#else | |
| #define YY_READ_BUF_SIZE 8192 | |
| +#endif /* __ia64__ */ | |
| #endif | |
| /* Copy whatever the last rule matched to the standard output. */ | |
| @@ -830,7 +1069,7 @@ static int input (void ); | |
| /* This used to be an fputs(), but since the string might contain NUL's, | |
| * we now use fwrite(). | |
| */ | |
| -#define ECHO do { if (fwrite( phptext, phpleng, 1, phpout )) {} } while (0) | |
| +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) | |
| #endif | |
| /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | |
| @@ -841,20 +1080,20 @@ static int input (void ); | |
| if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ | |
| { \ | |
| int c = '*'; \ | |
| - size_t n; \ | |
| + int n; \ | |
| for ( n = 0; n < max_size && \ | |
| - (c = getc( phpin )) != EOF && c != '\n'; ++n ) \ | |
| + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ | |
| buf[n] = (char) c; \ | |
| if ( c == '\n' ) \ | |
| buf[n++] = (char) c; \ | |
| - if ( c == EOF && ferror( phpin ) ) \ | |
| + if ( c == EOF && ferror( yyin ) ) \ | |
| YY_FATAL_ERROR( "input in flex scanner failed" ); \ | |
| result = n; \ | |
| } \ | |
| else \ | |
| { \ | |
| errno=0; \ | |
| - while ( (result = fread(buf, 1, max_size, phpin))==0 && ferror(phpin)) \ | |
| + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ | |
| { \ | |
| if( errno != EINTR) \ | |
| { \ | |
| @@ -862,7 +1101,7 @@ static int input (void ); | |
| break; \ | |
| } \ | |
| errno=0; \ | |
| - clearerr(phpin); \ | |
| + clearerr(yyin); \ | |
| } \ | |
| }\ | |
| \ | |
| @@ -895,12 +1134,12 @@ static int input (void ); | |
| #ifndef YY_DECL | |
| #define YY_DECL_IS_OURS 1 | |
| -extern int phplex (void); | |
| +extern int yylex (void); | |
| -#define YY_DECL int phplex (void) | |
| +#define YY_DECL int yylex (void) | |
| #endif /* !YY_DECL */ | |
| -/* Code executed at the beginning of each rule, after phptext and phpleng | |
| +/* Code executed at the beginning of each rule, after yytext and yyleng | |
| * have been set up. | |
| */ | |
| #ifndef YY_USER_ACTION | |
| @@ -909,7 +1148,7 @@ extern int phplex (void); | |
| /* Code executed at the end of each rule. */ | |
| #ifndef YY_BREAK | |
| -#define YY_BREAK break; | |
| +#define YY_BREAK /*LINTED*/break; | |
| #endif | |
| #define YY_RULE_SETUP \ | |
| @@ -919,9 +1158,9 @@ extern int phplex (void); | |
| */ | |
| YY_DECL | |
| { | |
| - register yy_state_type yy_current_state; | |
| - register char *yy_cp, *yy_bp; | |
| - register int yy_act; | |
| + yy_state_type yy_current_state; | |
| + char *yy_cp, *yy_bp; | |
| + int yy_act; | |
| if ( !(yy_init) ) | |
| { | |
| @@ -934,38 +1173,38 @@ YY_DECL | |
| if ( ! (yy_start) ) | |
| (yy_start) = 1; /* first start state */ | |
| - if ( ! phpin ) | |
| - phpin = stdin; | |
| + if ( ! yyin ) | |
| + yyin = stdin; | |
| - if ( ! phpout ) | |
| - phpout = stdout; | |
| + if ( ! yyout ) | |
| + yyout = stdout; | |
| if ( ! YY_CURRENT_BUFFER ) { | |
| - phpensure_buffer_stack (); | |
| + yyensure_buffer_stack (); | |
| YY_CURRENT_BUFFER_LVALUE = | |
| - php_create_buffer(phpin,YY_BUF_SIZE ); | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); | |
| } | |
| - php_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| } | |
| { | |
| #line 73 "php_lexer.l" | |
| -#line 957 "php_lexer.c" | |
| +#line 1195 "php_lexer.c" | |
| - while ( 1 ) /* loops until end-of-file is reached */ | |
| + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ | |
| { | |
| (yy_more_len) = 0; | |
| if ( (yy_more_flag) ) | |
| { | |
| - (yy_more_len) = (yy_c_buf_p) - (yytext_ptr); | |
| + (yy_more_len) = (int) ((yy_c_buf_p) - (yytext_ptr)); | |
| (yy_more_flag) = 0; | |
| } | |
| yy_cp = (yy_c_buf_p); | |
| - /* Support of phptext. */ | |
| + /* Support of yytext. */ | |
| *yy_cp = (yy_hold_char); | |
| /* yy_bp points to the position in yy_ch_buf of the start of | |
| @@ -977,7 +1216,7 @@ YY_DECL | |
| yy_match: | |
| do | |
| { | |
| - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; | |
| + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -987,9 +1226,9 @@ yy_match: | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 276 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| ++yy_cp; | |
| } | |
| while ( yy_base[yy_current_state] != 359 ); | |
| @@ -1007,11 +1246,11 @@ yy_find_action: | |
| if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) | |
| { | |
| - yy_size_t yyl; | |
| - for ( yyl = (yy_more_len); yyl < phpleng; ++yyl ) | |
| - if ( phptext[yyl] == '\n' ) | |
| + int yyl; | |
| + for ( yyl = (yy_more_len); yyl < yyleng; ++yyl ) | |
| + if ( yytext[yyl] == '\n' ) | |
| - phplineno++; | |
| + yylineno++; | |
| ; | |
| } | |
| @@ -1325,16 +1564,16 @@ case 60: | |
| YY_RULE_SETUP | |
| #line 153 "php_lexer.l" | |
| { | |
| - phptext[strlen(phptext)-1] = 0; | |
| + yytext[strlen(yytext)-1] = 0; | |
| if ( php_include_stack_ptr >= MAX_INCLUDE_DEPTH ) { | |
| fprintf( stderr, "WARNING: maximum include depth (which is %d) exceed", MAX_INCLUDE_DEPTH); | |
| } else { | |
| php_include_stack[php_include_stack_ptr++] = YY_CURRENT_BUFFER; | |
| - phpin = fopen(phptext+1, "r"); | |
| - if ( !phpin ) { | |
| - printf("WARNING: include file [%s] can not be opened\n", phptext+1); | |
| + yyin = fopen(yytext+1, "r"); | |
| + if ( !yyin ) { | |
| + printf("WARNING: include file [%s] can not be opened\n", yytext+1); | |
| } else { | |
| - php_switch_to_buffer(php_create_buffer(phpin,YY_BUF_SIZE )); | |
| + yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE )); | |
| } | |
| } | |
| BEGIN(INITIAL); | |
| @@ -1410,7 +1649,7 @@ case 70: | |
| YY_RULE_SETUP | |
| #line 207 "php_lexer.l" | |
| { | |
| - phplval.exp_node = get_var_node(phptext+1); | |
| + phplval.exp_node = get_var_node(yytext+1); | |
| return VARIABLE; | |
| } | |
| YY_BREAK | |
| @@ -1418,7 +1657,7 @@ case 71: | |
| YY_RULE_SETUP | |
| #line 212 "php_lexer.l" | |
| { | |
| - strcpy(phplval.str_val, phptext); | |
| + strcpy(phplval.str_val, yytext); | |
| return IDENT; | |
| } | |
| YY_BREAK | |
| @@ -1427,7 +1666,7 @@ YY_RULE_SETUP | |
| #line 217 "php_lexer.l" | |
| { | |
| int val; | |
| - sscanf(phptext, "0x%16x", &val); | |
| + sscanf(yytext, "0x%16x", &val); | |
| phplval.exp_node = make_const_exp_dnum(val); | |
| return DNUMBER; | |
| } | |
| @@ -1436,7 +1675,7 @@ case 73: | |
| YY_RULE_SETUP | |
| #line 224 "php_lexer.l" | |
| { | |
| - phplval.exp_node = make_const_exp_dnum(atoi(phptext)); | |
| + phplval.exp_node = make_const_exp_dnum(atoi(yytext)); | |
| return DNUMBER; | |
| } | |
| YY_BREAK | |
| @@ -1444,7 +1683,7 @@ case 74: | |
| YY_RULE_SETUP | |
| #line 229 "php_lexer.l" | |
| { | |
| - phplval.exp_node = make_const_exp_fnum(atof(phptext)); | |
| + phplval.exp_node = make_const_exp_fnum(atof(yytext)); | |
| return FNUMBER; | |
| } | |
| YY_BREAK | |
| @@ -1453,8 +1692,8 @@ case 75: | |
| YY_RULE_SETUP | |
| #line 234 "php_lexer.l" | |
| { | |
| - phptext[strlen(phptext)-1] = 0; | |
| - phplval.exp_node = make_const_exp_str(phptext+1, 1); | |
| + yytext[strlen(yytext)-1] = 0; | |
| + phplval.exp_node = make_const_exp_str(yytext+1, 1); | |
| return STRING; | |
| } | |
| YY_BREAK | |
| @@ -1463,8 +1702,8 @@ case 76: | |
| YY_RULE_SETUP | |
| #line 240 "php_lexer.l" | |
| { | |
| - phptext[strlen(phptext)-1] = 0; | |
| - phplval.exp_node = make_const_exp_str(phptext+1, 0); | |
| + yytext[strlen(yytext)-1] = 0; | |
| + phplval.exp_node = make_const_exp_str(yytext+1, 0); | |
| return STRING; | |
| } | |
| YY_BREAK | |
| @@ -1478,7 +1717,7 @@ case 78: | |
| YY_RULE_SETUP | |
| #line 248 "php_lexer.l" | |
| { | |
| - return phptext[0]; | |
| + return yytext[0]; | |
| } | |
| YY_BREAK | |
| case 79: | |
| @@ -1486,7 +1725,7 @@ YY_RULE_SETUP | |
| #line 251 "php_lexer.l" | |
| ECHO; | |
| YY_BREAK | |
| -#line 1490 "php_lexer.c" | |
| +#line 1728 "php_lexer.c" | |
| case YY_STATE_EOF(INITIAL): | |
| case YY_STATE_EOF(BLOCK_COMMENT): | |
| case YY_STATE_EOF(LINE_COMMENT): | |
| @@ -1506,15 +1745,15 @@ case YY_STATE_EOF(INCLUDE): | |
| { | |
| /* We're scanning a new file or input source. It's | |
| * possible that this happened because the user | |
| - * just pointed phpin at a new source and called | |
| - * phplex(). If so, then we have to assure | |
| + * just pointed yyin at a new source and called | |
| + * yylex(). If so, then we have to assure | |
| * consistency between YY_CURRENT_BUFFER and our | |
| * globals. Here is the right place to do so, because | |
| * this is the first action (other than possibly a | |
| * back-up) that will match for the new input source. | |
| */ | |
| (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | |
| - YY_CURRENT_BUFFER_LVALUE->yy_input_file = phpin; | |
| + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; | |
| YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; | |
| } | |
| @@ -1567,11 +1806,11 @@ case YY_STATE_EOF(INCLUDE): | |
| { | |
| (yy_did_buffer_switch_on_eof) = 0; | |
| - if ( phpwrap( ) ) | |
| + if ( yywrap( ) ) | |
| { | |
| /* Note: because we've taken care in | |
| * yy_get_next_buffer() to have set up | |
| - * phptext, we can now set up | |
| + * yytext, we can now set up | |
| * yy_c_buf_p so that if some total | |
| * hoser (like flex itself) wants to | |
| * call the scanner after we return the | |
| @@ -1621,7 +1860,7 @@ case YY_STATE_EOF(INCLUDE): | |
| } /* end of action switch */ | |
| } /* end of scanning one token */ | |
| } /* end of user's declarations */ | |
| -} /* end of phplex */ | |
| +} /* end of yylex */ | |
| /* yy_get_next_buffer - try to read in a new buffer | |
| * | |
| @@ -1632,9 +1871,9 @@ case YY_STATE_EOF(INCLUDE): | |
| */ | |
| static int yy_get_next_buffer (void) | |
| { | |
| - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | |
| - register char *source = (yytext_ptr); | |
| - register int number_to_move, i; | |
| + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | |
| + char *source = (yytext_ptr); | |
| + int number_to_move, i; | |
| int ret_val; | |
| if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) | |
| @@ -1663,7 +1902,7 @@ static int yy_get_next_buffer (void) | |
| /* Try to read more data. */ | |
| /* First move last chars to start of buffer. */ | |
| - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; | |
| + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); | |
| for ( i = 0; i < number_to_move; ++i ) | |
| *(dest++) = *(source++); | |
| @@ -1676,7 +1915,7 @@ static int yy_get_next_buffer (void) | |
| else | |
| { | |
| - yy_size_t num_to_read = | |
| + int num_to_read = | |
| YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; | |
| while ( num_to_read <= 0 ) | |
| @@ -1690,7 +1929,7 @@ static int yy_get_next_buffer (void) | |
| if ( b->yy_is_our_buffer ) | |
| { | |
| - yy_size_t new_size = b->yy_buf_size * 2; | |
| + int new_size = b->yy_buf_size * 2; | |
| if ( new_size <= 0 ) | |
| b->yy_buf_size += b->yy_buf_size / 8; | |
| @@ -1699,11 +1938,12 @@ static int yy_get_next_buffer (void) | |
| b->yy_ch_buf = (char *) | |
| /* Include room in for 2 EOB chars. */ | |
| - phprealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); | |
| + yyrealloc( (void *) b->yy_ch_buf, | |
| + (yy_size_t) (b->yy_buf_size + 2) ); | |
| } | |
| else | |
| /* Can't grow it, we don't own it. */ | |
| - b->yy_ch_buf = 0; | |
| + b->yy_ch_buf = NULL; | |
| if ( ! b->yy_ch_buf ) | |
| YY_FATAL_ERROR( | |
| @@ -1731,7 +1971,7 @@ static int yy_get_next_buffer (void) | |
| if ( number_to_move == YY_MORE_ADJ ) | |
| { | |
| ret_val = EOB_ACT_END_OF_FILE; | |
| - phprestart(phpin ); | |
| + yyrestart( yyin ); | |
| } | |
| else | |
| @@ -1745,12 +1985,15 @@ static int yy_get_next_buffer (void) | |
| else | |
| ret_val = EOB_ACT_CONTINUE_SCAN; | |
| - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { | |
| + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { | |
| /* Extend the array by 50%, plus the number we really need. */ | |
| - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); | |
| - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) phprealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); | |
| + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); | |
| + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( | |
| + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); | |
| if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) | |
| YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); | |
| + /* "- 2" to take care of EOB's */ | |
| + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); | |
| } | |
| (yy_n_chars) += number_to_move; | |
| @@ -1766,14 +2009,14 @@ static int yy_get_next_buffer (void) | |
| static yy_state_type yy_get_previous_state (void) | |
| { | |
| - register yy_state_type yy_current_state; | |
| - register char *yy_cp; | |
| + yy_state_type yy_current_state; | |
| + char *yy_cp; | |
| yy_current_state = (yy_start); | |
| for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) | |
| { | |
| - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | |
| + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -1783,9 +2026,9 @@ static int yy_get_next_buffer (void) | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 276 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| } | |
| return yy_current_state; | |
| @@ -1798,10 +2041,10 @@ static int yy_get_next_buffer (void) | |
| */ | |
| static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) | |
| { | |
| - register int yy_is_jam; | |
| - register char *yy_cp = (yy_c_buf_p); | |
| + int yy_is_jam; | |
| + char *yy_cp = (yy_c_buf_p); | |
| - register YY_CHAR yy_c = 1; | |
| + YY_CHAR yy_c = 1; | |
| if ( yy_accept[yy_current_state] ) | |
| { | |
| (yy_last_accepting_state) = yy_current_state; | |
| @@ -1811,14 +2054,18 @@ static int yy_get_next_buffer (void) | |
| { | |
| yy_current_state = (int) yy_def[yy_current_state]; | |
| if ( yy_current_state >= 276 ) | |
| - yy_c = yy_meta[(unsigned int) yy_c]; | |
| + yy_c = yy_meta[yy_c]; | |
| } | |
| - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
| + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; | |
| yy_is_jam = (yy_current_state == 275); | |
| return yy_is_jam ? 0 : yy_current_state; | |
| } | |
| +#ifndef YY_NO_UNPUT | |
| + | |
| +#endif | |
| + | |
| #ifndef YY_NO_INPUT | |
| #ifdef __cplusplus | |
| static int yyinput (void) | |
| @@ -1843,7 +2090,7 @@ static int yy_get_next_buffer (void) | |
| else | |
| { /* need more input */ | |
| - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); | |
| + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); | |
| ++(yy_c_buf_p); | |
| switch ( yy_get_next_buffer( ) ) | |
| @@ -1860,14 +2107,14 @@ static int yy_get_next_buffer (void) | |
| */ | |
| /* Reset buffer status. */ | |
| - phprestart(phpin ); | |
| + yyrestart( yyin ); | |
| /*FALLTHROUGH*/ | |
| case EOB_ACT_END_OF_FILE: | |
| { | |
| - if ( phpwrap( ) ) | |
| - return EOF; | |
| + if ( yywrap( ) ) | |
| + return 0; | |
| if ( ! (yy_did_buffer_switch_on_eof) ) | |
| YY_NEW_FILE; | |
| @@ -1886,12 +2133,12 @@ static int yy_get_next_buffer (void) | |
| } | |
| c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ | |
| - *(yy_c_buf_p) = '\0'; /* preserve phptext */ | |
| + *(yy_c_buf_p) = '\0'; /* preserve yytext */ | |
| (yy_hold_char) = *++(yy_c_buf_p); | |
| if ( c == '\n' ) | |
| - phplineno++; | |
| + yylineno++; | |
| ; | |
| return c; | |
| @@ -1903,32 +2150,32 @@ static int yy_get_next_buffer (void) | |
| * | |
| * @note This function does not reset the start condition to @c INITIAL . | |
| */ | |
| - void phprestart (FILE * input_file ) | |
| + void yyrestart (FILE * input_file ) | |
| { | |
| if ( ! YY_CURRENT_BUFFER ){ | |
| - phpensure_buffer_stack (); | |
| + yyensure_buffer_stack (); | |
| YY_CURRENT_BUFFER_LVALUE = | |
| - php_create_buffer(phpin,YY_BUF_SIZE ); | |
| + yy_create_buffer( yyin, YY_BUF_SIZE ); | |
| } | |
| - php_init_buffer(YY_CURRENT_BUFFER,input_file ); | |
| - php_load_buffer_state( ); | |
| + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); | |
| + yy_load_buffer_state( ); | |
| } | |
| /** Switch to a different input buffer. | |
| * @param new_buffer The new input buffer. | |
| * | |
| */ | |
| - void php_switch_to_buffer (YY_BUFFER_STATE new_buffer ) | |
| + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) | |
| { | |
| /* TODO. We should be able to replace this entire function body | |
| * with | |
| - * phppop_buffer_state(); | |
| - * phppush_buffer_state(new_buffer); | |
| + * yypop_buffer_state(); | |
| + * yypush_buffer_state(new_buffer); | |
| */ | |
| - phpensure_buffer_stack (); | |
| + yyensure_buffer_stack (); | |
| if ( YY_CURRENT_BUFFER == new_buffer ) | |
| return; | |
| @@ -1941,21 +2188,21 @@ static int yy_get_next_buffer (void) | |
| } | |
| YY_CURRENT_BUFFER_LVALUE = new_buffer; | |
| - php_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| /* We don't actually know whether we did this switch during | |
| - * EOF (phpwrap()) processing, but the only time this flag | |
| - * is looked at is after phpwrap() is called, so it's safe | |
| + * EOF (yywrap()) processing, but the only time this flag | |
| + * is looked at is after yywrap() is called, so it's safe | |
| * to go ahead and always set it. | |
| */ | |
| (yy_did_buffer_switch_on_eof) = 1; | |
| } | |
| -static void php_load_buffer_state (void) | |
| +static void yy_load_buffer_state (void) | |
| { | |
| (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | |
| (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; | |
| - phpin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; | |
| + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; | |
| (yy_hold_char) = *(yy_c_buf_p); | |
| } | |
| @@ -1965,35 +2212,35 @@ static void php_load_buffer_state (void) | |
| * | |
| * @return the allocated buffer state. | |
| */ | |
| - YY_BUFFER_STATE php_create_buffer (FILE * file, int size ) | |
| + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) | |
| { | |
| YY_BUFFER_STATE b; | |
| - b = (YY_BUFFER_STATE) phpalloc(sizeof( struct yy_buffer_state ) ); | |
| + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); | |
| if ( ! b ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in php_create_buffer()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
| b->yy_buf_size = size; | |
| /* yy_ch_buf has to be 2 characters longer than the size given because | |
| * we need to put in 2 end-of-buffer characters. | |
| */ | |
| - b->yy_ch_buf = (char *) phpalloc(b->yy_buf_size + 2 ); | |
| + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); | |
| if ( ! b->yy_ch_buf ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in php_create_buffer()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
| b->yy_is_our_buffer = 1; | |
| - php_init_buffer(b,file ); | |
| + yy_init_buffer( b, file ); | |
| return b; | |
| } | |
| /** Destroy the buffer. | |
| - * @param b a buffer created with php_create_buffer() | |
| + * @param b a buffer created with yy_create_buffer() | |
| * | |
| */ | |
| - void php_delete_buffer (YY_BUFFER_STATE b ) | |
| + void yy_delete_buffer (YY_BUFFER_STATE b ) | |
| { | |
| if ( ! b ) | |
| @@ -2003,27 +2250,27 @@ static void php_load_buffer_state (void) | |
| YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; | |
| if ( b->yy_is_our_buffer ) | |
| - phpfree((void *) b->yy_ch_buf ); | |
| + yyfree( (void *) b->yy_ch_buf ); | |
| - phpfree((void *) b ); | |
| + yyfree( (void *) b ); | |
| } | |
| /* Initializes or reinitializes a buffer. | |
| * This function is sometimes called more than once on the same buffer, | |
| - * such as during a phprestart() or at EOF. | |
| + * such as during a yyrestart() or at EOF. | |
| */ | |
| - static void php_init_buffer (YY_BUFFER_STATE b, FILE * file ) | |
| + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) | |
| { | |
| int oerrno = errno; | |
| - php_flush_buffer(b ); | |
| + yy_flush_buffer( b ); | |
| b->yy_input_file = file; | |
| b->yy_fill_buffer = 1; | |
| - /* If b is the current buffer, then php_init_buffer was _probably_ | |
| - * called from phprestart() or through yy_get_next_buffer. | |
| + /* If b is the current buffer, then yy_init_buffer was _probably_ | |
| + * called from yyrestart() or through yy_get_next_buffer. | |
| * In that case, we don't want to reset the lineno or column. | |
| */ | |
| if (b != YY_CURRENT_BUFFER){ | |
| @@ -2040,7 +2287,7 @@ static void php_load_buffer_state (void) | |
| * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. | |
| * | |
| */ | |
| - void php_flush_buffer (YY_BUFFER_STATE b ) | |
| + void yy_flush_buffer (YY_BUFFER_STATE b ) | |
| { | |
| if ( ! b ) | |
| return; | |
| @@ -2060,7 +2307,7 @@ static void php_load_buffer_state (void) | |
| b->yy_buffer_status = YY_BUFFER_NEW; | |
| if ( b == YY_CURRENT_BUFFER ) | |
| - php_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| } | |
| /** Pushes the new state onto the stack. The new state becomes | |
| @@ -2069,14 +2316,14 @@ static void php_load_buffer_state (void) | |
| * @param new_buffer The new state. | |
| * | |
| */ | |
| -void phppush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| { | |
| if (new_buffer == NULL) | |
| return; | |
| - phpensure_buffer_stack(); | |
| + yyensure_buffer_stack(); | |
| - /* This block is copied from php_switch_to_buffer. */ | |
| + /* This block is copied from yy_switch_to_buffer. */ | |
| if ( YY_CURRENT_BUFFER ) | |
| { | |
| /* Flush out information for old buffer. */ | |
| @@ -2090,8 +2337,8 @@ void phppush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| (yy_buffer_stack_top)++; | |
| YY_CURRENT_BUFFER_LVALUE = new_buffer; | |
| - /* copied from php_switch_to_buffer. */ | |
| - php_load_buffer_state( ); | |
| + /* copied from yy_switch_to_buffer. */ | |
| + yy_load_buffer_state( ); | |
| (yy_did_buffer_switch_on_eof) = 1; | |
| } | |
| @@ -2099,18 +2346,18 @@ void phppush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
| * The next element becomes the new top. | |
| * | |
| */ | |
| -void phppop_buffer_state (void) | |
| +void yypop_buffer_state (void) | |
| { | |
| if (!YY_CURRENT_BUFFER) | |
| return; | |
| - php_delete_buffer(YY_CURRENT_BUFFER ); | |
| + yy_delete_buffer(YY_CURRENT_BUFFER ); | |
| YY_CURRENT_BUFFER_LVALUE = NULL; | |
| if ((yy_buffer_stack_top) > 0) | |
| --(yy_buffer_stack_top); | |
| if (YY_CURRENT_BUFFER) { | |
| - php_load_buffer_state( ); | |
| + yy_load_buffer_state( ); | |
| (yy_did_buffer_switch_on_eof) = 1; | |
| } | |
| } | |
| @@ -2118,7 +2365,7 @@ void phppop_buffer_state (void) | |
| /* Allocates the stack if it does not exist. | |
| * Guarantees space for at least one push. | |
| */ | |
| -static void phpensure_buffer_stack (void) | |
| +static void yyensure_buffer_stack (void) | |
| { | |
| yy_size_t num_to_alloc; | |
| @@ -2128,12 +2375,12 @@ static void phpensure_buffer_stack (void) | |
| * scanner will even need a stack. We use 2 instead of 1 to avoid an | |
| * immediate realloc on the next call. | |
| */ | |
| - num_to_alloc = 1; | |
| - (yy_buffer_stack) = (struct yy_buffer_state**)phpalloc | |
| + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ | |
| + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc | |
| (num_to_alloc * sizeof(struct yy_buffer_state*) | |
| ); | |
| if ( ! (yy_buffer_stack) ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in phpensure_buffer_stack()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); | |
| memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); | |
| @@ -2145,15 +2392,15 @@ static void phpensure_buffer_stack (void) | |
| if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ | |
| /* Increase the buffer to prepare for a possible push. */ | |
| - int grow_size = 8 /* arbitrary grow size */; | |
| + yy_size_t grow_size = 8 /* arbitrary grow size */; | |
| num_to_alloc = (yy_buffer_stack_max) + grow_size; | |
| - (yy_buffer_stack) = (struct yy_buffer_state**)phprealloc | |
| + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc | |
| ((yy_buffer_stack), | |
| num_to_alloc * sizeof(struct yy_buffer_state*) | |
| ); | |
| if ( ! (yy_buffer_stack) ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in phpensure_buffer_stack()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); | |
| /* zero only the new slots.*/ | |
| memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); | |
| @@ -2167,7 +2414,7 @@ static void phpensure_buffer_stack (void) | |
| * | |
| * @return the newly allocated buffer state object. | |
| */ | |
| -YY_BUFFER_STATE php_scan_buffer (char * base, yy_size_t size ) | |
| +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) | |
| { | |
| YY_BUFFER_STATE b; | |
| @@ -2175,69 +2422,69 @@ YY_BUFFER_STATE php_scan_buffer (char * base, yy_size_t size ) | |
| base[size-2] != YY_END_OF_BUFFER_CHAR || | |
| base[size-1] != YY_END_OF_BUFFER_CHAR ) | |
| /* They forgot to leave room for the EOB's. */ | |
| - return 0; | |
| + return NULL; | |
| - b = (YY_BUFFER_STATE) phpalloc(sizeof( struct yy_buffer_state ) ); | |
| + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); | |
| if ( ! b ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in php_scan_buffer()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); | |
| - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ | |
| + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ | |
| b->yy_buf_pos = b->yy_ch_buf = base; | |
| b->yy_is_our_buffer = 0; | |
| - b->yy_input_file = 0; | |
| + b->yy_input_file = NULL; | |
| b->yy_n_chars = b->yy_buf_size; | |
| b->yy_is_interactive = 0; | |
| b->yy_at_bol = 1; | |
| b->yy_fill_buffer = 0; | |
| b->yy_buffer_status = YY_BUFFER_NEW; | |
| - php_switch_to_buffer(b ); | |
| + yy_switch_to_buffer( b ); | |
| return b; | |
| } | |
| -/** Setup the input buffer state to scan a string. The next call to phplex() will | |
| +/** Setup the input buffer state to scan a string. The next call to yylex() will | |
| * scan from a @e copy of @a str. | |
| * @param yystr a NUL-terminated string to scan | |
| * | |
| * @return the newly allocated buffer state object. | |
| * @note If you want to scan bytes that may contain NUL values, then use | |
| - * php_scan_bytes() instead. | |
| + * yy_scan_bytes() instead. | |
| */ | |
| -YY_BUFFER_STATE php_scan_string (yyconst char * yystr ) | |
| +YY_BUFFER_STATE yy_scan_string (const char * yystr ) | |
| { | |
| - return php_scan_bytes(yystr,strlen(yystr) ); | |
| + return yy_scan_bytes( yystr, (int) strlen(yystr) ); | |
| } | |
| -/** Setup the input buffer state to scan the given bytes. The next call to phplex() will | |
| +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will | |
| * scan from a @e copy of @a bytes. | |
| * @param yybytes the byte buffer to scan | |
| * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. | |
| * | |
| * @return the newly allocated buffer state object. | |
| */ | |
| -YY_BUFFER_STATE php_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) | |
| +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) | |
| { | |
| YY_BUFFER_STATE b; | |
| char *buf; | |
| yy_size_t n; | |
| - yy_size_t i; | |
| + int i; | |
| /* Get memory for full buffer, including space for trailing EOB's. */ | |
| - n = _yybytes_len + 2; | |
| - buf = (char *) phpalloc(n ); | |
| + n = (yy_size_t) (_yybytes_len + 2); | |
| + buf = (char *) yyalloc( n ); | |
| if ( ! buf ) | |
| - YY_FATAL_ERROR( "out of dynamic memory in php_scan_bytes()" ); | |
| + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); | |
| for ( i = 0; i < _yybytes_len; ++i ) | |
| buf[i] = yybytes[i]; | |
| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; | |
| - b = php_scan_buffer(buf,n ); | |
| + b = yy_scan_buffer( buf, n ); | |
| if ( ! b ) | |
| - YY_FATAL_ERROR( "bad buffer in php_scan_bytes()" ); | |
| + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); | |
| /* It's okay to grow etc. this buffer, and we should throw it | |
| * away when we're done. | |
| @@ -2251,9 +2498,9 @@ YY_BUFFER_STATE php_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len | |
| #define YY_EXIT_FAILURE 2 | |
| #endif | |
| -static void yy_fatal_error (yyconst char* msg ) | |
| +static void yynoreturn yy_fatal_error (const char* msg ) | |
| { | |
| - (void) fprintf( stderr, "%s\n", msg ); | |
| + fprintf( stderr, "%s\n", msg ); | |
| exit( YY_EXIT_FAILURE ); | |
| } | |
| @@ -2263,14 +2510,14 @@ static void yy_fatal_error (yyconst char* msg ) | |
| #define yyless(n) \ | |
| do \ | |
| { \ | |
| - /* Undo effects of setting up phptext. */ \ | |
| + /* Undo effects of setting up yytext. */ \ | |
| int yyless_macro_arg = (n); \ | |
| YY_LESS_LINENO(yyless_macro_arg);\ | |
| - phptext[phpleng] = (yy_hold_char); \ | |
| - (yy_c_buf_p) = phptext + yyless_macro_arg; \ | |
| + yytext[yyleng] = (yy_hold_char); \ | |
| + (yy_c_buf_p) = yytext + yyless_macro_arg; \ | |
| (yy_hold_char) = *(yy_c_buf_p); \ | |
| *(yy_c_buf_p) = '\0'; \ | |
| - phpleng = yyless_macro_arg; \ | |
| + yyleng = yyless_macro_arg; \ | |
| } \ | |
| while ( 0 ) | |
| @@ -2279,94 +2526,94 @@ static void yy_fatal_error (yyconst char* msg ) | |
| /** Get the current line number. | |
| * | |
| */ | |
| -int phpget_lineno (void) | |
| +int yyget_lineno (void) | |
| { | |
| - return phplineno; | |
| + return yylineno; | |
| } | |
| /** Get the input stream. | |
| * | |
| */ | |
| -FILE *phpget_in (void) | |
| +FILE *yyget_in (void) | |
| { | |
| - return phpin; | |
| + return yyin; | |
| } | |
| /** Get the output stream. | |
| * | |
| */ | |
| -FILE *phpget_out (void) | |
| +FILE *yyget_out (void) | |
| { | |
| - return phpout; | |
| + return yyout; | |
| } | |
| /** Get the length of the current token. | |
| * | |
| */ | |
| -yy_size_t phpget_leng (void) | |
| +int yyget_leng (void) | |
| { | |
| - return phpleng; | |
| + return yyleng; | |
| } | |
| /** Get the current token. | |
| * | |
| */ | |
| -char *phpget_text (void) | |
| +char *yyget_text (void) | |
| { | |
| - return phptext; | |
| + return yytext; | |
| } | |
| /** Set the current line number. | |
| - * @param line_number | |
| + * @param _line_number line number | |
| * | |
| */ | |
| -void phpset_lineno (int line_number ) | |
| +void yyset_lineno (int _line_number ) | |
| { | |
| - phplineno = line_number; | |
| + yylineno = _line_number; | |
| } | |
| /** Set the input stream. This does not discard the current | |
| * input buffer. | |
| - * @param in_str A readable stream. | |
| + * @param _in_str A readable stream. | |
| * | |
| - * @see php_switch_to_buffer | |
| + * @see yy_switch_to_buffer | |
| */ | |
| -void phpset_in (FILE * in_str ) | |
| +void yyset_in (FILE * _in_str ) | |
| { | |
| - phpin = in_str ; | |
| + yyin = _in_str ; | |
| } | |
| -void phpset_out (FILE * out_str ) | |
| +void yyset_out (FILE * _out_str ) | |
| { | |
| - phpout = out_str ; | |
| + yyout = _out_str ; | |
| } | |
| -int phpget_debug (void) | |
| +int yyget_debug (void) | |
| { | |
| - return php_flex_debug; | |
| + return yy_flex_debug; | |
| } | |
| -void phpset_debug (int bdebug ) | |
| +void yyset_debug (int _bdebug ) | |
| { | |
| - php_flex_debug = bdebug ; | |
| + yy_flex_debug = _bdebug ; | |
| } | |
| static int yy_init_globals (void) | |
| { | |
| /* Initialization is the same as for the non-reentrant scanner. | |
| - * This function is called from phplex_destroy(), so don't allocate here. | |
| + * This function is called from yylex_destroy(), so don't allocate here. | |
| */ | |
| - /* We do not touch phplineno unless the option is enabled. */ | |
| - phplineno = 1; | |
| + /* We do not touch yylineno unless the option is enabled. */ | |
| + yylineno = 1; | |
| - (yy_buffer_stack) = 0; | |
| + (yy_buffer_stack) = NULL; | |
| (yy_buffer_stack_top) = 0; | |
| (yy_buffer_stack_max) = 0; | |
| - (yy_c_buf_p) = (char *) 0; | |
| + (yy_c_buf_p) = NULL; | |
| (yy_init) = 0; | |
| (yy_start) = 0; | |
| @@ -2376,40 +2623,40 @@ static int yy_init_globals (void) | |
| /* Defined in main.c */ | |
| #ifdef YY_STDINIT | |
| - phpin = stdin; | |
| - phpout = stdout; | |
| + yyin = stdin; | |
| + yyout = stdout; | |
| #else | |
| - phpin = (FILE *) 0; | |
| - phpout = (FILE *) 0; | |
| + yyin = NULL; | |
| + yyout = NULL; | |
| #endif | |
| /* For future reference: Set errno on error, since we are called by | |
| - * phplex_init() | |
| + * yylex_init() | |
| */ | |
| return 0; | |
| } | |
| -/* phplex_destroy is for both reentrant and non-reentrant scanners. */ | |
| -int phplex_destroy (void) | |
| +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ | |
| +int yylex_destroy (void) | |
| { | |
| /* Pop the buffer stack, destroying each element. */ | |
| while(YY_CURRENT_BUFFER){ | |
| - php_delete_buffer(YY_CURRENT_BUFFER ); | |
| + yy_delete_buffer( YY_CURRENT_BUFFER ); | |
| YY_CURRENT_BUFFER_LVALUE = NULL; | |
| - phppop_buffer_state(); | |
| + yypop_buffer_state(); | |
| } | |
| /* Destroy the stack itself. */ | |
| - phpfree((yy_buffer_stack) ); | |
| + yyfree((yy_buffer_stack) ); | |
| (yy_buffer_stack) = NULL; | |
| /* Destroy the start condition stack. */ | |
| - phpfree((yy_start_stack) ); | |
| + yyfree( (yy_start_stack) ); | |
| (yy_start_stack) = NULL; | |
| /* Reset the globals. This is important in a non-reentrant scanner so the next time | |
| - * phplex() is called, initialization will occur. */ | |
| + * yylex() is called, initialization will occur. */ | |
| yy_init_globals( ); | |
| return 0; | |
| @@ -2420,18 +2667,19 @@ int phplex_destroy (void) | |
| */ | |
| #ifndef yytext_ptr | |
| -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) | |
| +static void yy_flex_strncpy (char* s1, const char * s2, int n ) | |
| { | |
| - register int i; | |
| + | |
| + int i; | |
| for ( i = 0; i < n; ++i ) | |
| s1[i] = s2[i]; | |
| } | |
| #endif | |
| #ifdef YY_NEED_STRLEN | |
| -static int yy_flex_strlen (yyconst char * s ) | |
| +static int yy_flex_strlen (const char * s ) | |
| { | |
| - register int n; | |
| + int n; | |
| for ( n = 0; s[n]; ++n ) | |
| ; | |
| @@ -2439,13 +2687,14 @@ static int yy_flex_strlen (yyconst char * s ) | |
| } | |
| #endif | |
| -void *phpalloc (yy_size_t size ) | |
| +void *yyalloc (yy_size_t size ) | |
| { | |
| - return (void *) malloc( size ); | |
| + return malloc(size); | |
| } | |
| -void *phprealloc (void * ptr, yy_size_t size ) | |
| +void *yyrealloc (void * ptr, yy_size_t size ) | |
| { | |
| + | |
| /* The cast to (char *) in the following accommodates both | |
| * implementations that use char* generic pointers, and those | |
| * that use void* generic pointers. It works with the latter | |
| @@ -2453,12 +2702,12 @@ void *phprealloc (void * ptr, yy_size_t size ) | |
| * any pointer type to void*, and deal with argument conversions | |
| * as though doing an assignment. | |
| */ | |
| - return (void *) realloc( (char *) ptr, size ); | |
| + return realloc(ptr, size); | |
| } | |
| -void phpfree (void * ptr ) | |
| +void yyfree (void * ptr ) | |
| { | |
| - free( (char *) ptr ); /* see phprealloc() for (char *) cast */ | |
| + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ | |
| } | |
| #define YYTABLES_NAME "yytables" | |
| diff --git a/src/webserver/src/php_parser.c b/src/webserver/src/php_parser.c | |
| index 31e45dd37..0f3463f89 100644 | |
| --- a/src/webserver/src/php_parser.c | |
| +++ b/src/webserver/src/php_parser.c | |
| @@ -1,8 +1,9 @@ | |
| -/* A Bison parser, made by GNU Bison 3.0.4. */ | |
| +/* A Bison parser, made by GNU Bison 3.8.2. */ | |
| /* Bison implementation for Yacc-like parsers in C | |
| - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. | |
| + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, | |
| + Inc. | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| @@ -15,7 +16,7 @@ | |
| GNU General Public License for more details. | |
| You should have received a copy of the GNU General Public License | |
| - along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
| + along with this program. If not, see <https://www.gnu.org/licenses/>. */ | |
| /* As a special exception, you may create a larger work that contains | |
| part or all of the Bison parser skeleton and distribute that work | |
| @@ -33,6 +34,10 @@ | |
| /* C LALR(1) parser skeleton written by Richard Stallman, by | |
| simplifying the original so-called "semantic" parser. */ | |
| +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, | |
| + especially those whose name start with YY_ or yy_. They are | |
| + private implementation details that can be changed or removed. */ | |
| + | |
| /* All symbols defined below should begin with yy or YY, to avoid | |
| infringing on user name space. This should be done even for local | |
| variables, as they might otherwise be expanded by user macros. | |
| @@ -40,11 +45,11 @@ | |
| define necessary library symbols; they are noted "INFRINGES ON | |
| USER NAME SPACE" below. */ | |
| -/* Identify Bison output. */ | |
| -#define YYBISON 1 | |
| +/* Identify Bison output, and Bison version. */ | |
| +#define YYBISON 30802 | |
| -/* Bison version. */ | |
| -#define YYBISON_VERSION "3.0.4" | |
| +/* Bison version string. */ | |
| +#define YYBISON_VERSION "3.8.2" | |
| /* Skeleton name. */ | |
| #define YYSKELETON_NAME "yacc.c" | |
| @@ -65,12 +70,11 @@ | |
| #define yyerror phperror | |
| #define yydebug phpdebug | |
| #define yynerrs phpnerrs | |
| - | |
| #define yylval phplval | |
| #define yychar phpchar | |
| -/* Copy the first part of user declarations. */ | |
| -#line 1 "php_parser.y" /* yacc.c:339 */ | |
| +/* First part of user prologue. */ | |
| +#line 1 "php_parser.y" | |
| // | |
| // This file is part of the aMule Project. | |
| @@ -136,189 +140,279 @@ PHP_SYN_NODE *add_branch_2_elseif(PHP_SYN_NODE *list, PHP_SYN_NODE *branch) | |
| } | |
| -#line 140 "php_parser.c" /* yacc.c:339 */ | |
| +#line 144 "php_parser.c" | |
| +# ifndef YY_CAST | |
| +# ifdef __cplusplus | |
| +# define YY_CAST(Type, Val) static_cast<Type> (Val) | |
| +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) | |
| +# else | |
| +# define YY_CAST(Type, Val) ((Type) (Val)) | |
| +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) | |
| +# endif | |
| +# endif | |
| # ifndef YY_NULLPTR | |
| -# if defined __cplusplus && 201103L <= __cplusplus | |
| -# define YY_NULLPTR nullptr | |
| +# if defined __cplusplus | |
| +# if 201103L <= __cplusplus | |
| +# define YY_NULLPTR nullptr | |
| +# else | |
| +# define YY_NULLPTR 0 | |
| +# endif | |
| # else | |
| -# define YY_NULLPTR 0 | |
| +# define YY_NULLPTR ((void*)0) | |
| # endif | |
| # endif | |
| -/* Enabling verbose error messages. */ | |
| -#ifdef YYERROR_VERBOSE | |
| -# undef YYERROR_VERBOSE | |
| -# define YYERROR_VERBOSE 1 | |
| -#else | |
| -# define YYERROR_VERBOSE 0 | |
| -#endif | |
| - | |
| -/* In a future release of Bison, this section will be replaced | |
| - by #include "php_parser.h". */ | |
| -#ifndef YY_PHP_PHP_PARSER_H_INCLUDED | |
| -# define YY_PHP_PHP_PARSER_H_INCLUDED | |
| -/* Debug traces. */ | |
| -#ifndef YYDEBUG | |
| -# define YYDEBUG 1 | |
| -#endif | |
| -#if YYDEBUG | |
| -extern int phpdebug; | |
| -#endif | |
| - | |
| -/* Token type. */ | |
| -#ifndef YYTOKENTYPE | |
| -# define YYTOKENTYPE | |
| - enum yytokentype | |
| - { | |
| - FNUMBER = 258, | |
| - DNUMBER = 259, | |
| - STRING = 260, | |
| - IDENT = 261, | |
| - VARIABLE = 262, | |
| - T_ECHO = 263, | |
| - EXIT = 264, | |
| - IF = 265, | |
| - DO = 266, | |
| - WHILE = 267, | |
| - ENDWHILE = 268, | |
| - FOR = 269, | |
| - ENDFOR = 270, | |
| - FOREACH = 271, | |
| - ENDFOREACH = 272, | |
| - DECLARE = 273, | |
| - ENDDECLARE = 274, | |
| - AS = 275, | |
| - CONST = 276, | |
| - GLOBAL = 277, | |
| - UNSET = 278, | |
| - ISSET = 279, | |
| - EMPTY = 280, | |
| - SWITCH = 281, | |
| - ENDSWITCH = 282, | |
| - CASE = 283, | |
| - DEFAULT = 284, | |
| - BREAK = 285, | |
| - CONTINUE = 286, | |
| - FUNCTION = 287, | |
| - RETURN = 288, | |
| - CLASS = 289, | |
| - INTERFACE = 290, | |
| - EXTENDS = 291, | |
| - IMPLEMENTS = 292, | |
| - OBJECT_OPERATOR = 293, | |
| - HASH_ASSIGN = 294, | |
| - LIST = 295, | |
| - ARRAY = 296, | |
| - CLASS_SCOPE = 297, | |
| - PRINT = 298, | |
| - PLUS_EQ = 299, | |
| - MINUS_EQ = 300, | |
| - MUL_EQ = 301, | |
| - DIV_EQ = 302, | |
| - CONCAT_EQ = 303, | |
| - MOD_EQ = 304, | |
| - AND_EQ = 305, | |
| - OR_EQ = 306, | |
| - XOR_EQ = 307, | |
| - SL_EQ = 308, | |
| - SR_EQ = 309, | |
| - LOG_OR = 310, | |
| - LOG_XOR = 311, | |
| - LOG_AND = 312, | |
| - BOOLEAN_OR = 313, | |
| - BOOLEAN_AND = 314, | |
| - IS_EQ = 315, | |
| - IS_NOEQUAL = 316, | |
| - IS_IDENTICAL = 317, | |
| - IS_NOIDENTICAL = 318, | |
| - IS_SMALLER_OR_EQ = 319, | |
| - IS_GREATER_OR_EQ = 320, | |
| - SL = 321, | |
| - SR = 322, | |
| - INSTANCEOF = 323, | |
| - INC = 324, | |
| - DEC = 325, | |
| - INT_CAST = 326, | |
| - DOUBLE_CAST = 327, | |
| - STRING_CAST = 328, | |
| - ARRAY_CAST = 329, | |
| - OBJECT_CAST = 330, | |
| - BOOL_CAST = 331, | |
| - UNSET_CAST = 332, | |
| - NEW = 333, | |
| - CLONE = 334, | |
| - ELSEIF = 335, | |
| - ELSE = 336, | |
| - ENDIF = 337, | |
| - STATIC = 338, | |
| - ABSTRACT = 339, | |
| - FINAL = 340, | |
| - PRIVATE = 341, | |
| - PROTECTED = 342, | |
| - PUBLIC = 343, | |
| - START_SCRIPT = 344, | |
| - END_SCRIPT = 345 | |
| - }; | |
| -#endif | |
| - | |
| -/* Value type. */ | |
| -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
| - | |
| -union YYSTYPE | |
| +#include "php_parser.h" | |
| +/* Symbol kind. */ | |
| +enum yysymbol_kind_t | |
| { | |
| -#line 67 "php_parser.y" /* yacc.c:355 */ | |
| - | |
| - PHP_SYN_NODE *syn_node; | |
| - PHP_EXP_NODE *exp_node; | |
| - | |
| - char str_val[256]; | |
| - | |
| -#line 278 "php_parser.c" /* yacc.c:355 */ | |
| + YYSYMBOL_YYEMPTY = -2, | |
| + YYSYMBOL_YYEOF = 0, /* "end of file" */ | |
| + YYSYMBOL_YYerror = 1, /* error */ | |
| + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ | |
| + YYSYMBOL_FNUMBER = 3, /* FNUMBER */ | |
| + YYSYMBOL_DNUMBER = 4, /* DNUMBER */ | |
| + YYSYMBOL_STRING = 5, /* STRING */ | |
| + YYSYMBOL_IDENT = 6, /* IDENT */ | |
| + YYSYMBOL_VARIABLE = 7, /* VARIABLE */ | |
| + YYSYMBOL_T_ECHO = 8, /* T_ECHO */ | |
| + YYSYMBOL_EXIT = 9, /* EXIT */ | |
| + YYSYMBOL_IF = 10, /* IF */ | |
| + YYSYMBOL_DO = 11, /* DO */ | |
| + YYSYMBOL_WHILE = 12, /* WHILE */ | |
| + YYSYMBOL_ENDWHILE = 13, /* ENDWHILE */ | |
| + YYSYMBOL_FOR = 14, /* FOR */ | |
| + YYSYMBOL_ENDFOR = 15, /* ENDFOR */ | |
| + YYSYMBOL_FOREACH = 16, /* FOREACH */ | |
| + YYSYMBOL_ENDFOREACH = 17, /* ENDFOREACH */ | |
| + YYSYMBOL_DECLARE = 18, /* DECLARE */ | |
| + YYSYMBOL_ENDDECLARE = 19, /* ENDDECLARE */ | |
| + YYSYMBOL_AS = 20, /* AS */ | |
| + YYSYMBOL_CONST = 21, /* CONST */ | |
| + YYSYMBOL_GLOBAL = 22, /* GLOBAL */ | |
| + YYSYMBOL_UNSET = 23, /* UNSET */ | |
| + YYSYMBOL_ISSET = 24, /* ISSET */ | |
| + YYSYMBOL_EMPTY = 25, /* EMPTY */ | |
| + YYSYMBOL_SWITCH = 26, /* SWITCH */ | |
| + YYSYMBOL_ENDSWITCH = 27, /* ENDSWITCH */ | |
| + YYSYMBOL_CASE = 28, /* CASE */ | |
| + YYSYMBOL_DEFAULT = 29, /* DEFAULT */ | |
| + YYSYMBOL_BREAK = 30, /* BREAK */ | |
| + YYSYMBOL_CONTINUE = 31, /* CONTINUE */ | |
| + YYSYMBOL_FUNCTION = 32, /* FUNCTION */ | |
| + YYSYMBOL_RETURN = 33, /* RETURN */ | |
| + YYSYMBOL_CLASS = 34, /* CLASS */ | |
| + YYSYMBOL_INTERFACE = 35, /* INTERFACE */ | |
| + YYSYMBOL_EXTENDS = 36, /* EXTENDS */ | |
| + YYSYMBOL_IMPLEMENTS = 37, /* IMPLEMENTS */ | |
| + YYSYMBOL_OBJECT_OPERATOR = 38, /* OBJECT_OPERATOR */ | |
| + YYSYMBOL_HASH_ASSIGN = 39, /* HASH_ASSIGN */ | |
| + YYSYMBOL_LIST = 40, /* LIST */ | |
| + YYSYMBOL_ARRAY = 41, /* ARRAY */ | |
| + YYSYMBOL_CLASS_SCOPE = 42, /* CLASS_SCOPE */ | |
| + YYSYMBOL_43_ = 43, /* ',' */ | |
| + YYSYMBOL_PRINT = 44, /* PRINT */ | |
| + YYSYMBOL_45_ = 45, /* '=' */ | |
| + YYSYMBOL_PLUS_EQ = 46, /* PLUS_EQ */ | |
| + YYSYMBOL_MINUS_EQ = 47, /* MINUS_EQ */ | |
| + YYSYMBOL_MUL_EQ = 48, /* MUL_EQ */ | |
| + YYSYMBOL_DIV_EQ = 49, /* DIV_EQ */ | |
| + YYSYMBOL_CONCAT_EQ = 50, /* CONCAT_EQ */ | |
| + YYSYMBOL_MOD_EQ = 51, /* MOD_EQ */ | |
| + YYSYMBOL_AND_EQ = 52, /* AND_EQ */ | |
| + YYSYMBOL_OR_EQ = 53, /* OR_EQ */ | |
| + YYSYMBOL_XOR_EQ = 54, /* XOR_EQ */ | |
| + YYSYMBOL_SL_EQ = 55, /* SL_EQ */ | |
| + YYSYMBOL_SR_EQ = 56, /* SR_EQ */ | |
| + YYSYMBOL_57_ = 57, /* '?' */ | |
| + YYSYMBOL_58_ = 58, /* ':' */ | |
| + YYSYMBOL_LOG_OR = 59, /* LOG_OR */ | |
| + YYSYMBOL_LOG_XOR = 60, /* LOG_XOR */ | |
| + YYSYMBOL_LOG_AND = 61, /* LOG_AND */ | |
| + YYSYMBOL_BOOLEAN_OR = 62, /* BOOLEAN_OR */ | |
| + YYSYMBOL_BOOLEAN_AND = 63, /* BOOLEAN_AND */ | |
| + YYSYMBOL_64_ = 64, /* '|' */ | |
| + YYSYMBOL_65_ = 65, /* '^' */ | |
| + YYSYMBOL_66_ = 66, /* '&' */ | |
| + YYSYMBOL_IS_EQ = 67, /* IS_EQ */ | |
| + YYSYMBOL_IS_NOEQUAL = 68, /* IS_NOEQUAL */ | |
| + YYSYMBOL_IS_IDENTICAL = 69, /* IS_IDENTICAL */ | |
| + YYSYMBOL_IS_NOIDENTICAL = 70, /* IS_NOIDENTICAL */ | |
| + YYSYMBOL_71_ = 71, /* '<' */ | |
| + YYSYMBOL_IS_SMALLER_OR_EQ = 72, /* IS_SMALLER_OR_EQ */ | |
| + YYSYMBOL_73_ = 73, /* '>' */ | |
| + YYSYMBOL_IS_GREATER_OR_EQ = 74, /* IS_GREATER_OR_EQ */ | |
| + YYSYMBOL_SL = 75, /* SL */ | |
| + YYSYMBOL_SR = 76, /* SR */ | |
| + YYSYMBOL_77_ = 77, /* '+' */ | |
| + YYSYMBOL_78_ = 78, /* '-' */ | |
| + YYSYMBOL_79_ = 79, /* '.' */ | |
| + YYSYMBOL_80_ = 80, /* '*' */ | |
| + YYSYMBOL_81_ = 81, /* '/' */ | |
| + YYSYMBOL_82_ = 82, /* '%' */ | |
| + YYSYMBOL_83_ = 83, /* '!' */ | |
| + YYSYMBOL_INSTANCEOF = 84, /* INSTANCEOF */ | |
| + YYSYMBOL_85_ = 85, /* '~' */ | |
| + YYSYMBOL_INC = 86, /* INC */ | |
| + YYSYMBOL_DEC = 87, /* DEC */ | |
| + YYSYMBOL_INT_CAST = 88, /* INT_CAST */ | |
| + YYSYMBOL_DOUBLE_CAST = 89, /* DOUBLE_CAST */ | |
| + YYSYMBOL_STRING_CAST = 90, /* STRING_CAST */ | |
| + YYSYMBOL_ARRAY_CAST = 91, /* ARRAY_CAST */ | |
| + YYSYMBOL_OBJECT_CAST = 92, /* OBJECT_CAST */ | |
| + YYSYMBOL_BOOL_CAST = 93, /* BOOL_CAST */ | |
| + YYSYMBOL_UNSET_CAST = 94, /* UNSET_CAST */ | |
| + YYSYMBOL_95_ = 95, /* '@' */ | |
| + YYSYMBOL_96_ = 96, /* '[' */ | |
| + YYSYMBOL_NEW = 97, /* NEW */ | |
| + YYSYMBOL_CLONE = 98, /* CLONE */ | |
| + YYSYMBOL_ELSEIF = 99, /* ELSEIF */ | |
| + YYSYMBOL_ELSE = 100, /* ELSE */ | |
| + YYSYMBOL_ENDIF = 101, /* ENDIF */ | |
| + YYSYMBOL_STATIC = 102, /* STATIC */ | |
| + YYSYMBOL_ABSTRACT = 103, /* ABSTRACT */ | |
| + YYSYMBOL_FINAL = 104, /* FINAL */ | |
| + YYSYMBOL_PRIVATE = 105, /* PRIVATE */ | |
| + YYSYMBOL_PROTECTED = 106, /* PROTECTED */ | |
| + YYSYMBOL_PUBLIC = 107, /* PUBLIC */ | |
| + YYSYMBOL_START_SCRIPT = 108, /* START_SCRIPT */ | |
| + YYSYMBOL_END_SCRIPT = 109, /* END_SCRIPT */ | |
| + YYSYMBOL_110_ = 110, /* '{' */ | |
| + YYSYMBOL_111_ = 111, /* '}' */ | |
| + YYSYMBOL_112_ = 112, /* ';' */ | |
| + YYSYMBOL_113_ = 113, /* '(' */ | |
| + YYSYMBOL_114_ = 114, /* ')' */ | |
| + YYSYMBOL_115_ = 115, /* ']' */ | |
| + YYSYMBOL_116_ = 116, /* '$' */ | |
| + YYSYMBOL_YYACCEPT = 117, /* $accept */ | |
| + YYSYMBOL_program_tree = 118, /* program_tree */ | |
| + YYSYMBOL_top_statement_list = 119, /* top_statement_list */ | |
| + YYSYMBOL_top_statement = 120, /* top_statement */ | |
| + YYSYMBOL_statement = 121, /* statement */ | |
| + YYSYMBOL_decl_list = 122, /* decl_list */ | |
| + YYSYMBOL_expr_list = 123, /* expr_list */ | |
| + YYSYMBOL_variable_list = 124, /* variable_list */ | |
| + YYSYMBOL_global_var_list = 125, /* global_var_list */ | |
| + YYSYMBOL_global_var = 126, /* global_var */ | |
| + YYSYMBOL_static_var_list = 127, /* static_var_list */ | |
| + YYSYMBOL_static_var = 128, /* static_var */ | |
| + YYSYMBOL_function_decl_statement = 129, /* function_decl_statement */ | |
| + YYSYMBOL_130_1 = 130, /* $@1 */ | |
| + YYSYMBOL_parameter_list = 131, /* parameter_list */ | |
| + YYSYMBOL_optional_class_type = 132, /* optional_class_type */ | |
| + YYSYMBOL_for_statement = 133, /* for_statement */ | |
| + YYSYMBOL_foreach_statement = 134, /* foreach_statement */ | |
| + YYSYMBOL_for_expr = 135, /* for_expr */ | |
| + YYSYMBOL_elseif_list = 136, /* elseif_list */ | |
| + YYSYMBOL_else_statement = 137, /* else_statement */ | |
| + YYSYMBOL_while_statement = 138, /* while_statement */ | |
| + YYSYMBOL_switch_case_list = 139, /* switch_case_list */ | |
| + YYSYMBOL_case_list = 140, /* case_list */ | |
| + YYSYMBOL_case_list_item = 141, /* case_list_item */ | |
| + YYSYMBOL_case_separator = 142, /* case_separator */ | |
| + YYSYMBOL_const_value = 143, /* const_value */ | |
| + YYSYMBOL_variable = 144, /* variable */ | |
| + YYSYMBOL_deref_variable = 145, /* deref_variable */ | |
| + YYSYMBOL_function_call = 146, /* function_call */ | |
| + YYSYMBOL_func_param_list = 147, /* func_param_list */ | |
| + YYSYMBOL_expr = 148, /* expr */ | |
| + YYSYMBOL_exit_expr = 149, /* exit_expr */ | |
| + YYSYMBOL_assignment_list = 150, /* assignment_list */ | |
| + YYSYMBOL_assignment_list_element = 151, /* assignment_list_element */ | |
| + YYSYMBOL_array_pair_list = 152, /* array_pair_list */ | |
| + YYSYMBOL_array_elem = 153 /* array_elem */ | |
| }; | |
| +typedef enum yysymbol_kind_t yysymbol_kind_t; | |
| -typedef union YYSTYPE YYSTYPE; | |
| -# define YYSTYPE_IS_TRIVIAL 1 | |
| -# define YYSTYPE_IS_DECLARED 1 | |
| -#endif | |
| -extern YYSTYPE phplval; | |
| -int phpparse (void); | |
| +#ifdef short | |
| +# undef short | |
| +#endif | |
| -#endif /* !YY_PHP_PHP_PARSER_H_INCLUDED */ | |
| +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure | |
| + <limits.h> and (if available) <stdint.h> are included | |
| + so that the code can choose integer types of a good width. */ | |
| -/* Copy the second part of user declarations. */ | |
| +#ifndef __PTRDIFF_MAX__ | |
| +# include <limits.h> /* INFRINGES ON USER NAME SPACE */ | |
| +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ | |
| +# include <stdint.h> /* INFRINGES ON USER NAME SPACE */ | |
| +# define YY_STDINT_H | |
| +# endif | |
| +#endif | |
| -#line 295 "php_parser.c" /* yacc.c:358 */ | |
| +/* Narrow types that promote to a signed type and that can represent a | |
| + signed or unsigned integer of at least N bits. In tables they can | |
| + save space and decrease cache pressure. Promoting to a signed type | |
| + helps avoid bugs in integer arithmetic. */ | |
| -#ifdef short | |
| -# undef short | |
| +#ifdef __INT_LEAST8_MAX__ | |
| +typedef __INT_LEAST8_TYPE__ yytype_int8; | |
| +#elif defined YY_STDINT_H | |
| +typedef int_least8_t yytype_int8; | |
| +#else | |
| +typedef signed char yytype_int8; | |
| #endif | |
| -#ifdef YYTYPE_UINT8 | |
| -typedef YYTYPE_UINT8 yytype_uint8; | |
| +#ifdef __INT_LEAST16_MAX__ | |
| +typedef __INT_LEAST16_TYPE__ yytype_int16; | |
| +#elif defined YY_STDINT_H | |
| +typedef int_least16_t yytype_int16; | |
| #else | |
| -typedef unsigned char yytype_uint8; | |
| +typedef short yytype_int16; | |
| #endif | |
| -#ifdef YYTYPE_INT8 | |
| -typedef YYTYPE_INT8 yytype_int8; | |
| -#else | |
| -typedef signed char yytype_int8; | |
| +/* Work around bug in HP-UX 11.23, which defines these macros | |
| + incorrectly for preprocessor constants. This workaround can likely | |
| + be removed in 2023, as HPE has promised support for HP-UX 11.23 | |
| + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of | |
| + <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ | |
| +#ifdef __hpux | |
| +# undef UINT_LEAST8_MAX | |
| +# undef UINT_LEAST16_MAX | |
| +# define UINT_LEAST8_MAX 255 | |
| +# define UINT_LEAST16_MAX 65535 | |
| #endif | |
| -#ifdef YYTYPE_UINT16 | |
| -typedef YYTYPE_UINT16 yytype_uint16; | |
| +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ | |
| +typedef __UINT_LEAST8_TYPE__ yytype_uint8; | |
| +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ | |
| + && UINT_LEAST8_MAX <= INT_MAX) | |
| +typedef uint_least8_t yytype_uint8; | |
| +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX | |
| +typedef unsigned char yytype_uint8; | |
| #else | |
| -typedef unsigned short int yytype_uint16; | |
| +typedef short yytype_uint8; | |
| #endif | |
| -#ifdef YYTYPE_INT16 | |
| -typedef YYTYPE_INT16 yytype_int16; | |
| +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ | |
| +typedef __UINT_LEAST16_TYPE__ yytype_uint16; | |
| +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ | |
| + && UINT_LEAST16_MAX <= INT_MAX) | |
| +typedef uint_least16_t yytype_uint16; | |
| +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX | |
| +typedef unsigned short yytype_uint16; | |
| #else | |
| -typedef short int yytype_int16; | |
| +typedef int yytype_uint16; | |
| +#endif | |
| + | |
| +#ifndef YYPTRDIFF_T | |
| +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ | |
| +# define YYPTRDIFF_T __PTRDIFF_TYPE__ | |
| +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ | |
| +# elif defined PTRDIFF_MAX | |
| +# ifndef ptrdiff_t | |
| +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
| +# endif | |
| +# define YYPTRDIFF_T ptrdiff_t | |
| +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX | |
| +# else | |
| +# define YYPTRDIFF_T long | |
| +# define YYPTRDIFF_MAXIMUM LONG_MAX | |
| +# endif | |
| #endif | |
| #ifndef YYSIZE_T | |
| @@ -326,15 +420,28 @@ typedef short int yytype_int16; | |
| # define YYSIZE_T __SIZE_TYPE__ | |
| # elif defined size_t | |
| # define YYSIZE_T size_t | |
| -# elif ! defined YYSIZE_T | |
| +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ | |
| # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
| # define YYSIZE_T size_t | |
| # else | |
| -# define YYSIZE_T unsigned int | |
| +# define YYSIZE_T unsigned | |
| # endif | |
| #endif | |
| -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) | |
| +#define YYSIZE_MAXIMUM \ | |
| + YY_CAST (YYPTRDIFF_T, \ | |
| + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ | |
| + ? YYPTRDIFF_MAXIMUM \ | |
| + : YY_CAST (YYSIZE_T, -1))) | |
| + | |
| +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | |
| + | |
| + | |
| +/* Stored state numbers (used for stacks). */ | |
| +typedef yytype_int16 yy_state_t; | |
| + | |
| +/* State numbers in computations. */ | |
| +typedef int yy_state_fast_t; | |
| #ifndef YY_ | |
| # if defined YYENABLE_NLS && YYENABLE_NLS | |
| @@ -348,47 +455,43 @@ typedef short int yytype_int16; | |
| # endif | |
| #endif | |
| -#ifndef YY_ATTRIBUTE | |
| -# if (defined __GNUC__ \ | |
| - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ | |
| - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C | |
| -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) | |
| -# else | |
| -# define YY_ATTRIBUTE(Spec) /* empty */ | |
| -# endif | |
| -#endif | |
| #ifndef YY_ATTRIBUTE_PURE | |
| -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) | |
| +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) | |
| +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) | |
| +# else | |
| +# define YY_ATTRIBUTE_PURE | |
| +# endif | |
| #endif | |
| #ifndef YY_ATTRIBUTE_UNUSED | |
| -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) | |
| -#endif | |
| - | |
| -#if !defined _Noreturn \ | |
| - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) | |
| -# if defined _MSC_VER && 1200 <= _MSC_VER | |
| -# define _Noreturn __declspec (noreturn) | |
| +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) | |
| +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) | |
| # else | |
| -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) | |
| +# define YY_ATTRIBUTE_UNUSED | |
| # endif | |
| #endif | |
| /* Suppress unused-variable warnings by "using" E. */ | |
| #if ! defined lint || defined __GNUC__ | |
| -# define YYUSE(E) ((void) (E)) | |
| +# define YY_USE(E) ((void) (E)) | |
| #else | |
| -# define YYUSE(E) /* empty */ | |
| +# define YY_USE(E) /* empty */ | |
| #endif | |
| -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ | |
| /* Suppress an incorrect diagnostic about yylval being uninitialized. */ | |
| -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | |
| - _Pragma ("GCC diagnostic push") \ | |
| - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ | |
| +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ | |
| +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 | |
| +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | |
| + _Pragma ("GCC diagnostic push") \ | |
| + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") | |
| +# else | |
| +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | |
| + _Pragma ("GCC diagnostic push") \ | |
| + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ | |
| _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") | |
| -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ | |
| +# endif | |
| +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ | |
| _Pragma ("GCC diagnostic pop") | |
| #else | |
| # define YY_INITIAL_VALUE(Value) Value | |
| @@ -401,8 +504,22 @@ typedef short int yytype_int16; | |
| # define YY_INITIAL_VALUE(Value) /* Nothing. */ | |
| #endif | |
| +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ | |
| +# define YY_IGNORE_USELESS_CAST_BEGIN \ | |
| + _Pragma ("GCC diagnostic push") \ | |
| + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") | |
| +# define YY_IGNORE_USELESS_CAST_END \ | |
| + _Pragma ("GCC diagnostic pop") | |
| +#endif | |
| +#ifndef YY_IGNORE_USELESS_CAST_BEGIN | |
| +# define YY_IGNORE_USELESS_CAST_BEGIN | |
| +# define YY_IGNORE_USELESS_CAST_END | |
| +#endif | |
| + | |
| + | |
| +#define YY_ASSERT(E) ((void) (0 && (E))) | |
| -#if ! defined yyoverflow || YYERROR_VERBOSE | |
| +#if !defined yyoverflow | |
| /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
| @@ -467,8 +584,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ | |
| # endif | |
| # endif | |
| # endif | |
| -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ | |
| - | |
| +#endif /* !defined yyoverflow */ | |
| #if (! defined yyoverflow \ | |
| && (! defined __cplusplus \ | |
| @@ -477,17 +593,17 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ | |
| /* A type that is properly aligned for any stack member. */ | |
| union yyalloc | |
| { | |
| - yytype_int16 yyss_alloc; | |
| + yy_state_t yyss_alloc; | |
| YYSTYPE yyvs_alloc; | |
| }; | |
| /* The size of the maximum gap between one aligned stack and the next. */ | |
| -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) | |
| +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) | |
| /* The size of an array large to enough to hold all stacks, each with | |
| N elements. */ | |
| # define YYSTACK_BYTES(N) \ | |
| - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ | |
| + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ | |
| + YYSTACK_GAP_MAXIMUM) | |
| # define YYCOPY_NEEDED 1 | |
| @@ -500,11 +616,11 @@ union yyalloc | |
| # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ | |
| do \ | |
| { \ | |
| - YYSIZE_T yynewbytes; \ | |
| + YYPTRDIFF_T yynewbytes; \ | |
| YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | |
| Stack = &yyptr->Stack_alloc; \ | |
| - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
| - yyptr += yynewbytes / sizeof (*yyptr); \ | |
| + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
| + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ | |
| } \ | |
| while (0) | |
| @@ -516,12 +632,12 @@ union yyalloc | |
| # ifndef YYCOPY | |
| # if defined __GNUC__ && 1 < __GNUC__ | |
| # define YYCOPY(Dst, Src, Count) \ | |
| - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) | |
| + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) | |
| # else | |
| # define YYCOPY(Dst, Src, Count) \ | |
| do \ | |
| { \ | |
| - YYSIZE_T yyi; \ | |
| + YYPTRDIFF_T yyi; \ | |
| for (yyi = 0; yyi < (Count); yyi++) \ | |
| (Dst)[yyi] = (Src)[yyi]; \ | |
| } \ | |
| @@ -544,17 +660,20 @@ union yyalloc | |
| /* YYNSTATES -- Number of states. */ | |
| #define YYNSTATES 385 | |
| -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned | |
| - by yylex, with out-of-bounds checking. */ | |
| -#define YYUNDEFTOK 2 | |
| +/* YYMAXUTOK -- Last valid token kind. */ | |
| #define YYMAXUTOK 345 | |
| -#define YYTRANSLATE(YYX) \ | |
| - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | |
| + | |
| +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM | |
| + as returned by yylex, with out-of-bounds checking. */ | |
| +#define YYTRANSLATE(YYX) \ | |
| + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | |
| + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | |
| + : YYSYMBOL_YYUNDEF) | |
| /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM | |
| - as returned by yylex, without out-of-bounds checking. */ | |
| -static const yytype_uint8 yytranslate[] = | |
| + as returned by yylex. */ | |
| +static const yytype_int8 yytranslate[] = | |
| { | |
| 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
| @@ -594,8 +713,8 @@ static const yytype_uint8 yytranslate[] = | |
| }; | |
| #if YYDEBUG | |
| - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ | |
| -static const yytype_uint16 yyrline[] = | |
| +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ | |
| +static const yytype_int16 yyrline[] = | |
| { | |
| 0, 142, 142, 146, 147, 152, 153, 154, 159, 160, | |
| 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, | |
| @@ -617,32 +736,40 @@ static const yytype_uint16 yyrline[] = | |
| }; | |
| #endif | |
| -#if YYDEBUG || YYERROR_VERBOSE || 0 | |
| +/** Accessing symbol of state STATE. */ | |
| +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) | |
| + | |
| +#if YYDEBUG || 0 | |
| +/* The user-facing name of the symbol whose (internal) number is | |
| + YYSYMBOL. No bounds checking. */ | |
| +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; | |
| + | |
| /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | |
| First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | |
| static const char *const yytname[] = | |
| { | |
| - "$end", "error", "$undefined", "FNUMBER", "DNUMBER", "STRING", "IDENT", | |
| - "VARIABLE", "T_ECHO", "EXIT", "IF", "DO", "WHILE", "ENDWHILE", "FOR", | |
| - "ENDFOR", "FOREACH", "ENDFOREACH", "DECLARE", "ENDDECLARE", "AS", | |
| - "CONST", "GLOBAL", "UNSET", "ISSET", "EMPTY", "SWITCH", "ENDSWITCH", | |
| - "CASE", "DEFAULT", "BREAK", "CONTINUE", "FUNCTION", "RETURN", "CLASS", | |
| - "INTERFACE", "EXTENDS", "IMPLEMENTS", "OBJECT_OPERATOR", "HASH_ASSIGN", | |
| - "LIST", "ARRAY", "CLASS_SCOPE", "','", "PRINT", "'='", "PLUS_EQ", | |
| - "MINUS_EQ", "MUL_EQ", "DIV_EQ", "CONCAT_EQ", "MOD_EQ", "AND_EQ", "OR_EQ", | |
| - "XOR_EQ", "SL_EQ", "SR_EQ", "'?'", "':'", "LOG_OR", "LOG_XOR", "LOG_AND", | |
| - "BOOLEAN_OR", "BOOLEAN_AND", "'|'", "'^'", "'&'", "IS_EQ", "IS_NOEQUAL", | |
| - "IS_IDENTICAL", "IS_NOIDENTICAL", "'<'", "IS_SMALLER_OR_EQ", "'>'", | |
| - "IS_GREATER_OR_EQ", "SL", "SR", "'+'", "'-'", "'.'", "'*'", "'/'", "'%'", | |
| - "'!'", "INSTANCEOF", "'~'", "INC", "DEC", "INT_CAST", "DOUBLE_CAST", | |
| - "STRING_CAST", "ARRAY_CAST", "OBJECT_CAST", "BOOL_CAST", "UNSET_CAST", | |
| - "'@'", "'['", "NEW", "CLONE", "ELSEIF", "ELSE", "ENDIF", "STATIC", | |
| - "ABSTRACT", "FINAL", "PRIVATE", "PROTECTED", "PUBLIC", "START_SCRIPT", | |
| - "END_SCRIPT", "'{'", "'}'", "';'", "'('", "')'", "']'", "'$'", "$accept", | |
| - "program_tree", "top_statement_list", "top_statement", "statement", | |
| - "decl_list", "expr_list", "variable_list", "global_var_list", | |
| - "global_var", "static_var_list", "static_var", "function_decl_statement", | |
| - "$@1", "parameter_list", "optional_class_type", "for_statement", | |
| + "\"end of file\"", "error", "\"invalid token\"", "FNUMBER", "DNUMBER", | |
| + "STRING", "IDENT", "VARIABLE", "T_ECHO", "EXIT", "IF", "DO", "WHILE", | |
| + "ENDWHILE", "FOR", "ENDFOR", "FOREACH", "ENDFOREACH", "DECLARE", | |
| + "ENDDECLARE", "AS", "CONST", "GLOBAL", "UNSET", "ISSET", "EMPTY", | |
| + "SWITCH", "ENDSWITCH", "CASE", "DEFAULT", "BREAK", "CONTINUE", | |
| + "FUNCTION", "RETURN", "CLASS", "INTERFACE", "EXTENDS", "IMPLEMENTS", | |
| + "OBJECT_OPERATOR", "HASH_ASSIGN", "LIST", "ARRAY", "CLASS_SCOPE", "','", | |
| + "PRINT", "'='", "PLUS_EQ", "MINUS_EQ", "MUL_EQ", "DIV_EQ", "CONCAT_EQ", | |
| + "MOD_EQ", "AND_EQ", "OR_EQ", "XOR_EQ", "SL_EQ", "SR_EQ", "'?'", "':'", | |
| + "LOG_OR", "LOG_XOR", "LOG_AND", "BOOLEAN_OR", "BOOLEAN_AND", "'|'", | |
| + "'^'", "'&'", "IS_EQ", "IS_NOEQUAL", "IS_IDENTICAL", "IS_NOIDENTICAL", | |
| + "'<'", "IS_SMALLER_OR_EQ", "'>'", "IS_GREATER_OR_EQ", "SL", "SR", "'+'", | |
| + "'-'", "'.'", "'*'", "'/'", "'%'", "'!'", "INSTANCEOF", "'~'", "INC", | |
| + "DEC", "INT_CAST", "DOUBLE_CAST", "STRING_CAST", "ARRAY_CAST", | |
| + "OBJECT_CAST", "BOOL_CAST", "UNSET_CAST", "'@'", "'['", "NEW", "CLONE", | |
| + "ELSEIF", "ELSE", "ENDIF", "STATIC", "ABSTRACT", "FINAL", "PRIVATE", | |
| + "PROTECTED", "PUBLIC", "START_SCRIPT", "END_SCRIPT", "'{'", "'}'", "';'", | |
| + "'('", "')'", "']'", "'$'", "$accept", "program_tree", | |
| + "top_statement_list", "top_statement", "statement", "decl_list", | |
| + "expr_list", "variable_list", "global_var_list", "global_var", | |
| + "static_var_list", "static_var", "function_decl_statement", "$@1", | |
| + "parameter_list", "optional_class_type", "for_statement", | |
| "foreach_statement", "for_expr", "elseif_list", "else_statement", | |
| "while_statement", "switch_case_list", "case_list", "case_list_item", | |
| "case_separator", "const_value", "variable", "deref_variable", | |
| @@ -650,40 +777,26 @@ static const char *const yytname[] = | |
| "assignment_list", "assignment_list_element", "array_pair_list", | |
| "array_elem", YY_NULLPTR | |
| }; | |
| -#endif | |
| -# ifdef YYPRINT | |
| -/* YYTOKNUM[NUM] -- (External) token number corresponding to the | |
| - (internal) symbol number NUM (which must be that of a token). */ | |
| -static const yytype_uint16 yytoknum[] = | |
| +static const char * | |
| +yysymbol_name (yysymbol_kind_t yysymbol) | |
| { | |
| - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
| - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
| - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
| - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
| - 295, 296, 297, 44, 298, 61, 299, 300, 301, 302, | |
| - 303, 304, 305, 306, 307, 308, 309, 63, 58, 310, | |
| - 311, 312, 313, 314, 124, 94, 38, 315, 316, 317, | |
| - 318, 60, 319, 62, 320, 321, 322, 43, 45, 46, | |
| - 42, 47, 37, 33, 323, 126, 324, 325, 326, 327, | |
| - 328, 329, 330, 331, 332, 64, 91, 333, 334, 335, | |
| - 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, | |
| - 123, 125, 59, 40, 41, 93, 36 | |
| -}; | |
| -# endif | |
| + return yytname[yysymbol]; | |
| +} | |
| +#endif | |
| -#define YYPACT_NINF -335 | |
| +#define YYPACT_NINF (-335) | |
| -#define yypact_value_is_default(Yystate) \ | |
| - (!!((Yystate) == (-335))) | |
| +#define yypact_value_is_default(Yyn) \ | |
| + ((Yyn) == YYPACT_NINF) | |
| -#define YYTABLE_NINF -53 | |
| +#define YYTABLE_NINF (-53) | |
| -#define yytable_value_is_error(Yytable_value) \ | |
| - (!!((Yytable_value) == (-53))) | |
| +#define yytable_value_is_error(Yyn) \ | |
| + ((Yyn) == YYTABLE_NINF) | |
| - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
| - STATE-NUM. */ | |
| +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
| + STATE-NUM. */ | |
| static const yytype_int16 yypact[] = | |
| { | |
| -94, -335, 54, 344, -335, -335, -335, -335, -32, -335, | |
| @@ -727,9 +840,9 @@ static const yytype_int16 yypact[] = | |
| -335, -335, -335, 174, -335 | |
| }; | |
| - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. | |
| - Performed when YYTABLE does not specify something else to do. Zero | |
| - means the default is an error. */ | |
| +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. | |
| + Performed when YYTABLE does not specify something else to do. Zero | |
| + means the default is an error. */ | |
| static const yytype_uint8 yydefact[] = | |
| { | |
| 0, 4, 0, 0, 1, 76, 77, 78, 79, 83, | |
| @@ -773,7 +886,7 @@ static const yytype_uint8 yydefact[] = | |
| 27, 57, 60, 0, 55 | |
| }; | |
| - /* YYPGOTO[NTERM-NUM]. */ | |
| +/* YYPGOTO[NTERM-NUM]. */ | |
| static const yytype_int16 yypgoto[] = | |
| { | |
| -335, -335, -40, -335, -13, -335, 259, -335, -335, 125, | |
| @@ -782,18 +895,18 @@ static const yytype_int16 yypgoto[] = | |
| -204, -6, -335, 41, 38, -335, 44 | |
| }; | |
| - /* YYDEFGOTO[NTERM-NUM]. */ | |
| +/* YYDEFGOTO[NTERM-NUM]. */ | |
| static const yytype_int16 yydefgoto[] = | |
| { | |
| - -1, 2, 3, 47, 48, 163, 159, 166, 68, 69, | |
| + 0, 2, 3, 47, 48, 163, 159, 166, 68, 69, | |
| 98, 99, 49, 171, 289, 290, 369, 334, 160, 302, | |
| 326, 276, 287, 311, 341, 360, 50, 51, 52, 53, | |
| 150, 54, 60, 176, 177, 180, 181 | |
| }; | |
| - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If | |
| - positive, shift that token. If negative, reduce the rule whose | |
| - number is the opposite. If YYTABLE_NINF, syntax error. */ | |
| +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If | |
| + positive, shift that token. If negative, reduce the rule whose | |
| + number is the opposite. If YYTABLE_NINF, syntax error. */ | |
| static const yytype_int16 yytable[] = | |
| { | |
| 62, 100, 182, 101, 58, 339, 340, 339, 340, 306, | |
| @@ -1412,8 +1525,8 @@ static const yytype_int16 yycheck[] = | |
| 74, 75, 76, 77, 78, 79, 80, 81, 82 | |
| }; | |
| - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | |
| - symbol of state STATE-NUM. */ | |
| +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of | |
| + state STATE-NUM. */ | |
| static const yytype_uint8 yystos[] = | |
| { | |
| 0, 108, 118, 119, 0, 3, 4, 5, 6, 7, | |
| @@ -1457,7 +1570,7 @@ static const yytype_uint8 yystos[] = | |
| 134, 112, 121, 15, 112 | |
| }; | |
| - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
| +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ | |
| static const yytype_uint8 yyr1[] = | |
| { | |
| 0, 117, 118, 119, 119, 120, 120, 120, 121, 121, | |
| @@ -1479,8 +1592,8 @@ static const yytype_uint8 yyr1[] = | |
| 150, 151, 151, 151, 152, 152, 153, 153, 153, 153 | |
| }; | |
| - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ | |
| -static const yytype_uint8 yyr2[] = | |
| +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ | |
| +static const yytype_int8 yyr2[] = | |
| { | |
| 0, 2, 3, 2, 0, 1, 3, 1, 3, 2, | |
| 3, 3, 7, 5, 7, 9, 5, 2, 3, 2, | |
| @@ -1502,39 +1615,39 @@ static const yytype_uint8 yyr2[] = | |
| }; | |
| +enum { YYENOMEM = -2 }; | |
| + | |
| #define yyerrok (yyerrstatus = 0) | |
| #define yyclearin (yychar = YYEMPTY) | |
| -#define YYEMPTY (-2) | |
| -#define YYEOF 0 | |
| #define YYACCEPT goto yyacceptlab | |
| #define YYABORT goto yyabortlab | |
| #define YYERROR goto yyerrorlab | |
| +#define YYNOMEM goto yyexhaustedlab | |
| #define YYRECOVERING() (!!yyerrstatus) | |
| -#define YYBACKUP(Token, Value) \ | |
| -do \ | |
| - if (yychar == YYEMPTY) \ | |
| - { \ | |
| - yychar = (Token); \ | |
| - yylval = (Value); \ | |
| - YYPOPSTACK (yylen); \ | |
| - yystate = *yyssp; \ | |
| - goto yybackup; \ | |
| - } \ | |
| - else \ | |
| - { \ | |
| - yyerror (YY_("syntax error: cannot back up")); \ | |
| - YYERROR; \ | |
| - } \ | |
| -while (0) | |
| - | |
| -/* Error token number */ | |
| -#define YYTERROR 1 | |
| -#define YYERRCODE 256 | |
| - | |
| +#define YYBACKUP(Token, Value) \ | |
| + do \ | |
| + if (yychar == YYEMPTY) \ | |
| + { \ | |
| + yychar = (Token); \ | |
| + yylval = (Value); \ | |
| + YYPOPSTACK (yylen); \ | |
| + yystate = *yyssp; \ | |
| + goto yybackup; \ | |
| + } \ | |
| + else \ | |
| + { \ | |
| + yyerror (YY_("syntax error: cannot back up")); \ | |
| + YYERROR; \ | |
| + } \ | |
| + while (0) | |
| + | |
| +/* Backward compatibility with an undocumented macro. | |
| + Use YYerror or YYUNDEF. */ | |
| +#define YYERRCODE YYUNDEF | |
| /* Enable debugging if requested. */ | |
| @@ -1551,55 +1664,52 @@ do { \ | |
| YYFPRINTF Args; \ | |
| } while (0) | |
| -/* This macro is provided for backward compatibility. */ | |
| -#ifndef YY_LOCATION_PRINT | |
| -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
| -#endif | |
| -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ | |
| + | |
| +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ | |
| do { \ | |
| if (yydebug) \ | |
| { \ | |
| YYFPRINTF (stderr, "%s ", Title); \ | |
| yy_symbol_print (stderr, \ | |
| - Type, Value); \ | |
| + Kind, Value); \ | |
| YYFPRINTF (stderr, "\n"); \ | |
| } \ | |
| } while (0) | |
| -/*----------------------------------------. | |
| -| Print this symbol's value on YYOUTPUT. | | |
| -`----------------------------------------*/ | |
| +/*-----------------------------------. | |
| +| Print this symbol's value on YYO. | | |
| +`-----------------------------------*/ | |
| static void | |
| -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
| +yy_symbol_value_print (FILE *yyo, | |
| + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) | |
| { | |
| - FILE *yyo = yyoutput; | |
| - YYUSE (yyo); | |
| + FILE *yyoutput = yyo; | |
| + YY_USE (yyoutput); | |
| if (!yyvaluep) | |
| return; | |
| -# ifdef YYPRINT | |
| - if (yytype < YYNTOKENS) | |
| - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
| -# endif | |
| - YYUSE (yytype); | |
| + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
| + YY_USE (yykind); | |
| + YY_IGNORE_MAYBE_UNINITIALIZED_END | |
| } | |
| -/*--------------------------------. | |
| -| Print this symbol on YYOUTPUT. | | |
| -`--------------------------------*/ | |
| +/*---------------------------. | |
| +| Print this symbol on YYO. | | |
| +`---------------------------*/ | |
| static void | |
| -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
| +yy_symbol_print (FILE *yyo, | |
| + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) | |
| { | |
| - YYFPRINTF (yyoutput, "%s %s (", | |
| - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); | |
| + YYFPRINTF (yyo, "%s %s (", | |
| + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); | |
| - yy_symbol_value_print (yyoutput, yytype, yyvaluep); | |
| - YYFPRINTF (yyoutput, ")"); | |
| + yy_symbol_value_print (yyo, yykind, yyvaluep); | |
| + YYFPRINTF (yyo, ")"); | |
| } | |
| /*------------------------------------------------------------------. | |
| @@ -1608,7 +1718,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
| `------------------------------------------------------------------*/ | |
| static void | |
| -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) | |
| +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) | |
| { | |
| YYFPRINTF (stderr, "Stack now"); | |
| for (; yybottom <= yytop; yybottom++) | |
| @@ -1631,21 +1741,21 @@ do { \ | |
| `------------------------------------------------*/ | |
| static void | |
| -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) | |
| +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, | |
| + int yyrule) | |
| { | |
| - unsigned long int yylno = yyrline[yyrule]; | |
| + int yylno = yyrline[yyrule]; | |
| int yynrhs = yyr2[yyrule]; | |
| int yyi; | |
| - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", | |
| + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", | |
| yyrule - 1, yylno); | |
| /* The symbols being reduced. */ | |
| for (yyi = 0; yyi < yynrhs; yyi++) | |
| { | |
| YYFPRINTF (stderr, " $%d = ", yyi + 1); | |
| yy_symbol_print (stderr, | |
| - yystos[yyssp[yyi + 1 - yynrhs]], | |
| - &(yyvsp[(yyi + 1) - (yynrhs)]) | |
| - ); | |
| + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), | |
| + &yyvsp[(yyi + 1) - (yynrhs)]); | |
| YYFPRINTF (stderr, "\n"); | |
| } | |
| } | |
| @@ -1660,8 +1770,8 @@ do { \ | |
| multiple parsers can coexist. */ | |
| int yydebug; | |
| #else /* !YYDEBUG */ | |
| -# define YYDPRINTF(Args) | |
| -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) | |
| +# define YYDPRINTF(Args) ((void) 0) | |
| +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) | |
| # define YY_STACK_PRINT(Bottom, Top) | |
| # define YY_REDUCE_PRINT(Rule) | |
| #endif /* !YYDEBUG */ | |
| @@ -1684,249 +1794,30 @@ int yydebug; | |
| #endif | |
| -#if YYERROR_VERBOSE | |
| -# ifndef yystrlen | |
| -# if defined __GLIBC__ && defined _STRING_H | |
| -# define yystrlen strlen | |
| -# else | |
| -/* Return the length of YYSTR. */ | |
| -static YYSIZE_T | |
| -yystrlen (const char *yystr) | |
| -{ | |
| - YYSIZE_T yylen; | |
| - for (yylen = 0; yystr[yylen]; yylen++) | |
| - continue; | |
| - return yylen; | |
| -} | |
| -# endif | |
| -# endif | |
| -# ifndef yystpcpy | |
| -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE | |
| -# define yystpcpy stpcpy | |
| -# else | |
| -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
| - YYDEST. */ | |
| -static char * | |
| -yystpcpy (char *yydest, const char *yysrc) | |
| -{ | |
| - char *yyd = yydest; | |
| - const char *yys = yysrc; | |
| - | |
| - while ((*yyd++ = *yys++) != '\0') | |
| - continue; | |
| - | |
| - return yyd - 1; | |
| -} | |
| -# endif | |
| -# endif | |
| - | |
| -# ifndef yytnamerr | |
| -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
| - quotes and backslashes, so that it's suitable for yyerror. The | |
| - heuristic is that double-quoting is unnecessary unless the string | |
| - contains an apostrophe, a comma, or backslash (other than | |
| - backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
| - null, do not copy; instead, return the length of what the result | |
| - would have been. */ | |
| -static YYSIZE_T | |
| -yytnamerr (char *yyres, const char *yystr) | |
| -{ | |
| - if (*yystr == '"') | |
| - { | |
| - YYSIZE_T yyn = 0; | |
| - char const *yyp = yystr; | |
| - | |
| - for (;;) | |
| - switch (*++yyp) | |
| - { | |
| - case '\'': | |
| - case ',': | |
| - goto do_not_strip_quotes; | |
| - | |
| - case '\\': | |
| - if (*++yyp != '\\') | |
| - goto do_not_strip_quotes; | |
| - /* Fall through. */ | |
| - default: | |
| - if (yyres) | |
| - yyres[yyn] = *yyp; | |
| - yyn++; | |
| - break; | |
| - | |
| - case '"': | |
| - if (yyres) | |
| - yyres[yyn] = '\0'; | |
| - return yyn; | |
| - } | |
| - do_not_strip_quotes: ; | |
| - } | |
| - if (! yyres) | |
| - return yystrlen (yystr); | |
| - | |
| - return yystpcpy (yyres, yystr) - yyres; | |
| -} | |
| -# endif | |
| - | |
| -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message | |
| - about the unexpected token YYTOKEN for the state stack whose top is | |
| - YYSSP. | |
| - | |
| - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is | |
| - not large enough to hold the message. In that case, also set | |
| - *YYMSG_ALLOC to the required number of bytes. Return 2 if the | |
| - required number of bytes is too large to store. */ | |
| -static int | |
| -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |
| - yytype_int16 *yyssp, int yytoken) | |
| -{ | |
| - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); | |
| - YYSIZE_T yysize = yysize0; | |
| - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | |
| - /* Internationalized format string. */ | |
| - const char *yyformat = YY_NULLPTR; | |
| - /* Arguments of yyformat. */ | |
| - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
| - /* Number of reported tokens (one for the "unexpected", one per | |
| - "expected"). */ | |
| - int yycount = 0; | |
| - | |
| - /* There are many possibilities here to consider: | |
| - - If this state is a consistent state with a default action, then | |
| - the only way this function was invoked is if the default action | |
| - is an error action. In that case, don't check for expected | |
| - tokens because there are none. | |
| - - The only way there can be no lookahead present (in yychar) is if | |
| - this state is a consistent state with a default action. Thus, | |
| - detecting the absence of a lookahead is sufficient to determine | |
| - that there is no unexpected or expected token to report. In that | |
| - case, just report a simple "syntax error". | |
| - - Don't assume there isn't a lookahead just because this state is a | |
| - consistent state with a default action. There might have been a | |
| - previous inconsistent state, consistent state with a non-default | |
| - action, or user semantic action that manipulated yychar. | |
| - - Of course, the expected token list depends on states to have | |
| - correct lookahead information, and it depends on the parser not | |
| - to perform extra reductions after fetching a lookahead from the | |
| - scanner and before detecting a syntax error. Thus, state merging | |
| - (from LALR or IELR) and default reductions corrupt the expected | |
| - token list. However, the list is correct for canonical LR with | |
| - one exception: it will still contain any token that will not be | |
| - accepted due to an error action in a later state. | |
| - */ | |
| - if (yytoken != YYEMPTY) | |
| - { | |
| - int yyn = yypact[*yyssp]; | |
| - yyarg[yycount++] = yytname[yytoken]; | |
| - if (!yypact_value_is_default (yyn)) | |
| - { | |
| - /* Start YYX at -YYN if negative to avoid negative indexes in | |
| - YYCHECK. In other words, skip the first -YYN actions for | |
| - this state because they are default actions. */ | |
| - int yyxbegin = yyn < 0 ? -yyn : 0; | |
| - /* Stay within bounds of both yycheck and yytname. */ | |
| - int yychecklim = YYLAST - yyn + 1; | |
| - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | |
| - int yyx; | |
| - | |
| - for (yyx = yyxbegin; yyx < yyxend; ++yyx) | |
| - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR | |
| - && !yytable_value_is_error (yytable[yyx + yyn])) | |
| - { | |
| - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | |
| - { | |
| - yycount = 1; | |
| - yysize = yysize0; | |
| - break; | |
| - } | |
| - yyarg[yycount++] = yytname[yyx]; | |
| - { | |
| - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); | |
| - if (! (yysize <= yysize1 | |
| - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
| - return 2; | |
| - yysize = yysize1; | |
| - } | |
| - } | |
| - } | |
| - } | |
| - | |
| - switch (yycount) | |
| - { | |
| -# define YYCASE_(N, S) \ | |
| - case N: \ | |
| - yyformat = S; \ | |
| - break | |
| - YYCASE_(0, YY_("syntax error")); | |
| - YYCASE_(1, YY_("syntax error, unexpected %s")); | |
| - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | |
| - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | |
| - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | |
| - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | |
| -# undef YYCASE_ | |
| - } | |
| - | |
| - { | |
| - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); | |
| - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
| - return 2; | |
| - yysize = yysize1; | |
| - } | |
| - | |
| - if (*yymsg_alloc < yysize) | |
| - { | |
| - *yymsg_alloc = 2 * yysize; | |
| - if (! (yysize <= *yymsg_alloc | |
| - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) | |
| - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; | |
| - return 1; | |
| - } | |
| - | |
| - /* Avoid sprintf, as that infringes on the user's name space. | |
| - Don't have undefined behavior even if the translation | |
| - produced a string with the wrong number of "%s"s. */ | |
| - { | |
| - char *yyp = *yymsg; | |
| - int yyi = 0; | |
| - while ((*yyp = *yyformat) != '\0') | |
| - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | |
| - { | |
| - yyp += yytnamerr (yyp, yyarg[yyi++]); | |
| - yyformat += 2; | |
| - } | |
| - else | |
| - { | |
| - yyp++; | |
| - yyformat++; | |
| - } | |
| - } | |
| - return 0; | |
| -} | |
| -#endif /* YYERROR_VERBOSE */ | |
| /*-----------------------------------------------. | |
| | Release the memory associated to this symbol. | | |
| `-----------------------------------------------*/ | |
| static void | |
| -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) | |
| +yydestruct (const char *yymsg, | |
| + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) | |
| { | |
| - YYUSE (yyvaluep); | |
| + YY_USE (yyvaluep); | |
| if (!yymsg) | |
| yymsg = "Deleting"; | |
| - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
| + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); | |
| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
| - YYUSE (yytype); | |
| + YY_USE (yykind); | |
| YY_IGNORE_MAYBE_UNINITIALIZED_END | |
| } | |
| - | |
| - | |
| -/* The lookahead symbol. */ | |
| +/* Lookahead token kind. */ | |
| int yychar; | |
| /* The semantic value of the lookahead symbol. */ | |
| @@ -1935,6 +1826,8 @@ YYSTYPE yylval; | |
| int yynerrs; | |
| + | |
| + | |
| /*----------. | |
| | yyparse. | | |
| `----------*/ | |
| @@ -1942,43 +1835,36 @@ int yynerrs; | |
| int | |
| yyparse (void) | |
| { | |
| - int yystate; | |
| + yy_state_fast_t yystate = 0; | |
| /* Number of tokens to shift before error messages enabled. */ | |
| - int yyerrstatus; | |
| + int yyerrstatus = 0; | |
| - /* The stacks and their tools: | |
| - 'yyss': related to states. | |
| - 'yyvs': related to semantic values. | |
| - | |
| - Refer to the stacks through separate pointers, to allow yyoverflow | |
| + /* Refer to the stacks through separate pointers, to allow yyoverflow | |
| to reallocate them elsewhere. */ | |
| - /* The state stack. */ | |
| - yytype_int16 yyssa[YYINITDEPTH]; | |
| - yytype_int16 *yyss; | |
| - yytype_int16 *yyssp; | |
| + /* Their size. */ | |
| + YYPTRDIFF_T yystacksize = YYINITDEPTH; | |
| - /* The semantic value stack. */ | |
| - YYSTYPE yyvsa[YYINITDEPTH]; | |
| - YYSTYPE *yyvs; | |
| - YYSTYPE *yyvsp; | |
| + /* The state stack: array, bottom, top. */ | |
| + yy_state_t yyssa[YYINITDEPTH]; | |
| + yy_state_t *yyss = yyssa; | |
| + yy_state_t *yyssp = yyss; | |
| - YYSIZE_T yystacksize; | |
| + /* The semantic value stack: array, bottom, top. */ | |
| + YYSTYPE yyvsa[YYINITDEPTH]; | |
| + YYSTYPE *yyvs = yyvsa; | |
| + YYSTYPE *yyvsp = yyvs; | |
| int yyn; | |
| + /* The return value of yyparse. */ | |
| int yyresult; | |
| - /* Lookahead token as an internal (translated) token number. */ | |
| - int yytoken = 0; | |
| + /* Lookahead symbol kind. */ | |
| + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; | |
| /* The variables used to return semantic value and location from the | |
| action routines. */ | |
| YYSTYPE yyval; | |
| -#if YYERROR_VERBOSE | |
| - /* Buffer for error messages, and its allocated size. */ | |
| - char yymsgbuf[128]; | |
| - char *yymsg = yymsgbuf; | |
| - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
| -#endif | |
| + | |
| #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) | |
| @@ -1986,71 +1872,75 @@ yyparse (void) | |
| Keep to zero when no symbol should be popped. */ | |
| int yylen = 0; | |
| - yyssp = yyss = yyssa; | |
| - yyvsp = yyvs = yyvsa; | |
| - yystacksize = YYINITDEPTH; | |
| - | |
| YYDPRINTF ((stderr, "Starting parse\n")); | |
| - yystate = 0; | |
| - yyerrstatus = 0; | |
| - yynerrs = 0; | |
| yychar = YYEMPTY; /* Cause a token to be read. */ | |
| + | |
| goto yysetstate; | |
| + | |
| /*------------------------------------------------------------. | |
| -| yynewstate -- Push a new state, which is found in yystate. | | |
| +| yynewstate -- push a new state, which is found in yystate. | | |
| `------------------------------------------------------------*/ | |
| - yynewstate: | |
| +yynewstate: | |
| /* In all cases, when you get here, the value and location stacks | |
| have just been pushed. So pushing a state here evens the stacks. */ | |
| yyssp++; | |
| - yysetstate: | |
| - *yyssp = yystate; | |
| + | |
| +/*--------------------------------------------------------------------. | |
| +| yysetstate -- set current state (the top of the stack) to yystate. | | |
| +`--------------------------------------------------------------------*/ | |
| +yysetstate: | |
| + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
| + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); | |
| + YY_IGNORE_USELESS_CAST_BEGIN | |
| + *yyssp = YY_CAST (yy_state_t, yystate); | |
| + YY_IGNORE_USELESS_CAST_END | |
| + YY_STACK_PRINT (yyss, yyssp); | |
| if (yyss + yystacksize - 1 <= yyssp) | |
| +#if !defined yyoverflow && !defined YYSTACK_RELOCATE | |
| + YYNOMEM; | |
| +#else | |
| { | |
| /* Get the current used size of the three stacks, in elements. */ | |
| - YYSIZE_T yysize = yyssp - yyss + 1; | |
| + YYPTRDIFF_T yysize = yyssp - yyss + 1; | |
| -#ifdef yyoverflow | |
| +# if defined yyoverflow | |
| { | |
| /* Give user a chance to reallocate the stack. Use copies of | |
| these so that the &'s don't force the real ones into | |
| memory. */ | |
| + yy_state_t *yyss1 = yyss; | |
| YYSTYPE *yyvs1 = yyvs; | |
| - yytype_int16 *yyss1 = yyss; | |
| /* Each stack pointer address is followed by the size of the | |
| data in use in that stack, in bytes. This used to be a | |
| conditional around just the two extra args, but that might | |
| be undefined if yyoverflow is a macro. */ | |
| yyoverflow (YY_("memory exhausted"), | |
| - &yyss1, yysize * sizeof (*yyssp), | |
| - &yyvs1, yysize * sizeof (*yyvsp), | |
| + &yyss1, yysize * YYSIZEOF (*yyssp), | |
| + &yyvs1, yysize * YYSIZEOF (*yyvsp), | |
| &yystacksize); | |
| - | |
| yyss = yyss1; | |
| yyvs = yyvs1; | |
| } | |
| -#else /* no yyoverflow */ | |
| -# ifndef YYSTACK_RELOCATE | |
| - goto yyexhaustedlab; | |
| -# else | |
| +# else /* defined YYSTACK_RELOCATE */ | |
| /* Extend the stack our own way. */ | |
| if (YYMAXDEPTH <= yystacksize) | |
| - goto yyexhaustedlab; | |
| + YYNOMEM; | |
| yystacksize *= 2; | |
| if (YYMAXDEPTH < yystacksize) | |
| yystacksize = YYMAXDEPTH; | |
| { | |
| - yytype_int16 *yyss1 = yyss; | |
| + yy_state_t *yyss1 = yyss; | |
| union yyalloc *yyptr = | |
| - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
| + YY_CAST (union yyalloc *, | |
| + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); | |
| if (! yyptr) | |
| - goto yyexhaustedlab; | |
| + YYNOMEM; | |
| YYSTACK_RELOCATE (yyss_alloc, yyss); | |
| YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
| # undef YYSTACK_RELOCATE | |
| @@ -2058,30 +1948,31 @@ yyparse (void) | |
| YYSTACK_FREE (yyss1); | |
| } | |
| # endif | |
| -#endif /* no yyoverflow */ | |
| yyssp = yyss + yysize - 1; | |
| yyvsp = yyvs + yysize - 1; | |
| - YYDPRINTF ((stderr, "Stack size increased to %lu\n", | |
| - (unsigned long int) yystacksize)); | |
| + YY_IGNORE_USELESS_CAST_BEGIN | |
| + YYDPRINTF ((stderr, "Stack size increased to %ld\n", | |
| + YY_CAST (long, yystacksize))); | |
| + YY_IGNORE_USELESS_CAST_END | |
| if (yyss + yystacksize - 1 <= yyssp) | |
| YYABORT; | |
| } | |
| +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ | |
| - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
| if (yystate == YYFINAL) | |
| YYACCEPT; | |
| goto yybackup; | |
| + | |
| /*-----------. | |
| | yybackup. | | |
| `-----------*/ | |
| yybackup: | |
| - | |
| /* Do appropriate processing given the current state. Read a | |
| lookahead token if we need one and don't already have one. */ | |
| @@ -2092,18 +1983,29 @@ yybackup: | |
| /* Not known => get a lookahead token if don't already have one. */ | |
| - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ | |
| + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ | |
| if (yychar == YYEMPTY) | |
| { | |
| - YYDPRINTF ((stderr, "Reading a token: ")); | |
| + YYDPRINTF ((stderr, "Reading a token\n")); | |
| yychar = yylex (); | |
| } | |
| if (yychar <= YYEOF) | |
| { | |
| - yychar = yytoken = YYEOF; | |
| + yychar = YYEOF; | |
| + yytoken = YYSYMBOL_YYEOF; | |
| YYDPRINTF ((stderr, "Now at end of input.\n")); | |
| } | |
| + else if (yychar == YYerror) | |
| + { | |
| + /* The scanner already issued an error message, process directly | |
| + to error recovery. But do not keep the error token as | |
| + lookahead, it is too special and may lead us to an endless | |
| + loop in error recovery. */ | |
| + yychar = YYUNDEF; | |
| + yytoken = YYSYMBOL_YYerror; | |
| + goto yyerrlab1; | |
| + } | |
| else | |
| { | |
| yytoken = YYTRANSLATE (yychar); | |
| @@ -2131,15 +2033,13 @@ yybackup: | |
| /* Shift the lookahead token. */ | |
| YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); | |
| - | |
| - /* Discard the shifted token. */ | |
| - yychar = YYEMPTY; | |
| - | |
| yystate = yyn; | |
| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
| *++yyvsp = yylval; | |
| YY_IGNORE_MAYBE_UNINITIALIZED_END | |
| + /* Discard the shifted token. */ | |
| + yychar = YYEMPTY; | |
| goto yynewstate; | |
| @@ -2154,7 +2054,7 @@ yydefault: | |
| /*-----------------------------. | |
| -| yyreduce -- Do a reduction. | | |
| +| yyreduce -- do a reduction. | | |
| `-----------------------------*/ | |
| yyreduce: | |
| /* yyn is the number of a rule to reduce with. */ | |
| @@ -2174,219 +2074,219 @@ yyreduce: | |
| YY_REDUCE_PRINT (yyn); | |
| switch (yyn) | |
| { | |
| - case 2: | |
| -#line 142 "php_parser.y" /* yacc.c:1646 */ | |
| - { g_syn_tree_top = (yyvsp[-1].syn_node); } | |
| -#line 2181 "php_parser.c" /* yacc.c:1646 */ | |
| + case 2: /* program_tree: START_SCRIPT top_statement_list END_SCRIPT */ | |
| +#line 142 "php_parser.y" | |
| + { g_syn_tree_top = (yyvsp[-1].syn_node); } | |
| +#line 2081 "php_parser.c" | |
| break; | |
| - case 3: | |
| -#line 146 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = add_statement_2_list((yyvsp[-1].syn_node), (yyvsp[0].syn_node)); } | |
| -#line 2187 "php_parser.c" /* yacc.c:1646 */ | |
| + case 3: /* top_statement_list: top_statement_list top_statement */ | |
| +#line 146 "php_parser.y" | |
| + { (yyval.syn_node) = add_statement_2_list((yyvsp[-1].syn_node), (yyvsp[0].syn_node)); } | |
| +#line 2087 "php_parser.c" | |
| break; | |
| - case 4: | |
| -#line 147 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = 0; } | |
| -#line 2193 "php_parser.c" /* yacc.c:1646 */ | |
| + case 4: /* top_statement_list: %empty */ | |
| +#line 147 "php_parser.y" | |
| + { (yyval.syn_node) = 0; } | |
| +#line 2093 "php_parser.c" | |
| break; | |
| - case 6: | |
| -#line 153 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = (yyvsp[-1].syn_node); } | |
| -#line 2199 "php_parser.c" /* yacc.c:1646 */ | |
| + case 6: /* top_statement: START_SCRIPT top_statement_list END_SCRIPT */ | |
| +#line 153 "php_parser.y" | |
| + { (yyval.syn_node) = (yyvsp[-1].syn_node); } | |
| +#line 2099 "php_parser.c" | |
| break; | |
| - case 8: | |
| -#line 159 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = (yyvsp[-1].syn_node); } | |
| -#line 2205 "php_parser.c" /* yacc.c:1646 */ | |
| + case 8: /* statement: '{' top_statement_list '}' */ | |
| +#line 159 "php_parser.y" | |
| + { (yyval.syn_node) = (yyvsp[-1].syn_node); } | |
| +#line 2105 "php_parser.c" | |
| break; | |
| - case 9: | |
| -#line 160 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_expr_syn_node(PHP_ST_EXPR, (yyvsp[-1].exp_node)); } | |
| -#line 2211 "php_parser.c" /* yacc.c:1646 */ | |
| + case 9: /* statement: expr ';' */ | |
| +#line 160 "php_parser.y" | |
| + { (yyval.syn_node) = make_expr_syn_node(PHP_ST_EXPR, (yyvsp[-1].exp_node)); } | |
| +#line 2111 "php_parser.c" | |
| break; | |
| - case 10: | |
| -#line 161 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = 0; } | |
| -#line 2217 "php_parser.c" /* yacc.c:1646 */ | |
| + case 10: /* statement: GLOBAL global_var_list ';' */ | |
| +#line 161 "php_parser.y" | |
| + { (yyval.syn_node) = 0; } | |
| +#line 2117 "php_parser.c" | |
| break; | |
| - case 11: | |
| -#line 162 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = (yyvsp[-1].syn_node); } | |
| -#line 2223 "php_parser.c" /* yacc.c:1646 */ | |
| + case 11: /* statement: STATIC static_var_list ';' */ | |
| +#line 162 "php_parser.y" | |
| + { (yyval.syn_node) = (yyvsp[-1].syn_node); } | |
| +#line 2123 "php_parser.c" | |
| break; | |
| - case 12: | |
| -#line 163 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_ifelse_syn_node((yyvsp[-4].exp_node), (yyvsp[-2].syn_node), (yyvsp[-1].syn_node), (yyvsp[0].syn_node)); } | |
| -#line 2229 "php_parser.c" /* yacc.c:1646 */ | |
| + case 12: /* statement: IF '(' expr ')' statement elseif_list else_statement */ | |
| +#line 163 "php_parser.y" | |
| + { (yyval.syn_node) = make_ifelse_syn_node((yyvsp[-4].exp_node), (yyvsp[-2].syn_node), (yyvsp[-1].syn_node), (yyvsp[0].syn_node)); } | |
| +#line 2129 "php_parser.c" | |
| break; | |
| - case 13: | |
| -#line 164 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_while_loop_syn_node((yyvsp[-2].exp_node), (yyvsp[0].syn_node), 1); } | |
| -#line 2235 "php_parser.c" /* yacc.c:1646 */ | |
| + case 13: /* statement: WHILE '(' expr ')' while_statement */ | |
| +#line 164 "php_parser.y" | |
| + { (yyval.syn_node) = make_while_loop_syn_node((yyvsp[-2].exp_node), (yyvsp[0].syn_node), 1); } | |
| +#line 2135 "php_parser.c" | |
| break; | |
| - case 14: | |
| -#line 165 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_while_loop_syn_node((yyvsp[-2].exp_node), (yyvsp[-5].syn_node), 0); } | |
| -#line 2241 "php_parser.c" /* yacc.c:1646 */ | |
| + case 14: /* statement: DO statement WHILE '(' expr ')' ';' */ | |
| +#line 165 "php_parser.y" | |
| + { (yyval.syn_node) = make_while_loop_syn_node((yyvsp[-2].exp_node), (yyvsp[-5].syn_node), 0); } | |
| +#line 2141 "php_parser.c" | |
| break; | |
| - case 15: | |
| -#line 166 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_for_syn_node((yyvsp[-6].exp_node), (yyvsp[-4].exp_node), (yyvsp[-2].exp_node), (yyvsp[0].syn_node)); } | |
| -#line 2247 "php_parser.c" /* yacc.c:1646 */ | |
| + case 15: /* statement: FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement */ | |
| +#line 166 "php_parser.y" | |
| + { (yyval.syn_node) = make_for_syn_node((yyvsp[-6].exp_node), (yyvsp[-4].exp_node), (yyvsp[-2].exp_node), (yyvsp[0].syn_node)); } | |
| +#line 2147 "php_parser.c" | |
| break; | |
| - case 16: | |
| -#line 167 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_switch_syn_node((yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2253 "php_parser.c" /* yacc.c:1646 */ | |
| + case 16: /* statement: SWITCH '(' expr ')' switch_case_list */ | |
| +#line 167 "php_parser.y" | |
| + { (yyval.syn_node) = make_switch_syn_node((yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2153 "php_parser.c" | |
| break; | |
| - case 17: | |
| -#line 168 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_expr_syn_node(PHP_ST_CONTINUE, 0); } | |
| -#line 2259 "php_parser.c" /* yacc.c:1646 */ | |
| + case 17: /* statement: CONTINUE ';' */ | |
| +#line 168 "php_parser.y" | |
| + { (yyval.syn_node) = make_expr_syn_node(PHP_ST_CONTINUE, 0); } | |
| +#line 2159 "php_parser.c" | |
| break; | |
| - case 18: | |
| -#line 169 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_expr_syn_node(PHP_ST_CONTINUE, (yyvsp[-1].exp_node)); } | |
| -#line 2265 "php_parser.c" /* yacc.c:1646 */ | |
| + case 18: /* statement: CONTINUE expr ';' */ | |
| +#line 169 "php_parser.y" | |
| + { (yyval.syn_node) = make_expr_syn_node(PHP_ST_CONTINUE, (yyvsp[-1].exp_node)); } | |
| +#line 2165 "php_parser.c" | |
| break; | |
| - case 19: | |
| -#line 170 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_expr_syn_node(PHP_ST_BREAK, 0); } | |
| -#line 2271 "php_parser.c" /* yacc.c:1646 */ | |
| + case 19: /* statement: BREAK ';' */ | |
| +#line 170 "php_parser.y" | |
| + { (yyval.syn_node) = make_expr_syn_node(PHP_ST_BREAK, 0); } | |
| +#line 2171 "php_parser.c" | |
| break; | |
| - case 20: | |
| -#line 171 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_expr_syn_node(PHP_ST_BREAK, (yyvsp[-1].exp_node)); } | |
| -#line 2277 "php_parser.c" /* yacc.c:1646 */ | |
| + case 20: /* statement: BREAK expr ';' */ | |
| +#line 171 "php_parser.y" | |
| + { (yyval.syn_node) = make_expr_syn_node(PHP_ST_BREAK, (yyvsp[-1].exp_node)); } | |
| +#line 2177 "php_parser.c" | |
| break; | |
| - case 21: | |
| -#line 172 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_expr_syn_node(PHP_ST_RET, 0); } | |
| -#line 2283 "php_parser.c" /* yacc.c:1646 */ | |
| + case 21: /* statement: RETURN ';' */ | |
| +#line 172 "php_parser.y" | |
| + { (yyval.syn_node) = make_expr_syn_node(PHP_ST_RET, 0); } | |
| +#line 2183 "php_parser.c" | |
| break; | |
| - case 22: | |
| -#line 173 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_expr_syn_node(PHP_ST_RET, (yyvsp[-1].exp_node)); } | |
| -#line 2289 "php_parser.c" /* yacc.c:1646 */ | |
| + case 22: /* statement: RETURN expr ';' */ | |
| +#line 173 "php_parser.y" | |
| + { (yyval.syn_node) = make_expr_syn_node(PHP_ST_RET, (yyvsp[-1].exp_node)); } | |
| +#line 2189 "php_parser.c" | |
| break; | |
| - case 23: | |
| -#line 174 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = make_expr_syn_node(PHP_ST_ECHO, (yyvsp[-1].exp_node)); } | |
| -#line 2295 "php_parser.c" /* yacc.c:1646 */ | |
| + case 23: /* statement: T_ECHO expr_list ';' */ | |
| +#line 174 "php_parser.y" | |
| + { (yyval.syn_node) = make_expr_syn_node(PHP_ST_ECHO, (yyvsp[-1].exp_node)); } | |
| +#line 2195 "php_parser.c" | |
| break; | |
| - case 24: | |
| -#line 175 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2301 "php_parser.c" /* yacc.c:1646 */ | |
| + case 24: /* statement: UNSET '(' variable_list ')' ';' */ | |
| +#line 175 "php_parser.y" | |
| + { } | |
| +#line 2201 "php_parser.c" | |
| break; | |
| - case 25: | |
| -#line 176 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 25: /* statement: FOREACH '(' expr AS variable ')' foreach_statement */ | |
| +#line 176 "php_parser.y" | |
| + { | |
| (yyval.syn_node) = make_foreach_loop_syn_node((yyvsp[-4].exp_node), 0, (yyvsp[-2].exp_node), (yyvsp[0].syn_node), 0); | |
| } | |
| -#line 2309 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2209 "php_parser.c" | |
| break; | |
| - case 26: | |
| -#line 179 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 26: /* statement: FOREACH '(' expr AS variable HASH_ASSIGN variable ')' foreach_statement */ | |
| +#line 179 "php_parser.y" | |
| + { | |
| (yyval.syn_node) = make_foreach_loop_syn_node((yyvsp[-6].exp_node), (yyvsp[-4].exp_node), (yyvsp[-2].exp_node), (yyvsp[0].syn_node), 0); | |
| } | |
| -#line 2317 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2217 "php_parser.c" | |
| break; | |
| - case 27: | |
| -#line 182 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 27: /* statement: FOREACH '(' expr AS variable HASH_ASSIGN '&' variable ')' foreach_statement */ | |
| +#line 182 "php_parser.y" | |
| + { | |
| (yyval.syn_node) = make_foreach_loop_syn_node((yyvsp[-7].exp_node), (yyvsp[-5].exp_node), (yyvsp[-2].exp_node), (yyvsp[0].syn_node), 1); | |
| } | |
| -#line 2325 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2225 "php_parser.c" | |
| break; | |
| - case 28: | |
| -#line 185 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2331 "php_parser.c" /* yacc.c:1646 */ | |
| + case 28: /* statement: DECLARE '(' decl_list ')' statement */ | |
| +#line 185 "php_parser.y" | |
| + { } | |
| +#line 2231 "php_parser.c" | |
| break; | |
| - case 29: | |
| -#line 186 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2337 "php_parser.c" /* yacc.c:1646 */ | |
| + case 29: /* statement: DECLARE '(' decl_list ')' ':' top_statement_list ENDDECLARE */ | |
| +#line 186 "php_parser.y" | |
| + { } | |
| +#line 2237 "php_parser.c" | |
| break; | |
| - case 30: | |
| -#line 187 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = 0; } | |
| -#line 2343 "php_parser.c" /* yacc.c:1646 */ | |
| + case 30: /* statement: ';' */ | |
| +#line 187 "php_parser.y" | |
| + { (yyval.syn_node) = 0; } | |
| +#line 2243 "php_parser.c" | |
| break; | |
| - case 31: | |
| -#line 190 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2349 "php_parser.c" /* yacc.c:1646 */ | |
| + case 31: /* decl_list: IDENT '=' const_value */ | |
| +#line 190 "php_parser.y" | |
| + { } | |
| +#line 2249 "php_parser.c" | |
| break; | |
| - case 32: | |
| -#line 191 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2355 "php_parser.c" /* yacc.c:1646 */ | |
| + case 32: /* decl_list: decl_list ',' IDENT '=' const_value */ | |
| +#line 191 "php_parser.y" | |
| + { } | |
| +#line 2255 "php_parser.c" | |
| break; | |
| - case 33: | |
| -#line 194 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_LIST, 0); (yyval.exp_node)->exp_node = (yyvsp[0].exp_node); } | |
| -#line 2361 "php_parser.c" /* yacc.c:1646 */ | |
| + case 33: /* expr_list: expr */ | |
| +#line 194 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_LIST, 0); (yyval.exp_node)->exp_node = (yyvsp[0].exp_node); } | |
| +#line 2261 "php_parser.c" | |
| break; | |
| - case 34: | |
| -#line 195 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 34: /* expr_list: expr_list ',' expr */ | |
| +#line 195 "php_parser.y" | |
| + { | |
| PHP_EXP_NODE *last = (yyvsp[-2].exp_node); | |
| while ( last->next) last = last->next; | |
| last->next = make_exp_1(PHP_OP_LIST, 0); | |
| last->next->exp_node = (yyvsp[0].exp_node); | |
| (yyval.exp_node) = (yyvsp[-2].exp_node); | |
| } | |
| -#line 2373 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2273 "php_parser.c" | |
| break; | |
| - case 37: | |
| -#line 211 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = 0; } | |
| -#line 2379 "php_parser.c" /* yacc.c:1646 */ | |
| + case 37: /* global_var_list: global_var */ | |
| +#line 211 "php_parser.y" | |
| + { (yyval.syn_node) = 0; } | |
| +#line 2279 "php_parser.c" | |
| break; | |
| - case 38: | |
| -#line 212 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2385 "php_parser.c" /* yacc.c:1646 */ | |
| + case 38: /* global_var_list: global_var_list ',' global_var */ | |
| +#line 212 "php_parser.y" | |
| + { } | |
| +#line 2285 "php_parser.c" | |
| break; | |
| - case 39: | |
| -#line 216 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 39: /* global_var: VARIABLE */ | |
| +#line 216 "php_parser.y" | |
| + { | |
| const char *varname = get_scope_var_name(g_current_scope, (yyvsp[0].exp_node)->var_si_node->var); | |
| PHP_SCOPE_ITEM *si = get_scope_item(g_current_scope, varname); | |
| PHP_SCOPE_ITEM *gsi = get_scope_item(g_global_scope, varname); | |
| @@ -2399,47 +2299,47 @@ yyreduce: | |
| php_report_error(PHP_ERROR, "There is no such global var"); | |
| } | |
| } | |
| -#line 2403 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2303 "php_parser.c" | |
| break; | |
| - case 40: | |
| -#line 231 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = 0; } | |
| -#line 2409 "php_parser.c" /* yacc.c:1646 */ | |
| + case 40: /* static_var_list: static_var */ | |
| +#line 231 "php_parser.y" | |
| + { (yyval.syn_node) = 0; } | |
| +#line 2309 "php_parser.c" | |
| break; | |
| - case 41: | |
| -#line 232 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2415 "php_parser.c" /* yacc.c:1646 */ | |
| + case 41: /* static_var_list: static_var_list ',' static_var */ | |
| +#line 232 "php_parser.y" | |
| + { } | |
| +#line 2315 "php_parser.c" | |
| break; | |
| - case 42: | |
| -#line 235 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyvsp[0].exp_node)->var_node->flags |= PHP_VARFLAG_STATIC; (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| -#line 2421 "php_parser.c" /* yacc.c:1646 */ | |
| + case 42: /* static_var: VARIABLE */ | |
| +#line 235 "php_parser.y" | |
| + { (yyvsp[0].exp_node)->var_node->flags |= PHP_VARFLAG_STATIC; (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| +#line 2321 "php_parser.c" | |
| break; | |
| - case 43: | |
| -#line 236 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 43: /* static_var: VARIABLE '=' const_value */ | |
| +#line 236 "php_parser.y" | |
| + { | |
| (yyvsp[-2].exp_node)->var_node->flags |= PHP_VARFLAG_STATIC; (yyval.exp_node) = (yyvsp[-2].exp_node); | |
| value_value_assign(&(yyvsp[-2].exp_node)->var_node->value, &(yyvsp[0].exp_node)->val_node); | |
| } | |
| -#line 2430 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2330 "php_parser.c" | |
| break; | |
| - case 44: | |
| -#line 244 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 44: /* $@1: %empty */ | |
| +#line 244 "php_parser.y" | |
| + { | |
| switch_push_scope_table(make_scope_table()); | |
| } | |
| -#line 2438 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2338 "php_parser.c" | |
| break; | |
| - case 45: | |
| -#line 246 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 45: /* function_decl_statement: FUNCTION IDENT $@1 '(' parameter_list ')' '{' top_statement_list '}' */ | |
| +#line 246 "php_parser.y" | |
| + { | |
| (yyval.syn_node) = make_func_decl_syn_node((yyvsp[-7].str_val), (yyvsp[-4].exp_node)); | |
| (yyval.syn_node)->func_decl->scope = g_current_scope; | |
| (yyval.syn_node)->func_decl->is_native = 0; | |
| @@ -2448,132 +2348,132 @@ yyreduce: | |
| add_func_2_scope(g_current_scope, (yyval.syn_node)); | |
| (yyval.syn_node) = 0; | |
| } | |
| -#line 2452 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2352 "php_parser.c" | |
| break; | |
| - case 46: | |
| -#line 255 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2458 "php_parser.c" /* yacc.c:1646 */ | |
| + case 46: /* function_decl_statement: FUNCTION '&' IDENT '(' parameter_list ')' '{' top_statement_list '}' */ | |
| +#line 255 "php_parser.y" | |
| + { } | |
| +#line 2358 "php_parser.c" | |
| break; | |
| - case 47: | |
| -#line 259 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_func_param(0, (yyvsp[0].exp_node), (yyvsp[-1].str_val), 0); } | |
| -#line 2464 "php_parser.c" /* yacc.c:1646 */ | |
| + case 47: /* parameter_list: optional_class_type VARIABLE */ | |
| +#line 259 "php_parser.y" | |
| + { (yyval.exp_node) = make_func_param(0, (yyvsp[0].exp_node), (yyvsp[-1].str_val), 0); } | |
| +#line 2364 "php_parser.c" | |
| break; | |
| - case 48: | |
| -#line 260 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_func_param(0, (yyvsp[0].exp_node), (yyvsp[-2].str_val), 1); } | |
| -#line 2470 "php_parser.c" /* yacc.c:1646 */ | |
| + case 48: /* parameter_list: optional_class_type '&' VARIABLE */ | |
| +#line 260 "php_parser.y" | |
| + { (yyval.exp_node) = make_func_param(0, (yyvsp[0].exp_node), (yyvsp[-2].str_val), 1); } | |
| +#line 2370 "php_parser.c" | |
| break; | |
| - case 49: | |
| -#line 261 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_func_param((yyvsp[-3].exp_node), (yyvsp[0].exp_node), (yyvsp[-1].str_val), 0); } | |
| -#line 2476 "php_parser.c" /* yacc.c:1646 */ | |
| + case 49: /* parameter_list: parameter_list ',' optional_class_type VARIABLE */ | |
| +#line 261 "php_parser.y" | |
| + { (yyval.exp_node) = make_func_param((yyvsp[-3].exp_node), (yyvsp[0].exp_node), (yyvsp[-1].str_val), 0); } | |
| +#line 2376 "php_parser.c" | |
| break; | |
| - case 50: | |
| -#line 262 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_func_param((yyvsp[-4].exp_node), (yyvsp[0].exp_node), (yyvsp[-2].str_val), 1); } | |
| -#line 2482 "php_parser.c" /* yacc.c:1646 */ | |
| + case 50: /* parameter_list: parameter_list ',' optional_class_type '&' VARIABLE */ | |
| +#line 262 "php_parser.y" | |
| + { (yyval.exp_node) = make_func_param((yyvsp[-4].exp_node), (yyvsp[0].exp_node), (yyvsp[-2].str_val), 1); } | |
| +#line 2382 "php_parser.c" | |
| break; | |
| - case 51: | |
| -#line 263 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = 0; } | |
| -#line 2488 "php_parser.c" /* yacc.c:1646 */ | |
| + case 51: /* parameter_list: %empty */ | |
| +#line 263 "php_parser.y" | |
| + { (yyval.exp_node) = 0; } | |
| +#line 2388 "php_parser.c" | |
| break; | |
| - case 52: | |
| -#line 267 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.str_val)[0] = 0; } | |
| -#line 2494 "php_parser.c" /* yacc.c:1646 */ | |
| + case 52: /* optional_class_type: %empty */ | |
| +#line 267 "php_parser.y" | |
| + { (yyval.str_val)[0] = 0; } | |
| +#line 2394 "php_parser.c" | |
| break; | |
| - case 55: | |
| -#line 273 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = (yyvsp[-2].syn_node); } | |
| -#line 2500 "php_parser.c" /* yacc.c:1646 */ | |
| + case 55: /* for_statement: ':' top_statement_list ENDFOR ';' */ | |
| +#line 273 "php_parser.y" | |
| + { (yyval.syn_node) = (yyvsp[-2].syn_node); } | |
| +#line 2400 "php_parser.c" | |
| break; | |
| - case 57: | |
| -#line 278 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = (yyvsp[-2].syn_node); } | |
| -#line 2506 "php_parser.c" /* yacc.c:1646 */ | |
| + case 57: /* foreach_statement: ':' top_statement_list ENDFOREACH ';' */ | |
| +#line 278 "php_parser.y" | |
| + { (yyval.syn_node) = (yyvsp[-2].syn_node); } | |
| +#line 2406 "php_parser.c" | |
| break; | |
| - case 59: | |
| -#line 282 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = 0; } | |
| -#line 2512 "php_parser.c" /* yacc.c:1646 */ | |
| + case 59: /* for_expr: %empty */ | |
| +#line 282 "php_parser.y" | |
| + { (yyval.exp_node) = 0; } | |
| +#line 2412 "php_parser.c" | |
| break; | |
| - case 60: | |
| -#line 286 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = add_branch_2_elseif((yyvsp[-5].syn_node), make_ifelse_syn_node((yyvsp[-2].exp_node), (yyvsp[0].syn_node), 0, 0)); } | |
| -#line 2518 "php_parser.c" /* yacc.c:1646 */ | |
| + case 60: /* elseif_list: elseif_list ELSEIF '(' expr ')' statement */ | |
| +#line 286 "php_parser.y" | |
| + { (yyval.syn_node) = add_branch_2_elseif((yyvsp[-5].syn_node), make_ifelse_syn_node((yyvsp[-2].exp_node), (yyvsp[0].syn_node), 0, 0)); } | |
| +#line 2418 "php_parser.c" | |
| break; | |
| - case 61: | |
| -#line 287 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = 0; } | |
| -#line 2524 "php_parser.c" /* yacc.c:1646 */ | |
| + case 61: /* elseif_list: %empty */ | |
| +#line 287 "php_parser.y" | |
| + { (yyval.syn_node) = 0; } | |
| +#line 2424 "php_parser.c" | |
| break; | |
| - case 62: | |
| -#line 291 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = 0; } | |
| -#line 2530 "php_parser.c" /* yacc.c:1646 */ | |
| + case 62: /* else_statement: %empty */ | |
| +#line 291 "php_parser.y" | |
| + { (yyval.syn_node) = 0; } | |
| +#line 2430 "php_parser.c" | |
| break; | |
| - case 63: | |
| -#line 292 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = (yyvsp[0].syn_node); } | |
| -#line 2536 "php_parser.c" /* yacc.c:1646 */ | |
| + case 63: /* else_statement: ELSE statement */ | |
| +#line 292 "php_parser.y" | |
| + { (yyval.syn_node) = (yyvsp[0].syn_node); } | |
| +#line 2436 "php_parser.c" | |
| break; | |
| - case 65: | |
| -#line 296 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.syn_node) = (yyvsp[-2].syn_node); } | |
| -#line 2542 "php_parser.c" /* yacc.c:1646 */ | |
| + case 65: /* while_statement: ':' top_statement_list ENDWHILE ';' */ | |
| +#line 296 "php_parser.y" | |
| + { (yyval.syn_node) = (yyvsp[-2].syn_node); } | |
| +#line 2442 "php_parser.c" | |
| break; | |
| - case 66: | |
| -#line 300 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| -#line 2548 "php_parser.c" /* yacc.c:1646 */ | |
| + case 66: /* switch_case_list: '{' case_list '}' */ | |
| +#line 300 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| +#line 2448 "php_parser.c" | |
| break; | |
| - case 67: | |
| -#line 301 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| -#line 2554 "php_parser.c" /* yacc.c:1646 */ | |
| + case 67: /* switch_case_list: '{' ';' case_list '}' */ | |
| +#line 301 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| +#line 2454 "php_parser.c" | |
| break; | |
| - case 68: | |
| -#line 302 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-2].exp_node); } | |
| -#line 2560 "php_parser.c" /* yacc.c:1646 */ | |
| + case 68: /* switch_case_list: ':' case_list ENDSWITCH ';' */ | |
| +#line 302 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-2].exp_node); } | |
| +#line 2460 "php_parser.c" | |
| break; | |
| - case 69: | |
| -#line 303 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-2].exp_node); } | |
| -#line 2566 "php_parser.c" /* yacc.c:1646 */ | |
| + case 69: /* switch_case_list: ':' ';' case_list ENDSWITCH ';' */ | |
| +#line 303 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-2].exp_node); } | |
| +#line 2466 "php_parser.c" | |
| break; | |
| - case 70: | |
| -#line 307 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = 0; } | |
| -#line 2572 "php_parser.c" /* yacc.c:1646 */ | |
| + case 70: /* case_list: %empty */ | |
| +#line 307 "php_parser.y" | |
| + { (yyval.exp_node) = 0; } | |
| +#line 2472 "php_parser.c" | |
| break; | |
| - case 71: | |
| -#line 308 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 71: /* case_list: case_list case_list_item case_separator top_statement_list */ | |
| +#line 308 "php_parser.y" | |
| + { | |
| (yyvsp[-2].exp_node)->tree_node.syn_right = (yyvsp[0].syn_node); | |
| if ( (yyvsp[-3].exp_node) ) { | |
| PHP_EXP_NODE *last = (yyvsp[-3].exp_node); | |
| @@ -2586,545 +2486,546 @@ yyreduce: | |
| (yyval.exp_node)->exp_node = (yyvsp[-2].exp_node); | |
| } | |
| } | |
| -#line 2590 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 2490 "php_parser.c" | |
| break; | |
| - case 72: | |
| -#line 323 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LIST, (yyvsp[0].exp_node), 0); } | |
| -#line 2596 "php_parser.c" /* yacc.c:1646 */ | |
| + case 72: /* case_list_item: CASE expr */ | |
| +#line 323 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LIST, (yyvsp[0].exp_node), 0); } | |
| +#line 2496 "php_parser.c" | |
| break; | |
| - case 73: | |
| -#line 324 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LIST, 0, 0); } | |
| -#line 2602 "php_parser.c" /* yacc.c:1646 */ | |
| + case 73: /* case_list_item: DEFAULT */ | |
| +#line 324 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LIST, 0, 0); } | |
| +#line 2502 "php_parser.c" | |
| break; | |
| - case 79: | |
| -#line 335 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_known_const((yyvsp[0].str_val)); } | |
| -#line 2608 "php_parser.c" /* yacc.c:1646 */ | |
| + case 79: /* const_value: IDENT */ | |
| +#line 335 "php_parser.y" | |
| + { (yyval.exp_node) = make_known_const((yyvsp[0].str_val)); } | |
| +#line 2508 "php_parser.c" | |
| break; | |
| - case 81: | |
| -#line 339 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_CLASS_DEREF, make_const_exp_str((yyvsp[-2].str_val), 0), make_const_exp_str((yyvsp[0].str_val), 0)); } | |
| -#line 2614 "php_parser.c" /* yacc.c:1646 */ | |
| + case 81: /* variable: IDENT CLASS_SCOPE IDENT */ | |
| +#line 339 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_CLASS_DEREF, make_const_exp_str((yyvsp[-2].str_val), 0), make_const_exp_str((yyvsp[0].str_val), 0)); } | |
| +#line 2514 "php_parser.c" | |
| break; | |
| - case 82: | |
| -#line 340 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_OBJECT_DEREF, (yyvsp[-2].exp_node), make_const_exp_str((yyvsp[0].str_val), 0)); } | |
| -#line 2620 "php_parser.c" /* yacc.c:1646 */ | |
| + case 82: /* variable: deref_variable OBJECT_OPERATOR IDENT */ | |
| +#line 340 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_OBJECT_DEREF, (yyvsp[-2].exp_node), make_const_exp_str((yyvsp[0].str_val), 0)); } | |
| +#line 2520 "php_parser.c" | |
| break; | |
| - case 84: | |
| -#line 345 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_BY_KEY, (yyvsp[-2].exp_node), 0); } | |
| -#line 2626 "php_parser.c" /* yacc.c:1646 */ | |
| + case 84: /* deref_variable: deref_variable '[' ']' */ | |
| +#line 345 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_BY_KEY, (yyvsp[-2].exp_node), 0); } | |
| +#line 2526 "php_parser.c" | |
| break; | |
| - case 85: | |
| -#line 346 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_BY_KEY, (yyvsp[-3].exp_node), (yyvsp[-1].exp_node));} | |
| -#line 2632 "php_parser.c" /* yacc.c:1646 */ | |
| + case 85: /* deref_variable: deref_variable '[' expr ']' */ | |
| +#line 346 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_BY_KEY, (yyvsp[-3].exp_node), (yyvsp[-1].exp_node));} | |
| +#line 2532 "php_parser.c" | |
| break; | |
| - case 86: | |
| -#line 347 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_BY_KEY, (yyvsp[-3].exp_node), (yyvsp[-1].exp_node));} | |
| -#line 2638 "php_parser.c" /* yacc.c:1646 */ | |
| + case 86: /* deref_variable: deref_variable '{' expr '}' */ | |
| +#line 347 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_BY_KEY, (yyvsp[-3].exp_node), (yyvsp[-1].exp_node));} | |
| +#line 2538 "php_parser.c" | |
| break; | |
| - case 87: | |
| -#line 348 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_VAR_BY_EXP, (yyvsp[-1].exp_node)); } | |
| -#line 2644 "php_parser.c" /* yacc.c:1646 */ | |
| + case 87: /* deref_variable: '$' '{' expr '}' */ | |
| +#line 348 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_VAR_BY_EXP, (yyvsp[-1].exp_node)); } | |
| +#line 2544 "php_parser.c" | |
| break; | |
| - case 88: | |
| -#line 352 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_func_call_exp((yyvsp[-3].str_val), (yyvsp[-1].exp_node)); } | |
| -#line 2650 "php_parser.c" /* yacc.c:1646 */ | |
| + case 88: /* function_call: IDENT '(' func_param_list ')' */ | |
| +#line 352 "php_parser.y" | |
| + { (yyval.exp_node) = make_func_call_exp((yyvsp[-3].str_val), (yyvsp[-1].exp_node)); } | |
| +#line 2550 "php_parser.c" | |
| break; | |
| - case 89: | |
| -#line 353 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2656 "php_parser.c" /* yacc.c:1646 */ | |
| + case 89: /* function_call: deref_variable CLASS_SCOPE IDENT '(' func_param_list ')' */ | |
| +#line 353 "php_parser.y" | |
| + { } | |
| +#line 2556 "php_parser.c" | |
| break; | |
| - case 90: | |
| -#line 354 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2662 "php_parser.c" /* yacc.c:1646 */ | |
| + case 90: /* function_call: deref_variable OBJECT_OPERATOR IDENT '(' func_param_list ')' */ | |
| +#line 354 "php_parser.y" | |
| + { } | |
| +#line 2562 "php_parser.c" | |
| break; | |
| - case 91: | |
| -#line 357 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_func_call_param_list(); func_call_add_expr((yyval.exp_node)->var_node, (yyvsp[0].exp_node), 0); } | |
| -#line 2668 "php_parser.c" /* yacc.c:1646 */ | |
| + case 91: /* func_param_list: expr */ | |
| +#line 357 "php_parser.y" | |
| + { (yyval.exp_node) = make_func_call_param_list(); func_call_add_expr((yyval.exp_node)->var_node, (yyvsp[0].exp_node), 0); } | |
| +#line 2568 "php_parser.c" | |
| break; | |
| - case 92: | |
| -#line 358 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_func_call_param_list(); func_call_add_expr((yyval.exp_node)->var_node, (yyvsp[0].exp_node), 1); } | |
| -#line 2674 "php_parser.c" /* yacc.c:1646 */ | |
| + case 92: /* func_param_list: '&' variable */ | |
| +#line 358 "php_parser.y" | |
| + { (yyval.exp_node) = make_func_call_param_list(); func_call_add_expr((yyval.exp_node)->var_node, (yyvsp[0].exp_node), 1); } | |
| +#line 2574 "php_parser.c" | |
| break; | |
| - case 93: | |
| -#line 359 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-2].exp_node); func_call_add_expr((yyval.exp_node)->var_node, (yyvsp[0].exp_node), 0); } | |
| -#line 2680 "php_parser.c" /* yacc.c:1646 */ | |
| + case 93: /* func_param_list: func_param_list ',' expr */ | |
| +#line 359 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-2].exp_node); func_call_add_expr((yyval.exp_node)->var_node, (yyvsp[0].exp_node), 0); } | |
| +#line 2580 "php_parser.c" | |
| break; | |
| - case 94: | |
| -#line 360 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-3].exp_node); func_call_add_expr((yyval.exp_node)->var_node, (yyvsp[0].exp_node), 1); } | |
| -#line 2686 "php_parser.c" /* yacc.c:1646 */ | |
| + case 94: /* func_param_list: func_param_list ',' '&' variable */ | |
| +#line 360 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-3].exp_node); func_call_add_expr((yyval.exp_node)->var_node, (yyvsp[0].exp_node), 1); } | |
| +#line 2586 "php_parser.c" | |
| break; | |
| - case 95: | |
| -#line 361 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_func_call_param_list(); } | |
| -#line 2692 "php_parser.c" /* yacc.c:1646 */ | |
| + case 95: /* func_param_list: %empty */ | |
| +#line 361 "php_parser.y" | |
| + { (yyval.exp_node) = make_func_call_param_list(); } | |
| +#line 2592 "php_parser.c" | |
| break; | |
| - case 96: | |
| -#line 366 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 2698 "php_parser.c" /* yacc.c:1646 */ | |
| + case 96: /* expr: LIST '(' assignment_list ')' '=' expr */ | |
| +#line 366 "php_parser.y" | |
| + { } | |
| +#line 2598 "php_parser.c" | |
| break; | |
| - case 98: | |
| -#line 368 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_ASS, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2704 "php_parser.c" /* yacc.c:1646 */ | |
| + case 98: /* expr: variable '=' expr */ | |
| +#line 368 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_ASS, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2604 "php_parser.c" | |
| break; | |
| - case 99: | |
| -#line 369 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| -#line 2710 "php_parser.c" /* yacc.c:1646 */ | |
| + case 99: /* expr: function_call */ | |
| +#line 369 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| +#line 2610 "php_parser.c" | |
| break; | |
| - case 100: | |
| -#line 370 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_MAKE_REF, (yyvsp[-3].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2716 "php_parser.c" /* yacc.c:1646 */ | |
| + case 100: /* expr: variable '=' '&' variable */ | |
| +#line 370 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_MAKE_REF, (yyvsp[-3].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2616 "php_parser.c" | |
| break; | |
| - case 101: | |
| -#line 375 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_ADD, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2722 "php_parser.c" /* yacc.c:1646 */ | |
| + case 101: /* expr: variable PLUS_EQ expr */ | |
| +#line 375 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_ADD, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2622 "php_parser.c" | |
| break; | |
| - case 102: | |
| -#line 376 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_SUB, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2728 "php_parser.c" /* yacc.c:1646 */ | |
| + case 102: /* expr: variable MINUS_EQ expr */ | |
| +#line 376 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_SUB, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2628 "php_parser.c" | |
| break; | |
| - case 103: | |
| -#line 377 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_MUL, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2734 "php_parser.c" /* yacc.c:1646 */ | |
| + case 103: /* expr: variable MUL_EQ expr */ | |
| +#line 377 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_MUL, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2634 "php_parser.c" | |
| break; | |
| - case 104: | |
| -#line 378 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_DIV, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2740 "php_parser.c" /* yacc.c:1646 */ | |
| + case 104: /* expr: variable DIV_EQ expr */ | |
| +#line 378 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_DIV, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2640 "php_parser.c" | |
| break; | |
| - case 105: | |
| -#line 379 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_CAT, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2746 "php_parser.c" /* yacc.c:1646 */ | |
| + case 105: /* expr: variable CONCAT_EQ expr */ | |
| +#line 379 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_CAT, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2646 "php_parser.c" | |
| break; | |
| - case 106: | |
| -#line 380 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_REM, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2752 "php_parser.c" /* yacc.c:1646 */ | |
| + case 106: /* expr: variable MOD_EQ expr */ | |
| +#line 380 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_REM, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2652 "php_parser.c" | |
| break; | |
| - case 107: | |
| -#line 381 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_AND, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2758 "php_parser.c" /* yacc.c:1646 */ | |
| + case 107: /* expr: variable AND_EQ expr */ | |
| +#line 381 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_AND, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2658 "php_parser.c" | |
| break; | |
| - case 108: | |
| -#line 382 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_OR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2764 "php_parser.c" /* yacc.c:1646 */ | |
| + case 108: /* expr: variable OR_EQ expr */ | |
| +#line 382 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_OR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2664 "php_parser.c" | |
| break; | |
| - case 109: | |
| -#line 383 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_XOR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2770 "php_parser.c" /* yacc.c:1646 */ | |
| + case 109: /* expr: variable XOR_EQ expr */ | |
| +#line 383 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_XOR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2670 "php_parser.c" | |
| break; | |
| - case 110: | |
| -#line 384 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_SHL, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2776 "php_parser.c" /* yacc.c:1646 */ | |
| + case 110: /* expr: variable SL_EQ expr */ | |
| +#line 384 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_SHL, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2676 "php_parser.c" | |
| break; | |
| - case 111: | |
| -#line 385 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_SHR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| -#line 2782 "php_parser.c" /* yacc.c:1646 */ | |
| + case 111: /* expr: variable SR_EQ expr */ | |
| +#line 385 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-2].exp_node), make_exp_2(PHP_OP_SHR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node))); } | |
| +#line 2682 "php_parser.c" | |
| break; | |
| - case 112: | |
| -#line 387 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-1].exp_node), make_exp_2(PHP_OP_ADD, (yyvsp[-1].exp_node), make_const_exp_dnum(1))); } | |
| -#line 2788 "php_parser.c" /* yacc.c:1646 */ | |
| + case 112: /* expr: variable INC */ | |
| +#line 387 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-1].exp_node), make_exp_2(PHP_OP_ADD, (yyvsp[-1].exp_node), make_const_exp_dnum(1))); } | |
| +#line 2688 "php_parser.c" | |
| break; | |
| - case 113: | |
| -#line 388 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[0].exp_node), make_exp_2(PHP_OP_ADD, (yyvsp[0].exp_node), make_const_exp_dnum(1))); } | |
| -#line 2794 "php_parser.c" /* yacc.c:1646 */ | |
| + case 113: /* expr: INC variable */ | |
| +#line 388 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[0].exp_node), make_exp_2(PHP_OP_ADD, (yyvsp[0].exp_node), make_const_exp_dnum(1))); } | |
| +#line 2694 "php_parser.c" | |
| break; | |
| - case 114: | |
| -#line 389 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-1].exp_node), make_exp_2(PHP_OP_SUB, (yyvsp[-1].exp_node), make_const_exp_dnum(1))); } | |
| -#line 2800 "php_parser.c" /* yacc.c:1646 */ | |
| + case 114: /* expr: variable DEC */ | |
| +#line 389 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[-1].exp_node), make_exp_2(PHP_OP_SUB, (yyvsp[-1].exp_node), make_const_exp_dnum(1))); } | |
| +#line 2700 "php_parser.c" | |
| break; | |
| - case 115: | |
| -#line 390 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[0].exp_node), make_exp_2(PHP_OP_SUB, (yyvsp[0].exp_node), make_const_exp_dnum(1))); } | |
| -#line 2806 "php_parser.c" /* yacc.c:1646 */ | |
| + case 115: /* expr: DEC variable */ | |
| +#line 390 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2_self(PHP_OP_ASS, (yyvsp[0].exp_node), make_exp_2(PHP_OP_SUB, (yyvsp[0].exp_node), make_const_exp_dnum(1))); } | |
| +#line 2706 "php_parser.c" | |
| break; | |
| - case 116: | |
| -#line 392 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_OR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2812 "php_parser.c" /* yacc.c:1646 */ | |
| + case 116: /* expr: expr BOOLEAN_OR expr */ | |
| +#line 392 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_OR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2712 "php_parser.c" | |
| break; | |
| - case 117: | |
| -#line 393 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_AND, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2818 "php_parser.c" /* yacc.c:1646 */ | |
| + case 117: /* expr: expr BOOLEAN_AND expr */ | |
| +#line 393 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_AND, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2718 "php_parser.c" | |
| break; | |
| - case 118: | |
| -#line 394 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_OR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2824 "php_parser.c" /* yacc.c:1646 */ | |
| + case 118: /* expr: expr LOG_OR expr */ | |
| +#line 394 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_OR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2724 "php_parser.c" | |
| break; | |
| - case 119: | |
| -#line 395 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_AND, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2830 "php_parser.c" /* yacc.c:1646 */ | |
| + case 119: /* expr: expr LOG_AND expr */ | |
| +#line 395 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_AND, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2730 "php_parser.c" | |
| break; | |
| - case 120: | |
| -#line 396 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_XOR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2836 "php_parser.c" /* yacc.c:1646 */ | |
| + case 120: /* expr: expr LOG_XOR expr */ | |
| +#line 396 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LOG_XOR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2736 "php_parser.c" | |
| break; | |
| - case 121: | |
| -#line 397 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_OR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2842 "php_parser.c" /* yacc.c:1646 */ | |
| + case 121: /* expr: expr '|' expr */ | |
| +#line 397 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_OR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2742 "php_parser.c" | |
| break; | |
| - case 122: | |
| -#line 398 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_AND, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2848 "php_parser.c" /* yacc.c:1646 */ | |
| + case 122: /* expr: expr '&' expr */ | |
| +#line 398 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_AND, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2748 "php_parser.c" | |
| break; | |
| - case 123: | |
| -#line 399 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_XOR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2854 "php_parser.c" /* yacc.c:1646 */ | |
| + case 123: /* expr: expr '^' expr */ | |
| +#line 399 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_XOR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2754 "php_parser.c" | |
| break; | |
| - case 124: | |
| -#line 400 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_CAT, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2860 "php_parser.c" /* yacc.c:1646 */ | |
| + case 124: /* expr: expr '.' expr */ | |
| +#line 400 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_CAT, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2760 "php_parser.c" | |
| break; | |
| - case 125: | |
| -#line 401 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_ADD, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2866 "php_parser.c" /* yacc.c:1646 */ | |
| + case 125: /* expr: expr '+' expr */ | |
| +#line 401 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_ADD, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2766 "php_parser.c" | |
| break; | |
| - case 126: | |
| -#line 402 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_SUB, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2872 "php_parser.c" /* yacc.c:1646 */ | |
| + case 126: /* expr: expr '-' expr */ | |
| +#line 402 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_SUB, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2772 "php_parser.c" | |
| break; | |
| - case 127: | |
| -#line 403 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_MUL, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2878 "php_parser.c" /* yacc.c:1646 */ | |
| + case 127: /* expr: expr '*' expr */ | |
| +#line 403 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_MUL, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2778 "php_parser.c" | |
| break; | |
| - case 128: | |
| -#line 404 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_DIV, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2884 "php_parser.c" /* yacc.c:1646 */ | |
| + case 128: /* expr: expr '/' expr */ | |
| +#line 404 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_DIV, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2784 "php_parser.c" | |
| break; | |
| - case 129: | |
| -#line 405 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_REM, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2890 "php_parser.c" /* yacc.c:1646 */ | |
| + case 129: /* expr: expr '%' expr */ | |
| +#line 405 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_REM, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2790 "php_parser.c" | |
| break; | |
| - case 130: | |
| -#line 406 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_SHL, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2896 "php_parser.c" /* yacc.c:1646 */ | |
| + case 130: /* expr: expr SL expr */ | |
| +#line 406 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_SHL, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2796 "php_parser.c" | |
| break; | |
| - case 131: | |
| -#line 407 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_SHR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2902 "php_parser.c" /* yacc.c:1646 */ | |
| + case 131: /* expr: expr SR expr */ | |
| +#line 407 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_SHR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2802 "php_parser.c" | |
| break; | |
| - case 132: | |
| -#line 408 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| -#line 2908 "php_parser.c" /* yacc.c:1646 */ | |
| + case 132: /* expr: '+' expr */ | |
| +#line 408 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| +#line 2808 "php_parser.c" | |
| break; | |
| - case 133: | |
| -#line 409 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_SUB, make_const_exp_dnum(0), (yyvsp[0].exp_node)); } | |
| -#line 2914 "php_parser.c" /* yacc.c:1646 */ | |
| + case 133: /* expr: '-' expr */ | |
| +#line 409 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_SUB, make_const_exp_dnum(0), (yyvsp[0].exp_node)); } | |
| +#line 2814 "php_parser.c" | |
| break; | |
| - case 134: | |
| -#line 410 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_LOG_NOT, (yyvsp[0].exp_node)); } | |
| -#line 2920 "php_parser.c" /* yacc.c:1646 */ | |
| + case 134: /* expr: '!' expr */ | |
| +#line 410 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_LOG_NOT, (yyvsp[0].exp_node)); } | |
| +#line 2820 "php_parser.c" | |
| break; | |
| - case 135: | |
| -#line 411 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_NOT, (yyvsp[0].exp_node)); } | |
| -#line 2926 "php_parser.c" /* yacc.c:1646 */ | |
| + case 135: /* expr: '~' expr */ | |
| +#line 411 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_NOT, (yyvsp[0].exp_node)); } | |
| +#line 2826 "php_parser.c" | |
| break; | |
| - case 136: | |
| -#line 412 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_SAME, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2932 "php_parser.c" /* yacc.c:1646 */ | |
| + case 136: /* expr: expr IS_IDENTICAL expr */ | |
| +#line 412 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_SAME, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2832 "php_parser.c" | |
| break; | |
| - case 137: | |
| -#line 413 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_NOT_SAME, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2938 "php_parser.c" /* yacc.c:1646 */ | |
| + case 137: /* expr: expr IS_NOIDENTICAL expr */ | |
| +#line 413 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_NOT_SAME, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2838 "php_parser.c" | |
| break; | |
| - case 138: | |
| -#line 414 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_EQ, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2944 "php_parser.c" /* yacc.c:1646 */ | |
| + case 138: /* expr: expr IS_EQ expr */ | |
| +#line 414 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_EQ, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2844 "php_parser.c" | |
| break; | |
| - case 139: | |
| -#line 415 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_NEQ, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2950 "php_parser.c" /* yacc.c:1646 */ | |
| + case 139: /* expr: expr IS_NOEQUAL expr */ | |
| +#line 415 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_NEQ, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2850 "php_parser.c" | |
| break; | |
| - case 140: | |
| -#line 416 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LWR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2956 "php_parser.c" /* yacc.c:1646 */ | |
| + case 140: /* expr: expr '<' expr */ | |
| +#line 416 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LWR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2856 "php_parser.c" | |
| break; | |
| - case 141: | |
| -#line 417 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_LWR_EQ, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2962 "php_parser.c" /* yacc.c:1646 */ | |
| + case 141: /* expr: expr IS_SMALLER_OR_EQ expr */ | |
| +#line 417 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_LWR_EQ, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2862 "php_parser.c" | |
| break; | |
| - case 142: | |
| -#line 418 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_GRT, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2968 "php_parser.c" /* yacc.c:1646 */ | |
| + case 142: /* expr: expr '>' expr */ | |
| +#line 418 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_GRT, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2868 "php_parser.c" | |
| break; | |
| - case 143: | |
| -#line 419 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_GRT_EQ, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 2974 "php_parser.c" /* yacc.c:1646 */ | |
| + case 143: /* expr: expr IS_GREATER_OR_EQ expr */ | |
| +#line 419 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_GRT_EQ, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 2874 "php_parser.c" | |
| break; | |
| - case 144: | |
| -#line 420 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| -#line 2980 "php_parser.c" /* yacc.c:1646 */ | |
| + case 144: /* expr: '(' expr ')' */ | |
| +#line 420 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| +#line 2880 "php_parser.c" | |
| break; | |
| - case 145: | |
| -#line 421 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_MUX, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); (yyval.exp_node)->exp_node = (yyvsp[-4].exp_node); } | |
| -#line 2986 "php_parser.c" /* yacc.c:1646 */ | |
| + case 145: /* expr: expr '?' expr ':' expr */ | |
| +#line 421 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_MUX, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); (yyval.exp_node)->exp_node = (yyvsp[-4].exp_node); } | |
| +#line 2886 "php_parser.c" | |
| break; | |
| - case 146: | |
| -#line 422 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_CAST_INT, (yyvsp[0].exp_node)); } | |
| -#line 2992 "php_parser.c" /* yacc.c:1646 */ | |
| + case 146: /* expr: INT_CAST expr */ | |
| +#line 422 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_CAST_INT, (yyvsp[0].exp_node)); } | |
| +#line 2892 "php_parser.c" | |
| break; | |
| - case 147: | |
| -#line 423 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_CAST_FLOAT, (yyvsp[0].exp_node)); } | |
| -#line 2998 "php_parser.c" /* yacc.c:1646 */ | |
| + case 147: /* expr: DOUBLE_CAST expr */ | |
| +#line 423 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_CAST_FLOAT, (yyvsp[0].exp_node)); } | |
| +#line 2898 "php_parser.c" | |
| break; | |
| - case 148: | |
| -#line 424 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_CAST_STR, (yyvsp[0].exp_node)); } | |
| -#line 3004 "php_parser.c" /* yacc.c:1646 */ | |
| + case 148: /* expr: STRING_CAST expr */ | |
| +#line 424 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_CAST_STR, (yyvsp[0].exp_node)); } | |
| +#line 2904 "php_parser.c" | |
| break; | |
| - case 149: | |
| -#line 425 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_CAST_BOOL, (yyvsp[0].exp_node)); } | |
| -#line 3010 "php_parser.c" /* yacc.c:1646 */ | |
| + case 149: /* expr: BOOL_CAST expr */ | |
| +#line 425 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_CAST_BOOL, (yyvsp[0].exp_node)); } | |
| +#line 2910 "php_parser.c" | |
| break; | |
| - case 150: | |
| -#line 428 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 3016 "php_parser.c" /* yacc.c:1646 */ | |
| + case 150: /* expr: UNSET_CAST expr */ | |
| +#line 428 "php_parser.y" | |
| + { } | |
| +#line 2916 "php_parser.c" | |
| break; | |
| - case 151: | |
| -#line 429 "php_parser.y" /* yacc.c:1646 */ | |
| - { } | |
| -#line 3022 "php_parser.c" /* yacc.c:1646 */ | |
| + case 151: /* expr: EXIT exit_expr */ | |
| +#line 429 "php_parser.y" | |
| + { } | |
| +#line 2922 "php_parser.c" | |
| break; | |
| - case 152: | |
| -#line 430 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| -#line 3028 "php_parser.c" /* yacc.c:1646 */ | |
| + case 152: /* expr: '@' expr */ | |
| +#line 430 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| +#line 2928 "php_parser.c" | |
| break; | |
| - case 153: | |
| -#line 432 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| -#line 3034 "php_parser.c" /* yacc.c:1646 */ | |
| + case 153: /* expr: const_value */ | |
| +#line 432 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[0].exp_node); } | |
| +#line 2934 "php_parser.c" | |
| break; | |
| - case 154: | |
| -#line 433 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_ARRAY, (yyvsp[-1].exp_node)); } | |
| -#line 3040 "php_parser.c" /* yacc.c:1646 */ | |
| + case 154: /* expr: ARRAY '(' array_pair_list ')' */ | |
| +#line 433 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_ARRAY, (yyvsp[-1].exp_node)); } | |
| +#line 2940 "php_parser.c" | |
| break; | |
| - case 155: | |
| -#line 434 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_PRINT, (yyvsp[0].exp_node)); } | |
| -#line 3046 "php_parser.c" /* yacc.c:1646 */ | |
| + case 155: /* expr: PRINT expr */ | |
| +#line 434 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_PRINT, (yyvsp[0].exp_node)); } | |
| +#line 2946 "php_parser.c" | |
| break; | |
| - case 156: | |
| -#line 437 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| -#line 3052 "php_parser.c" /* yacc.c:1646 */ | |
| + case 156: /* exit_expr: '(' expr ')' */ | |
| +#line 437 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| +#line 2952 "php_parser.c" | |
| break; | |
| - case 157: | |
| -#line 438 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = 0; } | |
| -#line 3058 "php_parser.c" /* yacc.c:1646 */ | |
| + case 157: /* exit_expr: '(' ')' */ | |
| +#line 438 "php_parser.y" | |
| + { (yyval.exp_node) = 0; } | |
| +#line 2958 "php_parser.c" | |
| break; | |
| - case 158: | |
| -#line 439 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = 0; } | |
| -#line 3064 "php_parser.c" /* yacc.c:1646 */ | |
| + case 158: /* exit_expr: %empty */ | |
| +#line 439 "php_parser.y" | |
| + { (yyval.exp_node) = 0; } | |
| +#line 2964 "php_parser.c" | |
| break; | |
| - case 161: | |
| -#line 447 "php_parser.y" /* yacc.c:1646 */ | |
| - { /*$$ = make_assign_node($1);*/ } | |
| -#line 3070 "php_parser.c" /* yacc.c:1646 */ | |
| + case 161: /* assignment_list_element: variable */ | |
| +#line 447 "php_parser.y" | |
| + { /*$$ = make_assign_node($1);*/ } | |
| +#line 2970 "php_parser.c" | |
| break; | |
| - case 162: | |
| -#line 448 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| -#line 3076 "php_parser.c" /* yacc.c:1646 */ | |
| + case 162: /* assignment_list_element: LIST '(' assignment_list ')' */ | |
| +#line 448 "php_parser.y" | |
| + { (yyval.exp_node) = (yyvsp[-1].exp_node); } | |
| +#line 2976 "php_parser.c" | |
| break; | |
| - case 163: | |
| -#line 449 "php_parser.y" /* yacc.c:1646 */ | |
| - { /*$$ = make_assign_node(0);*/ } | |
| -#line 3082 "php_parser.c" /* yacc.c:1646 */ | |
| + case 163: /* assignment_list_element: %empty */ | |
| +#line 449 "php_parser.y" | |
| + { /*$$ = make_assign_node(0);*/ } | |
| +#line 2982 "php_parser.c" | |
| break; | |
| - case 164: | |
| -#line 452 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_LIST, 0); (yyval.exp_node)->exp_node = (yyvsp[0].exp_node); } | |
| -#line 3088 "php_parser.c" /* yacc.c:1646 */ | |
| + case 164: /* array_pair_list: array_elem */ | |
| +#line 452 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_LIST, 0); (yyval.exp_node)->exp_node = (yyvsp[0].exp_node); } | |
| +#line 2988 "php_parser.c" | |
| break; | |
| - case 165: | |
| -#line 453 "php_parser.y" /* yacc.c:1646 */ | |
| - { | |
| + case 165: /* array_pair_list: array_pair_list ',' array_elem */ | |
| +#line 453 "php_parser.y" | |
| + { | |
| PHP_EXP_NODE *last = (yyvsp[-2].exp_node); | |
| while ( last->next) last = last->next; | |
| last->next = make_exp_1(PHP_OP_LIST, 0); | |
| last->next->exp_node = (yyvsp[0].exp_node); | |
| (yyval.exp_node) = (yyvsp[-2].exp_node); | |
| } | |
| -#line 3100 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 3000 "php_parser.c" | |
| break; | |
| - case 166: | |
| -#line 462 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_ARRAY_PAIR, (yyvsp[0].exp_node)); } | |
| -#line 3106 "php_parser.c" /* yacc.c:1646 */ | |
| + case 166: /* array_elem: expr */ | |
| +#line 462 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_ARRAY_PAIR, (yyvsp[0].exp_node)); } | |
| +#line 3006 "php_parser.c" | |
| break; | |
| - case 167: | |
| -#line 463 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_PAIR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 3112 "php_parser.c" /* yacc.c:1646 */ | |
| + case 167: /* array_elem: expr HASH_ASSIGN expr */ | |
| +#line 463 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_PAIR, (yyvsp[-2].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 3012 "php_parser.c" | |
| break; | |
| - case 168: | |
| -#line 464 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_REF_PAIR, (yyvsp[-3].exp_node), (yyvsp[0].exp_node)); } | |
| -#line 3118 "php_parser.c" /* yacc.c:1646 */ | |
| + case 168: /* array_elem: expr HASH_ASSIGN '&' variable */ | |
| +#line 464 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_2(PHP_OP_ARRAY_REF_PAIR, (yyvsp[-3].exp_node), (yyvsp[0].exp_node)); } | |
| +#line 3018 "php_parser.c" | |
| break; | |
| - case 169: | |
| -#line 465 "php_parser.y" /* yacc.c:1646 */ | |
| - { (yyval.exp_node) = make_exp_1(PHP_OP_ARRAY_REF_PAIR, (yyvsp[0].exp_node)); } | |
| -#line 3124 "php_parser.c" /* yacc.c:1646 */ | |
| + case 169: /* array_elem: '&' variable */ | |
| +#line 465 "php_parser.y" | |
| + { (yyval.exp_node) = make_exp_1(PHP_OP_ARRAY_REF_PAIR, (yyvsp[0].exp_node)); } | |
| +#line 3024 "php_parser.c" | |
| break; | |
| -#line 3128 "php_parser.c" /* yacc.c:1646 */ | |
| +#line 3028 "php_parser.c" | |
| + | |
| default: break; | |
| } | |
| /* User semantic actions sometimes alter yychar, and that requires | |
| @@ -3138,25 +3039,23 @@ yyreduce: | |
| case of YYERROR or YYBACKUP, subsequent parser actions might lead | |
| to an incorrect destructor call or verbose syntax error message | |
| before the lookahead is translated. */ | |
| - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); | |
| + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); | |
| YYPOPSTACK (yylen); | |
| yylen = 0; | |
| - YY_STACK_PRINT (yyss, yyssp); | |
| *++yyvsp = yyval; | |
| /* Now 'shift' the result of the reduction. Determine what state | |
| that goes to, based on the state we popped back to and the rule | |
| number reduced by. */ | |
| - | |
| - yyn = yyr1[yyn]; | |
| - | |
| - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | |
| - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
| - yystate = yytable[yystate]; | |
| - else | |
| - yystate = yydefgoto[yyn - YYNTOKENS]; | |
| + { | |
| + const int yylhs = yyr1[yyn] - YYNTOKENS; | |
| + const int yyi = yypgoto[yylhs] + *yyssp; | |
| + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp | |
| + ? yytable[yyi] | |
| + : yydefgoto[yylhs]); | |
| + } | |
| goto yynewstate; | |
| @@ -3167,50 +3066,14 @@ yyreduce: | |
| yyerrlab: | |
| /* Make sure we have latest lookahead translation. See comments at | |
| user semantic actions for why this is necessary. */ | |
| - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); | |
| - | |
| + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); | |
| /* If not already recovering from an error, report this error. */ | |
| if (!yyerrstatus) | |
| { | |
| ++yynerrs; | |
| -#if ! YYERROR_VERBOSE | |
| yyerror (YY_("syntax error")); | |
| -#else | |
| -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ | |
| - yyssp, yytoken) | |
| - { | |
| - char const *yymsgp = YY_("syntax error"); | |
| - int yysyntax_error_status; | |
| - yysyntax_error_status = YYSYNTAX_ERROR; | |
| - if (yysyntax_error_status == 0) | |
| - yymsgp = yymsg; | |
| - else if (yysyntax_error_status == 1) | |
| - { | |
| - if (yymsg != yymsgbuf) | |
| - YYSTACK_FREE (yymsg); | |
| - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); | |
| - if (!yymsg) | |
| - { | |
| - yymsg = yymsgbuf; | |
| - yymsg_alloc = sizeof yymsgbuf; | |
| - yysyntax_error_status = 2; | |
| - } | |
| - else | |
| - { | |
| - yysyntax_error_status = YYSYNTAX_ERROR; | |
| - yymsgp = yymsg; | |
| - } | |
| - } | |
| - yyerror (yymsgp); | |
| - if (yysyntax_error_status == 2) | |
| - goto yyexhaustedlab; | |
| - } | |
| -# undef YYSYNTAX_ERROR | |
| -#endif | |
| } | |
| - | |
| - | |
| if (yyerrstatus == 3) | |
| { | |
| /* If just tried and failed to reuse lookahead token after an | |
| @@ -3239,12 +3102,11 @@ yyerrlab: | |
| | yyerrorlab -- error raised explicitly by YYERROR. | | |
| `---------------------------------------------------*/ | |
| yyerrorlab: | |
| - | |
| - /* Pacify compilers like GCC when the user code never invokes | |
| - YYERROR and the label yyerrorlab therefore never appears in user | |
| - code. */ | |
| - if (/*CONSTCOND*/ 0) | |
| - goto yyerrorlab; | |
| + /* Pacify compilers when the user code never invokes YYERROR and the | |
| + label yyerrorlab therefore never appears in user code. */ | |
| + if (0) | |
| + YYERROR; | |
| + ++yynerrs; | |
| /* Do not reclaim the symbols of the rule whose action triggered | |
| this YYERROR. */ | |
| @@ -3261,13 +3123,14 @@ yyerrorlab: | |
| yyerrlab1: | |
| yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
| + /* Pop stack until we find a state that shifts the error token. */ | |
| for (;;) | |
| { | |
| yyn = yypact[yystate]; | |
| if (!yypact_value_is_default (yyn)) | |
| { | |
| - yyn += YYTERROR; | |
| - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
| + yyn += YYSYMBOL_YYerror; | |
| + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) | |
| { | |
| yyn = yytable[yyn]; | |
| if (0 < yyn) | |
| @@ -3281,7 +3144,7 @@ yyerrlab1: | |
| yydestruct ("Error: popping", | |
| - yystos[yystate], yyvsp); | |
| + YY_ACCESSING_SYMBOL (yystate), yyvsp); | |
| YYPOPSTACK (1); | |
| yystate = *yyssp; | |
| YY_STACK_PRINT (yyss, yyssp); | |
| @@ -3293,7 +3156,7 @@ yyerrlab1: | |
| /* Shift the error token. */ | |
| - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); | |
| + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); | |
| yystate = yyn; | |
| goto yynewstate; | |
| @@ -3304,26 +3167,30 @@ yyerrlab1: | |
| `-------------------------------------*/ | |
| yyacceptlab: | |
| yyresult = 0; | |
| - goto yyreturn; | |
| + goto yyreturnlab; | |
| + | |
| /*-----------------------------------. | |
| | yyabortlab -- YYABORT comes here. | | |
| `-----------------------------------*/ | |
| yyabortlab: | |
| yyresult = 1; | |
| - goto yyreturn; | |
| + goto yyreturnlab; | |
| -#if !defined yyoverflow || YYERROR_VERBOSE | |
| -/*-------------------------------------------------. | |
| -| yyexhaustedlab -- memory exhaustion comes here. | | |
| -`-------------------------------------------------*/ | |
| + | |
| +/*-----------------------------------------------------------. | |
| +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | | |
| +`-----------------------------------------------------------*/ | |
| yyexhaustedlab: | |
| yyerror (YY_("memory exhausted")); | |
| yyresult = 2; | |
| - /* Fall through. */ | |
| -#endif | |
| + goto yyreturnlab; | |
| + | |
| -yyreturn: | |
| +/*----------------------------------------------------------. | |
| +| yyreturnlab -- parsing is finished, clean up and return. | | |
| +`----------------------------------------------------------*/ | |
| +yyreturnlab: | |
| if (yychar != YYEMPTY) | |
| { | |
| /* Make sure we have latest lookahead translation. See comments at | |
| @@ -3339,16 +3206,14 @@ yyreturn: | |
| while (yyssp != yyss) | |
| { | |
| yydestruct ("Cleanup: popping", | |
| - yystos[*yyssp], yyvsp); | |
| + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); | |
| YYPOPSTACK (1); | |
| } | |
| #ifndef yyoverflow | |
| if (yyss != yyssa) | |
| YYSTACK_FREE (yyss); | |
| #endif | |
| -#if YYERROR_VERBOSE | |
| - if (yymsg != yymsgbuf) | |
| - YYSTACK_FREE (yymsg); | |
| -#endif | |
| + | |
| return yyresult; | |
| } | |
| + | |
| diff --git a/src/webserver/src/php_parser.h b/src/webserver/src/php_parser.h | |
| index a9863e1d6..d81c5117a 100644 | |
| --- a/src/webserver/src/php_parser.h | |
| +++ b/src/webserver/src/php_parser.h | |
| @@ -1,8 +1,9 @@ | |
| -/* A Bison parser, made by GNU Bison 3.0.4. */ | |
| +/* A Bison parser, made by GNU Bison 3.8.2. */ | |
| /* Bison interface for Yacc-like parsers in C | |
| - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. | |
| + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, | |
| + Inc. | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| @@ -15,7 +16,7 @@ | |
| GNU General Public License for more details. | |
| You should have received a copy of the GNU General Public License | |
| - along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
| + along with this program. If not, see <https://www.gnu.org/licenses/>. */ | |
| /* As a special exception, you may create a larger work that contains | |
| part or all of the Bison parser skeleton and distribute that work | |
| @@ -30,6 +31,10 @@ | |
| This special exception was added by the Free Software Foundation in | |
| version 2.2 of Bison. */ | |
| +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, | |
| + especially those whose name start with YY_ or yy_. They are | |
| + private implementation details that can be changed or removed. */ | |
| + | |
| #ifndef YY_PHP_PHP_PARSER_H_INCLUDED | |
| # define YY_PHP_PHP_PARSER_H_INCLUDED | |
| /* Debug traces. */ | |
| @@ -40,117 +45,121 @@ | |
| extern int phpdebug; | |
| #endif | |
| -/* Token type. */ | |
| +/* Token kinds. */ | |
| #ifndef YYTOKENTYPE | |
| # define YYTOKENTYPE | |
| enum yytokentype | |
| { | |
| - FNUMBER = 258, | |
| - DNUMBER = 259, | |
| - STRING = 260, | |
| - IDENT = 261, | |
| - VARIABLE = 262, | |
| - T_ECHO = 263, | |
| - EXIT = 264, | |
| - IF = 265, | |
| - DO = 266, | |
| - WHILE = 267, | |
| - ENDWHILE = 268, | |
| - FOR = 269, | |
| - ENDFOR = 270, | |
| - FOREACH = 271, | |
| - ENDFOREACH = 272, | |
| - DECLARE = 273, | |
| - ENDDECLARE = 274, | |
| - AS = 275, | |
| - CONST = 276, | |
| - GLOBAL = 277, | |
| - UNSET = 278, | |
| - ISSET = 279, | |
| - EMPTY = 280, | |
| - SWITCH = 281, | |
| - ENDSWITCH = 282, | |
| - CASE = 283, | |
| - DEFAULT = 284, | |
| - BREAK = 285, | |
| - CONTINUE = 286, | |
| - FUNCTION = 287, | |
| - RETURN = 288, | |
| - CLASS = 289, | |
| - INTERFACE = 290, | |
| - EXTENDS = 291, | |
| - IMPLEMENTS = 292, | |
| - OBJECT_OPERATOR = 293, | |
| - HASH_ASSIGN = 294, | |
| - LIST = 295, | |
| - ARRAY = 296, | |
| - CLASS_SCOPE = 297, | |
| - PRINT = 298, | |
| - PLUS_EQ = 299, | |
| - MINUS_EQ = 300, | |
| - MUL_EQ = 301, | |
| - DIV_EQ = 302, | |
| - CONCAT_EQ = 303, | |
| - MOD_EQ = 304, | |
| - AND_EQ = 305, | |
| - OR_EQ = 306, | |
| - XOR_EQ = 307, | |
| - SL_EQ = 308, | |
| - SR_EQ = 309, | |
| - LOG_OR = 310, | |
| - LOG_XOR = 311, | |
| - LOG_AND = 312, | |
| - BOOLEAN_OR = 313, | |
| - BOOLEAN_AND = 314, | |
| - IS_EQ = 315, | |
| - IS_NOEQUAL = 316, | |
| - IS_IDENTICAL = 317, | |
| - IS_NOIDENTICAL = 318, | |
| - IS_SMALLER_OR_EQ = 319, | |
| - IS_GREATER_OR_EQ = 320, | |
| - SL = 321, | |
| - SR = 322, | |
| - INSTANCEOF = 323, | |
| - INC = 324, | |
| - DEC = 325, | |
| - INT_CAST = 326, | |
| - DOUBLE_CAST = 327, | |
| - STRING_CAST = 328, | |
| - ARRAY_CAST = 329, | |
| - OBJECT_CAST = 330, | |
| - BOOL_CAST = 331, | |
| - UNSET_CAST = 332, | |
| - NEW = 333, | |
| - CLONE = 334, | |
| - ELSEIF = 335, | |
| - ELSE = 336, | |
| - ENDIF = 337, | |
| - STATIC = 338, | |
| - ABSTRACT = 339, | |
| - FINAL = 340, | |
| - PRIVATE = 341, | |
| - PROTECTED = 342, | |
| - PUBLIC = 343, | |
| - START_SCRIPT = 344, | |
| - END_SCRIPT = 345 | |
| + YYEMPTY = -2, | |
| + YYEOF = 0, /* "end of file" */ | |
| + YYerror = 256, /* error */ | |
| + YYUNDEF = 257, /* "invalid token" */ | |
| + FNUMBER = 258, /* FNUMBER */ | |
| + DNUMBER = 259, /* DNUMBER */ | |
| + STRING = 260, /* STRING */ | |
| + IDENT = 261, /* IDENT */ | |
| + VARIABLE = 262, /* VARIABLE */ | |
| + T_ECHO = 263, /* T_ECHO */ | |
| + EXIT = 264, /* EXIT */ | |
| + IF = 265, /* IF */ | |
| + DO = 266, /* DO */ | |
| + WHILE = 267, /* WHILE */ | |
| + ENDWHILE = 268, /* ENDWHILE */ | |
| + FOR = 269, /* FOR */ | |
| + ENDFOR = 270, /* ENDFOR */ | |
| + FOREACH = 271, /* FOREACH */ | |
| + ENDFOREACH = 272, /* ENDFOREACH */ | |
| + DECLARE = 273, /* DECLARE */ | |
| + ENDDECLARE = 274, /* ENDDECLARE */ | |
| + AS = 275, /* AS */ | |
| + CONST = 276, /* CONST */ | |
| + GLOBAL = 277, /* GLOBAL */ | |
| + UNSET = 278, /* UNSET */ | |
| + ISSET = 279, /* ISSET */ | |
| + EMPTY = 280, /* EMPTY */ | |
| + SWITCH = 281, /* SWITCH */ | |
| + ENDSWITCH = 282, /* ENDSWITCH */ | |
| + CASE = 283, /* CASE */ | |
| + DEFAULT = 284, /* DEFAULT */ | |
| + BREAK = 285, /* BREAK */ | |
| + CONTINUE = 286, /* CONTINUE */ | |
| + FUNCTION = 287, /* FUNCTION */ | |
| + RETURN = 288, /* RETURN */ | |
| + CLASS = 289, /* CLASS */ | |
| + INTERFACE = 290, /* INTERFACE */ | |
| + EXTENDS = 291, /* EXTENDS */ | |
| + IMPLEMENTS = 292, /* IMPLEMENTS */ | |
| + OBJECT_OPERATOR = 293, /* OBJECT_OPERATOR */ | |
| + HASH_ASSIGN = 294, /* HASH_ASSIGN */ | |
| + LIST = 295, /* LIST */ | |
| + ARRAY = 296, /* ARRAY */ | |
| + CLASS_SCOPE = 297, /* CLASS_SCOPE */ | |
| + PRINT = 298, /* PRINT */ | |
| + PLUS_EQ = 299, /* PLUS_EQ */ | |
| + MINUS_EQ = 300, /* MINUS_EQ */ | |
| + MUL_EQ = 301, /* MUL_EQ */ | |
| + DIV_EQ = 302, /* DIV_EQ */ | |
| + CONCAT_EQ = 303, /* CONCAT_EQ */ | |
| + MOD_EQ = 304, /* MOD_EQ */ | |
| + AND_EQ = 305, /* AND_EQ */ | |
| + OR_EQ = 306, /* OR_EQ */ | |
| + XOR_EQ = 307, /* XOR_EQ */ | |
| + SL_EQ = 308, /* SL_EQ */ | |
| + SR_EQ = 309, /* SR_EQ */ | |
| + LOG_OR = 310, /* LOG_OR */ | |
| + LOG_XOR = 311, /* LOG_XOR */ | |
| + LOG_AND = 312, /* LOG_AND */ | |
| + BOOLEAN_OR = 313, /* BOOLEAN_OR */ | |
| + BOOLEAN_AND = 314, /* BOOLEAN_AND */ | |
| + IS_EQ = 315, /* IS_EQ */ | |
| + IS_NOEQUAL = 316, /* IS_NOEQUAL */ | |
| + IS_IDENTICAL = 317, /* IS_IDENTICAL */ | |
| + IS_NOIDENTICAL = 318, /* IS_NOIDENTICAL */ | |
| + IS_SMALLER_OR_EQ = 319, /* IS_SMALLER_OR_EQ */ | |
| + IS_GREATER_OR_EQ = 320, /* IS_GREATER_OR_EQ */ | |
| + SL = 321, /* SL */ | |
| + SR = 322, /* SR */ | |
| + INSTANCEOF = 323, /* INSTANCEOF */ | |
| + INC = 324, /* INC */ | |
| + DEC = 325, /* DEC */ | |
| + INT_CAST = 326, /* INT_CAST */ | |
| + DOUBLE_CAST = 327, /* DOUBLE_CAST */ | |
| + STRING_CAST = 328, /* STRING_CAST */ | |
| + ARRAY_CAST = 329, /* ARRAY_CAST */ | |
| + OBJECT_CAST = 330, /* OBJECT_CAST */ | |
| + BOOL_CAST = 331, /* BOOL_CAST */ | |
| + UNSET_CAST = 332, /* UNSET_CAST */ | |
| + NEW = 333, /* NEW */ | |
| + CLONE = 334, /* CLONE */ | |
| + ELSEIF = 335, /* ELSEIF */ | |
| + ELSE = 336, /* ELSE */ | |
| + ENDIF = 337, /* ENDIF */ | |
| + STATIC = 338, /* STATIC */ | |
| + ABSTRACT = 339, /* ABSTRACT */ | |
| + FINAL = 340, /* FINAL */ | |
| + PRIVATE = 341, /* PRIVATE */ | |
| + PROTECTED = 342, /* PROTECTED */ | |
| + PUBLIC = 343, /* PUBLIC */ | |
| + START_SCRIPT = 344, /* START_SCRIPT */ | |
| + END_SCRIPT = 345 /* END_SCRIPT */ | |
| }; | |
| + typedef enum yytokentype yytoken_kind_t; | |
| #endif | |
| /* Value type. */ | |
| #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
| - | |
| union YYSTYPE | |
| { | |
| -#line 67 "php_parser.y" /* yacc.c:1909 */ | |
| +#line 67 "php_parser.y" | |
| PHP_SYN_NODE *syn_node; | |
| PHP_EXP_NODE *exp_node; | |
| char str_val[256]; | |
| -#line 152 "php_parser.h" /* yacc.c:1909 */ | |
| -}; | |
| +#line 161 "php_parser.h" | |
| +}; | |
| typedef union YYSTYPE YYSTYPE; | |
| # define YYSTYPE_IS_TRIVIAL 1 | |
| # define YYSTYPE_IS_DECLARED 1 | |
| @@ -159,6 +168,8 @@ typedef union YYSTYPE YYSTYPE; | |
| extern YYSTYPE phplval; | |
| + | |
| int phpparse (void); | |
| + | |
| #endif /* !YY_PHP_PHP_PARSER_H_INCLUDED */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment