diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e05699ff45..537c5a2459 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,7 +14,7 @@ jobs: - name: Install Codelite's dependencies run: | # brew update && brew upgrade # fails somehow - brew install git cmake libssh hunspell flex + brew install git cmake libssh hunspell bison flex # WxWidgets - name: Checkout diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml index 83fb8d9439..f550c95d7e 100644 --- a/.github/workflows/msys2.yml +++ b/.github/workflows/msys2.yml @@ -11,14 +11,21 @@ jobs: steps: - uses: msys2/setup-msys2@v2 - - # pre-requires - - name: Install dependencies - shell: msys2 {0} - run: | - # pacman -Syu --noconfirm # Fail, requires to close this process - pacman -S --noconfirm mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-make mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-clang-tools-extra - pacman -S --noconfirm mingw-w64-clang-x86_64-zlib mingw-w64-clang-x86_64-libssh mingw-w64-clang-x86_64-hunspell mingw-w64-clang-x86_64-openssl mingw-w64-clang-x86_64-sqlite3 flex + with: + msystem: clang64 + update: true + install: >- + mingw-w64-clang-x86_64-cmake + mingw-w64-clang-x86_64-make + mingw-w64-clang-x86_64-clang + mingw-w64-clang-x86_64-clang-tools-extra + mingw-w64-clang-x86_64-zlib + mingw-w64-clang-x86_64-libssh + mingw-w64-clang-x86_64-hunspell + mingw-w64-clang-x86_64-openssl + mingw-w64-clang-x86_64-sqlite3 + bison + flex # WxWidgets - name: Checkout @@ -34,8 +41,8 @@ jobs: run: | mkdir wxWidgets/build-release cd wxWidgets/build-release - PATH="/clang64/bin:$PATH" cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$HOME/root" -DwxBUILD_DEBUG_LEVEL=0 -DwxBUILD_MONOLITHIC=1 -DwxBUILD_SAMPLES=SOME -DwxUSE_STL=1 - PATH="/clang64/bin:$PATH" mingw32-make -j$(nproc) && PATH="/clang64/bin:$PATH" mingw32-make install + cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$HOME/root" -DwxBUILD_DEBUG_LEVEL=0 -DwxBUILD_MONOLITHIC=1 -DwxBUILD_SAMPLES=SOME -DwxUSE_STL=1 + mingw32-make -j$(nproc) && PATH="/clang64/bin:$PATH" mingw32-make install # wx-config-msys2 - name: Checkout @@ -49,8 +56,8 @@ jobs: run: | mkdir wx-config-msys2/build-release cd wx-config-msys2/build-release - PATH="/clang64/bin:$PATH" cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/root - PATH="/clang64/bin:$PATH" mingw32-make -j$(nproc) install + cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$HOME/root" + mingw32-make -j$(nproc) install #add $HOME/root/bin to PATH # Codelite @@ -64,8 +71,8 @@ jobs: run: | mkdir build-release cd build-release - MSYS2_BASE=/d/a/_temp/msys64 PATH="/clang64/bin:$HOME/root/bin:$PATH" cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DWXWIN="$HOME/root" -Wno-dev - PATH="/clang64/bin:$HOME/root/bin:$PATH" mingw32-make -j$(nproc) install + MSYS2_BASE=/d/a/_temp/msys64 PATH="$HOME/root/bin:$PATH" cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DWXWIN="$HOME/root" -Wno-dev + PATH="$HOME/root/bin:$PATH" mingw32-make -j$(nproc) install # Upload artefact - name: artifact diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ecf8ff79c4..a1c8aa98f6 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -31,7 +31,7 @@ jobs: # Codelite - name: install Codelite's dependencies - run: sudo apt-get install build-essential cmake git libpcre2-dev libsqlite3-dev libssh-dev flex + run: sudo apt-get install build-essential cmake git libpcre2-dev libsqlite3-dev libssh-dev bison flex - name: Checkout Codelite uses: actions/checkout@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 95fde38490..002a39dedb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,23 @@ if(NOT SQLite3_FOUND) endif() endif() +find_package(BISON REQUIRED) + +if(NOT BISON_FOUND) + if(UNIX) + message(FATAL_ERROR " **** Could not find flex. Please install bison package") + elseif(APPLE) + message(FATAL_ERROR " **** Could not find flex. Please install bison via brew") + elseif(MINGW) + message( + FATAL_ERROR + " **** Could not find flex. Please install bison package: pacman -S bison" + ) + else() + message(FATAL_ERROR " **** Could not find bison. Please install bison package") + endif() +endif() + find_package(FLEX REQUIRED) if(NOT FLEX_FOUND) @@ -892,6 +909,7 @@ add_subdirectory(sdk/wxsqlite3) add_subdirectory(sdk/wxshapeframework) add_subdirectory(sdk/databaselayer) add_subdirectory(yaml-cpp) +add_subdirectory(CxxParser) add_subdirectory(CodeLite) add_subdirectory(Plugin) add_subdirectory(PCH) diff --git a/CodeLite/CMakeLists.txt b/CodeLite/CMakeLists.txt index ead3093ea2..36e2d34921 100644 --- a/CodeLite/CMakeLists.txt +++ b/CodeLite/CMakeLists.txt @@ -104,6 +104,7 @@ target_link_libraries( ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" ${SQLite3_LIBRARIES} + libCxxParser wxsqlite3 ${LIBSSH_LIB} ${GTK_LIBS} diff --git a/CodeLite/cpp_expr_lexer.cpp b/CodeLite/cpp_expr_lexer.cpp deleted file mode 100644 index 932226e357..0000000000 --- a/CodeLite/cpp_expr_lexer.cpp +++ /dev/null @@ -1,2662 +0,0 @@ -#define yy_create_buffer cl_expr__create_buffer -#define yy_delete_buffer cl_expr__delete_buffer -#define yy_scan_buffer cl_expr__scan_buffer -#define yy_scan_string cl_expr__scan_string -#define yy_scan_bytes cl_expr__scan_bytes -#define yy_flex_debug cl_expr__flex_debug -#define yy_init_buffer cl_expr__init_buffer -#define yy_flush_buffer cl_expr__flush_buffer -#define yy_load_buffer_state cl_expr__load_buffer_state -#define yy_switch_to_buffer cl_expr__switch_to_buffer -#define yyin cl_expr_in -#define yyleng cl_expr_leng -#define yylex cl_expr_lex -#define yyout cl_expr_out -#define yyrestart cl_expr_restart -#define yytext cl_expr_text -#define yylineno cl_expr_lineno -#define yywrap cl_expr_wrap - -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#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. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384*5 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - 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 - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int 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 int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* 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 yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst 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 = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 146 -#define YY_END_OF_BUFFER 147 -static yyconst short int yy_acclist[618] = - { 0, - 147, 133, 146, 3, 133, 146, 5, 146, 4, 133, - 146, 97, 133, 146, 133, 146, 99, 133, 146, 92, - 133, 146, 133, 146, 83, 133, 146, 84, 133, 146, - 93, 133, 146, 94, 133, 146, 85, 133, 146, 95, - 133, 146, 91, 133, 146, 98, 133, 146, 78, 133, - 146, 77, 133, 146, 105, 133, 146, 106, 133, 146, - 100, 133, 146, 107, 133, 146, 101, 133, 146, 104, - 133, 146, 76, 133, 146, 76, 133, 146, 89, 133, - 146, 90, 133, 146, 102, 133, 146, 76, 133, 146, - 76, 133, 146, 76, 133, 146, 76, 133, 146, 76, - - 133, 146, 76, 133, 146, 76, 133, 146, 76, 133, - 146, 76, 133, 146, 76, 133, 146, 76, 133, 146, - 76, 133, 146, 76, 133, 146, 76, 133, 146, 76, - 133, 146, 76, 133, 146, 76, 133, 146, 76, 133, - 146, 87, 133, 146, 103, 133, 146, 88, 133, 146, - 96, 133, 146, 86, 133, 146, 141, 146, 134, 146, - 139, 141, 146, 135, 141, 146, 139, 141, 146, 140, - 146, 137, 146, 138, 140, 146, 143, 146, 142, 146, - 145, 146, 146, 145, 146, 3, 5, 4, 119, 82, - 124, 120, 129, 122, 112, 125, 113, 126, 110, 108, - - 80, 1, 2, 123, 80, 78, 78, 78, 77, 77, - 77, 109, 114, 116, 118, 117, 115, 76, 130, 76, - 76, 76, 76, 76, 76, 76, 76, 15, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 26, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 131, 121, 139, 139, 138, 144, - 81, 111, 132, 80, 80, 78, 79, 77, 127, 128, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - - 24, 76, 76, 76, 76, 76, 76, 76, 30, 76, - 76, 76, 76, 57, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 139, 80, 79, 79, 6, 76, 33, - 76, 76, 8, 76, 76, 9, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 17, 76, 18, 76, 76, - 20, 76, 76, 76, 76, 76, 76, 25, 76, 76, - 76, 76, 76, 31, 76, 32, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - - 76, 76, 76, 76, 65, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 47, 76, 76, 76, 139, 79, - 7, 76, 75, 76, 52, 76, 10, 76, 76, 76, - 76, 76, 76, 76, 19, 76, 21, 76, 76, 61, - 76, 23, 76, 76, 27, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 37, 76, 76, 76, 76, 76, 76, 76, 76, 74, - 76, 76, 76, 76, 44, 76, 45, 76, 76, 73, - 76, 76, 76, 49, 76, 139, 76, 76, 76, 13, - 76, 54, 76, 16, 76, 76, 22, 76, 55, 76, - - 28, 76, 76, 56, 76, 76, 76, 76, 76, 34, - 76, 76, 76, 64, 76, 76, 76, 36, 76, 38, - 76, 51, 76, 39, 76, 40, 76, 41, 76, 42, - 76, 76, 50, 76, 76, 76, 76, 76, 76, 136, - 139, 76, 76, 12, 76, 14, 76, 76, 29, 76, - 76, 76, 76, 76, 63, 76, 76, 76, 76, 76, - 76, 43, 76, 76, 76, 66, 76, 76, 76, 11, - 76, 76, 76, 58, 76, 59, 76, 60, 76, 76, - 35, 76, 76, 76, 67, 76, 68, 76, 46, 76, - 48, 76, 76, 76, 53, 76, 62, 76, 76, 76, - - 71, 76, 76, 76, 76, 76, 76, 70, 76, 69, - 76, 76, 76, 76, 76, 72, 76 - } ; - -static yyconst short int yy_accept[467] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 7, 9, 12, 15, 17, 20, 23, - 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, - 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, - 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, - 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, - 145, 148, 151, 154, 157, 159, 161, 164, 167, 170, - 172, 174, 177, 179, 181, 183, 184, 186, 187, 188, - 188, 189, 190, 190, 191, 191, 192, 193, 194, 194, - 194, 195, 196, 197, 198, 199, 200, 201, 201, 202, - - 203, 204, 205, 206, 207, 207, 207, 208, 209, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 219, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 271, 271, 272, 272, 272, 273, 274, 274, - 275, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - - 294, 295, 296, 297, 298, 299, 300, 301, 303, 304, - 305, 306, 307, 308, 309, 311, 312, 313, 314, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, 339, 340, 341, 342, 343, 344, 345, 345, - 345, 345, 345, 345, 346, 347, 348, 350, 352, 353, - 355, 356, 358, 359, 360, 361, 362, 363, 364, 365, - 366, 368, 370, 371, 373, 374, 375, 376, 377, 378, - 380, 381, 382, 383, 384, 386, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - - 402, 403, 404, 405, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 417, 418, 419, 420, 420, 420, 420, - 420, 421, 423, 425, 427, 429, 430, 431, 432, 433, - 434, 435, 437, 439, 440, 442, 444, 445, 447, 448, - 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 463, 464, 465, 466, 467, 468, 469, - 470, 472, 473, 474, 475, 477, 479, 480, 482, 483, - 484, 486, 487, 488, 489, 490, 492, 494, 496, 497, - 499, 501, 503, 504, 506, 507, 508, 509, 510, 512, - 513, 514, 516, 517, 518, 520, 522, 524, 526, 528, - - 530, 532, 533, 535, 536, 537, 538, 539, 540, 542, - 543, 544, 546, 548, 549, 551, 552, 553, 554, 555, - 557, 558, 559, 560, 561, 562, 564, 565, 566, 568, - 569, 570, 572, 573, 574, 576, 578, 580, 581, 583, - 584, 585, 587, 589, 591, 593, 594, 595, 597, 599, - 600, 601, 603, 604, 605, 606, 607, 608, 610, 612, - 613, 614, 615, 616, 618, 618 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 7, 8, 9, 10, 1, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 23, - 23, 23, 23, 23, 23, 24, 24, 25, 26, 27, - 28, 29, 30, 1, 31, 31, 31, 31, 32, 33, - 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, - 34, 34, 34, 34, 36, 34, 34, 37, 34, 34, - 38, 39, 40, 41, 42, 1, 43, 44, 45, 46, - - 47, 48, 49, 50, 51, 34, 52, 53, 54, 55, - 56, 57, 34, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[71] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 5, 6, 1, 1, 1, 1, 1, 3, - 6, 6, 6, 7, 7, 7, 7, 1, 3, 1, - 1, 7, 5, 5, 6, 6, 6, 5, 7, 7, - 7, 7, 7, 7, 8, 7, 7, 8, 7, 8, - 7, 8, 7, 8, 7, 7, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[478] = - { 0, - 0, 811, 70, 0, 140, 0, 817, 816, 208, 209, - 818, 822, 211, 822, 224, 789, 210, 788, 208, 776, - 822, 822, 786, 204, 822, 214, 224, 229, 238, 231, - 788, 822, 195, 784, 206, 822, 0, 228, 822, 822, - 783, 749, 213, 233, 212, 240, 250, 753, 217, 231, - 209, 243, 236, 761, 259, 264, 257, 262, 757, 822, - 211, 822, 822, 822, 822, 822, 0, 822, 759, 822, - 822, 0, 822, 822, 822, 822, 784, 321, 822, 328, - 334, 822, 281, 822, 320, 822, 822, 822, 225, 322, - 822, 822, 822, 822, 822, 788, 822, 783, 324, 822, - - 822, 822, 328, 365, 346, 385, 260, 314, 0, 393, - 318, 320, 822, 774, 822, 822, 822, 773, 0, 344, - 761, 822, 739, 742, 750, 221, 753, 752, 739, 342, - 732, 737, 323, 319, 733, 730, 734, 732, 729, 735, - 725, 348, 346, 729, 728, 728, 718, 733, 732, 368, - 734, 371, 721, 361, 378, 725, 721, 347, 720, 716, - 384, 721, 713, 311, 719, 822, 822, 0, 721, 0, - 822, 425, 0, 822, 410, 0, 822, 822, 433, 822, - 415, 436, 822, 409, 822, 822, 822, 712, 714, 723, - 718, 719, 705, 703, 382, 410, 714, 716, 716, 710, - - 710, 705, 701, 698, 706, 709, 708, 0, 703, 693, - 701, 701, 693, 694, 0, 697, 694, 695, 0, 683, - 682, 690, 676, 677, 683, 684, 679, 672, 674, 676, - 683, 669, 667, 667, 669, 666, 668, 676, 675, 674, - 664, 668, 663, 657, 670, 672, 661, 662, 454, 485, - 452, 521, 444, 457, 436, 361, 0, 0, 660, 0, - 661, 0, 651, 649, 657, 646, 651, 645, 651, 649, - 0, 0, 654, 0, 643, 642, 646, 638, 642, 0, - 648, 648, 633, 638, 0, 0, 633, 648, 420, 636, - 646, 641, 636, 627, 625, 626, 623, 635, 440, 630, - - 635, 634, 625, 0, 614, 634, 440, 627, 619, 624, - 623, 610, 0, 610, 622, 613, 474, 0, 472, 0, - 822, 0, 0, 0, 625, 611, 612, 617, 616, 615, - 610, 0, 0, 605, 0, 0, 613, 0, 610, 611, - 609, 598, 594, 597, 601, 608, 590, 604, 603, 587, - 599, 590, 0, 598, 583, 594, 596, 580, 589, 595, - 0, 577, 589, 592, 0, 0, 579, 0, 590, 581, - 0, 577, 578, 557, 557, 551, 0, 0, 550, 0, - 0, 0, 540, 0, 520, 506, 518, 513, 0, 511, - 497, 0, 509, 497, 0, 0, 0, 0, 509, 0, - - 0, 490, 0, 501, 494, 500, 493, 489, 0, 498, - 493, 0, 0, 497, 0, 493, 479, 490, 488, 0, - 480, 468, 468, 478, 475, 0, 474, 474, 0, 472, - 456, 0, 469, 465, 0, 0, 0, 460, 0, 446, - 460, 0, 0, 0, 0, 442, 458, 0, 0, 453, - 440, 0, 439, 428, 427, 391, 350, 0, 0, 313, - 274, 248, 228, 0, 822, 569, 577, 585, 593, 597, - 601, 605, 611, 617, 621, 623, 625 - } ; - -static yyconst short int yy_def[478] = - { 0, - 465, 1, 465, 3, 465, 5, 466, 466, 467, 467, - 465, 465, 465, 465, 465, 465, 468, 465, 465, 469, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 470, 470, 465, 465, - 465, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 465, - 465, 465, 465, 465, 465, 465, 471, 465, 471, 465, - 465, 472, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 468, 465, 473, 465, 465, 465, 469, 474, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - - 465, 465, 465, 465, 465, 465, 465, 465, 475, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 470, 468, - 469, 465, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 465, 465, 471, 471, 472, - 465, 468, 476, 465, 469, 477, 465, 465, 465, 465, - 465, 465, 465, 475, 465, 465, 465, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 471, 468, 468, - 469, 469, 465, 465, 465, 465, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 471, 468, 250, 469, 252, - 465, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 471, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - - 470, 470, 470, 470, 470, 470, 470, 470, 471, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 0, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465 - } ; - -static yyconst short int yy_nxt[893] = - { 0, - 12, 13, 14, 15, 15, 15, 13, 16, 17, 12, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, - 37, 37, 37, 37, 38, 37, 37, 39, 12, 40, - 41, 37, 42, 43, 44, 45, 46, 47, 48, 37, - 49, 37, 50, 37, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 37, 37, 37, 60, 61, 62, 63, - 65, 65, 66, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - - 67, 67, 67, 67, 67, 67, 67, 65, 68, 65, - 65, 67, 67, 67, 67, 69, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 65, 65, 65, 65, - 70, 70, 71, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 72, 72, 72, 72, 72, 72, 72, 70, 70, 70, - 70, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - - 72, 72, 72, 72, 72, 72, 70, 70, 70, 70, - 76, 76, 78, 79, 80, 80, 80, 78, 84, 87, - 92, 114, 115, 77, 77, 80, 79, 81, 81, 81, - 80, 93, 94, 117, 118, 88, 120, 174, 166, 97, - 121, 95, 96, 98, 100, 99, 99, 99, 85, 101, - 103, 146, 110, 110, 110, 147, 102, 103, 130, 104, - 104, 105, 106, 90, 142, 111, 112, 131, 124, 106, - 125, 143, 107, 108, 109, 126, 132, 106, 167, 191, - 192, 144, 127, 111, 106, 128, 145, 464, 129, 84, - 107, 112, 133, 150, 134, 183, 151, 135, 108, 148, - - 137, 109, 138, 136, 149, 139, 463, 140, 153, 154, - 157, 161, 163, 158, 159, 162, 462, 164, 155, 85, - 183, 156, 78, 79, 80, 80, 80, 78, 160, 80, - 79, 80, 80, 80, 80, 80, 79, 81, 81, 81, - 80, 172, 172, 175, 175, 99, 99, 99, 183, 99, - 99, 99, 84, 185, 185, 179, 180, 461, 180, 179, - 180, 245, 180, 246, 202, 103, 183, 105, 105, 105, - 179, 180, 185, 200, 179, 180, 180, 106, 185, 203, - 180, 201, 85, 173, 103, 176, 104, 104, 105, 196, - 213, 460, 106, 211, 197, 321, 106, 236, 214, 107, - - 108, 181, 212, 181, 237, 215, 182, 182, 182, 230, - 222, 106, 103, 321, 110, 110, 110, 107, 223, 226, - 232, 227, 174, 224, 106, 108, 231, 111, 112, 240, - 228, 251, 251, 84, 241, 233, 182, 182, 182, 106, - 264, 265, 242, 255, 256, 111, 249, 249, 90, 253, - 459, 253, 266, 112, 254, 254, 254, 182, 182, 182, - 267, 255, 84, 85, 174, 254, 254, 254, 180, 256, - 180, 321, 344, 319, 319, 317, 317, 345, 254, 254, - 254, 355, 84, 180, 174, 363, 458, 457, 180, 180, - 90, 180, 85, 84, 364, 356, 321, 456, 455, 454, - - 453, 452, 451, 450, 180, 449, 318, 318, 318, 180, - 90, 448, 85, 447, 446, 318, 318, 318, 445, 444, - 443, 442, 441, 85, 440, 439, 438, 318, 318, 318, - 318, 318, 318, 174, 437, 436, 435, 434, 433, 432, - 431, 430, 320, 320, 320, 429, 428, 427, 426, 425, - 424, 320, 320, 320, 423, 422, 421, 420, 419, 90, - 418, 417, 416, 320, 320, 320, 320, 320, 320, 73, - 73, 73, 73, 73, 73, 73, 73, 75, 75, 75, - 75, 75, 75, 75, 75, 83, 415, 83, 83, 83, - 83, 83, 83, 89, 414, 89, 413, 89, 89, 89, - - 89, 119, 119, 119, 119, 168, 168, 168, 168, 170, - 170, 170, 170, 83, 83, 83, 412, 411, 83, 89, - 89, 89, 410, 409, 89, 184, 184, 250, 250, 252, - 252, 408, 407, 406, 405, 404, 403, 402, 401, 400, - 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, - 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, - 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, - 369, 368, 367, 366, 365, 362, 361, 360, 359, 358, - 357, 354, 353, 352, 351, 350, 349, 348, 347, 346, - 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, - - 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, - 323, 322, 316, 315, 314, 313, 312, 311, 310, 309, - 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, - 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, - 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, - 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, - 268, 263, 262, 261, 260, 259, 258, 257, 248, 247, - 244, 243, 239, 238, 235, 234, 229, 225, 221, 220, - 219, 218, 217, 216, 210, 209, 208, 207, 206, 205, - 204, 199, 198, 195, 194, 193, 190, 189, 188, 90, - - 187, 186, 178, 177, 171, 169, 165, 152, 141, 123, - 122, 116, 113, 91, 90, 86, 82, 465, 74, 74, - 64, 11, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465 - - } ; - -static yyconst short int yy_chk[893] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 9, 10, 13, 13, 13, 13, 13, 13, 17, 19, - 24, 33, 33, 9, 10, 15, 15, 15, 15, 15, - 15, 24, 26, 35, 35, 19, 38, 89, 61, 27, - 38, 26, 26, 27, 28, 27, 27, 27, 17, 28, - 30, 51, 30, 30, 30, 51, 28, 29, 45, 29, - 29, 29, 30, 89, 49, 30, 30, 45, 43, 29, - 43, 49, 29, 29, 29, 44, 45, 30, 61, 126, - 126, 50, 44, 30, 29, 44, 50, 463, 44, 83, - 29, 30, 46, 53, 46, 107, 53, 46, 29, 52, - - 47, 29, 47, 46, 52, 47, 462, 47, 55, 55, - 56, 57, 58, 56, 56, 57, 461, 58, 55, 83, - 107, 55, 78, 78, 78, 78, 78, 78, 56, 80, - 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, - 81, 85, 85, 90, 90, 99, 99, 99, 108, 103, - 103, 103, 120, 111, 112, 99, 99, 460, 99, 103, - 103, 164, 103, 164, 134, 105, 108, 105, 105, 105, - 99, 99, 112, 133, 103, 103, 99, 105, 111, 134, - 103, 133, 120, 85, 104, 90, 104, 104, 104, 130, - 143, 457, 105, 142, 130, 256, 104, 158, 143, 104, - - 104, 106, 142, 106, 158, 143, 106, 106, 106, 154, - 150, 104, 110, 256, 110, 110, 110, 104, 150, 152, - 155, 152, 175, 150, 110, 104, 154, 110, 110, 161, - 152, 175, 175, 172, 161, 155, 181, 181, 181, 110, - 195, 195, 161, 184, 184, 110, 172, 172, 175, 179, - 456, 179, 196, 110, 179, 179, 179, 182, 182, 182, - 196, 184, 249, 172, 251, 253, 253, 253, 182, 184, - 182, 255, 289, 251, 251, 249, 249, 289, 254, 254, - 254, 299, 317, 182, 319, 307, 455, 454, 182, 254, - 251, 254, 249, 250, 307, 299, 255, 453, 451, 450, - - 447, 446, 441, 440, 254, 438, 250, 250, 250, 254, - 319, 434, 317, 433, 431, 250, 250, 250, 430, 428, - 427, 425, 424, 250, 423, 422, 421, 250, 250, 250, - 250, 250, 250, 252, 419, 418, 417, 416, 414, 411, - 410, 408, 252, 252, 252, 407, 406, 405, 404, 402, - 399, 252, 252, 252, 394, 393, 391, 390, 388, 252, - 387, 386, 385, 252, 252, 252, 252, 252, 252, 466, - 466, 466, 466, 466, 466, 466, 466, 467, 467, 467, - 467, 467, 467, 467, 467, 468, 383, 468, 468, 468, - 468, 468, 468, 469, 379, 469, 376, 469, 469, 469, - - 469, 470, 470, 470, 470, 471, 471, 471, 471, 472, - 472, 472, 472, 473, 473, 473, 375, 374, 473, 474, - 474, 474, 373, 372, 474, 475, 475, 476, 476, 477, - 477, 370, 369, 367, 364, 363, 362, 360, 359, 358, - 357, 356, 355, 354, 352, 351, 350, 349, 348, 347, - 346, 345, 344, 343, 342, 341, 340, 339, 337, 334, - 331, 330, 329, 328, 327, 326, 325, 316, 315, 314, - 312, 311, 310, 309, 308, 306, 305, 303, 302, 301, - 300, 298, 297, 296, 295, 294, 293, 292, 291, 290, - 288, 287, 284, 283, 282, 281, 279, 278, 277, 276, - - 275, 273, 270, 269, 268, 267, 266, 265, 264, 263, - 261, 259, 248, 247, 246, 245, 244, 243, 242, 241, - 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, - 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, - 220, 218, 217, 216, 214, 213, 212, 211, 210, 209, - 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, - 197, 194, 193, 192, 191, 190, 189, 188, 169, 165, - 163, 162, 160, 159, 157, 156, 153, 151, 149, 148, - 147, 146, 145, 144, 141, 140, 139, 138, 137, 136, - 135, 132, 131, 129, 128, 127, 125, 124, 123, 121, - - 118, 114, 98, 96, 77, 69, 59, 54, 48, 42, - 41, 34, 31, 23, 20, 18, 16, 11, 8, 7, - 2, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465 - - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#define INITIAL 0 -/* Included code before lex code */ -/*************** Includes and Defines *****************************/ - - -#include "map" -#include "cpp_lexer.h" // YACC generated definitions based on C++ grammar -#include "errno.h" - -#define YYSTYPE std::string -#define ECHO - -#include "string" -#include -#include -#include - -extern std::string cl_expr_lval; -extern std::string cl_var_lval; - -bool setExprLexerInput(const std::string &in); -void cl_expr_lex_clean(); - -bool exprIsaTYPE(char *string); -bool exprIsaMACRO(char *string); -static bool defineFound = false; - -/* Prototypes */ -#define WHITE_RETURN(x) /* do nothing */ - -#define PA_KEYWORD_RETURN(x) RETURN_VAL(x) /* standard C PArser Keyword */ -#define CPP_KEYWORD_RETURN(x) PA_KEYWORD_RETURN(x) /* C++ keyword */ -#define PPPA_KEYWORD_RETURN(x) RETURN_VAL(x) /* both PreProcessor and PArser keyword */ -#define PP_KEYWORD_RETURN(x) IDENTIFIER_RETURN() - -#define IDENTIFIER_RETURN(){\ - if(exprIsaTYPE(yytext)){\ - RETURN_VAL(LE_TYPEDEFname);\ - }else if(exprIsaMACRO(yytext)){\ - RETURN_VAL(LE_MACRO);\ - }else{ RETURN_VAL(LE_IDENTIFIER);}\ - } - - -#define PPOP_RETURN(x) RETURN_VAL((int)*yytext) /* PreProcess and Parser operator */ -#define NAMED_PPOP_RETURN(x) RETURN_VAL(x) -#define ASCIIOP_RETURN(x) RETURN_VAL((int)*yytext) /* a single character operator */ -#define NAMEDOP_RETURN(x) RETURN_VAL(x) /* a multichar operator, with a name */ - -#define NUMERICAL_RETURN(x) RETURN_VAL(x) /* some sort of constant */ -#define LITERAL_RETURN(x) RETURN_VAL(x) /* a string literal */ -#define C_COMMENT_RETURN(x) RETURN_VAL(x) /* C Style comment */ -#define RETURN_VAL(x) {\ - cl_expr_lval = yytext;\ - return(x);} -#define PREPR 1 - -#define WRAP_PREP 2 - -#define CPP_COMMENT 3 - -#define C_COMMENT 4 - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 822 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - ++yylineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -{ - BEGIN C_COMMENT; - } - YY_BREAK -case 2: -YY_RULE_SETUP -{ - BEGIN CPP_COMMENT; - } - YY_BREAK -case 3: -YY_RULE_SETUP -{ - WHITE_RETURN(' '); - } - YY_BREAK -case 4: -YY_RULE_SETUP -{ - WHITE_RETURN(' '); - } - YY_BREAK -case 5: -YY_RULE_SETUP -{ - WHITE_RETURN('\n'); - } - YY_BREAK -case 6: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_AUTO);} - YY_BREAK -case 7: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_BREAK);} - YY_BREAK -case 8: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CASE);} - YY_BREAK -case 9: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CHAR);} - YY_BREAK -case 10: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CONST);} - YY_BREAK -case 11: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CONTINUE);} - YY_BREAK -case 12: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DEFAULT);} - YY_BREAK -case 13: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_DEFINE);} - YY_BREAK -case 14: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_OPDEFINED);} - YY_BREAK -case 15: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DO);} - YY_BREAK -case 16: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DOUBLE);} - YY_BREAK -case 17: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ELIF);} - YY_BREAK -case 18: -YY_RULE_SETUP -{PPPA_KEYWORD_RETURN(LE_ELSE);} - YY_BREAK -case 19: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ENDIF);} - YY_BREAK -case 20: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_ENUM);} - YY_BREAK -case 21: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ERROR);} - YY_BREAK -case 22: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_EXTERN);} - YY_BREAK -case 23: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_FLOAT);} - YY_BREAK -case 24: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_FOR);} - YY_BREAK -case 25: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_GOTO);} - YY_BREAK -case 26: -YY_RULE_SETUP -{PPPA_KEYWORD_RETURN(LE_IF);} - YY_BREAK -case 27: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_IFDEF);} - YY_BREAK -case 28: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_IFNDEF);} - YY_BREAK -case 29: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_INCLUDE); } - YY_BREAK -case 30: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_INT);} - YY_BREAK -case 31: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_LINE);} - YY_BREAK -case 32: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_LONG);} - YY_BREAK -case 33: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_BOOL);} - YY_BREAK -case 34: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_PRAGMA);} - YY_BREAK -case 35: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_REGISTER);} - YY_BREAK -case 36: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_RETURN);} - YY_BREAK -case 37: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SHORT);} - YY_BREAK -case 38: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIGNED);} - YY_BREAK -case 39: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIZEOF);} - YY_BREAK -case 40: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_STATIC);} - YY_BREAK -case 41: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_STRUCT);} - YY_BREAK -case 42: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SWITCH);} - YY_BREAK -case 43: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_TYPEDEF);} - YY_BREAK -case 44: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_UNDEF);} - YY_BREAK -case 45: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_UNION);} - YY_BREAK -case 46: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_UNSIGNED);} - YY_BREAK -case 47: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_VOID);} - YY_BREAK -case 48: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_VOLATILE);} - YY_BREAK -case 49: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_WHILE);} - YY_BREAK -case 50: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_TIME_T);} - YY_BREAK -case 51: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIZE_T);} - YY_BREAK -case 52: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CLASS);} - YY_BREAK -case 53: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_NAMESPACE);} - YY_BREAK -case 54: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DELETE);} - YY_BREAK -case 55: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_FRIEND);} - YY_BREAK -case 56: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_INLINE);} - YY_BREAK -case 57: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_NEW);} - YY_BREAK -case 58: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OPERATOR);} - YY_BREAK -case 59: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OVERLOAD);} - YY_BREAK -case 60: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OVERRIDE);} - YY_BREAK -case 61: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_FINAL);} - YY_BREAK -case 62: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PROTECTED);} - YY_BREAK -case 63: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PRIVATE);} - YY_BREAK -case 64: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PUBLIC);} - YY_BREAK -case 65: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_THIS);} - YY_BREAK -case 66: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_VIRTUAL);} - YY_BREAK -case 67: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_TEMPLATE);} - YY_BREAK -case 68: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_TYPENAME);} - YY_BREAK -case 69: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DYNAMIC_CAST);} - YY_BREAK -case 70: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_STATIC_CAST);} - YY_BREAK -case 71: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CONST_CAST);} - YY_BREAK -case 72: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_REINTERPRET_CAST);} - YY_BREAK -case 73: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_USING);} - YY_BREAK -case 74: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_THROW);} - YY_BREAK -case 75: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CATCH);} - YY_BREAK -case 76: -YY_RULE_SETUP -{IDENTIFIER_RETURN();} - YY_BREAK -case 77: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_INTEGERconstant);} - YY_BREAK -case 78: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_OCTALconstant);} - YY_BREAK -case 79: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_HEXconstant);} - YY_BREAK -case 80: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_FLOATINGconstant);} - YY_BREAK -case 81: -YY_RULE_SETUP -{ - NUMERICAL_RETURN(LE_CHARACTERconstant); - } - YY_BREAK -case 82: -YY_RULE_SETUP -{ - LITERAL_RETURN(LE_STRINGliteral);} - YY_BREAK -case 83: -YY_RULE_SETUP -{PPOP_RETURN(LE_LP);} - YY_BREAK -case 84: -YY_RULE_SETUP -{PPOP_RETURN(LE_RP);} - YY_BREAK -case 85: -YY_RULE_SETUP -{PPOP_RETURN(LE_COMMA);} - YY_BREAK -case 86: -YY_RULE_SETUP -{BEGIN PREPR;} - YY_BREAK -case 87: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LC);} - YY_BREAK -case 88: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_RC);} - YY_BREAK -case 89: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LB);} - YY_BREAK -case 90: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_RB);} - YY_BREAK -case 91: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_DOT);} - YY_BREAK -case 92: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_AND);} - YY_BREAK -case 93: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_STAR);} - YY_BREAK -case 94: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_PLUS);} - YY_BREAK -case 95: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_MINUS);} - YY_BREAK -case 96: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_NEGATE);} - YY_BREAK -case 97: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_NOT);} - YY_BREAK -case 98: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_DIV);} - YY_BREAK -case 99: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_MOD);} - YY_BREAK -case 100: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LT);} - YY_BREAK -case 101: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_GT);} - YY_BREAK -case 102: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_XOR);} - YY_BREAK -case 103: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_PIPE);} - YY_BREAK -case 104: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_QUESTION);} - YY_BREAK -case 105: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_COLON);} - YY_BREAK -case 106: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_SEMICOLON);} - YY_BREAK -case 107: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_ASSIGN);} - YY_BREAK -case 108: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DOTstar);} - YY_BREAK -case 109: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_CLCL);} - YY_BREAK -case 110: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ARROW);} - YY_BREAK -case 111: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ARROWstar);} - YY_BREAK -case 112: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ICR);} - YY_BREAK -case 113: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DECR);} - YY_BREAK -case 114: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LS);} - YY_BREAK -case 115: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_RS);} - YY_BREAK -case 116: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LE);} - YY_BREAK -case 117: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_GE);} - YY_BREAK -case 118: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_EQ);} - YY_BREAK -case 119: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_NE);} - YY_BREAK -case 120: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ANDAND);} - YY_BREAK -case 121: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_OROR);} - YY_BREAK -case 122: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MULTassign);} - YY_BREAK -case 123: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DIVassign);} - YY_BREAK -case 124: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MODassign);} - YY_BREAK -case 125: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_PLUSassign);} - YY_BREAK -case 126: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MINUSassign);} - YY_BREAK -case 127: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LSassign);} - YY_BREAK -case 128: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_RSassign);} - YY_BREAK -case 129: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ANDassign);} - YY_BREAK -case 130: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ERassign);} - YY_BREAK -case 131: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ORassign);} - YY_BREAK -case 132: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ELLIPSIS);} - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(PREPR): -case YY_STATE_EOF(WRAP_PREP): -case YY_STATE_EOF(CPP_COMMENT): -case YY_STATE_EOF(C_COMMENT): -{ - //reset lexer - yyterminate(); - } - YY_BREAK -case 133: -YY_RULE_SETUP -{return yytext[0];} - YY_BREAK -case 134: -YY_RULE_SETUP -{ - defineFound = false; - BEGIN INITIAL; - } - YY_BREAK -case 135: -YY_RULE_SETUP -{ - BEGIN WRAP_PREP; - } - YY_BREAK -case 136: -YY_RULE_SETUP -{ - defineFound = true; - } - YY_BREAK -case 137: -YY_RULE_SETUP -{ - BEGIN PREPR; - } - YY_BREAK -case 138: -YY_RULE_SETUP -{ - if(defineFound) - { - defineFound = false; - } - } - YY_BREAK -case 139: -YY_RULE_SETUP -{ - if(defineFound) - { - defineFound = false; - } - } - YY_BREAK -case 140: -YY_RULE_SETUP -{} - YY_BREAK -case 141: -YY_RULE_SETUP -{} - YY_BREAK -case 142: -YY_RULE_SETUP -{BEGIN INITIAL;} - YY_BREAK -case 143: -YY_RULE_SETUP -{} - YY_BREAK -case 144: -YY_RULE_SETUP -{BEGIN INITIAL;} - YY_BREAK -case 145: -YY_RULE_SETUP -{} - YY_BREAK -case 146: -YY_RULE_SETUP -ECHO; - YY_BREAK - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * 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->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have 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 - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - char *dest = yy_current_buffer->yy_ch_buf; - char *source = yytext_ptr; - int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - int yy_is_jam; - - YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 465); - if ( ! yy_is_jam ) - *yy_state_ptr++ = yy_current_state; - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; - char *yy_bp; -#endif - { - char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - int number_to_move = yy_n_chars + 2; - char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --yylineno; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++yylineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * 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; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - 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 *) yy_flex_alloc( 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 ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - 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; - - b = (YY_BUFFER_STATE) yy_flex_alloc( 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_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - 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 ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - 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. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* 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 - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif - - -bool exprIsaTYPE(char *string) -{ - return false; -} - -bool exprIsaMACRO(char *string) -{ - return false; -} - -void cl_expr_lex_clean() -{ - yy_flush_buffer(YY_CURRENT_BUFFER); - yy_delete_buffer(YY_CURRENT_BUFFER); - cl_expr_lineno = 1; -} - -/*******************************************************************/ -bool setExprLexerInput(const std::string &in) -{ - BEGIN INITIAL; - yy_scan_string(in.c_str()); - - //update the working file name - return true; -} - -int yywrap() -{ - return 1; -} diff --git a/CodeLite/cpp_expr_parser.cpp b/CodeLite/cpp_expr_parser.cpp deleted file mode 100644 index 4afdd8b4e2..0000000000 --- a/CodeLite/cpp_expr_parser.cpp +++ /dev/null @@ -1,976 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_expr_parse -#define yylex cl_expr_lex -#define yyerror cl_expr_error -#define yychar cl_expr_char -#define yyval cl_expr_val -#define yylval cl_expr_lval -#define yydebug cl_expr_debug -#define yynerrs cl_expr_nerrs -#define yyerrflag cl_expr_errflag -#define yyss cl_expr_ss -#define yyssp cl_expr_ssp -#define yyvs cl_expr_vs -#define yyvsp cl_expr_vsp -#define yylhs cl_expr_lhs -#define yylen cl_expr_len -#define yydefred cl_expr_defred -#define yydgoto cl_expr_dgoto -#define yysindex cl_expr_sindex -#define yyrindex cl_expr_rindex -#define yygindex cl_expr_gindex -#define yytable cl_expr_table -#define yycheck cl_expr_check -#define yyname cl_expr_name -#define yyrule cl_expr_rule -#define YYPREFIX "cl_expr_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include "string" -#include "vector" -#include "stdio.h" -#include "map" -#include "expression_result.h" - -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ - -void cl_expr_error(char *string); - -static ExpressionResult result; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_expr_text; -extern int cl_expr_lex(); -extern int cl_expr_parse(); -extern int cl_expr_lineno; -extern std::vector currentScope; -extern bool setExprLexerInput(const std::string &in); -extern void cl_expr_lex_clean(); - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define YYERRCODE 256 -short cl_expr_lhs[] = { -1, - 0, 0, 3, 1, 1, 4, 4, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 7, 7, 7, 8, 8, 8, 2, 2, - 2, 2, 2, 2, 14, 15, 15, 16, 16, 12, - 12, 12, 12, 18, 18, 19, 19, 10, 11, 11, - 11, 13, 13, 9, 9, 20, 17, 17, -}; -short cl_expr_len[] = { 2, - 0, 2, 0, 2, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, - 2, 2, 0, 1, 3, 4, 4, 7, 6, 2, - 3, 3, 5, 8, 2, 0, 3, 0, 1, 1, - 1, 1, 1, 0, 1, 0, 2, 2, 0, 1, - 1, 6, 3, 0, 2, 2, 0, 1, -}; -short cl_expr_defred[] = { 1, - 0, 5, 2, 0, 50, 51, 4, 0, 30, 40, - 41, 42, 43, 0, 0, 0, 0, 54, 31, 0, - 32, 0, 0, 55, 54, 0, 0, 58, 35, 56, - 0, 0, 0, 0, 46, 7, 54, 0, 24, 39, - 33, 0, 0, 53, 0, 0, 0, 0, 37, 29, - 0, 47, 45, 48, 0, 13, 8, 0, 9, 12, - 0, 0, 17, 0, 16, 0, 20, 46, 25, 46, - 34, 22, 21, 11, 10, 15, 14, 18, 19, 0, - 26, 27, 52, 0, 46, 28, -}; -short cl_expr_dgoto[] = { 1, - 3, 7, 4, 37, 67, 68, 38, 39, 26, 44, - 8, 17, 27, 21, 32, 41, 29, 54, 45, 24, -}; -short cl_expr_sindex[] = { 0, - -221, 0, 0, 3, 0, 0, 0, -17, 0, 0, - 0, 0, 0, -3, -254, -264, -14, 0, 0, -16, - 0, -87, 17, 0, 0, -227, 41, 0, 0, 0, - -175, 59, 40, -60, 0, 0, 0, -22, 0, 0, - 0, 78, -175, 0, -11, -203, -189, -175, 0, 0, - -5, 0, 0, 0, 71, 0, 0, -138, 0, 0, - -138, -118, 0, -118, 0, -57, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -175, - 0, 0, 0, 22, 0, 0, -}; -short cl_expr_rindex[] = { 0, - -25, 0, 0, -21, 0, 0, 0, -195, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 5, 9, 0, 0, 0, 0, 0, 0, 0, - -42, 13, 0, -12, 0, 0, 0, 0, 0, 0, - 0, 0, -42, 0, -34, 0, 0, -180, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -30, 0, 0, - 14, 65, 0, 72, 0, 73, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -42, - 0, 0, 0, 0, 0, 0, -}; -short cl_expr_gindex[] = { 0, - 0, 0, 0, 0, -46, 32, -32, 74, 16, 38, - 0, 0, 99, -10, 0, 0, 0, 0, 0, 0, -}; -#define YYTABLESIZE 363 -short cl_expr_table[] = { 43, - 57, 23, 80, 28, 57, 23, 44, 11, 36, 44, - 51, 11, 38, 11, 3, 78, 3, 79, 49, 23, - 49, 48, 14, 16, 15, 46, 53, 44, 46, 46, - 52, 11, 3, 3, 2, 55, 18, 19, 48, 49, - 57, 57, 57, 22, 57, 25, 57, 84, 36, 46, - 36, 10, 47, 20, 38, 10, 70, 10, 57, 57, - 6, 5, 57, 57, 57, 48, 36, 36, 56, 57, - 38, 38, 46, 58, 28, 10, 31, 6, 6, 59, - 34, 35, 6, 85, 60, 61, 62, 63, 6, 72, - 64, 65, 73, 6, 6, 6, 6, 36, 40, 6, - 6, 42, 15, 81, 20, 82, 15, 83, 15, 14, - 46, 71, 54, 14, 46, 14, 46, 50, 66, 56, - 57, 69, 86, 33, 58, 0, 15, 6, 0, 0, - 59, 0, 0, 14, 46, 60, 61, 62, 63, 56, - 57, 64, 65, 0, 74, 0, 0, 0, 0, 0, - 59, 0, 0, 0, 0, 60, 75, 76, 63, 0, - 0, 77, 65, 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, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 6, 6, 6, 6, 0, 0, 6, 6, 0, - 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, - 57, 0, 0, 0, 36, 6, 3, 0, 38, 0, - 49, 0, 30, 44, 9, 30, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 49, 0, 0, 0, - 0, 0, 57, 0, 0, 0, 57, 0, 0, 0, - 36, 0, 0, 0, 38, 0, 0, 0, 57, 0, - 0, 0, 57, 0, 0, 0, 36, 0, 0, 0, - 38, 3, 3, 3, 3, 49, 49, 49, 49, 10, - 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 57, 57, 57, - 57, 57, 57, 57, 57, 36, 36, 36, 36, 38, - 38, 38, 38, -}; -short cl_expr_check[] = { 60, - 0, 44, 60, 91, 0, 16, 41, 38, 0, 44, - 43, 42, 0, 44, 40, 62, 42, 64, 40, 62, - 42, 44, 40, 8, 42, 38, 38, 62, 41, 42, - 42, 62, 58, 59, 256, 46, 40, 292, 44, 62, - 40, 41, 42, 308, 40, 60, 42, 80, 40, 62, - 42, 38, 37, 308, 42, 42, 62, 44, 58, 59, - 58, 59, 58, 59, 60, 44, 58, 59, 258, 259, - 58, 59, 35, 263, 91, 62, 60, 258, 259, 269, - 308, 41, 263, 62, 274, 275, 276, 277, 269, 58, - 280, 281, 61, 274, 275, 276, 277, 273, 40, 280, - 281, 62, 38, 66, 308, 68, 42, 70, 44, 38, - 38, 41, 308, 42, 42, 44, 44, 40, 308, 258, - 259, 48, 85, 25, 263, -1, 62, 308, -1, -1, - 269, -1, -1, 62, 62, 274, 275, 276, 277, 258, - 259, 280, 281, -1, 263, -1, -1, -1, -1, -1, - 269, -1, -1, -1, -1, 274, 275, 276, 277, -1, - -1, 280, 281, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 258, 259, -1, -1, -1, - 263, -1, -1, -1, -1, -1, 269, -1, -1, -1, - -1, 274, 275, 276, 277, -1, -1, 280, 281, -1, - -1, -1, -1, -1, -1, 333, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, - 256, -1, -1, -1, 256, 308, 292, -1, 256, -1, - 292, -1, 333, 308, 292, 333, -1, -1, -1, -1, - -1, -1, 308, -1, -1, -1, 308, -1, -1, -1, - -1, -1, 292, -1, -1, -1, 292, -1, -1, -1, - 292, -1, -1, -1, 292, -1, -1, -1, 308, -1, - -1, -1, 308, -1, -1, -1, 308, -1, -1, -1, - 308, 347, 348, 349, 350, 347, 348, 349, 350, 347, - 348, 349, 350, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 347, 348, 349, - 350, 347, 348, 349, 350, 347, 348, 349, 350, 347, - 348, 349, 350, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 352 -#if YYDEBUG -char *cl_expr_name[] = { -"end-of-file",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,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,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,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,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,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,0,0,0, -0,0,0,"LE_AUTO","LE_DOUBLE","LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE","LE_LONG", -"LE_SWITCH","LE_CASE","LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR", -"LE_EXTERN","LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT", -"LE_UNSIGNED","LE_BOOL","LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID", -"LE_DEFAULT","LE_GOTO","LE_SIZEOF","LE_VOLATILE","LE_DO","LE_IF","LE_STATIC", -"LE_WHILE","LE_NEW","LE_DELETE","LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC", -"LE_PROTECTED","LE_PRIVATE","LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD", -"LE_OVERRIDE","LE_FINAL","LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH", -"LE_IDENTIFIER","LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T", -}; -char *cl_expr_rule[] = { -"$accept : translation_unit", -"translation_unit :", -"translation_unit : translation_unit primary_expr", -"$$1 :", -"primary_expr : $$1 simple_expr", -"primary_expr : error", -"const_spec :", -"const_spec : LE_CONST", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : basic_type_name_inter", -"basic_type_name : LE_SHORT basic_type_name", -"basic_type_name : LE_LONG basic_type_name", -"parameter_list :", -"parameter_list : template_parameter", -"parameter_list : parameter_list ',' template_parameter", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp", -"simple_expr : stmnt_starter special_cast '<' cast_type '>' '('", -"simple_expr : stmnt_starter LE_THIS", -"simple_expr : stmnt_starter '*' LE_THIS", -"simple_expr : stmnt_starter '*' identifier_name", -"simple_expr : stmnt_starter nested_scope_specifier identifier_name optional_template_init_list optinal_postifx", -"simple_expr : stmnt_starter '(' '(' cast_type ')' special_star_amp identifier_name ')'", -"identifier_name : LE_IDENTIFIER array_brackets", -"optional_template_init_list :", -"optional_template_init_list : '<' parameter_list '>'", -"optinal_postifx :", -"optinal_postifx : '('", -"special_cast : LE_DYNAMIC_CAST", -"special_cast : LE_STATIC_CAST", -"special_cast : LE_CONST_CAST", -"special_cast : LE_REINTERPRET_CAST", -"amp_item :", -"amp_item : '&'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : ':'", -"cast_type : nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp", -"cast_type : nested_scope_specifier LE_IDENTIFIER special_star_amp", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"array_brackets :", -"array_brackets : '['", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - -void expr_consumBracketsContent(char openBrace) -{ - char closeBrace; - - switch(openBrace) { - case '(': closeBrace = ')'; break; - case '[': closeBrace = ']'; break; - case '<': closeBrace = '>'; break; - case '{': closeBrace = '}'; break; - default: - openBrace = '('; - closeBrace = ')'; - break; - } - - int depth = 1; - while(depth > 0) - { - int ch = cl_expr_lex(); - //printf("ch=%d\n", ch); - //fflush(stdout); - if(ch == 0){ - break; - } - - if(ch == closeBrace) - { - depth--; - continue; - } - else if(ch == openBrace) - { - depth ++ ; - continue; - } - } -} - -void expr_FuncArgList() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_expr_lex(); - //printf("ch=%d\n", ch); - //fflush(stdout); - if(ch ==0){ - break; - } - - if(ch == ')') - { - depth--; - continue; - } - else if(ch == '(') - { - depth ++ ; - continue; - } - } -} - -void expr_consumeTemplateDecl() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_expr_lex(); - //printf("ch=%d\n", ch); - fflush(stdout); - if(ch ==0){ - break; - } - - if(ch == '>') - { - depth--; - continue; - } - else if(ch == '<') - { - depth ++ ; - continue; - } - } -} - -void expr_syncParser(){ - //dont do anything, a hook to allow us to implement some - //nice error recovery if needed -} - -// return the scope name at the end of the input string -ExpressionResult &parse_expression(const std::string &in) -{ - result.Reset(); - //provide the lexer with new input - if( !setExprLexerInput(in) ){ - return result; - } - - //printf("parsing...\n"); - cl_expr_parse(); - //do the lexer cleanup - cl_expr_lex_clean(); - - return result; -} -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - int yym, yyn, yystate; -#if YYDEBUG - char *yys; - extern char *getenv(); - - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 3: -{result.Reset();} -break; -case 5: -{ - yyclearin; /*clear lookahead token*/ - yyerrok; - /*fprintf(stderr, "CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_expr_text, cl_expr_lineno);*/ - /*fflush(stderr);*/ - expr_syncParser(); - } -break; -case 6: -{yyval = ""; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[0]; } -break; -case 16: -{ yyval = yyvsp[0]; } -break; -case 17: -{ yyval = yyvsp[0]; } -break; -case 18: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 19: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 20: -{ yyval = yyvsp[0]; } -break; -case 21: -{ yyval = yyvsp[-1] + " " + yyvsp[0];} -break; -case 22: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 23: -{yyval = "";} -break; -case 24: -{yyval = yyvsp[0];} -break; -case 25: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 26: -{ - if(yyvsp[-3].empty()) { - yyval = yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - - } else { - yyval = yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } - } -break; -case 27: -{ - if(yyvsp[-3].empty()) { - yyval = yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - - } else { - yyval = yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } - } -break; -case 28: -{ - if(yyvsp[-6].empty()) { - yyval = yyvsp[-5] + yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + " "; - } else { - yyval = yyvsp[-6] + " " + yyvsp[-5] + yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + " "; - } - } -break; -case 29: -{ - expr_FuncArgList(); - yyval = yyvsp[-2]; - result.m_isaType = true; - result.m_name = yyvsp[-2]; - result.m_isFunc = false; - /*printf("Rule 1\n");*/ - /*result.Print();*/ - } -break; -case 30: -{ - yyval = yyvsp[0]; - result.m_isaType = false; - result.m_name = yyval; - result.m_isFunc = false; - result.m_isThis = true; - result.m_isPtr = true; - /*result.Print();*/ - } -break; -case 31: -{ - yyval = yyvsp[0]; - result.m_isaType = false; - result.m_name = yyval; - result.m_isFunc = false; - result.m_isThis = true; - /*result.Print();*/ - } -break; -case 32: -{ - yyval = yyvsp[0]; - result.m_isaType = false; - result.m_name = yyval; - result.m_isFunc = false; - result.m_isThis = false; - result.m_isPtr = false; - /*result.Print();*/ - } -break; -case 33: -{ - result.m_isaType = false; - result.m_name = yyvsp[-2]; - result.m_isThis = false; - yyvsp[-3].erase(yyvsp[-3].find_last_not_of(":")+1); - result.m_scope = yyvsp[-3]; - result.m_isTemplate = yyvsp[-1].empty() ? false : true; - result.m_templateInitList = yyvsp[-1]; - /*result.Print();*/ - } -break; -case 34: -{ - yyval = yyvsp[-4]; - result.m_isaType = true; - result.m_name = yyval; - result.m_isFunc = false; - result.m_isThis = false; - /*result.Print();*/ - } -break; -case 35: -{yyval = yyvsp[-1];} -break; -case 36: -{yyval = "";} -break; -case 37: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 38: -{yyval = "";} -break; -case 39: -{ - yyval = yyvsp[0]; - expr_FuncArgList(); - result.m_isFunc = true; - } -break; -case 40: -{yyval = yyvsp[0];} -break; -case 41: -{yyval = yyvsp[0];} -break; -case 42: -{yyval = yyvsp[0];} -break; -case 43: -{yyval = yyvsp[0];} -break; -case 44: -{yyval = ""; } -break; -case 45: -{ yyval = yyvsp[0]; } -break; -case 46: -{yyval = ""; } -break; -case 47: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 48: -{ yyval = yyvsp[-1] + yyvsp[0]; } -break; -case 49: -{yyval = "";} -break; -case 50: -{ yyval = ";";} -break; -case 51: -{ yyval = ":";} -break; -case 52: -{ - yyval = yyvsp[-5] + yyvsp[-4]; - yyvsp[-5].erase(yyvsp[-5].find_last_not_of(":")+1); - result.m_scope = yyvsp[-5]; - result.m_name = yyvsp[-4]; - result.m_isPtr = (yyvsp[0].find("*") != (size_t)-1);; - result.m_isTemplate = true; - result.m_templateInitList = yyvsp[-3] + yyvsp[-2] + yyvsp[-1]; - } -break; -case 53: -{ - yyval = yyvsp[-2] + yyvsp[-1]; - yyvsp[-2].erase(yyvsp[-2].find_last_not_of(":")+1); - result.m_scope = yyvsp[-2]; - result.m_name = yyvsp[-1]; - result.m_isPtr = (yyvsp[0].find("*") != (size_t)-1);; - } -break; -case 54: -{yyval = "";} -break; -case 55: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 56: -{yyval = yyvsp[-1]+ yyvsp[0];} -break; -case 57: -{ yyval = ""; } -break; -case 58: -{ expr_consumBracketsContent('['); yyval = "[]";} -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CodeLite/cpp_func_parser.cpp b/CodeLite/cpp_func_parser.cpp deleted file mode 100644 index 518f574358..0000000000 --- a/CodeLite/cpp_func_parser.cpp +++ /dev/null @@ -1,1050 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_func_parse -#define yylex cl_func_lex -#define yyerror cl_func_error -#define yychar cl_func_char -#define yyval cl_func_val -#define yylval cl_func_lval -#define yydebug cl_func_debug -#define yynerrs cl_func_nerrs -#define yyerrflag cl_func_errflag -#define yyss cl_func_ss -#define yyssp cl_func_ssp -#define yyvs cl_func_vs -#define yyvsp cl_func_vsp -#define yylhs cl_func_lhs -#define yylen cl_func_len -#define yydefred cl_func_defred -#define yydgoto cl_func_dgoto -#define yysindex cl_func_sindex -#define yyrindex cl_func_rindex -#define yygindex cl_func_gindex -#define yytable cl_func_table -#define yycheck cl_func_check -#define yyname cl_func_name -#define yyrule cl_func_rule -#define YYPREFIX "cl_func_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include "string" -#include "vector" -#include "stdio.h" -#include "map" -#include "function.h" - -#define YYDEBUG_LEXER_TEXT (cl_func_lval) -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ - -#ifdef yylex -#undef yylex -#define yylex cl_scope_lex -#endif - -int cl_func_parse(); -void cl_func_error(char *string); - -static FunctionList *g_funcs = NULL; -static clFunction curr_func; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_func_text; -extern int cl_scope_lex(); -extern bool setLexerInput(const std::string &in, const std::map &ignoreTokens); -extern int cl_scope_lineno; -extern void cl_scope_lex_clean(); - - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define YYERRCODE 256 -short cl_func_lhs[] = { -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 0, 0, 5, - 3, 3, 6, 6, 8, 8, 7, 7, 9, 9, - 10, 10, 10, 11, 11, 11, 15, 15, 15, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 20, 4, 21, 21, 23, 23, 23, 24, 24, 13, - 13, 22, 22, 25, 26, 25, 18, 18, 12, 12, - 27, 27, 28, 28, 14, 17, 17, 17, 19, 19, - 19, -}; -short cl_func_len[] = { 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 1, 0, 2, 0, - 2, 1, 0, 2, 1, 3, 1, 1, 0, 4, - 0, 1, 3, 4, 4, 7, 1, 2, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, - 0, 15, 0, 4, 0, 1, 1, 1, 1, 0, - 2, 0, 2, 2, 0, 4, 0, 1, 0, 1, - 0, 1, 0, 2, 2, 0, 1, 1, 3, 3, - 6, -}; -short cl_func_defred[] = { 18, - 0, 22, 19, 0, 97, 98, 21, 0, 0, 0, - 0, 88, 0, 27, 28, 25, 0, 0, 90, 80, - 24, 0, 30, 0, 0, 26, 6, 1, 0, 2, - 5, 3, 0, 10, 0, 9, 0, 12, 11, 17, - 93, 81, 80, 16, 15, 4, 8, 7, 13, 14, - 84, 0, 100, 0, 99, 0, 0, 32, 80, 0, - 94, 92, 95, 0, 0, 0, 0, 0, 93, 0, - 86, 68, 69, 56, 60, 61, 52, 53, 62, 63, - 64, 65, 54, 55, 59, 57, 70, 50, 51, 48, - 40, 41, 42, 43, 44, 45, 46, 47, 49, 58, - 0, 0, 39, 85, 38, 71, 33, 101, 0, 93, - 66, 67, 0, 0, 34, 35, 0, 0, 0, 0, - 93, 0, 0, 0, 36, 0, 83, 76, 77, 0, - 74, 78, 79, 72, -}; -short cl_func_dgoto[] = { 1, - 40, 41, 3, 7, 4, 16, 17, 18, 10, 57, - 58, 59, 24, 53, 67, 103, 8, 13, 25, 113, - 120, 124, 130, 134, 42, 60, 63, 54, -}; -short cl_func_sindex[] = { 0, - -247, 0, 0, 22, 0, 0, 0, -267, 7, -223, - -229, 0, -185, 0, 0, 0, -212, -26, 0, 0, - 0, -229, 0, 84, -185, 0, 0, 0, -181, 0, - 0, 0, 142, 0, 142, 0, -59, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -185, 0, 51, 0, -121, -11, 0, 0, -235, - 0, 0, 0, 1, -58, -203, 67, -185, 0, 113, - 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, - 68, 17, 0, 0, 0, 0, 0, 0, -56, 0, - 0, 0, -185, -185, 0, 0, -191, 8, 81, 62, - 0, -185, -189, -200, 0, 53, 0, 0, 0, -52, - 0, 0, 0, 0, -}; -short cl_func_rindex[] = { 0, - 75, 0, 0, -190, 0, 0, 0, -128, 0, -67, - 12, 0, 122, 0, 0, 0, 0, 0, 0, 0, - 0, 12, 0, 0, -120, 0, 0, 0, -27, 0, - 0, 0, -22, 0, -13, 0, -15, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -32, 0, -20, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 88, 0, 0, 122, 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, 78, 0, - 0, 0, -6, -32, 0, 0, 3, 0, 0, -46, - 0, -41, 0, -51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -}; -short cl_func_gindex[] = { 0, - 24, 59, 0, 0, 0, 110, 0, 0, 0, -64, - 69, 41, -33, -9, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -}; -#define YYTABLESIZE 494 -short cl_func_table[] = { 31, - 52, 104, 31, 114, 66, 89, 133, 75, 2, 56, - 4, 31, 82, 4, 4, 8, 4, 22, 8, 8, - 91, 8, 93, 91, 7, 70, 93, 7, 7, 31, - 7, 55, 68, 99, 4, 23, 9, 95, 97, 8, - 101, 91, 93, 91, 87, 92, 100, 94, 7, 118, - 69, 68, 89, 20, 89, 23, 49, 126, 50, 108, - 88, 73, 89, 73, 14, 43, 11, 96, 96, 121, - 132, 75, 96, 23, 12, 15, 82, 44, 96, 6, - 5, 45, 96, 96, 96, 96, 96, 19, 62, 96, - 96, 102, 61, 131, 96, 21, 68, 71, 4, 115, - 116, 128, 129, 8, 105, 91, 106, 96, 111, 112, - 93, 125, 7, 96, 119, 93, 89, 96, 93, 93, - 122, 93, 123, 127, 98, 73, 90, 37, 110, 29, - 29, 26, 20, 20, 29, 0, 107, 0, 0, 93, - 29, 0, 0, 0, 29, 29, 29, 29, 29, 0, - 0, 29, 29, 117, 0, 0, 0, 0, 0, 0, - 96, 96, 0, 0, 0, 0, 0, 0, 0, 29, - 0, 64, 89, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 0, 0, 0, 0, 65, 89, 0, 0, - 87, 87, 0, 0, 0, 87, 0, 0, 0, 0, - 0, 87, 0, 0, 0, 87, 87, 87, 87, 87, - 0, 0, 87, 87, 0, 0, 89, 89, 0, 0, - 0, 89, 29, 29, 0, 89, 89, 89, 0, 0, - 89, 0, 89, 89, 89, 89, 89, 0, 89, 89, - 87, 89, 89, 89, 89, 4, 0, 89, 89, 0, - 8, 0, 91, 0, 0, 82, 82, 93, 0, 7, - 0, 0, 0, 0, 0, 4, 89, 0, 0, 0, - 8, 0, 91, 51, 51, 89, 51, 93, 0, 7, - 4, 0, 0, 87, 87, 8, 0, 91, 0, 0, - 72, 73, 93, 0, 7, 89, 89, 0, 0, 89, - 85, 0, 0, 0, 73, 73, 0, 0, 0, 89, - 89, 0, 0, 0, 0, 0, 0, 0, 89, 89, - 0, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 20, 20, 85, 86, 0, 20, 0, 0, - 0, 27, 28, 20, 0, 0, 29, 20, 20, 20, - 20, 20, 30, 0, 20, 20, 0, 31, 32, 33, - 34, 0, 0, 35, 36, 0, 0, 0, 0, 0, - 27, 28, 20, 0, 0, 29, 0, 0, 20, 89, - 89, 30, 20, 0, 89, 0, 31, 32, 33, 34, - 89, 37, 35, 36, 0, 89, 89, 89, 89, 27, - 28, 89, 89, 0, 46, 0, 0, 0, 0, 0, - 30, 0, 0, 0, 0, 31, 32, 47, 34, 0, - 109, 48, 36, 0, 0, 20, 20, 0, 0, 89, - 0, 0, 0, 0, 38, 39, 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, 38, 39, 0, 0, 0, 0, 0, - 0, 0, 89, 89, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 38, 39, -}; -short cl_func_check[] = { 41, - 60, 60, 44, 60, 126, 126, 59, 59, 256, 43, - 38, 44, 59, 41, 42, 38, 44, 44, 41, 42, - 41, 44, 38, 44, 38, 59, 42, 41, 42, 62, - 44, 41, 44, 33, 62, 62, 304, 37, 38, 62, - 40, 62, 42, 43, 44, 45, 46, 47, 62, 114, - 62, 44, 59, 13, 61, 44, 33, 122, 35, 69, - 60, 59, 62, 61, 294, 25, 60, 258, 259, 62, - 123, 123, 263, 62, 298, 305, 123, 259, 269, 58, - 59, 263, 273, 274, 275, 276, 277, 273, 38, 280, - 281, 91, 42, 41, 94, 308, 44, 333, 126, 109, - 110, 302, 303, 126, 308, 126, 40, 298, 41, 93, - 126, 121, 126, 304, 306, 38, 123, 308, 41, 42, - 40, 44, 61, 313, 124, 123, 126, 40, 70, 258, - 259, 22, 58, 59, 263, -1, 68, -1, -1, 62, - 269, -1, -1, -1, 273, 274, 275, 276, 277, -1, - -1, 280, 281, 113, -1, -1, -1, -1, -1, -1, - 351, 352, -1, -1, -1, -1, -1, -1, -1, 298, - -1, 293, 293, -1, -1, -1, -1, -1, -1, 308, - -1, -1, -1, -1, -1, -1, 308, 308, -1, -1, - 258, 259, -1, -1, -1, 263, -1, -1, -1, -1, - -1, 269, -1, -1, -1, 273, 274, 275, 276, 277, - -1, -1, 280, 281, -1, -1, 258, 259, -1, -1, - -1, 263, 351, 352, -1, 258, 259, 269, -1, -1, - 263, -1, 274, 275, 276, 277, 269, -1, 280, 281, - 308, 274, 275, 276, 277, 273, -1, 280, 281, -1, - 273, -1, 273, -1, -1, 302, 303, 273, -1, 273, - -1, -1, -1, -1, -1, 293, 308, -1, -1, -1, - 293, -1, 293, 333, 333, 308, 333, 293, -1, 293, - 308, -1, -1, 351, 352, 308, -1, 308, -1, -1, - 290, 291, 308, -1, 308, 302, 303, -1, -1, 306, - 333, -1, -1, -1, 302, 303, -1, -1, -1, 351, - 352, -1, -1, -1, -1, -1, -1, -1, 351, 352, - -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, - 330, 331, 258, 259, 334, 335, -1, 263, -1, -1, - -1, 258, 259, 269, -1, -1, 263, 273, 274, 275, - 276, 277, 269, -1, 280, 281, -1, 274, 275, 276, - 277, -1, -1, 280, 281, -1, -1, -1, -1, -1, - 258, 259, 298, -1, -1, 263, -1, -1, 304, 258, - 259, 269, 308, -1, 263, -1, 274, 275, 276, 277, - 269, 308, 280, 281, -1, 274, 275, 276, 277, 258, - 259, 280, 281, -1, 263, -1, -1, -1, -1, -1, - 269, -1, -1, -1, -1, 274, 275, 276, 277, -1, - 308, 280, 281, -1, -1, 351, 352, -1, -1, 308, - -1, -1, -1, -1, 351, 352, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 351, 352, -1, -1, -1, -1, -1, - -1, -1, 351, 352, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 351, 352, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 352 -#if YYDEBUG -char *cl_func_name[] = { -"end-of-file",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,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,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,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,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,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,"LE_AUTO","LE_DOUBLE", -"LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE","LE_LONG","LE_SWITCH","LE_CASE", -"LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR","LE_EXTERN","LE_RETURN", -"LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT","LE_UNSIGNED","LE_BOOL", -"LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID","LE_DEFAULT","LE_GOTO","LE_SIZEOF", -"LE_VOLATILE","LE_DO","LE_IF","LE_STATIC","LE_WHILE","LE_NEW","LE_DELETE", -"LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC","LE_PROTECTED","LE_PRIVATE", -"LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD","LE_OVERRIDE","LE_FINAL", -"LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH","LE_IDENTIFIER", -"LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T", -}; -char *cl_func_rule[] = { -"$accept : translation_unit", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name_inter : LE_TIME_T", -"basic_type_name_inter : LE_SIZE_T", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : LE_LONG LE_LONG", -"basic_type_name : LE_LONG LE_INT", -"basic_type_name : basic_type_name_inter", -"translation_unit :", -"translation_unit : translation_unit external_decl", -"$$1 :", -"external_decl : $$1 function_decl", -"external_decl : error", -"template_arg :", -"template_arg : template_specifiter LE_IDENTIFIER", -"template_arg_list : template_arg", -"template_arg_list : template_arg_list ',' template_arg", -"template_specifiter : LE_CLASS", -"template_specifiter : LE_TYPENAME", -"opt_template_qualifier :", -"opt_template_qualifier : LE_TEMPLATE '<' template_arg_list '>'", -"template_parameter_list :", -"template_parameter_list : template_parameter", -"template_parameter_list : template_parameter_list ',' template_parameter", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp", -"func_name : LE_IDENTIFIER", -"func_name : '~' LE_IDENTIFIER", -"func_name : LE_OPERATOR any_operator", -"any_operator : '+'", -"any_operator : '-'", -"any_operator : '*'", -"any_operator : '/'", -"any_operator : '%'", -"any_operator : '^'", -"any_operator : '&'", -"any_operator : '|'", -"any_operator : '~'", -"any_operator : '!'", -"any_operator : '<'", -"any_operator : '>'", -"any_operator : LE_LS", -"any_operator : LE_RS", -"any_operator : LE_ANDAND", -"any_operator : LE_OROR", -"any_operator : LE_ARROW", -"any_operator : LE_ARROWstar", -"any_operator : '.'", -"any_operator : LE_DOTstar", -"any_operator : LE_ICR", -"any_operator : LE_DECR", -"any_operator : LE_LE", -"any_operator : LE_GE", -"any_operator : LE_EQ", -"any_operator : LE_NE", -"any_operator : '(' ')'", -"any_operator : '[' ']'", -"any_operator : LE_NEW", -"any_operator : LE_DELETE", -"any_operator : ','", -"$$2 :", -"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec variable_decl const_spec nested_scope_specifier func_name '(' $$2 const_spec declare_throw opt_pure_virtual override_final_specifier func_postfix", -"declare_throw :", -"declare_throw : LE_THROW '(' template_parameter_list ')'", -"override_final_specifier :", -"override_final_specifier : LE_OVERRIDE", -"override_final_specifier : LE_FINAL", -"func_postfix : '{'", -"func_postfix : ';'", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"opt_pure_virtual :", -"opt_pure_virtual : '=' LE_OCTALconstant", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"$$3 :", -"scope_specifier : LE_IDENTIFIER '<' $$3 LE_CLCL", -"virtual_spec :", -"virtual_spec : LE_VIRTUAL", -"const_spec :", -"const_spec : LE_CONST", -"amp_item :", -"amp_item : '&'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : ':'", -"variable_decl : nested_scope_specifier basic_type_name special_star_amp", -"variable_decl : nested_scope_specifier LE_IDENTIFIER special_star_amp", -"variable_decl : nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - -void func_consumeFuncArgList() -{ - curr_func.m_signature = "("; - - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - if(ch == 0) - { - break; - } - - curr_func.m_signature += cl_func_lval; - curr_func.m_signature += " "; - if(ch == ')') - { - depth--; - continue; - } - else if(ch == '(') - { - depth ++ ; - continue; - } - } -} - -/** - * consume all token until matching closing brace is found - */ -void func_consumeDecl() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - //printf("ch=%d\n", ch); - //fflush(stdout); - if(ch ==0) - { - break; - } - if(ch == '}') - { - depth--; - continue; - } - else if(ch == '{') - { - depth ++ ; - continue; - } - } - -} - -void func_consumeTemplateDecl() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - //printf("ch=%d\n", ch); - //fflush(stdout); - if(ch ==0){ - break; - } - - if(ch == '>') - { - depth--; - continue; - } - else if(ch == '<') - { - depth ++ ; - continue; - } - } -} - -// return the scope name at the end of the input string -void get_functions(const std::string &in, FunctionList &li, const std::map &ignoreTokens) -{ - if( !setLexerInput(in, ignoreTokens) ) - { - return; - } - - g_funcs = &li; - - //call tghe main parsing routine - cl_func_parse(); - g_funcs = NULL; - - //do the lexer cleanup - cl_scope_lex_clean(); -} -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - int yym, yyn, yystate; -#if YYDEBUG - char *yys; - extern char *getenv(); - - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if ((yyn = yydefred[yystate])) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -{ yyval = yyvsp[0]; } -break; -case 2: -{ yyval = yyvsp[0]; } -break; -case 3: -{ yyval = yyvsp[0]; } -break; -case 4: -{ yyval = yyvsp[0]; } -break; -case 5: -{ yyval = yyvsp[0]; } -break; -case 6: -{ yyval = yyvsp[0]; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 16: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 17: -{ yyval = yyvsp[0]; } -break; -case 20: -{curr_func.Reset();} -break; -case 22: -{ - /*printf("CodeLite: syntax error, unexpected token '%s' found\n", cl_func_lval.c_str());*/ - } -break; -case 23: -{ yyval = "";} -break; -case 24: -{yyval = yyvsp[-1] + " " + yyvsp[0];} -break; -case 25: -{ yyval = yyvsp[0]; } -break; -case 26: -{ yyval = yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; } -break; -case 27: -{ yyval = yyvsp[0]; } -break; -case 28: -{ yyval = yyvsp[0]; } -break; -case 30: -{ yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 31: -{yyval = "";} -break; -case 32: -{yyval = yyvsp[0];} -break; -case 33: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 34: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 35: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 36: -{ - yyval = yyvsp[-6] + yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ; - } -break; -case 37: -{yyval = yyvsp[0];} -break; -case 38: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 39: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 71: -{func_consumeFuncArgList();} -break; -case 72: -{ - /*trim down trailing '::' from scope name*/ - yyvsp[-9].erase(yyvsp[-9].find_last_not_of(":")+1); - curr_func.m_isVirtual = yyvsp[-12].find("virtual") != std::string::npos; - curr_func.m_isPureVirtual = yyvsp[-2].find("=") != std::string::npos; - curr_func.m_isConst = yyvsp[-4].find("const") != std::string::npos; - curr_func.m_isFinal = yyvsp[-1].find("final") != std::string::npos; - curr_func.m_name = yyvsp[-7]; - curr_func.m_scope = yyvsp[-8]; - curr_func.m_retrunValusConst = yyvsp[-11]; - curr_func.m_lineno = cl_scope_lineno; - curr_func.m_throws = yyvsp[-3]; - curr_func.m_returnValue.m_rightSideConst = yyvsp[-9]; - curr_func.m_returnValue.m_isConst = !yyvsp[-11].empty(); - if(g_funcs) - { - g_funcs->push_back(curr_func); - } - curr_func.Reset(); - } -break; -case 73: -{yyval = "";} -break; -case 74: -{yyval = yyvsp[-1];} -break; -case 75: -{yyval = "";} -break; -case 80: -{yyval = "";} -break; -case 81: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 82: -{yyval = "";} -break; -case 83: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 84: -{yyval = yyvsp[-1]+ yyvsp[0];} -break; -case 85: -{func_consumeTemplateDecl();} -break; -case 86: -{yyval = yyvsp[-3] + yyvsp[0];} -break; -case 87: -{yyval = ""; } -break; -case 88: -{ yyval = yyvsp[0]; } -break; -case 89: -{yyval = ""; } -break; -case 90: -{ yyval = yyvsp[0]; } -break; -case 91: -{yyval = ""; } -break; -case 92: -{ yyval = yyvsp[0]; } -break; -case 93: -{yyval = ""; } -break; -case 94: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 95: -{ yyval = yyvsp[-1] + yyvsp[0]; } -break; -case 96: -{yyval = "";} -break; -case 97: -{ yyval = ";";} -break; -case 98: -{ yyval = ":";} -break; -case 99: -{ - yyvsp[-2].erase(yyvsp[-2].find_last_not_of(":")+1); - curr_func.m_returnValue.m_type = yyvsp[-1]; - curr_func.m_returnValue.m_typeScope = yyvsp[-2]; - curr_func.m_returnValue.m_starAmp = yyvsp[0]; - curr_func.m_returnValue.m_isPtr = (yyvsp[0].find("*") != (size_t)-1); - yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - } -break; -case 100: -{ - yyvsp[-2].erase(yyvsp[-2].find_last_not_of(":")+1); - curr_func.m_returnValue.m_type = yyvsp[-1]; - curr_func.m_returnValue.m_typeScope = yyvsp[-2]; - curr_func.m_returnValue.m_starAmp = yyvsp[0]; - curr_func.m_returnValue.m_isPtr = (yyvsp[0].find("*") != (size_t)-1); - yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0] ; - } -break; -case 101: -{ - yyvsp[-5].erase(yyvsp[-5].find_last_not_of(":")+1); - curr_func.m_returnValue.m_type = yyvsp[-4]; - curr_func.m_returnValue.m_typeScope = yyvsp[-5]; - curr_func.m_returnValue.m_starAmp = yyvsp[0]; - curr_func.m_returnValue.m_isPtr = (yyvsp[0].find("*") != (size_t)-1); - curr_func.m_returnValue.m_isTemplate = true; - curr_func.m_returnValue.m_templateDecl = yyvsp[-2]; - yyval = yyvsp[-5] + yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] ; - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CodeLite/cpp_lexer.cpp b/CodeLite/cpp_lexer.cpp deleted file mode 100644 index c1fe69801a..0000000000 --- a/CodeLite/cpp_lexer.cpp +++ /dev/null @@ -1,2805 +0,0 @@ -#define yy_create_buffer cl_scope__create_buffer -#define yy_delete_buffer cl_scope__delete_buffer -#define yy_scan_buffer cl_scope__scan_buffer -#define yy_scan_string cl_scope__scan_string -#define yy_scan_bytes cl_scope__scan_bytes -#define yy_flex_debug cl_scope__flex_debug -#define yy_init_buffer cl_scope__init_buffer -#define yy_flush_buffer cl_scope__flush_buffer -#define yy_load_buffer_state cl_scope__load_buffer_state -#define yy_switch_to_buffer cl_scope__switch_to_buffer -#define yyin cl_scope_in -#define yyleng cl_scope_leng -#define yylex cl_scope_lex -#define yyout cl_scope_out -#define yyrestart cl_scope_restart -#define yytext cl_scope_text -#define yylineno cl_scope_lineno -#define yywrap cl_scope_wrap - -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#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. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384*5 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - 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 - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int 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 int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* 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 yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst 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 = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 149 -#define YY_END_OF_BUFFER 150 -static yyconst short int yy_acclist[652] = - { 0, - 150, 136, 149, 3, 136, 149, 5, 149, 4, 136, - 149, 100, 136, 149, 136, 149, 102, 136, 149, 95, - 136, 149, 136, 149, 86, 136, 149, 87, 136, 149, - 96, 136, 149, 97, 136, 149, 88, 136, 149, 98, - 136, 149, 94, 136, 149, 101, 136, 149, 81, 136, - 149, 80, 136, 149, 108, 136, 149, 109, 136, 149, - 103, 136, 149, 110, 136, 149, 104, 136, 149, 107, - 136, 149, 79, 136, 149, 79, 136, 149, 92, 136, - 149, 93, 136, 149, 105, 136, 149, 79, 136, 149, - 79, 136, 149, 79, 136, 149, 79, 136, 149, 79, - - 136, 149, 79, 136, 149, 79, 136, 149, 79, 136, - 149, 79, 136, 149, 79, 136, 149, 79, 136, 149, - 79, 136, 149, 79, 136, 149, 79, 136, 149, 79, - 136, 149, 79, 136, 149, 79, 136, 149, 79, 136, - 149, 79, 136, 149, 90, 136, 149, 106, 136, 149, - 91, 136, 149, 99, 136, 149, 3, 136, 149, 89, - 136, 149, 144, 149, 137, 149, 142, 144, 149, 138, - 144, 149, 142, 144, 149, 143, 149, 140, 149, 141, - 143, 149, 146, 149, 145, 149, 148, 149, 149, 148, - 149, 3, 5, 4, 122, 85, 127, 123, 132, 125, - - 115, 128, 116, 129, 113, 111, 83, 1, 2, 126, - 83, 81, 81, 81, 80, 80, 80, 112, 117, 119, - 121, 120, 118, 79, 133, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 15, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 26, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 134, 124, 3, 89, 142, 142, 141, 147, - 84, 114, 135, 83, 83, 81, 82, 80, 130, 131, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 24, 79, 79, 79, 79, 79, 79, 79, - 30, 79, 79, 79, 79, 57, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 142, 83, 82, 82, 79, - 6, 79, 33, 79, 79, 8, 79, 79, 9, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 17, 79, 18, 79, 79, 20, 79, 79, 79, 79, - 79, 79, 25, 79, 79, 79, 79, 79, 31, 79, - - 32, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 65, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 47, - 79, 79, 79, 142, 82, 79, 7, 79, 75, 79, - 52, 79, 10, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 19, 79, 21, 79, 79, 61, 79, 23, - 79, 79, 27, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 37, 79, - 79, 79, 79, 79, 79, 79, 79, 74, 79, 79, - 79, 79, 44, 79, 45, 79, 79, 73, 79, 79, - - 79, 49, 79, 142, 79, 79, 79, 79, 13, 79, - 54, 79, 79, 79, 16, 79, 79, 22, 79, 55, - 79, 28, 79, 79, 56, 79, 79, 79, 79, 79, - 34, 79, 79, 79, 64, 79, 79, 79, 36, 79, - 38, 79, 51, 79, 39, 79, 40, 79, 41, 79, - 42, 79, 79, 50, 79, 79, 79, 79, 79, 79, - 139, 142, 79, 79, 79, 12, 79, 14, 79, 79, - 79, 79, 29, 79, 79, 79, 79, 79, 63, 79, - 79, 79, 79, 79, 79, 43, 79, 79, 79, 66, - 79, 79, 79, 79, 11, 79, 79, 79, 79, 79, - - 58, 79, 59, 79, 60, 79, 79, 35, 79, 79, - 79, 67, 79, 68, 79, 46, 79, 48, 79, 79, - 79, 78, 79, 77, 79, 79, 53, 79, 62, 79, - 79, 79, 76, 79, 71, 79, 79, 79, 79, 79, - 79, 70, 79, 69, 79, 79, 79, 79, 79, 72, - 79 - } ; - -static yyconst short int yy_accept[494] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 7, 9, 12, 15, 17, 20, 23, - 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, - 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, - 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, - 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, - 145, 148, 151, 154, 157, 160, 163, 165, 167, 170, - 173, 176, 178, 180, 183, 185, 187, 189, 190, 192, - 193, 194, 194, 195, 196, 196, 197, 197, 198, 199, - 200, 200, 200, 201, 202, 203, 204, 205, 206, 207, - - 207, 208, 209, 210, 211, 212, 213, 213, 213, 214, - 215, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 225, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 250, 251, 252, 253, - 254, 255, 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, 281, 281, - 282, 282, 282, 283, 284, 284, 285, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 315, 316, 317, 318, - 319, 320, 321, 323, 324, 325, 326, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 357, 357, 357, - 357, 357, 358, 359, 360, 361, 363, 365, 366, 368, - 369, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 383, 385, 386, 388, 389, 390, 391, 392, - 393, 395, 396, 397, 398, 399, 401, 403, 404, 405, - - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 417, 418, 419, 420, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 432, 433, 434, 435, 435, 435, - 435, 435, 436, 437, 439, 441, 443, 445, 446, 447, - 448, 449, 450, 451, 452, 453, 455, 457, 458, 460, - 462, 463, 465, 466, 467, 468, 469, 470, 471, 472, - 473, 474, 475, 476, 477, 478, 479, 481, 482, 483, - 484, 485, 486, 487, 488, 490, 491, 492, 493, 495, - 497, 498, 500, 501, 502, 504, 505, 506, 507, 508, - 509, 511, 513, 514, 515, 517, 518, 520, 522, 524, - - 525, 527, 528, 529, 530, 531, 533, 534, 535, 537, - 538, 539, 541, 543, 545, 547, 549, 551, 553, 554, - 556, 557, 558, 559, 560, 561, 563, 564, 565, 566, - 568, 570, 571, 572, 573, 575, 576, 577, 578, 579, - 581, 582, 583, 584, 585, 586, 588, 589, 590, 592, - 593, 594, 595, 597, 598, 599, 600, 601, 603, 605, - 607, 608, 610, 611, 612, 614, 616, 618, 620, 621, - 622, 624, 626, 627, 629, 631, 632, 633, 635, 637, - 638, 639, 640, 641, 642, 644, 646, 647, 648, 649, - 650, 652, 652 - - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 7, 8, 9, 10, 1, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 23, - 23, 23, 23, 23, 23, 24, 24, 25, 26, 27, - 28, 29, 30, 1, 31, 31, 31, 31, 32, 33, - 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, - 34, 34, 34, 34, 36, 34, 34, 37, 34, 34, - 38, 39, 40, 41, 42, 1, 43, 44, 45, 46, - - 47, 48, 49, 50, 51, 34, 52, 53, 54, 55, - 56, 57, 34, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[71] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 5, 6, 1, 1, 1, 1, 1, 3, - 6, 6, 6, 7, 7, 7, 7, 1, 3, 1, - 1, 7, 5, 5, 6, 6, 6, 5, 7, 7, - 7, 7, 7, 7, 8, 7, 7, 8, 7, 8, - 7, 8, 7, 8, 7, 7, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[505] = - { 0, - 0, 69, 79, 0, 149, 0, 857, 856, 217, 218, - 858, 861, 220, 861, 233, 829, 219, 828, 217, 816, - 861, 861, 826, 213, 861, 223, 233, 238, 247, 240, - 828, 861, 45, 824, 46, 861, 0, 234, 861, 861, - 823, 808, 788, 188, 235, 221, 249, 239, 792, 225, - 247, 218, 248, 238, 800, 264, 269, 262, 267, 796, - 861, 261, 861, 861, 333, 861, 861, 861, 0, 861, - 798, 861, 861, 0, 861, 861, 861, 861, 823, 342, - 861, 348, 354, 861, 303, 861, 303, 861, 861, 861, - 293, 308, 861, 861, 861, 861, 861, 827, 861, 822, - - 341, 861, 861, 861, 358, 363, 380, 396, 305, 197, - 0, 406, 335, 344, 861, 813, 861, 861, 861, 812, - 0, 353, 800, 861, 792, 777, 780, 788, 18, 791, - 790, 777, 280, 778, 769, 774, 318, 361, 770, 767, - 771, 769, 766, 772, 762, 329, 372, 766, 765, 765, - 755, 770, 769, 358, 771, 384, 758, 182, 365, 762, - 758, 385, 757, 753, 388, 758, 750, 317, 756, 861, - 861, 458, 861, 0, 758, 0, 861, 447, 0, 861, - 427, 0, 861, 861, 454, 861, 457, 460, 861, 439, - 861, 861, 861, 758, 748, 750, 759, 754, 755, 741, - - 739, 386, 445, 750, 401, 752, 752, 746, 746, 741, - 737, 734, 742, 745, 744, 0, 739, 729, 737, 737, - 729, 730, 0, 733, 730, 731, 0, 719, 718, 726, - 712, 713, 719, 720, 715, 708, 710, 712, 719, 705, - 703, 703, 705, 702, 704, 712, 711, 710, 700, 704, - 699, 693, 706, 708, 697, 698, 476, 507, 481, 543, - 467, 488, 436, 402, 703, 0, 0, 695, 0, 696, - 0, 686, 684, 692, 681, 686, 680, 675, 684, 684, - 682, 0, 0, 687, 0, 676, 675, 679, 671, 675, - 0, 681, 681, 666, 671, 0, 0, 666, 681, 448, - - 669, 679, 674, 669, 660, 658, 659, 656, 668, 463, - 663, 668, 667, 658, 0, 647, 667, 463, 660, 652, - 657, 656, 643, 0, 643, 655, 646, 412, 0, 418, - 0, 861, 647, 0, 0, 0, 657, 643, 644, 649, - 648, 637, 636, 645, 640, 0, 0, 635, 0, 0, - 643, 0, 640, 641, 639, 628, 624, 627, 631, 638, - 620, 634, 633, 617, 629, 620, 0, 628, 613, 624, - 626, 610, 619, 625, 0, 607, 619, 622, 0, 0, - 609, 0, 620, 611, 0, 614, 601, 614, 597, 597, - 610, 0, 599, 598, 0, 601, 0, 0, 0, 598, - - 0, 597, 583, 576, 571, 0, 562, 525, 0, 537, - 525, 0, 0, 0, 0, 539, 0, 0, 520, 0, - 531, 524, 530, 520, 519, 0, 514, 527, 522, 0, - 0, 510, 506, 521, 0, 517, 503, 514, 512, 0, - 511, 499, 492, 503, 500, 0, 498, 498, 0, 496, - 495, 478, 0, 475, 474, 488, 485, 0, 0, 0, - 482, 0, 469, 483, 0, 0, 0, 0, 480, 464, - 0, 0, 479, 0, 0, 470, 455, 0, 0, 448, - 442, 427, 398, 412, 0, 0, 333, 279, 250, 221, - 0, 861, 591, 599, 607, 615, 619, 623, 627, 633, - - 639, 643, 645, 647 - } ; - -static yyconst short int yy_def[505] = - { 0, - 492, 1, 492, 3, 492, 5, 493, 493, 494, 494, - 492, 492, 492, 492, 492, 492, 495, 492, 492, 496, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 497, 497, 492, 492, - 492, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 492, 492, 492, 492, 492, 492, 492, 492, 498, 492, - 498, 492, 492, 499, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 495, 492, 500, 492, 492, 492, - 496, 501, 492, 492, 492, 492, 492, 492, 492, 492, - - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 502, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 497, 495, 496, 492, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 492, - 492, 492, 492, 498, 498, 499, 492, 495, 503, 492, - 496, 504, 492, 492, 492, 492, 492, 492, 492, 502, - 492, 492, 492, 497, 497, 497, 497, 497, 497, 497, - - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 498, 495, 495, 496, 496, - 492, 492, 492, 492, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 498, 495, 258, 496, - 260, 492, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 498, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 498, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 0, 492, 492, 492, 492, 492, 492, 492, 492, - - 492, 492, 492, 492 - } ; - -static yyconst short int yy_nxt[932] = - { 0, - 12, 13, 14, 15, 15, 15, 13, 16, 17, 12, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, - 37, 37, 37, 37, 38, 37, 37, 39, 12, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 37, - 50, 37, 51, 37, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 37, 37, 37, 61, 62, 63, 64, - 65, 116, 117, 119, 120, 65, 198, 199, 66, 67, - 67, 68, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 69, - 69, 69, 69, 69, 69, 69, 67, 70, 67, 67, - 69, 69, 69, 69, 71, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 67, 67, 67, 67, 72, - 72, 73, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 74, - 74, 74, 74, 74, 74, 74, 72, 72, 72, 72, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 72, 72, 72, 72, 78, - 78, 80, 81, 82, 82, 82, 80, 86, 89, 94, - 238, 189, 79, 79, 82, 81, 83, 83, 83, 82, - 95, 96, 122, 127, 90, 128, 123, 239, 99, 189, - 97, 98, 100, 102, 101, 101, 101, 87, 103, 105, - 150, 112, 112, 112, 151, 104, 105, 133, 106, 106, - 107, 108, 146, 134, 113, 114, 135, 129, 108, 147, - 491, 109, 110, 111, 130, 136, 108, 131, 170, 141, - 132, 142, 113, 108, 143, 154, 144, 148, 155, 109, - - 114, 137, 149, 138, 152, 180, 139, 110, 490, 153, - 111, 86, 140, 157, 158, 161, 165, 167, 162, 163, - 166, 489, 168, 159, 178, 178, 160, 203, 171, 181, - 181, 92, 204, 164, 172, 81, 82, 82, 82, 172, - 189, 87, 173, 80, 81, 82, 82, 82, 80, 82, - 81, 82, 82, 82, 82, 82, 81, 83, 83, 83, - 82, 86, 101, 101, 101, 189, 179, 253, 208, 254, - 191, 182, 185, 186, 219, 186, 209, 488, 191, 101, - 101, 101, 105, 220, 106, 106, 107, 185, 186, 185, - 186, 87, 186, 186, 108, 191, 191, 109, 110, 105, - - 230, 107, 107, 107, 185, 186, 210, 240, 231, 108, - 186, 108, 187, 232, 187, 109, 221, 188, 188, 188, - 86, 211, 241, 110, 222, 105, 108, 112, 112, 112, - 180, 223, 234, 248, 235, 244, 332, 108, 249, 180, - 113, 114, 245, 236, 273, 274, 250, 278, 259, 259, - 87, 279, 108, 487, 332, 86, 92, 486, 113, 172, - 81, 82, 82, 82, 172, 92, 114, 173, 257, 257, - 261, 332, 261, 263, 264, 262, 262, 262, 188, 188, - 188, 188, 188, 188, 86, 87, 485, 275, 262, 262, - 262, 263, 186, 180, 186, 276, 332, 328, 328, 264, - - 358, 484, 330, 330, 369, 359, 483, 186, 377, 262, - 262, 262, 186, 482, 87, 86, 481, 378, 370, 92, - 186, 480, 186, 479, 478, 477, 476, 475, 329, 329, - 329, 474, 473, 472, 471, 186, 470, 329, 329, 329, - 186, 469, 468, 467, 466, 87, 465, 464, 463, 329, - 329, 329, 329, 329, 329, 180, 462, 461, 460, 459, - 458, 457, 456, 455, 331, 331, 331, 454, 453, 452, - 451, 450, 449, 331, 331, 331, 448, 447, 446, 445, - 444, 92, 443, 442, 441, 331, 331, 331, 331, 331, - 331, 75, 75, 75, 75, 75, 75, 75, 75, 77, - - 77, 77, 77, 77, 77, 77, 77, 85, 440, 85, - 85, 85, 85, 85, 85, 91, 439, 91, 438, 91, - 91, 91, 91, 121, 121, 121, 121, 174, 174, 174, - 174, 176, 176, 176, 176, 85, 85, 85, 437, 436, - 85, 91, 91, 91, 435, 434, 91, 190, 190, 258, - 258, 260, 260, 433, 432, 431, 430, 429, 428, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, - 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, - - 386, 385, 384, 383, 382, 381, 380, 379, 376, 375, - 374, 373, 372, 371, 368, 367, 366, 365, 364, 363, - 362, 361, 360, 357, 356, 355, 354, 353, 352, 351, - 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, - 340, 339, 338, 337, 336, 335, 334, 333, 327, 326, - 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, - 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, - 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, - 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, - 285, 284, 283, 282, 281, 280, 277, 272, 271, 270, - - 269, 268, 267, 266, 265, 256, 255, 252, 251, 247, - 246, 243, 242, 237, 233, 229, 228, 227, 226, 225, - 224, 218, 217, 216, 215, 214, 213, 212, 207, 206, - 205, 202, 201, 200, 197, 196, 195, 194, 92, 193, - 192, 184, 183, 177, 175, 169, 156, 145, 126, 125, - 124, 118, 115, 93, 92, 88, 84, 492, 76, 76, - 11, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492 - } ; - -static yyconst short int yy_chk[932] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 33, 33, 35, 35, 2, 129, 129, 2, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 9, - 10, 13, 13, 13, 13, 13, 13, 17, 19, 24, - 158, 110, 9, 10, 15, 15, 15, 15, 15, 15, - 24, 26, 38, 44, 19, 44, 38, 158, 27, 110, - 26, 26, 27, 28, 27, 27, 27, 17, 28, 30, - 52, 30, 30, 30, 52, 28, 29, 46, 29, 29, - 29, 30, 50, 46, 30, 30, 46, 45, 29, 50, - 490, 29, 29, 29, 45, 46, 30, 45, 62, 48, - 45, 48, 30, 29, 48, 54, 48, 51, 54, 29, - - 30, 47, 51, 47, 53, 91, 47, 29, 489, 53, - 29, 85, 47, 56, 56, 57, 58, 59, 57, 57, - 58, 488, 59, 56, 87, 87, 56, 133, 62, 92, - 92, 91, 133, 57, 65, 65, 65, 65, 65, 65, - 109, 85, 65, 80, 80, 80, 80, 80, 80, 82, - 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, - 83, 122, 101, 101, 101, 109, 87, 168, 137, 168, - 113, 92, 101, 101, 146, 101, 137, 487, 114, 105, - 105, 105, 106, 146, 106, 106, 106, 101, 101, 105, - 105, 122, 105, 101, 106, 113, 114, 106, 106, 107, - - 154, 107, 107, 107, 105, 105, 138, 159, 154, 106, - 105, 107, 108, 154, 108, 106, 147, 108, 108, 108, - 328, 138, 159, 106, 147, 112, 107, 112, 112, 112, - 330, 147, 156, 165, 156, 162, 264, 112, 165, 181, - 112, 112, 162, 156, 202, 202, 165, 205, 181, 181, - 328, 205, 112, 484, 264, 178, 330, 483, 112, 172, - 172, 172, 172, 172, 172, 181, 112, 172, 178, 178, - 185, 263, 185, 190, 190, 185, 185, 185, 187, 187, - 187, 188, 188, 188, 257, 178, 482, 203, 261, 261, - 261, 190, 188, 259, 188, 203, 263, 257, 257, 190, - - 300, 481, 259, 259, 310, 300, 480, 188, 318, 262, - 262, 262, 188, 477, 257, 258, 476, 318, 310, 259, - 262, 473, 262, 470, 469, 464, 463, 461, 258, 258, - 258, 457, 456, 455, 454, 262, 452, 258, 258, 258, - 262, 451, 450, 448, 447, 258, 445, 444, 443, 258, - 258, 258, 258, 258, 258, 260, 442, 441, 439, 438, - 437, 436, 434, 433, 260, 260, 260, 432, 429, 428, - 427, 425, 424, 260, 260, 260, 423, 422, 421, 419, - 416, 260, 411, 410, 408, 260, 260, 260, 260, 260, - 260, 493, 493, 493, 493, 493, 493, 493, 493, 494, - - 494, 494, 494, 494, 494, 494, 494, 495, 407, 495, - 495, 495, 495, 495, 495, 496, 405, 496, 404, 496, - 496, 496, 496, 497, 497, 497, 497, 498, 498, 498, - 498, 499, 499, 499, 499, 500, 500, 500, 403, 402, - 500, 501, 501, 501, 400, 396, 501, 502, 502, 503, - 503, 504, 504, 394, 393, 391, 390, 389, 388, 387, - 386, 384, 383, 381, 378, 377, 376, 374, 373, 372, - 371, 370, 369, 368, 366, 365, 364, 363, 362, 361, - 360, 359, 358, 357, 356, 355, 354, 353, 351, 348, - 345, 344, 343, 342, 341, 340, 339, 338, 337, 333, - - 327, 326, 325, 323, 322, 321, 320, 319, 317, 316, - 314, 313, 312, 311, 309, 308, 307, 306, 305, 304, - 303, 302, 301, 299, 298, 295, 294, 293, 292, 290, - 289, 288, 287, 286, 284, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 270, 268, 265, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, - 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, - 234, 233, 232, 231, 230, 229, 228, 226, 225, 224, - 222, 221, 220, 219, 218, 217, 215, 214, 213, 212, - 211, 210, 209, 208, 207, 206, 204, 201, 200, 199, - - 198, 197, 196, 195, 194, 175, 169, 167, 166, 164, - 163, 161, 160, 157, 155, 153, 152, 151, 150, 149, - 148, 145, 144, 143, 142, 141, 140, 139, 136, 135, - 134, 132, 131, 130, 128, 127, 126, 125, 123, 120, - 116, 100, 98, 79, 71, 60, 55, 49, 43, 42, - 41, 34, 31, 23, 20, 18, 16, 11, 8, 7, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#define INITIAL 0 -/* Included code before lex code */ -/*************** Includes and Defines *****************************/ - - -#include "map" -#include "cpp_lexer.h" // YACC generated definitions based on C++ grammar -#include "errno.h" - -#define YYSTYPE std::string -#define ECHO - -#include "string" -#include -#include -#include - -extern std::string cl_scope_lval; -extern std::string cl_var_lval; -extern std::string cl_func_lval; -extern std::string cl_typedef_lval; - -std::vector currentScope; - -bool setLexerInput(const std::string &in, const std::map &ignoreTokens); -void setUseIgnoreMacros(bool ignore); - -std::string getCurrentScope(); -void printScopeName(); -void cl_scope_lex_clean(); -void cl_scope_less(int count); - -//we keep a very primitive map with only symbol name -//that we encountered so far -std::map g_symbols; -std::map g_macros; - -static std::map g_ignoreList; -static bool gs_useMacroIgnore = true; - -bool isaTYPE(char *string); -bool isaMACRO(char *string); -bool isignoredToken(char *string); - -static bool defineFound = false; - -/* Prototypes */ -#define WHITE_RETURN(x) /* do nothing */ - -#define PA_KEYWORD_RETURN(x) RETURN_VAL(x) /* standard C PArser Keyword */ -#define CPP_KEYWORD_RETURN(x) PA_KEYWORD_RETURN(x) /* C++ keyword */ -#define PPPA_KEYWORD_RETURN(x) RETURN_VAL(x) /* both PreProcessor and PArser keyword */ -#define PP_KEYWORD_RETURN(x) IDENTIFIER_RETURN() - -#define IDENTIFIER_RETURN(){\ - if(isaTYPE(yytext)){\ - RETURN_VAL(LE_TYPEDEFname);\ - }else if(isaMACRO(yytext)){\ - RETURN_VAL(LE_MACRO);\ - }else if(isignoredToken(yytext)){\ - }else{ RETURN_VAL(LE_IDENTIFIER);}\ - } - - -#define PPOP_RETURN(x) RETURN_VAL((int)*yytext) /* PreProcess and Parser operator */ -#define NAMED_PPOP_RETURN(x) RETURN_VAL(x) -#define ASCIIOP_RETURN(x) RETURN_VAL((int)*yytext) /* a single character operator */ -#define NAMEDOP_RETURN(x) RETURN_VAL(x) /* a multichar operator, with a name */ - -#define NUMERICAL_RETURN(x) RETURN_VAL(x) /* some sort of constant */ -#define LITERAL_RETURN(x) RETURN_VAL(x) /* a string literal */ -#define C_COMMENT_RETURN(x) RETURN_VAL(x) /* C Style comment */ -#define RETURN_VAL(x) {\ - cl_scope_lval = yytext;\ - cl_var_lval = yytext;\ - cl_func_lval = yytext;\ - cl_typedef_lval = yytext;\ - return(x);} - -#define PREPR 1 - -#define WRAP_PREP 2 - -#define CPP_COMMENT 3 - -#define C_COMMENT 4 - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 493 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 861 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - ++yylineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -{ - BEGIN C_COMMENT; - } - YY_BREAK -case 2: -YY_RULE_SETUP -{ - BEGIN CPP_COMMENT; - } - YY_BREAK -case 3: -YY_RULE_SETUP -{ - WHITE_RETURN(' '); - } - YY_BREAK -case 4: -YY_RULE_SETUP -{ - WHITE_RETURN(' '); - } - YY_BREAK -case 5: -YY_RULE_SETUP -{ - WHITE_RETURN('\n'); - } - YY_BREAK -case 6: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_AUTO);} - YY_BREAK -case 7: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_BREAK);} - YY_BREAK -case 8: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CASE);} - YY_BREAK -case 9: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CHAR);} - YY_BREAK -case 10: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CONST);} - YY_BREAK -case 11: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CONTINUE);} - YY_BREAK -case 12: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DEFAULT);} - YY_BREAK -case 13: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_DEFINE);} - YY_BREAK -case 14: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_OPDEFINED);} - YY_BREAK -case 15: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DO);} - YY_BREAK -case 16: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DOUBLE);} - YY_BREAK -case 17: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ELIF);} - YY_BREAK -case 18: -YY_RULE_SETUP -{PPPA_KEYWORD_RETURN(LE_ELSE);} - YY_BREAK -case 19: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ENDIF);} - YY_BREAK -case 20: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_ENUM);} - YY_BREAK -case 21: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ERROR);} - YY_BREAK -case 22: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_EXTERN);} - YY_BREAK -case 23: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_FLOAT);} - YY_BREAK -case 24: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_FOR);} - YY_BREAK -case 25: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_GOTO);} - YY_BREAK -case 26: -YY_RULE_SETUP -{PPPA_KEYWORD_RETURN(LE_IF);} - YY_BREAK -case 27: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_IFDEF);} - YY_BREAK -case 28: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_IFNDEF);} - YY_BREAK -case 29: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_INCLUDE); } - YY_BREAK -case 30: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_INT);} - YY_BREAK -case 31: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_LINE);} - YY_BREAK -case 32: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_LONG);} - YY_BREAK -case 33: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_BOOL);} - YY_BREAK -case 34: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_PRAGMA);} - YY_BREAK -case 35: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_REGISTER);} - YY_BREAK -case 36: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_RETURN);} - YY_BREAK -case 37: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SHORT);} - YY_BREAK -case 38: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIGNED);} - YY_BREAK -case 39: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIZEOF);} - YY_BREAK -case 40: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_STATIC);} - YY_BREAK -case 41: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_STRUCT);} - YY_BREAK -case 42: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SWITCH);} - YY_BREAK -case 43: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_TYPEDEF);} - YY_BREAK -case 44: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_UNDEF);} - YY_BREAK -case 45: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_UNION);} - YY_BREAK -case 46: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_UNSIGNED);} - YY_BREAK -case 47: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_VOID);} - YY_BREAK -case 48: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_VOLATILE);} - YY_BREAK -case 49: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_WHILE);} - YY_BREAK -case 50: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_TIME_T);} - YY_BREAK -case 51: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIZE_T);} - YY_BREAK -case 52: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CLASS);} - YY_BREAK -case 53: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_NAMESPACE);} - YY_BREAK -case 54: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DELETE);} - YY_BREAK -case 55: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_FRIEND);} - YY_BREAK -case 56: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_INLINE);} - YY_BREAK -case 57: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_NEW);} - YY_BREAK -case 58: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OPERATOR);} - YY_BREAK -case 59: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OVERLOAD);} - YY_BREAK -case 60: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OVERRIDE);} - YY_BREAK -case 61: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_FINAL);} - YY_BREAK -case 62: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PROTECTED);} - YY_BREAK -case 63: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PRIVATE);} - YY_BREAK -case 64: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PUBLIC);} - YY_BREAK -case 65: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_THIS);} - YY_BREAK -case 66: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_VIRTUAL);} - YY_BREAK -case 67: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_TEMPLATE);} - YY_BREAK -case 68: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_TYPENAME);} - YY_BREAK -case 69: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DYNAMIC_CAST);} - YY_BREAK -case 70: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_STATIC_CAST);} - YY_BREAK -case 71: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CONST_CAST);} - YY_BREAK -case 72: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_REINTERPRET_CAST);} - YY_BREAK -case 73: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_USING);} - YY_BREAK -case 74: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_THROW);} - YY_BREAK -case 75: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CATCH);} - YY_BREAK -case 76: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DECLSPEC);} - YY_BREAK -case 77: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DLLIMPORT);} - YY_BREAK -case 78: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DLLIEXPORT);} - YY_BREAK -case 79: -YY_RULE_SETUP -{IDENTIFIER_RETURN();} - YY_BREAK -case 80: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_INTEGERconstant);} - YY_BREAK -case 81: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_OCTALconstant);} - YY_BREAK -case 82: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_HEXconstant);} - YY_BREAK -case 83: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_FLOATINGconstant);} - YY_BREAK -case 84: -YY_RULE_SETUP -{ - NUMERICAL_RETURN(LE_CHARACTERconstant); - } - YY_BREAK -case 85: -YY_RULE_SETUP -{ - LITERAL_RETURN(LE_STRINGliteral);} - YY_BREAK -case 86: -YY_RULE_SETUP -{PPOP_RETURN(LE_LP);} - YY_BREAK -case 87: -YY_RULE_SETUP -{PPOP_RETURN(LE_RP);} - YY_BREAK -case 88: -YY_RULE_SETUP -{PPOP_RETURN(LE_COMMA);} - YY_BREAK -case 89: -YY_RULE_SETUP -{BEGIN PREPR;} - YY_BREAK -case 90: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LC);} - YY_BREAK -case 91: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_RC);} - YY_BREAK -case 92: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LB);} - YY_BREAK -case 93: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_RB);} - YY_BREAK -case 94: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_DOT);} - YY_BREAK -case 95: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_AND);} - YY_BREAK -case 96: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_STAR);} - YY_BREAK -case 97: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_PLUS);} - YY_BREAK -case 98: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_MINUS);} - YY_BREAK -case 99: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_NEGATE);} - YY_BREAK -case 100: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_NOT);} - YY_BREAK -case 101: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_DIV);} - YY_BREAK -case 102: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_MOD);} - YY_BREAK -case 103: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LT);} - YY_BREAK -case 104: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_GT);} - YY_BREAK -case 105: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_XOR);} - YY_BREAK -case 106: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_PIPE);} - YY_BREAK -case 107: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_QUESTION);} - YY_BREAK -case 108: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_COLON);} - YY_BREAK -case 109: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_SEMICOLON);} - YY_BREAK -case 110: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_ASSIGN);} - YY_BREAK -case 111: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DOTstar);} - YY_BREAK -case 112: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_CLCL);} - YY_BREAK -case 113: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ARROW);} - YY_BREAK -case 114: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ARROWstar);} - YY_BREAK -case 115: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ICR);} - YY_BREAK -case 116: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DECR);} - YY_BREAK -case 117: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LS);} - YY_BREAK -case 118: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_RS);} - YY_BREAK -case 119: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LE);} - YY_BREAK -case 120: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_GE);} - YY_BREAK -case 121: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_EQ);} - YY_BREAK -case 122: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_NE);} - YY_BREAK -case 123: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ANDAND);} - YY_BREAK -case 124: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_OROR);} - YY_BREAK -case 125: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MULTassign);} - YY_BREAK -case 126: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DIVassign);} - YY_BREAK -case 127: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MODassign);} - YY_BREAK -case 128: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_PLUSassign);} - YY_BREAK -case 129: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MINUSassign);} - YY_BREAK -case 130: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LSassign);} - YY_BREAK -case 131: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_RSassign);} - YY_BREAK -case 132: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ANDassign);} - YY_BREAK -case 133: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ERassign);} - YY_BREAK -case 134: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ORassign);} - YY_BREAK -case 135: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ELLIPSIS);} - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(PREPR): -case YY_STATE_EOF(WRAP_PREP): -case YY_STATE_EOF(CPP_COMMENT): -case YY_STATE_EOF(C_COMMENT): -{ - //reset lexer - yyterminate(); - } - YY_BREAK -case 136: -YY_RULE_SETUP -{return yytext[0];} - YY_BREAK -case 137: -YY_RULE_SETUP -{ - defineFound = false; - BEGIN INITIAL; - } - YY_BREAK -case 138: -YY_RULE_SETUP -{ - BEGIN WRAP_PREP; - } - YY_BREAK -case 139: -YY_RULE_SETUP -{ - defineFound = true; - } - YY_BREAK -case 140: -YY_RULE_SETUP -{ - BEGIN PREPR; - } - YY_BREAK -case 141: -YY_RULE_SETUP -{ - if(defineFound) - { - defineFound = false; - g_macros[yytext] = true; - } - } - YY_BREAK -case 142: -YY_RULE_SETUP -{ - if(defineFound) - { - defineFound = false; - g_macros[yytext] = true; - } - } - YY_BREAK -case 143: -YY_RULE_SETUP -{} - YY_BREAK -case 144: -YY_RULE_SETUP -{} - YY_BREAK -case 145: -YY_RULE_SETUP -{BEGIN INITIAL;} - YY_BREAK -case 146: -YY_RULE_SETUP -{} - YY_BREAK -case 147: -YY_RULE_SETUP -{BEGIN INITIAL;} - YY_BREAK -case 148: -YY_RULE_SETUP -{} - YY_BREAK -case 149: -YY_RULE_SETUP -ECHO; - YY_BREAK - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * 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->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have 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 - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - char *dest = yy_current_buffer->yy_ch_buf; - char *source = yytext_ptr; - int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 493 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - int yy_is_jam; - - YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 493 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 492); - if ( ! yy_is_jam ) - *yy_state_ptr++ = yy_current_state; - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; - char *yy_bp; -#endif - { - char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - int number_to_move = yy_n_chars + 2; - char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --yylineno; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++yylineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * 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; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - 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 *) yy_flex_alloc( 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 ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - 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; - - b = (YY_BUFFER_STATE) yy_flex_alloc( 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_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - 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 ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - 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. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* 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 - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif - - -bool isaTYPE(char *string) -{ - return g_symbols.find(string) != g_symbols.end(); -} - -bool isignoredToken(char *string) -{ - std::map::iterator iter = g_ignoreList.find(string); - if(iter == g_ignoreList.end()){ - /* this string is not in the ignore macro list */ - return false; - } else { - /* it exist, but maybe it has a replacement */ - return iter->second.empty(); - } -} - -bool isaMACRO(char *string) -{ - if(gs_useMacroIgnore) { - return g_macros.find(string) != g_macros.end(); - }else{ - return false; - } -} - -void cl_scope_lex_clean() -{ - yy_flush_buffer(YY_CURRENT_BUFFER); - yy_delete_buffer(YY_CURRENT_BUFFER); - cl_scope_lineno = 1; - currentScope.clear(); - g_symbols.clear(); - g_macros.clear(); -} - -/** - * scope util functions - */ -void printScopeName() -{ - /* - if(currentScope.empty()) - { - printf("%d: current scope is global scope\n", cl_scope_lineno ); - } - else - { - printf("%d: current scope is %s\n", cl_scope_lineno, getCurrentScope().c_str()); - } - */ -} - -void increaseScope() -{ - static int value = 0; - std::string scopeName("__anon_"); - - char buf[100]; - sprintf(buf, "%d", value++); - scopeName += buf; - currentScope.push_back(scopeName); -} - -std::string getCurrentScope() -{ - //format scope name - std::string scope; - if(currentScope.empty()){ - return ""; - } - - std::vector tmpscope(currentScope); - - while( tmpscope.empty() == false ){ - std::string _scope = tmpscope.front(); - tmpscope.erase(tmpscope.begin()); - - if(_scope.find("__anon_") == (size_t)-1 && _scope.empty() == false){ - scope += _scope; - scope += "::"; - } - } - - //remove the trailing '::' - scope.erase(scope.find_last_not_of(":")+1); - return scope; -} - -/*******************************************************************/ -bool setLexerInput(const std::string &in, const std::map &ignoreTokens) -{ - BEGIN INITIAL; - yy_scan_string(in.c_str()); - - g_ignoreList = ignoreTokens; - - //update the working file name - return true; -} - -void setUseIgnoreMacros(bool ignore) { - gs_useMacroIgnore = ignore; -} - -int yywrap(){ - return 1; -} - -void cl_scope_less(int count){ - yyless(count); -} diff --git a/CodeLite/cpp_lexer.h b/CodeLite/cpp_lexer.h deleted file mode 100644 index 81c280bd70..0000000000 --- a/CodeLite/cpp_lexer.h +++ /dev/null @@ -1,124 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// Copyright : (C) 2015 Eran Ifrah -// File name : cpp_lexer.h -// -// ------------------------------------------------------------------------- -// A -// _____ _ _ _ _ -// / __ \ | | | | (_) | -// | / \/ ___ __| | ___| | _| |_ ___ -// | | / _ \ / _ |/ _ \ | | | __/ _ ) -// | \__/\ (_) | (_| | __/ |___| | || __/ -// \____/\___/ \__,_|\___\_____/_|\__\___| -// -// F i l e -// -// 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 -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define LE_DECLSPEC 353 -#define LE_DLLIMPORT 354 -#define LE_DLLIEXPORT 355 diff --git a/CodeLite/scope_parser.cpp b/CodeLite/scope_parser.cpp deleted file mode 100644 index 1d8ebee4bb..0000000000 --- a/CodeLite/scope_parser.cpp +++ /dev/null @@ -1,1362 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_scope_parse -#define yylex cl_scope_lex -#define yyerror cl_scope_error -#define yychar cl_scope_char -#define yyval cl_scope_val -#define yylval cl_scope_lval -#define yydebug cl_scope_debug -#define yynerrs cl_scope_nerrs -#define yyerrflag cl_scope_errflag -#define yyss cl_scope_ss -#define yyssp cl_scope_ssp -#define yyvs cl_scope_vs -#define yyvsp cl_scope_vsp -#define yylhs cl_scope_lhs -#define yylen cl_scope_len -#define yydefred cl_scope_defred -#define yydgoto cl_scope_dgoto -#define yysindex cl_scope_sindex -#define yyrindex cl_scope_rindex -#define yygindex cl_scope_gindex -#define yytable cl_scope_table -#define yycheck cl_scope_check -#define yyname cl_scope_name -#define yyrule cl_scope_rule -#define YYPREFIX "cl_scope_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include -#include -#include -#include -#include - -#define YYDEBUG_LEXER_TEXT (cl_scope_lval) -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ -static std::string readInitializer(const char* delim); -static void readClassName(); - -static std::string className; - -static std::string templateInitList; -int cl_scope_parse(); -void cl_scope_error(char *string); -void syncParser(); - -static std::vector gs_additionlNS; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_scope_text; -extern int cl_scope_lex(); -extern bool setLexerInput(const std::string &in, const std::map &ignoreTokens); -extern int cl_scope_lineno; -extern std::vector currentScope; -extern void printScopeName(); /*print the current scope name*/ -extern void increaseScope(); /*increase scope with anonymouse value*/ -extern std::string getCurrentScope(); -extern void cl_scope_lex_clean(); -extern void cl_scope_less(int count); - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define LE_DECLSPEC 353 -#define LE_DLLIMPORT 354 -#define LE_DLLIEXPORT 355 -#define YYERRCODE 256 -short cl_scope_lhs[] = { -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 0, 0, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 14, - 14, 14, 16, 16, 15, 15, 17, 17, 18, 18, - 18, 19, 19, 19, 10, 9, 9, 4, 11, 12, - 13, 24, 24, 25, 25, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 27, 27, 28, 28, - 5, 31, 8, 32, 8, 33, 8, 21, 21, 34, - 35, 34, 29, 29, 20, 20, 36, 36, 37, 37, - 22, 23, 23, 23, 30, 30, 30, 39, 6, 40, - 40, 40, 40, 41, 38, 38, 38, 7, -}; -short cl_scope_len[] = { 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 1, 0, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 3, 1, 3, 1, 1, 0, 4, 0, 1, - 3, 4, 4, 7, 5, 5, 3, 3, 1, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, - 2, 0, 12, 0, 9, 0, 11, 0, 2, 2, - 0, 4, 0, 1, 0, 1, 0, 1, 0, 2, - 2, 0, 1, 1, 3, 3, 6, 0, 7, 0, - 2, 2, 2, 2, 0, 1, 3, 4, -}; -short cl_scope_defred[] = { 17, - 0, 29, 0, 0, 123, 50, 49, 51, 124, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 0, 101, 108, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 47, 0, 53, 52, 114, 48, 0, 0, - 109, 128, 138, 35, 36, 33, 0, 0, 0, 116, - 108, 110, 111, 45, 0, 0, 0, 38, 46, 0, - 108, 0, 0, 0, 136, 32, 34, 6, 1, 0, - 2, 5, 3, 0, 10, 0, 9, 0, 0, 11, - 0, 16, 119, 0, 0, 112, 0, 134, 0, 129, - 15, 14, 4, 8, 7, 12, 13, 84, 85, 72, - 76, 77, 68, 69, 78, 79, 80, 81, 70, 71, - 75, 73, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 57, 86, 66, 67, 56, 58, 59, 60, - 61, 62, 63, 64, 65, 74, 0, 0, 55, 0, - 126, 0, 54, 0, 125, 104, 0, 0, 133, 132, - 131, 137, 82, 83, 0, 40, 108, 120, 118, 121, - 106, 0, 102, 0, 119, 0, 0, 97, 98, 105, - 0, 41, 127, 0, 119, 0, 0, 0, 42, 43, - 107, 0, 0, 0, 0, 103, 119, 0, 44, 100, -}; -short cl_scope_dgoto[] = { 1, - 82, 83, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 46, 47, 48, 28, 155, 156, 157, - 29, 141, 21, 38, 84, 139, 170, 183, 39, 61, - 171, 162, 167, 41, 62, 160, 142, 64, 55, 88, - 65, -}; -short cl_scope_sindex[] = { 0, - -3, 0, -269, -259, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -241, 0, 0, -239, -236, 28, -25, -211, -202, -2, - 5, -268, 0, -175, 0, 0, 0, 0, -144, -58, - 0, 0, 0, 0, 0, 0, -172, -12, -52, 0, - 0, 0, 0, 0, -171, 77, -268, 0, 0, 129, - 0, -194, 79, -23, 0, 0, 0, 0, 0, -163, - 0, 0, 0, -150, 0, -150, 0, -33, -48, 0, - -204, 0, 0, 101, -201, 0, -179, 0, -171, 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, 0, - 0, 0, 0, 0, 0, 0, 102, 49, 0, -144, - 0, 74, 0, 105, 0, 0, -19, 111, 0, 0, - 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, - 0, -28, 0, -144, 0, 158, -144, 0, 0, 0, - -144, 0, 0, -18, 0, 21, -152, -144, 0, 0, - 0, 116, 34, -10, -144, 0, 0, 4, 0, 0, -}; -short cl_scope_rindex[] = { 0, - -111, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 78, 0, 0, 0, 0, 0, -149, 104, 0, 0, - 0, -8, 0, 0, 0, 0, 0, 0, 193, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -22, 23, -8, 0, 0, 0, - 0, 0, -20, 0, 0, 0, 0, 0, 0, 24, - 0, 0, 0, 32, 0, 37, 0, 0, 42, 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, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, - 0, -24, 0, 0, 0, 0, 120, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 0, 0, 44, 0, 0, 0, - -107, 0, 0, 2, 0, 0, 45, -9, 0, 0, - 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, -}; -short cl_scope_gindex[] = { 0, - 41, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 114, 0, 0, 0, -88, 9, -21, - -4, -64, 0, 0, 33, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 85, -}; -#define YYTABLESIZE 544 -short cl_scope_table[] = { 135, - 54, 53, 39, 130, 132, 39, 137, 53, 128, 127, - 124, 140, 136, 129, 122, 115, 117, 51, 145, 117, - 89, 135, 34, 130, 24, 44, 125, 123, 126, 169, - 25, 57, 164, 164, 39, 30, 45, 117, 22, 119, - 53, 178, 119, 119, 190, 119, 60, 164, 35, 58, - 165, 187, 39, 30, 9, 5, 85, 138, 23, 8, - 131, 4, 26, 119, 4, 4, 31, 4, 30, 8, - 59, 31, 8, 8, 7, 8, 27, 7, 7, 119, - 7, 54, 36, 119, 31, 4, 37, 32, 78, 184, - 133, 78, 134, 8, 168, 91, 188, 33, 7, 92, - 173, 90, 135, 143, 130, 40, 147, 68, 69, 179, - 180, 159, 93, 144, 96, 158, 97, 148, 71, 6, - 42, 7, 189, 72, 73, 94, 75, 43, 50, 95, - 77, 149, 49, 150, 151, 56, 63, 66, 86, 87, - 146, 154, 153, 181, 161, 176, 122, 122, 122, 177, - 163, 122, 166, 182, 122, 185, 186, 122, 108, 54, - 122, 122, 122, 122, 122, 122, 115, 99, 122, 122, - 67, 175, 172, 152, 0, 0, 0, 0, 0, 0, - 0, 122, 122, 0, 0, 0, 122, 0, 0, 0, - 0, 0, 122, 0, 0, 0, 122, 0, 115, 0, - 80, 0, 0, 37, 0, 0, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, - 115, 0, 0, 0, 115, 0, 0, 0, 0, 113, - 115, 0, 0, 0, 0, 115, 115, 115, 115, 122, - 0, 115, 115, 0, 0, 0, 0, 0, 115, 115, - 0, 0, 2, 115, 81, 0, 98, 99, 0, 115, - 0, 3, 0, 0, 115, 115, 115, 115, 117, 115, - 115, 115, 0, 0, 52, 0, 0, 0, 0, 0, - 52, 0, 0, 117, 52, 0, 0, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 115, 0, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 115, 52, 52, 4, 4, 0, 115, 0, - 0, 0, 0, 111, 8, 0, 0, 0, 0, 7, - 0, 4, 0, 0, 119, 37, 37, 37, 0, 8, - 37, 115, 0, 0, 7, 0, 37, 0, 0, 119, - 37, 37, 37, 37, 37, 0, 0, 37, 37, 0, - 0, 113, 113, 0, 0, 0, 113, 0, 0, 0, - 37, 37, 113, 0, 0, 37, 113, 113, 113, 113, - 113, 0, 0, 113, 113, 37, 68, 69, 0, 0, - 0, 70, 0, 0, 0, 0, 113, 71, 0, 0, - 0, 0, 72, 73, 74, 75, 0, 0, 76, 77, - 0, 113, 0, 0, 0, 68, 69, 0, 0, 0, - 70, 78, 0, 0, 115, 115, 71, 0, 37, 115, - 0, 72, 73, 74, 75, 115, 79, 76, 77, 0, - 115, 115, 115, 115, 0, 0, 115, 115, 0, 0, - 115, 115, 0, 0, 113, 115, 0, 0, 0, 0, - 0, 115, 0, 0, 0, 174, 115, 115, 115, 115, - 0, 0, 115, 115, 115, 0, 0, 0, 0, 80, - 0, 0, 0, 0, 0, 115, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 115, 0, 0, 0, 0, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 115, 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, 115, -}; -short cl_scope_check[] = { 33, - 59, 60, 41, 37, 38, 44, 40, 60, 42, 43, - 44, 60, 46, 47, 126, 123, 41, 39, 83, 44, - 44, 44, 27, 44, 266, 294, 60, 61, 62, 58, - 272, 44, 44, 44, 44, 44, 305, 62, 308, 38, - 60, 60, 41, 42, 41, 44, 51, 44, 260, 62, - 62, 62, 62, 62, 58, 59, 61, 91, 318, 63, - 94, 38, 304, 62, 41, 42, 44, 44, 308, 38, - 123, 308, 41, 42, 38, 44, 318, 41, 42, 38, - 44, 40, 294, 42, 62, 62, 298, 60, 293, 178, - 124, 293, 126, 62, 123, 259, 185, 123, 62, 263, - 165, 125, 125, 308, 125, 308, 308, 258, 259, 174, - 175, 38, 263, 81, 74, 42, 76, 85, 269, 123, - 123, 125, 187, 274, 275, 276, 277, 123, 273, 280, - 281, 311, 308, 313, 314, 308, 308, 61, 333, 61, - 40, 93, 41, 123, 40, 167, 258, 259, 260, 171, - 40, 263, 157, 306, 266, 40, 123, 269, 308, 40, - 272, 273, 274, 275, 276, 277, 123, 123, 280, 281, - 57, 166, 164, 89, -1, -1, -1, -1, -1, -1, - -1, 293, 294, -1, -1, -1, 298, -1, -1, -1, - -1, -1, 304, -1, -1, -1, 308, -1, 306, -1, - 351, -1, -1, 126, -1, -1, 318, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 258, - 259, -1, -1, -1, 263, -1, -1, -1, -1, 126, - 269, -1, -1, -1, -1, 274, 275, 276, 277, 351, - -1, 280, 281, -1, -1, -1, -1, -1, 258, 259, - -1, -1, 256, 263, 126, -1, 290, 291, -1, 269, - -1, 265, -1, -1, 274, 275, 276, 277, 293, 308, - 280, 281, -1, -1, 333, -1, -1, -1, -1, -1, - 333, -1, -1, 308, 333, -1, -1, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 308, -1, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 351, 333, 333, 319, 293, -1, 126, -1, - -1, -1, -1, 333, 293, -1, -1, -1, -1, 293, - -1, 308, -1, -1, 293, 258, 259, 260, -1, 308, - 263, 351, -1, -1, 308, -1, 269, -1, -1, 308, - 273, 274, 275, 276, 277, -1, -1, 280, 281, -1, - -1, 258, 259, -1, -1, -1, 263, -1, -1, -1, - 293, 294, 269, -1, -1, 298, 273, 274, 275, 276, - 277, -1, -1, 280, 281, 308, 258, 259, -1, -1, - -1, 263, -1, -1, -1, -1, 293, 269, -1, -1, - -1, -1, 274, 275, 276, 277, -1, -1, 280, 281, - -1, 308, -1, -1, -1, 258, 259, -1, -1, -1, - 263, 293, -1, -1, 258, 259, 269, -1, 351, 263, - -1, 274, 275, 276, 277, 269, 308, 280, 281, -1, - 274, 275, 276, 277, -1, -1, 280, 281, -1, -1, - 258, 259, -1, -1, 351, 263, -1, -1, -1, -1, - -1, 269, -1, -1, -1, 308, 274, 275, 276, 277, - -1, -1, 280, 281, 308, -1, -1, -1, -1, 351, - -1, -1, -1, -1, -1, 293, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 308, -1, -1, -1, -1, -1, -1, -1, 351, -1, - -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 351, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 355 -#if YYDEBUG -char *cl_scope_name[] = { -"end-of-file",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,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,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,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,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,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,"LE_AUTO", -"LE_DOUBLE","LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE","LE_LONG","LE_SWITCH", -"LE_CASE","LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR","LE_EXTERN", -"LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT","LE_UNSIGNED","LE_BOOL", -"LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID","LE_DEFAULT","LE_GOTO","LE_SIZEOF", -"LE_VOLATILE","LE_DO","LE_IF","LE_STATIC","LE_WHILE","LE_NEW","LE_DELETE", -"LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC","LE_PROTECTED","LE_PRIVATE", -"LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD","LE_OVERRIDE","LE_FINAL", -"LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH","LE_IDENTIFIER", -"LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T","LE_DECLSPEC","LE_DLLIMPORT", -"LE_DLLIEXPORT", -}; -char *cl_scope_rule[] = { -"$accept : translation_unit", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name_inter : LE_SIZE_T", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : LE_LONG LE_LONG", -"basic_type_name : LE_LONG LE_INT", -"basic_type_name : basic_type_name_inter", -"translation_unit :", -"translation_unit : translation_unit external_decl", -"external_decl : class_decl", -"external_decl : dummy_case", -"external_decl : enum_decl", -"external_decl : union_decl", -"external_decl : function_decl", -"external_decl : namespace_decl", -"external_decl : using_namespace", -"external_decl : scope_reducer", -"external_decl : scope_increaer", -"external_decl : question_expression", -"external_decl : error", -"template_arg :", -"template_arg : template_specifiter LE_IDENTIFIER", -"template_arg : template_specifiter LE_IDENTIFIER '='", -"template_arg_list : template_arg", -"template_arg_list : template_arg_list ',' template_arg", -"template_specifiter : LE_CLASS", -"template_specifiter : LE_TYPENAME", -"opt_template_qualifier :", -"opt_template_qualifier : LE_TEMPLATE '<' template_arg_list '>'", -"template_parameter_list :", -"template_parameter_list : template_parameter", -"template_parameter_list : template_parameter_list ',' template_parameter", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp", -"using_namespace : LE_USING LE_NAMESPACE nested_scope_specifier LE_IDENTIFIER ';'", -"namespace_decl : stmnt_starter LE_NAMESPACE nested_scope_specifier LE_IDENTIFIER '{'", -"namespace_decl : stmnt_starter LE_NAMESPACE '{'", -"class_decl : stmnt_starter opt_template_qualifier class_keyword", -"scope_reducer : '}'", -"scope_increaer : '{'", -"question_expression : '?'", -"class_keyword : LE_CLASS", -"class_keyword : LE_STRUCT", -"func_name : LE_IDENTIFIER", -"func_name : LE_OPERATOR any_operator", -"any_operator : '+'", -"any_operator : '='", -"any_operator : '*'", -"any_operator : '/'", -"any_operator : '%'", -"any_operator : '^'", -"any_operator : '&'", -"any_operator : '|'", -"any_operator : '~'", -"any_operator : '!'", -"any_operator : '<'", -"any_operator : '>'", -"any_operator : LE_LS", -"any_operator : LE_RS", -"any_operator : LE_ANDAND", -"any_operator : LE_OROR", -"any_operator : LE_ARROW", -"any_operator : LE_ARROWstar", -"any_operator : '.'", -"any_operator : LE_DOTstar", -"any_operator : LE_ICR", -"any_operator : LE_DECR", -"any_operator : LE_LE", -"any_operator : LE_GE", -"any_operator : LE_EQ", -"any_operator : LE_NE", -"any_operator : '(' ')'", -"any_operator : '[' ']'", -"any_operator : LE_NEW", -"any_operator : LE_DELETE", -"any_operator : ','", -"any_operator : LE_MULTassign", -"any_operator : LE_DIVassign", -"any_operator : LE_MODassign", -"any_operator : LE_PLUSassign", -"any_operator : LE_MINUSassign", -"any_operator : LE_LSassign", -"any_operator : LE_RSassign", -"any_operator : LE_ANDassign", -"any_operator : LE_ERassign", -"any_operator : LE_ORassign", -"optional_initialization_list : '{'", -"optional_initialization_list : ':'", -"declare_throw :", -"declare_throw : LE_THROW '(' template_parameter_list ')'", -"dummy_case : LE_CASE LE_IDENTIFIER", -"$$1 :", -"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec variable_decl nested_scope_specifier func_name '(' $$1 const_spec declare_throw '{'", -"$$2 :", -"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec nested_scope_specifier func_name '(' $$2 optional_initialization_list", -"$$3 :", -"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec nested_scope_specifier '~' func_name '(' $$3 const_spec '{'", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"$$4 :", -"scope_specifier : LE_IDENTIFIER '<' $$4 LE_CLCL", -"virtual_spec :", -"virtual_spec : LE_VIRTUAL", -"const_spec :", -"const_spec : LE_CONST", -"amp_item :", -"amp_item : '&'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : ':'", -"variable_decl : nested_scope_specifier basic_type_name special_star_amp", -"variable_decl : nested_scope_specifier LE_IDENTIFIER special_star_amp", -"variable_decl : nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp", -"$$5 :", -"enum_decl : stmnt_starter LE_ENUM LE_IDENTIFIER '{' $$5 enum_arg_list '}'", -"enum_optional_assign :", -"enum_optional_assign : '=' LE_HEXconstant", -"enum_optional_assign : '=' LE_OCTALconstant", -"enum_optional_assign : '=' LE_INTEGERconstant", -"enum_argument : LE_IDENTIFIER enum_optional_assign", -"enum_arg_list :", -"enum_arg_list : enum_argument", -"enum_arg_list : enum_arg_list ',' enum_argument", -"union_decl : stmnt_starter LE_UNION LE_IDENTIFIER '{'", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - -void syncParser(){ - //move lexer to the next ';' line or scope opening '{' - //int ch = cl_scope_lex(); -} - -//swallow all tokens up to the first '{' -void consumeInitializationList(){ - while( true ){ - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - if(ch == '{'){ - break; - } - } -} - -void consumeFuncArgList(){ - int depth = 1; - while(depth > 0){ - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - if(ch == ')'){ - depth--; - continue; - } - else if(ch == '('){ - depth ++ ; - continue; - } - } -} - -void readClassName() -{ -#define NEXT_TOK() c = cl_scope_lex(); if(c == 0) {className.clear(); return;} -#define BREAK_IF_NOT(x) if(c != (int)x) {className.clear(); break;} -#define BREAK_IF_NOT2(x, y) if(c != (int)x && c != (int)y) break; -#define BREAK_IF(x) if(c == (int)x) break; - - className.clear(); - - // look ahead and see if we can see another - while( true ){ - int c = cl_scope_lex(); - if(c == 0){ // EOF? - className.clear(); - break; - } - - if(c == LE_MACRO || c == LE_FINAL) { - continue; - - } else if(c == LE_IDENTIFIER) { - className = cl_scope_text; - - } else if(c == LE_DECLSPEC && className.empty()) { - // found decl sepc - - // Next token is '(' - NEXT_TOK(); - BREAK_IF_NOT('('); - - // Next token is LE_DLLIMPORT or LE_DLLEXPORT - NEXT_TOK(); - BREAK_IF_NOT2(LE_DLLIEXPORT, LE_DLLIMPORT); - - // Next token should be closing brace - NEXT_TOK(); - BREAK_IF_NOT(')'); - - } else if( (c == '{') && (!className.empty()) ){ - // The following is the class content - break; - - } else if( c == ':' && !className.empty() ) { - // we got the class name, and we found ':' - // read all tokens up until the first open brace - while (true) { - NEXT_TOK(); - if( c == (int)'{') { - return; - } - } - } else { - className.clear(); - break; - - } - } -} - -/** - * consume all token until matching closing brace is found - */ -void consumeDecl() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - if(ch ==0) - { - break; - } - if(ch == '}') - { - depth--; - if(depth == 0) currentScope.pop_back();//reduce the scope - continue; - } - else if(ch == '{') - { - depth ++ ; - continue; - } - } - -} - -void consumeTemplateDecl() -{ - templateInitList.clear(); - int dep = 0; - while( true ){ - int c = cl_scope_lex(); - if(c == 0){ // EOF? - break; - } - - if(c == '>' && dep == 0){ - templateInitList += cl_scope_text; - break; - - } else { - templateInitList += cl_scope_text; - templateInitList += " "; - } - - switch(c) { - case (int)'<': - dep++; - break; - case (int)'>': - dep--; - break; - default: - break; - } - } - - if(templateInitList.empty() == false) - templateInitList.insert(0, "<"); -} - -std::string readInitializer(const char* delim) -{ - std::string intializer; - int dep = 0; - while( true ){ - int c = cl_scope_lex(); - if(c == 0){ // EOF? - break; - } - - if(strchr(delim, (char)c) && dep == 0){ - cl_scope_less(0); - break; - - } else { - intializer += cl_scope_text; - intializer += " "; - } - - switch(c) { - case (int)'<': - dep++; - break; - case (int)'>': - dep--; - break; - default: - break; - } - } - return intializer; -} -//swallow all tokens up to the first '{' -void consumeNotIncluding(int ch){ - while( true ){ - int c = cl_scope_lex(); - if(c == 0){ // EOF? - break; - } - - //keep the function signature - if(c == ch){ - cl_scope_less(0); - break; - } - } -} - -// return the scope name at the end of the input string -std::string get_scope_name( const std::string &in, - std::vector &additionalNS, - const std::map &ignoreTokens) -{ - if( !setLexerInput(in, ignoreTokens) ){ - return ""; - } - - //call tghe main parsing routine - cl_scope_parse(); - std::string scope = getCurrentScope(); - //do the lexer cleanup - cl_scope_lex_clean(); - - for(size_t i=0; i= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -{ yyval = yyvsp[0]; } -break; -case 2: -{ yyval = yyvsp[0]; } -break; -case 3: -{ yyval = yyvsp[0]; } -break; -case 4: -{ yyval = yyvsp[0]; } -break; -case 5: -{ yyval = yyvsp[0]; } -break; -case 6: -{ yyval = yyvsp[0]; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 16: -{ yyval = yyvsp[0]; } -break; -case 29: -{ - /*printf("CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_scope_text, cl_scope_lineno);*/ - /*syncParser();*/ - } -break; -case 30: -{ yyval = "";} -break; -case 31: -{yyval = yyvsp[-1] + " " + yyvsp[0];} -break; -case 32: -{yyval = yyvsp[-2] + " " + yyvsp[-1] + "=" + readInitializer(",>");} -break; -case 33: -{ yyval = yyvsp[0]; } -break; -case 34: -{ yyval = yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; } -break; -case 35: -{ yyval = yyvsp[0]; } -break; -case 36: -{ yyval = yyvsp[0]; } -break; -case 38: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - } -break; -case 39: -{yyval = "";} -break; -case 40: -{yyval = yyvsp[0];} -break; -case 41: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 42: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 43: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 44: -{ - yyval = yyvsp[-6] + yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ; - } -break; -case 45: -{ - gs_additionlNS.push_back(yyvsp[-2]+yyvsp[-1]); - } -break; -case 46: -{ - currentScope.push_back(yyvsp[-2]+yyvsp[-1]); - - } -break; -case 47: -{ - /*anonymouse namespace*/ - increaseScope(); - - } -break; -case 48: -{ - readClassName(); - /*increase the scope level*/ - if(className.empty() == false) { - currentScope.push_back( className ); - printScopeName(); - } - } -break; -case 49: -{ - if(currentScope.empty()) - { - /*fatal error!*/ - /*printf("CodeLite: fatal error - cant go beyond global scope!\n");*/ - } - else - { - currentScope.pop_back(); - printScopeName(); - } - } -break; -case 50: -{ - /*increase random scope*/ - increaseScope(); - printScopeName(); - } -break; -case 51: -{ - consumeNotIncluding(';'); - } -break; -case 52: -{yyval = yyvsp[0];} -break; -case 53: -{yyval = yyvsp[0];} -break; -case 54: -{yyval = yyvsp[0];} -break; -case 55: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 82: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 83: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 97: -{yyval = '{';} -break; -case 98: -{consumeInitializationList() /*eat everything including the open brace*/;} -break; -case 99: -{yyval = "";} -break; -case 100: -{yyval = yyvsp[-1];} -break; -case 101: -{ - /* eat up all tokens not including the ':'*/ - consumeNotIncluding(':'); -} -break; -case 102: -{consumeFuncArgList();} -break; -case 103: -{ - /*printf("found function %s\n", $7.c_str());*/ - /*trim down trailing '::' from scope name*/ - if(yyvsp[-6].find_last_not_of(":") != std::string::npos){ - yyvsp[-6].erase(yyvsp[-6].find_last_not_of(":")+1); - } - currentScope.push_back(yyvsp[-6]); - printScopeName(); - } -break; -case 104: -{consumeFuncArgList();} -break; -case 105: -{ - - /*trim down trailing '::' from scope name*/ - if(yyvsp[-4].find_last_not_of(":") != std::string::npos){ - yyvsp[-4].erase(yyvsp[-4].find_last_not_of(":")+1); - } - currentScope.push_back(yyvsp[-4]); - printScopeName(); - } -break; -case 106: -{consumeFuncArgList();} -break; -case 107: -{ - - /*trim down trailing '::' from scope name*/ - if(yyvsp[-6].find_last_not_of(":") != std::string::npos){ - yyvsp[-6].erase(yyvsp[-6].find_last_not_of(":")+1); - } - currentScope.push_back(yyvsp[-6]); - printScopeName(); - } -break; -case 108: -{yyval = "";} -break; -case 109: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 110: -{yyval = yyvsp[-1]+ yyvsp[0];} -break; -case 111: -{consumeTemplateDecl();} -break; -case 112: -{yyval = yyvsp[-3] + yyvsp[0];} -break; -case 113: -{yyval = ""; } -break; -case 114: -{ yyval = yyvsp[0]; } -break; -case 115: -{yyval = ""; } -break; -case 116: -{ yyval = yyvsp[0]; } -break; -case 117: -{yyval = ""; } -break; -case 118: -{ yyval = yyvsp[0]; } -break; -case 119: -{yyval = ""; } -break; -case 120: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 121: -{ yyval = yyvsp[-1] + yyvsp[0]; } -break; -case 122: -{yyval = "";} -break; -case 123: -{ yyval = ";";} -break; -case 124: -{ yyval = ":";} -break; -case 125: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0] ;} -break; -case 126: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0] ;} -break; -case 127: -{yyval = yyvsp[-5] + yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] ;} -break; -case 128: -{currentScope.push_back(yyvsp[-1]); printScopeName();} -break; -case 129: -{ - currentScope.pop_back();/*reduce the scope*/ - printScopeName(); - /*printf("found enum: %s, args are: %s\n", $2.c_str(), $5.c_str());*/ - } -break; -case 130: -{yyval = "";} -break; -case 131: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 132: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 133: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 134: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 135: -{yyval = "";} -break; -case 136: -{yyval = yyvsp[0];} -break; -case 137: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 138: -{ - currentScope.push_back(yyvsp[-1]); - printScopeName(); - consumeDecl(); - printScopeName(); - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CodeLite/typedef_parser.cpp b/CodeLite/typedef_parser.cpp deleted file mode 100644 index 0da70f4941..0000000000 --- a/CodeLite/typedef_parser.cpp +++ /dev/null @@ -1,963 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_typedef_parse -#define yylex cl_typedef_lex -#define yyerror cl_typedef_error -#define yychar cl_typedef_char -#define yyval cl_typedef_val -#define yylval cl_typedef_lval -#define yydebug cl_typedef_debug -#define yynerrs cl_typedef_nerrs -#define yyerrflag cl_typedef_errflag -#define yyss cl_typedef_ss -#define yyssp cl_typedef_ssp -#define yyvs cl_typedef_vs -#define yyvsp cl_typedef_vsp -#define yylhs cl_typedef_lhs -#define yylen cl_typedef_len -#define yydefred cl_typedef_defred -#define yydgoto cl_typedef_dgoto -#define yysindex cl_typedef_sindex -#define yyrindex cl_typedef_rindex -#define yygindex cl_typedef_gindex -#define yytable cl_typedef_table -#define yycheck cl_typedef_check -#define yyname cl_typedef_name -#define yyrule cl_typedef_rule -#define YYPREFIX "cl_typedef_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include "string" -#include "vector" -#include "stdio.h" -#include "map" -#include "variable.h" -#include "cl_typedef.h" - -#ifdef yylex -#undef yylex -#define yylex cl_scope_lex -#endif - -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ - -int cl_typedef_parse(); -void syncParser(); -static std::string typedef_consumBracketsContent(char openBrace); -static void typedef_consumeDefaultValue(char c1, char c2); - -static VariableList * gs_vars = NULL; -static std::vector gs_names; -static bool g_isUsedWithinFunc = false; -static std::string s_tmpString; -static Variable curr_var; -static clTypedefList gs_typedefs; -static clTypedef gs_currentTypedef; -static std::string s_templateInitList; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_scope_text; -extern int cl_scope_lex(); -extern void cl_scope_less(int count); -extern int cl_scope_lineno; -extern void cl_scope_lex_clean(); -extern bool setLexerInput(const std::string &in, const std::map &ignoreMap); -extern void setUseIgnoreMacros(bool ignore); - - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define YYERRCODE 256 -short cl_typedef_lhs[] = { -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 0, 0, 5, 3, 3, - 4, 4, 8, 9, 7, 7, 10, 13, 10, 14, - 14, 14, 15, 15, 15, 18, 18, 17, 17, 16, - 16, 16, 16, 16, 19, 19, 20, 20, 12, 6, - 6, 6, 6, 6, 11, 11, 11, 21, 11, 11, -}; -short cl_typedef_len[] = { 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 1, 0, 2, 0, 2, 1, - 6, 8, 2, 1, 0, 1, 0, 0, 3, 0, - 1, 3, 4, 4, 7, 2, 5, 0, 2, 0, - 1, 2, 2, 3, 0, 1, 0, 2, 2, 0, - 1, 1, 1, 1, 2, 3, 6, 0, 6, 4, -}; -short cl_typedef_defred[] = { 16, - 0, 20, 17, 0, 51, 52, 53, 54, 19, 0, - 0, 0, 0, 26, 0, 28, 0, 0, 0, 47, - 0, 29, 24, 0, 0, 43, 0, 23, 0, 6, - 1, 38, 0, 2, 5, 3, 0, 10, 0, 9, - 15, 55, 0, 0, 44, 21, 48, 46, 49, 0, - 14, 13, 4, 8, 7, 11, 12, 0, 39, 0, - 0, 36, 0, 0, 0, 58, 0, 31, 38, 22, - 0, 59, 0, 0, 0, 0, 32, 37, 0, 47, - 0, 33, 34, 0, 0, 35, -}; -short cl_typedef_dgoto[] = { 1, - 41, 42, 3, 9, 4, 10, 15, 19, 24, 13, - 20, 28, 22, 67, 68, 69, 43, 59, 49, 29, - 72, -}; -short cl_typedef_sindex[] = { 0, - -222, 0, 0, -50, 0, 0, 0, 0, 0, -235, - -264, -1, -254, 0, -207, 0, -237, 11, -237, 0, - 20, 0, 0, 23, 30, 0, 26, 0, 22, 0, - 0, 0, -180, 0, 0, 0, -30, 0, -30, 0, - 0, 0, -220, -264, 0, 0, 0, 0, 0, -219, - 0, 0, 0, 0, 0, 0, 0, -59, 0, -207, - -60, 0, -207, 27, -207, 0, -7, 0, 0, 0, - -5, 0, -207, -243, -85, -243, 0, 0, -58, 0, - -207, 0, 0, -4, -243, 0, -}; -short cl_typedef_rindex[] = { 0, - -55, 0, 0, -252, 0, 0, 0, 0, 0, -223, - -182, 0, 0, 0, -158, 0, 0, -129, 0, 0, - -211, 0, 0, 0, -105, 0, 0, 0, -15, 0, - 0, 0, -32, 0, 0, 0, -31, 0, -24, 0, - 0, 0, 0, -182, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -23, 0, -158, - -17, 0, -39, 0, -39, 0, 0, 0, 0, 0, - 0, 0, -76, -16, 0, 0, 0, 0, 12, 0, - -39, 0, 0, 0, 12, 0, -}; -short cl_typedef_gindex[] = { 0, - 43, 28, 0, 0, 0, 0, 60, 46, 88, 0, - 0, -34, 0, -33, 35, 2, -8, 0, 0, 0, - 0, -}; -#define YYTABLESIZE 301 -short cl_typedef_table[] = { 65, - 63, 81, 18, 18, 30, 4, 8, 8, 5, 4, - 8, 4, 8, 7, 56, 50, 21, 7, 56, 7, - 60, 57, 30, 50, 60, 57, 4, 8, 45, 4, - 8, 71, 11, 2, 7, 56, 73, 7, 73, 73, - 14, 60, 57, 45, 82, 83, 45, 84, 26, 47, - 86, 50, 25, 47, 74, 47, 76, 85, 16, 48, - 75, 21, 66, 47, 17, 18, 50, 18, 12, 18, - 23, 45, 6, 47, 7, 25, 25, 25, 51, 56, - 25, 57, 52, 44, 46, 70, 25, 58, 61, 78, - 25, 25, 25, 25, 25, 27, 38, 25, 25, 40, - 40, 40, 80, 60, 40, 64, 27, 77, 0, 0, - 40, 0, 0, 0, 0, 40, 40, 40, 40, 0, - 0, 40, 40, 0, 0, 25, 0, 0, 41, 41, - 41, 0, 0, 41, 0, 0, 0, 0, 0, 41, - 0, 0, 0, 0, 41, 41, 41, 41, 0, 40, - 41, 41, 42, 42, 42, 0, 0, 42, 0, 0, - 0, 0, 0, 42, 0, 0, 0, 0, 42, 42, - 42, 42, 30, 31, 42, 42, 0, 33, 41, 0, - 0, 40, 40, 34, 0, 0, 40, 0, 35, 36, - 37, 38, 40, 0, 39, 40, 0, 40, 40, 40, - 40, 0, 42, 40, 40, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 0, 0, 0, 0, 40, 40, - 0, 0, 79, 40, 0, 0, 0, 30, 31, 40, - 0, 40, 53, 0, 40, 40, 40, 40, 34, 0, - 40, 40, 0, 35, 36, 54, 38, 0, 18, 55, - 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 0, 0, 40, 0, - 0, 0, 62, 62, 62, 4, 8, 30, 31, 32, - 0, 0, 33, 7, 56, 0, 0, 0, 34, 0, - 60, 57, 45, 35, 36, 37, 38, 0, 0, 39, - 40, -}; -short cl_typedef_check[] = { 60, - 60, 60, 58, 59, 44, 38, 38, 58, 59, 42, - 42, 44, 44, 38, 38, 268, 15, 42, 42, 44, - 38, 38, 62, 32, 42, 42, 59, 59, 44, 62, - 62, 65, 268, 256, 59, 59, 44, 62, 44, 44, - 305, 59, 59, 59, 79, 80, 62, 81, 38, 38, - 85, 304, 42, 42, 62, 44, 62, 62, 60, 38, - 69, 60, 123, 42, 319, 273, 319, 123, 304, 125, - 308, 42, 123, 62, 125, 258, 259, 260, 259, 37, - 263, 39, 263, 61, 59, 59, 269, 308, 308, 333, - 273, 274, 275, 276, 277, 319, 308, 280, 281, 258, - 259, 260, 75, 44, 263, 60, 19, 73, -1, -1, - 269, -1, -1, -1, -1, 274, 275, 276, 277, -1, - -1, 280, 281, -1, -1, 308, -1, -1, 258, 259, - 260, -1, -1, 263, -1, -1, -1, -1, -1, 269, - -1, -1, -1, -1, 274, 275, 276, 277, -1, 308, - 280, 281, 258, 259, 260, -1, -1, 263, -1, -1, - -1, -1, -1, 269, -1, -1, -1, -1, 274, 275, - 276, 277, 258, 259, 280, 281, -1, 263, 308, -1, - -1, 258, 259, 269, -1, -1, 263, -1, 274, 275, - 276, 277, 269, -1, 280, 281, -1, 274, 275, 276, - 277, -1, 308, 280, 281, -1, -1, -1, -1, -1, - -1, -1, 268, -1, -1, -1, -1, -1, 258, 259, - -1, -1, 308, 263, -1, -1, -1, 258, 259, 269, - -1, 308, 263, -1, 274, 275, 276, 277, 269, -1, - 280, 281, -1, 274, 275, 276, 277, -1, 304, 280, - 281, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 319, -1, -1, -1, -1, 308, -1, - -1, -1, 333, 333, 333, 308, 308, 258, 259, 260, - -1, -1, 263, 308, 308, -1, -1, -1, 269, -1, - 308, 308, 308, 274, 275, 276, 277, -1, -1, 280, - 281, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 352 -#if YYDEBUG -char *cl_typedef_name[] = { -"end-of-file",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,"'*'",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,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,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,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,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,0,0, -0,0,0,0,"LE_AUTO","LE_DOUBLE","LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE", -"LE_LONG","LE_SWITCH","LE_CASE","LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR", -"LE_EXTERN","LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT", -"LE_UNSIGNED","LE_BOOL","LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID", -"LE_DEFAULT","LE_GOTO","LE_SIZEOF","LE_VOLATILE","LE_DO","LE_IF","LE_STATIC", -"LE_WHILE","LE_NEW","LE_DELETE","LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC", -"LE_PROTECTED","LE_PRIVATE","LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD", -"LE_OVERRIDE","LE_FINAL","LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH", -"LE_IDENTIFIER","LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T", -}; -char *cl_typedef_rule[] = { -"$accept : translation_unit", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : LE_LONG LE_LONG", -"basic_type_name : LE_LONG LE_INT", -"basic_type_name : basic_type_name_inter", -"translation_unit :", -"translation_unit : translation_unit external_decl", -"$$1 :", -"external_decl : $$1 typedefs", -"external_decl : error", -"typedefs : stmnt_starter LE_TYPEDEF opt_typename_specifier real_type new_name ';'", -"typedefs : stmnt_starter opt_template_qualifier LE_USING new_name '=' opt_typename_specifier real_type ';'", -"real_type : variable_decl special_star_amp", -"new_name : LE_IDENTIFIER", -"opt_typename_specifier :", -"opt_typename_specifier : LE_TYPENAME", -"opt_template_qualifier :", -"$$2 :", -"opt_template_qualifier : LE_TEMPLATE '<' $$2", -"parameter_list :", -"parameter_list : template_parameter", -"parameter_list : parameter_list ',' template_parameter", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"scope_specifier : LE_IDENTIFIER '<' parameter_list '>' LE_CLCL", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"const_spec :", -"const_spec : LE_CONST", -"const_spec : LE_CONST '*'", -"const_spec : LE_CONST '&'", -"const_spec : LE_CONST '*' '*'", -"amp_item :", -"amp_item : '&'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : '{'", -"stmnt_starter : '}'", -"stmnt_starter : ':'", -"variable_decl : const_spec basic_type_name", -"variable_decl : const_spec nested_scope_specifier LE_IDENTIFIER", -"variable_decl : const_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>'", -"$$3 :", -"variable_decl : const_spec LE_STRUCT nested_scope_specifier LE_IDENTIFIER '{' $$3", -"variable_decl : const_spec LE_STRUCT nested_scope_specifier LE_IDENTIFIER", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - - -std::string typedef_consumBracketsContent(char openBrace) -{ - char closeBrace; - - switch(openBrace) { - case '(': closeBrace = ')'; break; - case '[': closeBrace = ']'; break; - case '<': closeBrace = '>'; break; - case '{': closeBrace = '}'; break; - default: - openBrace = '('; - closeBrace = ')'; - break; - } - - std::string consumedData; - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - - if(ch == closeBrace) - { - consumedData.erase(0, consumedData.find_first_not_of(" ")); - consumedData.erase(consumedData.find_last_not_of(" ")+1); - consumedData += cl_scope_text; - - depth--; - continue; - } - else if(ch == openBrace) - { - consumedData.erase(0, consumedData.find_first_not_of(" ")); - consumedData.erase(consumedData.find_last_not_of(" ")+1); - consumedData += cl_scope_text; - - depth ++ ; - continue; - } - - consumedData += cl_scope_text; - consumedData += " "; - } - - return consumedData; -} - -void typedef_consumeDefaultValue(char c1, char c2) -{ - int depth = 0; - - while (depth >= 0) { - int ch = cl_scope_lex(); - if(ch == 0) { break;} - - if(ch == c1 && depth == 0) { - cl_scope_less(0); - break; - } - - if(ch == c2 && depth == 0) { - cl_scope_less(0); - break; - } - - curr_var.m_defaultValue += cl_scope_text; - if(ch == ')' || ch == '}'){ - depth--; - continue; - } else if(ch == '(' || ch == '{') { - depth ++ ; - continue; - } - } -} - -void do_clean_up() -{ - gs_vars = NULL; - - // restore settings - setUseIgnoreMacros(true); - g_isUsedWithinFunc = false; - gs_typedefs.clear(); - - //do the lexer cleanup - cl_scope_lex_clean(); -} - -// return the scope name at the end of the input string -void get_typedefs(const std::string &in, clTypedefList &li) -{ - std::map dummy; - - // provide the lexer with new input - if( !setLexerInput(in, dummy) ){ - return; - } - - // set the parser local output to our variable list - cl_typedef_parse(); - li = gs_typedefs; - - do_clean_up(); -} -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - int yym, yyn, yystate; -#if YYDEBUG - char *yys; - extern char *getenv(); - - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -{ yyval = yyvsp[0]; } -break; -case 2: -{ yyval = yyvsp[0]; } -break; -case 3: -{ yyval = yyvsp[0]; } -break; -case 4: -{ yyval = yyvsp[0]; } -break; -case 5: -{ yyval = yyvsp[0]; } -break; -case 6: -{ yyval = yyvsp[0]; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[0]; } -break; -case 18: -{curr_var.Reset(); gs_names.clear(); s_tmpString.clear(); gs_currentTypedef.clear(); s_templateInitList.clear();} -break; -case 20: -{ - yyclearin; /*clear lookahead token*/ - yyerrok; -/* printf("CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_scope_text, cl_scope_lineno);*/ - } -break; -case 21: -{ - if(gs_currentTypedef.m_realType.m_templateDecl.empty()) - gs_currentTypedef.m_realType.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - gs_typedefs.push_back(gs_currentTypedef); - - } -break; -case 22: -{ - if(gs_currentTypedef.m_realType.m_templateDecl.empty()) - gs_currentTypedef.m_realType.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - gs_typedefs.push_back(gs_currentTypedef); - } -break; -case 23: -{ - gs_currentTypedef.m_realType = curr_var; - gs_currentTypedef.m_realType.m_isPtr = (yyvsp[0].find("*") != std::string::npos); - } -break; -case 24: -{ gs_currentTypedef.m_name = yyvsp[0]; } -break; -case 25: -{ yyval = ""; } -break; -case 26: -{ yyval = yyvsp[0]; } -break; -case 28: -{s_tmpString = typedef_consumBracketsContent('<');} -break; -case 29: -{ - yyval = yyvsp[-2] + yyvsp[-1] + s_tmpString; - s_tmpString.clear(); - } -break; -case 30: -{yyval = "";} -break; -case 31: -{yyval = yyvsp[0];} -break; -case 32: -{yyval = yyvsp[-2] + yyvsp[-1] + " " + yyvsp[0];} -break; -case 33: -{ - yyval = yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 34: -{ - yyval = yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 35: -{ - yyval = yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ; - } -break; -case 36: -{yyval = yyvsp[-1]+ yyvsp[0]; } -break; -case 37: -{yyval = yyvsp[-4] ; s_templateInitList = yyvsp[-3] + yyvsp[-2] + yyvsp[-1];} -break; -case 38: -{yyval = "";} -break; -case 39: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 40: -{yyval = ""; } -break; -case 41: -{ yyval = yyvsp[0]; } -break; -case 42: -{ yyval = yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval; } -break; -case 43: -{ yyval = yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval; } -break; -case 44: -{ yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval;} -break; -case 45: -{yyval = ""; } -break; -case 46: -{ yyval = yyvsp[0]; } -break; -case 47: -{yyval = ""; } -break; -case 48: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 49: -{ yyval = yyvsp[-1] + yyvsp[0]; } -break; -case 50: -{yyval = "";} -break; -case 51: -{ yyval = ";";} -break; -case 52: -{ yyval = "{";} -break; -case 53: -{ yyval = "}";} -break; -case 54: -{ yyval = ":";} -break; -case 55: -{ - yyval = yyvsp[-1] + " " + yyvsp[0]; - yyvsp[0].erase(yyvsp[0].find_last_not_of(":")+1); - curr_var.m_type = yyvsp[0]; - curr_var.m_isBasicType = true; - curr_var.m_isConst = !yyvsp[-1].empty(); - } -break; -case 56: -{ - yyval = yyvsp[-2] + " " + yyvsp[-1] + yyvsp[0]; - yyvsp[-1].erase(yyvsp[-1].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-1]; - curr_var.m_type = yyvsp[0]; - curr_var.m_isConst = !yyvsp[-2].empty(); - s_tmpString.clear(); - } -break; -case 57: -{ - yyval = yyvsp[-5] + " " + yyvsp[-4] + yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - yyvsp[-4].erase(yyvsp[-4].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-4]; - curr_var.m_type = yyvsp[-3]; - curr_var.m_isTemplate = true; - curr_var.m_templateDecl = yyvsp[-2] +yyvsp[-1] +yyvsp[0]; - curr_var.m_isConst = !yyvsp[-5].empty(); - s_tmpString.clear(); - } -break; -case 58: -{s_tmpString = typedef_consumBracketsContent('{');} -break; -case 59: -{ - yyval = yyvsp[-5] + " " + yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + s_tmpString; - yyvsp[-3].erase(yyvsp[-3].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-3]; - curr_var.m_type = yyvsp[-2]; - curr_var.m_isTemplate = false; - curr_var.m_isConst = !yyvsp[-5].empty(); - s_tmpString.clear(); - } -break; -case 60: -{ - yyval = yyvsp[-4]; - yyvsp[-1].erase(yyvsp[-1].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-1]; - curr_var.m_type = yyvsp[0]; - curr_var.m_isTemplate = false; - curr_var.m_isConst = !yyvsp[-3].empty(); - s_tmpString.clear(); - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CodeLite/var_parser.cpp b/CodeLite/var_parser.cpp deleted file mode 100644 index 7f821deea0..0000000000 --- a/CodeLite/var_parser.cpp +++ /dev/null @@ -1,1422 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_var_parse -#define yylex cl_var_lex -#define yyerror cl_var_error -#define yychar cl_var_char -#define yyval cl_var_val -#define yylval cl_var_lval -#define yydebug cl_var_debug -#define yynerrs cl_var_nerrs -#define yyerrflag cl_var_errflag -#define yyss cl_var_ss -#define yyssp cl_var_ssp -#define yyvs cl_var_vs -#define yyvsp cl_var_vsp -#define yylhs cl_var_lhs -#define yylen cl_var_len -#define yydefred cl_var_defred -#define yydgoto cl_var_dgoto -#define yysindex cl_var_sindex -#define yyrindex cl_var_rindex -#define yygindex cl_var_gindex -#define yytable cl_var_table -#define yycheck cl_var_check -#define yyname cl_var_name -#define yyrule cl_var_rule -#define YYPREFIX "cl_var_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include "string" -#include "vector" -#include "stdio.h" -#include "map" -#include "variable.h" -#include "cl_typedef.h" - -#ifdef yylex -#undef yylex -#define yylex cl_scope_lex -#endif - -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ - -void cl_scope_error(char *string); -int cl_var_parse(); -void syncParser(); -void var_consumeDefaultValue(char c1, char c2); -void var_consumeDefaultValueIfNeeded(); - -static VariableList * gs_vars = NULL; -static std::vector gs_names; -static bool g_isUsedWithinFunc = false; -static std::string s_tmpString; -static Variable curr_var; -static std::string s_templateInitList; -static bool isBasicType = false; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_scope_text; -extern int cl_scope_lex(); -extern void cl_scope_less(int count); - -extern int cl_scope_lineno; -extern std::vector currentScope; -extern bool setLexerInput(const std::string &in, const std::map &ignoreMap); -extern void setUseIgnoreMacros(bool ignore); -extern void cl_scope_lex_clean(); - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define YYERRCODE 256 -short cl_var_lhs[] = { -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 0, 0, 5, - 3, 3, 3, 6, 6, 6, 7, 7, 7, 12, - 13, 16, 4, 19, 4, 4, 4, 4, 4, 4, - 4, 14, 14, 14, 14, 24, 24, 15, 15, 23, - 23, 26, 18, 27, 18, 22, 22, 21, 21, 21, - 21, 20, 20, 20, 20, 20, 25, 25, 9, 9, - 28, 28, 8, 8, 8, 8, 8, 8, 8, 29, - 29, 30, 30, 31, 31, 10, 11, 11, 11, 11, - 11, 17, 17, 17, 17, -}; -short cl_var_len[] = { 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 2, 2, 0, 2, 0, - 2, 3, 1, 0, 1, 3, 4, 4, 7, 0, - 0, 0, 13, 0, 8, 6, 6, 6, 5, 5, - 3, 0, 1, 2, 2, 1, 2, 1, 3, 1, - 1, 0, 2, 0, 5, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 5, 0, 2, - 0, 1, 0, 2, 2, 2, 3, 1, 2, 0, - 1, 0, 1, 0, 2, 3, 0, 1, 1, 1, - 1, 2, 3, 6, 4, -}; -short cl_var_defred[] = { 18, - 0, 23, 0, 19, 0, 6, 1, 0, 2, 5, - 0, 0, 10, 0, 9, 12, 11, 15, 0, 88, - 0, 89, 0, 90, 91, 21, 0, 0, 17, 16, - 4, 3, 8, 7, 13, 14, 22, 0, 0, 78, - 0, 84, 84, 0, 84, 0, 79, 72, 0, 76, - 74, 69, 92, 0, 0, 0, 0, 0, 0, 41, - 77, 0, 0, 70, 0, 85, 81, 0, 0, 30, - 0, 0, 67, 0, 0, 56, 57, 40, 83, 86, - 0, 39, 31, 0, 0, 52, 0, 0, 0, 25, - 69, 59, 60, 61, 38, 37, 0, 62, 84, 63, - 34, 65, 64, 66, 36, 53, 47, 0, 0, 0, - 0, 0, 0, 0, 0, 26, 68, 0, 84, 0, - 54, 35, 0, 27, 28, 43, 0, 0, 0, 55, - 0, 44, 45, 32, 0, 0, 29, 48, 0, 33, - 0, 49, -}; -short cl_var_dgoto[] = { 1, - 18, 19, 4, 26, 5, 89, 90, 91, 54, 55, - 27, 83, 97, 129, 139, 136, 42, 85, 114, 105, - 95, 78, 28, 86, 64, 106, 130, 51, 68, 80, - 56, -}; -short cl_var_sindex[] = { 0, - -26, 0, -219, 0, -23, 0, 0, -219, 0, 0, - -219, 274, 0, 274, 0, 0, 0, 0, -48, 0, - -168, 0, -168, 0, 0, 0, 94, -289, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -168, -30, 0, - 302, 0, 0, -256, 0, 13, 0, 0, 26, 0, - 0, 0, 0, -234, -168, 69, -168, 16, -168, 0, - 0, -228, -54, 0, -19, 0, 0, 22, -18, 0, - -202, -53, 0, -168, 6, 0, 0, 0, 0, 0, - 6, 0, 0, -53, 51, 0, -200, -168, -42, 0, - 0, 0, 0, 0, 0, 0, -159, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -29, -168, -210, - 322, -133, -202, 70, -210, 0, 0, -46, 0, -37, - 0, 0, -168, 0, 0, 0, -180, -172, 15, 0, - -13, 0, 0, 0, -210, -37, 0, 0, -6, 0, - -37, 0, -}; -short cl_var_rindex[] = { 0, - -40, 0, 0, 0, 212, 0, 0, 93, 0, 0, - 118, 131, 0, 145, 0, 0, 0, 0, 0, 0, - -187, 0, 236, 0, 0, 0, 265, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 25, 55, 0, - -169, 0, 0, 0, 0, 0, 0, 0, 81, 0, - 0, 0, 0, 0, -17, 144, -17, 0, -167, 0, - 0, 0, 37, 0, 0, 0, 0, 169, 0, 0, - 0, 158, 0, 106, 1, 0, 0, 0, 0, 0, - 1, 0, 0, 574, 0, 0, 0, 106, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 331, 183, - 0, 0, 0, 0, 0, 0, 0, 330, 0, 17, - 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 330, 4, 0, 0, 0, 0, - 4, 0, -}; -short cl_var_gindex[] = { 0, - 20, 5, 0, 0, 0, -59, 34, 92, -49, -15, - 0, 0, 0, -71, 0, 0, 91, 0, 0, 0, - 63, 77, 0, 35, -62, 0, 0, 0, 0, 0, - 0, -}; -#define YYTABLESIZE 697 -short cl_var_table[] = { 20, - 58, 109, 62, 20, 127, 74, 88, 50, 87, 3, - 37, 49, 29, 123, 109, 30, 23, 20, 20, 110, - 21, 77, 77, 73, 76, 76, 73, 57, 108, 59, - 109, 35, 115, 36, 25, 20, 58, 141, 6, 7, - 58, 111, 46, 8, 58, 53, 93, 42, 135, 9, - 87, 58, 140, 60, 10, 11, 12, 13, 58, 58, - 14, 15, 42, 131, 138, 73, 92, 61, 73, 142, - 73, 73, 73, 63, 93, 73, 70, 93, 93, 72, - 93, 73, 20, 113, 20, 79, 73, 73, 73, 73, - 102, 103, 73, 73, 99, 71, 94, 38, 71, 22, - 93, 24, 124, 125, 39, 84, 67, 107, 112, 98, - 66, 100, 41, 43, 41, 119, 40, 45, 41, 137, - 73, 75, 117, 58, 75, 58, 120, 132, 122, 47, - 4, 16, 17, 4, 4, 133, 4, 134, 69, 42, - 73, 104, 116, 96, 51, 82, 65, 121, 69, 24, - 71, 4, 0, 0, 4, 3, 4, 0, 3, 3, - 0, 3, 0, 73, 73, 0, 0, 24, 8, 0, - 0, 8, 8, 101, 8, 0, 3, 0, 0, 3, - 0, 3, 7, 0, 80, 7, 7, 80, 7, 8, - 0, 0, 8, 0, 8, 95, 0, 0, 95, 95, - 0, 95, 0, 7, 0, 80, 7, 80, 7, 82, - 0, 0, 82, 0, 0, 0, 20, 20, 20, 20, - 94, 95, 20, 94, 94, 20, 94, 0, 20, 2, - 82, 0, 20, 20, 20, 20, 20, 0, 0, 20, - 20, 0, 0, 0, 20, 0, 94, 0, 0, 0, - 0, 0, 0, 0, 48, 0, 58, 58, 58, 58, - 58, 0, 0, 58, 0, 0, 58, 20, 0, 58, - 126, 0, 0, 58, 58, 58, 58, 58, 73, 73, - 58, 58, 73, 73, 73, 58, 73, 73, 75, 81, - 73, 0, 0, 73, 0, 0, 0, 0, 73, 73, - 73, 73, 93, 0, 73, 73, 0, 0, 58, 93, - 20, 20, 71, 71, 71, 128, 0, 71, 0, 0, - 0, 93, 0, 71, 0, 0, 0, 0, 71, 71, - 71, 71, 73, 0, 71, 71, 0, 0, 75, 75, - 75, 0, 0, 75, 93, 0, 0, 0, 0, 75, - 44, 58, 58, 0, 75, 75, 75, 75, 4, 38, - 75, 75, 71, 73, 73, 4, 39, 84, 73, 0, - 0, 84, 0, 84, 73, 73, 73, 4, 40, 73, - 73, 73, 73, 3, 0, 73, 73, 0, 75, 0, - 3, 84, 0, 84, 0, 0, 8, 0, 0, 0, - 4, 0, 3, 8, 0, 71, 71, 0, 0, 80, - 7, 0, 0, 73, 0, 8, 80, 7, 0, 0, - 0, 0, 0, 95, 0, 3, 0, 0, 80, 7, - 95, 75, 75, 0, 82, 0, 0, 0, 8, 0, - 0, 82, 95, 0, 0, 0, 0, 0, 94, 0, - 0, 80, 7, 82, 0, 94, 73, 73, 0, 0, - 0, 0, 0, 0, 0, 95, 0, 94, 87, 87, - 87, 87, 0, 0, 87, 0, 82, 87, 0, 0, - 87, 0, 0, 0, 87, 87, 87, 87, 87, 0, - 94, 87, 87, 73, 73, 73, 87, 0, 73, 0, - 0, 0, 0, 0, 73, 0, 0, 0, 0, 73, - 73, 73, 73, 0, 0, 73, 73, 0, 0, 87, - 0, 0, 73, 73, 73, 0, 0, 73, 0, 0, - 0, 6, 7, 73, 0, 0, 31, 0, 73, 73, - 73, 73, 9, 73, 73, 73, 0, 10, 32, 33, - 13, 0, 0, 34, 15, 0, 0, 0, 0, 6, - 7, 52, 87, 87, 8, 0, 0, 50, 0, 0, - 9, 0, 73, 0, 0, 10, 11, 12, 13, 6, - 7, 14, 15, 0, 8, 0, 73, 73, 73, 73, - 9, 0, 0, 73, 0, 10, 11, 12, 13, 73, - 0, 14, 15, 0, 73, 73, 73, 73, 0, 0, - 73, 73, 0, 46, 46, 73, 73, 46, 0, 0, - 0, 0, 0, 0, 16, 17, 0, 0, 0, 118, - 0, 0, 46, 0, 46, 0, 0, 0, 73, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, - 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, - 0, 73, 73, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 46, -}; -short cl_var_check[] = { 40, - 0, 44, 52, 44, 42, 60, 60, 38, 71, 36, - 59, 42, 8, 60, 44, 11, 40, 58, 59, 62, - 44, 41, 41, 41, 44, 44, 44, 43, 88, 45, - 44, 12, 62, 14, 58, 59, 36, 44, 258, 259, - 40, 91, 332, 263, 44, 41, 41, 44, 62, 269, - 113, 308, 59, 41, 274, 275, 276, 277, 58, 59, - 280, 281, 59, 123, 136, 41, 61, 42, 44, 141, - 258, 259, 260, 308, 38, 263, 61, 41, 42, 308, - 44, 269, 123, 99, 125, 64, 274, 275, 276, 277, - 40, 41, 280, 281, 44, 41, 91, 266, 44, 123, - 64, 125, 118, 119, 273, 308, 38, 308, 268, 59, - 42, 61, 21, 23, 23, 111, 285, 27, 27, 135, - 308, 41, 333, 123, 44, 125, 260, 308, 59, 38, - 38, 351, 352, 41, 42, 308, 44, 123, 308, 123, - 308, 91, 109, 81, 332, 69, 55, 113, 57, 44, - 59, 59, -1, -1, 62, 38, 64, -1, 41, 42, - -1, 44, -1, 351, 352, -1, -1, 62, 38, -1, - -1, 41, 42, 123, 44, -1, 59, -1, -1, 62, - -1, 64, 38, -1, 41, 41, 42, 44, 44, 59, - -1, -1, 62, -1, 64, 38, -1, -1, 41, 42, - -1, 44, -1, 59, -1, 62, 62, 64, 64, 41, - -1, -1, 44, -1, -1, -1, 257, 258, 259, 260, - 38, 64, 263, 41, 42, 266, 44, -1, 269, 256, - 62, -1, 273, 274, 275, 276, 277, -1, -1, 280, - 281, -1, -1, -1, 285, -1, 64, -1, -1, -1, - -1, -1, -1, -1, 285, -1, 256, 257, 258, 259, - 260, -1, -1, 263, -1, -1, 266, 308, -1, 269, - 308, -1, -1, 273, 274, 275, 276, 277, 333, 333, - 280, 281, 258, 259, 260, 285, 333, 263, 308, 308, - 308, -1, -1, 269, -1, -1, -1, -1, 274, 275, - 276, 277, 266, -1, 280, 281, -1, -1, 308, 273, - 351, 352, 258, 259, 260, 353, -1, 263, -1, -1, - -1, 285, -1, 269, -1, -1, -1, -1, 274, 275, - 276, 277, 308, -1, 280, 281, -1, -1, 258, 259, - 260, -1, -1, 263, 308, -1, -1, -1, -1, 269, - 257, 351, 352, -1, 274, 275, 276, 277, 266, 266, - 280, 281, 308, 258, 259, 273, 273, 38, 263, -1, - -1, 42, -1, 44, 269, 351, 352, 285, 285, 274, - 275, 276, 277, 266, -1, 280, 281, -1, 308, -1, - 273, 62, -1, 64, -1, -1, 266, -1, -1, -1, - 308, -1, 285, 273, -1, 351, 352, -1, -1, 266, - 266, -1, -1, 308, -1, 285, 273, 273, -1, -1, - -1, -1, -1, 266, -1, 308, -1, -1, 285, 285, - 273, 351, 352, -1, 266, -1, -1, -1, 308, -1, - -1, 273, 285, -1, -1, -1, -1, -1, 266, -1, - -1, 308, 308, 285, -1, 273, 351, 352, -1, -1, - -1, -1, -1, -1, -1, 308, -1, 285, 257, 258, - 259, 260, -1, -1, 263, -1, 308, 266, -1, -1, - 269, -1, -1, -1, 273, 274, 275, 276, 277, -1, - 308, 280, 281, 258, 259, 260, 285, -1, 263, -1, - -1, -1, -1, -1, 269, -1, -1, -1, -1, 274, - 275, 276, 277, -1, -1, 280, 281, -1, -1, 308, - -1, -1, 258, 259, 260, -1, -1, 263, -1, -1, - -1, 258, 259, 269, -1, -1, 263, -1, 274, 275, - 276, 277, 269, 308, 280, 281, -1, 274, 275, 276, - 277, -1, -1, 280, 281, -1, -1, -1, -1, 258, - 259, 260, 351, 352, 263, -1, -1, 332, -1, -1, - 269, -1, 308, -1, -1, 274, 275, 276, 277, 258, - 259, 280, 281, -1, 263, -1, 351, 352, 258, 259, - 269, -1, -1, 263, -1, 274, 275, 276, 277, 269, - -1, 280, 281, -1, 274, 275, 276, 277, -1, -1, - 280, 281, -1, 40, 41, 351, 352, 44, -1, -1, - -1, -1, -1, -1, 351, 352, -1, -1, -1, 308, - -1, -1, 59, -1, 61, -1, -1, -1, 308, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 351, 352, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, - -1, -1, 351, 352, -1, -1, -1, -1, -1, -1, - -1, 351, 352, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 123, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 353 -#if YYDEBUG -char *cl_var_name[] = { -"end-of-file",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,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,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,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,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,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,0,"LE_AUTO","LE_DOUBLE","LE_INT","LE_STRUCT", -"LE_BREAK","LE_ELSE","LE_LONG","LE_SWITCH","LE_CASE","LE_ENUM","LE_REGISTER", -"LE_TYPEDEF","LE_CHAR","LE_EXTERN","LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT", -"LE_SHORT","LE_UNSIGNED","LE_BOOL","LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID", -"LE_DEFAULT","LE_GOTO","LE_SIZEOF","LE_VOLATILE","LE_DO","LE_IF","LE_STATIC", -"LE_WHILE","LE_NEW","LE_DELETE","LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC", -"LE_PROTECTED","LE_PRIVATE","LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD", -"LE_OVERRIDE","LE_FINAL","LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH", -"LE_IDENTIFIER","LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T","\"**\"", -}; -char *cl_var_rule[] = { -"$accept : translation_unit", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name_inter : LE_TIME_T", -"basic_type_name_inter : LE_SIZE_T", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : basic_type_name_inter", -"basic_type_name : LE_SHORT basic_type_name", -"basic_type_name : LE_LONG basic_type_name", -"translation_unit :", -"translation_unit : translation_unit external_decl", -"$$1 :", -"external_decl : $$1 variables", -"external_decl : '$' basic_type_name ';'", -"external_decl : error", -"parameter_list :", -"parameter_list : template_parameter", -"parameter_list : parameter_list ',' template_parameter", -"template_parameter : const_or_volatile_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_or_volatile_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_or_volatile_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp", -"$$2 :", -"$$3 :", -"$$4 :", -"variables : stmnt_starter LE_AUTO LE_IDENTIFIER '=' $$2 $$3 LE_TYPEDEF LE_STRUCT optional_struct_name '{' $$4 typedef_name_list ';'", -"$$5 :", -"variables : stmnt_starter variable_decl special_star_amp const_or_volatile_spec variable_name_list '{' $$5 ';'", -"variables : stmnt_starter variable_decl special_star_amp const_or_volatile_spec variable_name_list postfix", -"variables : '(' variable_decl special_star_amp const_or_volatile_spec LE_IDENTIFIER postfix2", -"variables : ',' variable_decl special_star_amp const_or_volatile_spec LE_IDENTIFIER postfix2", -"variables : '(' variable_decl special_star_amp const_or_volatile_spec postfix3", -"variables : ',' variable_decl special_star_amp const_or_volatile_spec postfix3", -"variables : ellipsis_prefix LE_ELLIPSIS ')'", -"optional_struct_name :", -"optional_struct_name : LE_IDENTIFIER", -"optional_struct_name : '*' LE_IDENTIFIER", -"optional_struct_name : \"**\" LE_IDENTIFIER", -"fully_qualified_identifier_name : LE_IDENTIFIER", -"fully_qualified_identifier_name : scope_specifier LE_IDENTIFIER", -"typedef_name_list : optional_struct_name", -"typedef_name_list : typedef_name_list ',' optional_struct_name", -"ellipsis_prefix : '('", -"ellipsis_prefix : ','", -"$$6 :", -"variable_name_list : fully_qualified_identifier_name $$6", -"$$7 :", -"variable_name_list : variable_name_list ',' special_star_amp fully_qualified_identifier_name $$7", -"postfix3 : ','", -"postfix3 : ')'", -"postfix2 :", -"postfix2 : '='", -"postfix2 : ')'", -"postfix2 : '['", -"postfix : ';'", -"postfix : '='", -"postfix : ')'", -"postfix : '('", -"postfix : '['", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"scope_specifier : LE_IDENTIFIER '<' parameter_list '>' LE_CLCL", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"volatile_qualifier :", -"volatile_qualifier : LE_VOLATILE", -"const_or_volatile_spec :", -"const_or_volatile_spec : LE_CONST volatile_qualifier", -"const_or_volatile_spec : LE_CONST '*'", -"const_or_volatile_spec : LE_CONST '&'", -"const_or_volatile_spec : LE_CONST '*' '*'", -"const_or_volatile_spec : LE_VOLATILE", -"const_or_volatile_spec : LE_ENUM const_or_volatile_spec", -"amp_item :", -"amp_item : '&'", -"at_list :", -"at_list : '@'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item at_list", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : '{'", -"stmnt_starter : '}'", -"stmnt_starter : ':'", -"variable_decl : const_or_volatile_spec basic_type_name", -"variable_decl : const_or_volatile_spec nested_scope_specifier LE_IDENTIFIER", -"variable_decl : const_or_volatile_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>'", -"variable_decl : const_or_volatile_spec LE_STRUCT nested_scope_specifier LE_IDENTIFIER", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - -void var_consumeAutoAssignment(const std::string& varname) -{ - // Collect everything until we encounter the first ';' - std::string expression; - while ( true ) { - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - if ( ch == ';' ) { - // add an auto variable - Variable var; - var.m_name = varname; - var.m_isAuto = true; - var.m_completeType.swap(expression); - curr_var.m_lineno = cl_scope_lineno; - - s_templateInitList.clear(); - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - - break; - } else { - expression.append( cl_scope_text ).append(" "); - } - } -} - -std::string var_consumBracketsContent(char openBrace) -{ - char closeBrace; - - switch(openBrace) { - case '(': closeBrace = ')'; break; - case '[': closeBrace = ']'; break; - case '<': closeBrace = '>'; break; - case '{': closeBrace = '}'; break; - default: - openBrace = '('; - closeBrace = ')'; - break; - } - - std::string consumedData; - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - - if(ch == closeBrace) - { - consumedData.erase(0, consumedData.find_first_not_of(" ")); - consumedData.erase(consumedData.find_last_not_of(" ")+1); - consumedData += cl_scope_text; - - depth--; - continue; - } - else if(ch == openBrace) - { - consumedData.erase(0, consumedData.find_first_not_of(" ")); - consumedData.erase(consumedData.find_last_not_of(" ")+1); - consumedData += cl_scope_text; - - depth ++ ; - continue; - } - - consumedData += cl_scope_text; - consumedData += " "; - } - - return consumedData; -} - -void var_consumeDefaultValueIfNeeded() -{ - int ch = cl_scope_lex(); - if(ch != '=') { - cl_scope_less(0); - return; - } - var_consumeDefaultValue(';', ','); -} - -void var_consumeDefaultValue(char c1, char c2) -{ - int depth = 0; - - curr_var.m_defaultValue.clear(); - while (depth >= 0) { - int ch = cl_scope_lex(); - if(ch == 0) { break;} - - if(ch == c1 && depth == 0) { - cl_scope_less(0); - break; - } - - if(ch == c2 && depth == 0) { - cl_scope_less(0); - break; - } - - curr_var.m_defaultValue += cl_scope_text; - if(ch == ')' || ch == '}'){ - depth--; - continue; - } else if(ch == '(' || ch == '{') { - depth ++ ; - continue; - } - } -} - -void clean_up() -{ - gs_vars = NULL; - - // restore settings - setUseIgnoreMacros(true); - g_isUsedWithinFunc = false; - isBasicType = false; - - //do the lexer cleanup - cl_scope_lex_clean(); -} - -// return the scope name at the end of the input string -void get_variables(const std::string &in, VariableList &li, const std::map &ignoreMap, bool isUsedWithinFunc) -{ - //provide the lexer with new input - if( !setLexerInput(in, ignoreMap) ){ - return; - } - - //set the parser local output to our variable list - gs_vars = &li; - setUseIgnoreMacros(false); - - // the 'g_isUsedWithinFunc' allows us to parse variabels without name - // this is typical when used as function declaration (e.g. void setValue(bool);) - g_isUsedWithinFunc = isUsedWithinFunc; - - //call tghe main parsing routine - cl_var_parse(); - clean_up(); -} - -bool is_primitive_type(const std::string &in) -{ - std::string input = "@"; // Hack the input string... - input += in; - input += ";"; - - const std::map ignoreMap; - if(!setLexerInput(input, ignoreMap)) { - return false; - } - - isBasicType = false; - cl_var_parse(); - bool res = isBasicType; - clean_up(); - return res; -} -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - int yym, yyn, yystate; -#if YYDEBUG - char *yys; - extern char *getenv(); - - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -{ yyval = yyvsp[0]; } -break; -case 2: -{ yyval = yyvsp[0]; } -break; -case 3: -{ yyval = yyvsp[0]; } -break; -case 4: -{ yyval = yyvsp[0]; } -break; -case 5: -{ yyval = yyvsp[0]; } -break; -case 6: -{ yyval = yyvsp[0]; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[0]; } -break; -case 16: -{ yyval = yyvsp[-1] + " " + yyvsp[0];} -break; -case 17: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 20: -{curr_var.Reset(); gs_names.clear(); s_tmpString.clear(); s_templateInitList.clear();} -break; -case 22: -{ - isBasicType = true; - } -break; -case 23: -{ - yyclearin; /*clear lookahead token*/ - yyerrok; -/* printf("CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_var_lval.c_str(), cl_scope_lineno);*/ - } -break; -case 24: -{yyval = "";} -break; -case 25: -{yyval = yyvsp[0];} -break; -case 26: -{yyval = yyvsp[-2] + yyvsp[-1] + " " + yyvsp[0];} -break; -case 27: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 28: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 29: -{ - yyval = yyvsp[-6] + yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ; - } -break; -case 30: -{var_consumeAutoAssignment(yyvsp[-1]);} -break; -case 31: -{} -break; -case 32: -{var_consumBracketsContent('{');} -break; -case 33: -{ - } -break; -case 34: -{var_consumBracketsContent('{');} -break; -case 35: -{ - if(gs_vars) - { - Variable var; - std::string pattern; - curr_var.m_isPtr = (yyvsp[-5].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-5]; - curr_var.m_lineno = cl_scope_lineno; - curr_var.m_rightSideConst = yyvsp[-4]; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - for(size_t i=0; i< gs_names.size(); i++) - { - /*create new variable for every variable name found*/ - var = curr_var; - var.m_pattern = yyvsp[-6] + " " + yyvsp[-5] + " " + yyvsp[-4] ; - if(var.m_completeType.empty()) { - var.m_completeType = yyvsp[-6] + " " + yyvsp[-5] + " " + yyvsp[-4] ; - } - var.m_name = gs_names.at(i).m_name; - var.m_defaultValue = gs_names.at(i).m_defaultValue; - - if(i != 0) { - var.m_isPtr = gs_names.at(i).m_isPtr; - var.m_starAmp = gs_names.at(i).m_starAmp; - } - gs_vars->push_back(var); - } - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 36: -{ - if(gs_vars) - { - Variable var; - std::string pattern; - curr_var.m_isPtr = (yyvsp[-3].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-3]; - curr_var.m_lineno = cl_scope_lineno; - curr_var.m_rightSideConst = yyvsp[-2]; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - for(size_t i=0; i< gs_names.size(); i++) - { - /*create new variable for every variable name found*/ - var = curr_var; - var.m_pattern = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] ; - if(var.m_completeType.empty()) { - var.m_completeType = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] ; - } - var.m_name = gs_names.at(i).m_name; - var.m_defaultValue = gs_names.at(i).m_defaultValue; - - if(i != 0) { - var.m_isPtr = gs_names.at(i).m_isPtr; - var.m_starAmp = gs_names.at(i).m_starAmp; - } - gs_vars->push_back(var); - } - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 37: -{ - if(gs_vars) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_completeType = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] ; - curr_var.m_isPtr = (yyvsp[-3].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-3]; - curr_var.m_arrayBrackets = yyvsp[0]; - curr_var.m_rightSideConst= yyvsp[-2]; - curr_var.m_lineno = cl_scope_lineno; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - /*create new variable for every variable name found*/ - var = curr_var; - var.m_name = yyvsp[-1]; - gs_vars->push_back(var); - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 38: -{ - if(gs_vars && g_isUsedWithinFunc) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_completeType = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] ; - curr_var.m_isPtr = (yyvsp[-3].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-3]; - curr_var.m_arrayBrackets = yyvsp[0]; - curr_var.m_rightSideConst = yyvsp[-2]; - curr_var.m_lineno = cl_scope_lineno; - - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - /*create new variable for every variable name found*/ - var = curr_var; - var.m_name = yyvsp[-1]; - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 39: -{ - if(gs_vars && g_isUsedWithinFunc) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_completeType = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_isPtr = (yyvsp[-2].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-2]; - curr_var.m_rightSideConst= yyvsp[-1]; - curr_var.m_lineno = cl_scope_lineno; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - /*create new variable for every variable name found*/ - var = curr_var; - var.m_name = ""; - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - } - if(yyvsp[0] == ",") { - cl_scope_less(0); - } - } -break; -case 40: -{ - if(gs_vars && g_isUsedWithinFunc) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_completeType = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_isPtr = (yyvsp[-2].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-2]; - curr_var.m_lineno = cl_scope_lineno; - curr_var.m_rightSideConst= yyvsp[-1]; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - /*create new variable for every variable name found*/ - var = curr_var; - var.m_name = ""; - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - } - if(yyvsp[0] == ",") { - cl_scope_less(0); - } - } -break; -case 41: -{ - /* special type of argument: Ellipsis, can only be at the end of function argument */ - if(gs_vars && g_isUsedWithinFunc) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; - curr_var.m_completeType = yyvsp[-1]; - curr_var.m_isPtr = false; - curr_var.m_starAmp = ""; - curr_var.m_lineno = cl_scope_lineno; - curr_var.m_isEllipsis = true; - - var = curr_var; - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 46: -{yyval = yyvsp[0];} -break; -case 47: -{yyval = yyvsp[0];} -break; -case 50: -{yyval = yyvsp[0];} -break; -case 51: -{yyval = yyvsp[0];} -break; -case 52: -{var_consumeDefaultValueIfNeeded();} -break; -case 53: -{ - curr_var.m_name = yyvsp[-1]; - gs_names.push_back(curr_var); - } -break; -case 54: -{var_consumeDefaultValueIfNeeded();} -break; -case 55: -{ - /*collect all the names*/ - curr_var.m_name = yyvsp[-1]; - curr_var.m_isPtr = (yyvsp[-2].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-2]; - gs_names.push_back(curr_var); - yyval = yyvsp[-4] + yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1]; - } -break; -case 58: -{yyval = "";} -break; -case 59: -{var_consumeDefaultValue(',', ')'); yyval = ""; } -break; -case 60: -{ yyval = ""; } -break; -case 61: -{ yyval = yyvsp[0] + var_consumBracketsContent('[');} -break; -case 65: -{ yyval = yyvsp[0] + var_consumBracketsContent('(');} -break; -case 66: -{ yyval = yyvsp[0] + var_consumBracketsContent('[');} -break; -case 67: -{ - yyval = yyvsp[-1]+ yyvsp[0]; - } -break; -case 68: -{ - yyval = yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - s_templateInitList = yyvsp[-3] + yyvsp[-2] + yyvsp[-1]; - } -break; -case 69: -{yyval = "";} -break; -case 70: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 71: -{ yyval = ""; } -break; -case 72: -{ yyval = yyvsp[0]; curr_var.m_isVolatile = true; } -break; -case 73: -{ yyval = ""; } -break; -case 74: -{ yyval = yyvsp[-1]; } -break; -case 75: -{ yyval = yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval; } -break; -case 76: -{ yyval = yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval; } -break; -case 77: -{ yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval;} -break; -case 78: -{ yyval = yyvsp[0]; curr_var.m_isVolatile = true; } -break; -case 79: -{ curr_var.m_enumInTypeDecl = true; } -break; -case 80: -{yyval = ""; } -break; -case 81: -{ yyval = yyvsp[0]; } -break; -case 82: -{yyval = "";} -break; -case 83: -{yyval = "*";} -break; -case 84: -{yyval = ""; } -break; -case 85: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 86: -{ yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; } -break; -case 87: -{yyval = "";} -break; -case 88: -{ yyval = ";";} -break; -case 89: -{ yyval = "{";} -break; -case 90: -{ yyval = "}";} -break; -case 91: -{ yyval = ":";} -break; -case 92: -{ - yyval = yyvsp[-1] + " " + yyvsp[0]; - yyvsp[0].erase(yyvsp[0].find_last_not_of(":")+1); - curr_var.m_type = yyvsp[0]; - curr_var.m_isBasicType = true; - curr_var.m_isConst = (yyvsp[-1].find("const") != std::string::npos); - } -break; -case 93: -{ - yyval = yyvsp[-2] + " " + yyvsp[-1] + yyvsp[0]; - yyvsp[-1].erase(yyvsp[-1].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-1]; - curr_var.m_type = yyvsp[0]; - curr_var.m_isConst = (yyvsp[-2].find("const") != std::string::npos); - s_tmpString.clear(); - } -break; -case 94: -{ - yyval = yyvsp[-5] + " " + yyvsp[-4] + yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - yyvsp[-4].erase(yyvsp[-4].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-4]; - curr_var.m_type = yyvsp[-3]; - curr_var.m_isTemplate = true; - curr_var.m_templateDecl = yyvsp[-2] +yyvsp[-1] +yyvsp[0]; - curr_var.m_isConst = (yyvsp[-5].find("const") != std::string::npos); - s_tmpString.clear(); - } -break; -case 95: -{ - yyval = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; - yyvsp[-1].erase(yyvsp[-1].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-1]; - curr_var.m_type = yyvsp[0]; - curr_var.m_isTemplate = !curr_var.m_templateDecl.empty(); - curr_var.m_completeType = yyvsp[-1] + yyvsp[0]; - curr_var.m_isConst = (yyvsp[-3].find("const") != std::string::npos); - s_tmpString.clear(); - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CxxParser/CMakeLists.txt b/CxxParser/CMakeLists.txt new file mode 100644 index 0000000000..aa53f2c6ff --- /dev/null +++ b/CxxParser/CMakeLists.txt @@ -0,0 +1,64 @@ +project(CxxParser) + +# Bison files +BISON_TARGET(CppScopeGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_scope_grammar.y" "${CMAKE_CURRENT_BINARY_DIR}/cpp_scope_grammar.cpp" + DEFINES_FILE "${CMAKE_CURRENT_BINARY_DIR}/cpp_lexer.h" + COMPILE_FLAGS "-p cl_scope_ --no-lines") +BISON_TARGET(TypedefGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/typedef_grammar.y" "${CMAKE_CURRENT_BINARY_DIR}/typedef_parser.cpp" + COMPILE_FLAGS "-p cl_typedef_ --no-lines") +BISON_TARGET(CppVariablesGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_variables_grammar.y" "${CMAKE_CURRENT_BINARY_DIR}/var_parser.cpp" + COMPILE_FLAGS "-p cl_var_ --no-lines") +BISON_TARGET(ExprGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/expr_grammar.y" "${CMAKE_CURRENT_BINARY_DIR}/cpp_expr_parser.cpp" + COMPILE_FLAGS "-p cl_expr_ --no-lines") +BISON_TARGET(CppFuncParserYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_func_parser.y" "${CMAKE_CURRENT_BINARY_DIR}/cpp_func_parser.cpp" + COMPILE_FLAGS "-p cl_func_ --no-lines") + +set(BisonSrcs + "${BISON_CppScopeGrammarYacc_OUTPUTS}" + "${BISON_TypedefGrammarYacc_OUTPUTS}" + "${BISON_CppVariablesGrammarYacc_OUTPUTS}" + "${BISON_ExprGrammarYacc_OUTPUTS}" + "${BISON_CppFuncParserYacc_OUTPUTS}" +) + +# Flex files +FLEX_TARGET(CppFlex "${CMAKE_SOURCE_DIR}/CxxParser/cpp.l" "${CMAKE_CURRENT_BINARY_DIR}/cpp.cpp" + COMPILE_FLAGS "-Pcl_scope_ --noline --yylineno --batch") +# Increase YY_BUF_SIZE from 16384 to 16384*5 +set_source_files_properties("${FLEX_CppFlex_OUTPUTS}" PROPERTIES COMPILE_DEFINITIONS "-DYY_BUF_SIZE=(16384*5)") +FLEX_TARGET(ExprLexerFlex "${CMAKE_SOURCE_DIR}/CxxParser/expr_lexer.l" "${CMAKE_CURRENT_BINARY_DIR}/expr_lexer.cpp" + COMPILE_FLAGS "-Pcl_expr_ --noline --yylineno --batch") +# Increase YY_BUF_SIZE from 16384 to 16384*5 +set_source_files_properties("${FLEX_ExprLexerFlex_OUTPUTS}" PROPERTIES COMPILE_DEFINITIONS "-DYY_BUF_SIZE=(16384*5)") + +ADD_FLEX_BISON_DEPENDENCY(CppFlex CppScopeGrammarYacc) +ADD_FLEX_BISON_DEPENDENCY(ExprLexerFlex CppScopeGrammarYacc) + +set(FlexSrcs "${FLEX_CppFlex_OUTPUTS}" "${FLEX_ExprLexerFlex_OUTPUTS}") + +# Define the outputs +add_library(libCxxParser STATIC + cl_typedef.h + code_completion_api.h + expression_result.cpp + expression_result.h + function.cpp + function.h + variable.cpp + variable.h + ${FlexSrcs} + ${BisonSrcs} +) + +# Include paths +target_include_directories(libCxxParser + PUBLIC "${CL_SRC_ROOT}/CxxParser" + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}" +) + +# "testing" application +add_executable(CxxParser + main.cpp +) + +target_link_libraries(CxxParser PRIVATE libCxxParser) diff --git a/CxxParser/CxxParser.workspace b/CxxParser/CxxParser.workspace deleted file mode 100644 index 27734b43e9..0000000000 --- a/CxxParser/CxxParser.workspace +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/CxxParser/Parser.project b/CxxParser/Parser.project deleted file mode 100644 index 0dc2fff18a..0000000000 --- a/CxxParser/Parser.project +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - copy *.h ..\CodeLite\. - copy *.cpp ..\CodeLite\. - - - - - - - - - None - - - - - scope_parser.cpp cpp_lexer.cpp var_parser.cpp cpp_expr_lexer.cpp cpp_expr_parser.cpp cpp_func_parser.cpp typedef_parser.cpp -scope_parser.cpp: cpp_scope_grammar.y - yacc -dl -t -v -pcl_scope_ cpp_scope_grammar.y - mv y.tab.c scope_parser.cpp - mv y.tab.h cpp_lexer.h - -cpp_lexer.cpp: cpp.l - flex -L -Pcl_scope_ cpp.l - sed -e "s/YY_BUF_SIZE 16384/YY_BUF_SIZE 16384*5/g" lex.cl_scope_.c > cpp_lexer.cpp - -typedef_parser.cpp: typedef_grammar.y - yacc -l -t -v -pcl_typedef_ typedef_grammar.y - mv y.tab.c typedef_parser.cpp - -var_parser.cpp: cpp_variables_grammar.y - yacc -l -t -v -pcl_var_ cpp_variables_grammar.y - mv y.tab.c var_parser.cpp - -cpp_expr_lexer.cpp: expr_lexer.l - flex -L -Pcl_expr_ expr_lexer.l - sed -e "s/YY_BUF_SIZE 16384/YY_BUF_SIZE 16384*5/g" lex.cl_expr_.c > cpp_expr_lexer.cpp - -cpp_expr_parser.cpp: expr_grammar.y - yacc -l -t -v -pcl_expr_ expr_grammar.y - mv y.tab.c cpp_expr_parser.cpp - -cpp_func_parser.cpp: cpp_func_parser.y - yacc -l -t -v -pcl_func_ cpp_func_parser.y - mv y.tab.c cpp_func_parser.cpp - - - - - - - - - - - diff --git a/CxxParser/code_completion_api.h b/CxxParser/code_completion_api.h index a1f83c0fc2..f705096768 100644 --- a/CxxParser/code_completion_api.h +++ b/CxxParser/code_completion_api.h @@ -19,7 +19,7 @@ extern WXDLLIMPEXP_CL void cl_scope_lex_clean(); // directly extern int cl_scope_lex(); extern int cl_scope_lineno; -extern std::string cl_scope_text; +extern char* cl_scope_text; class WXDLLIMPEXP_CL CppLexer { diff --git a/CxxParser/cpp.l b/CxxParser/cpp.l index 4519839fbe..88e865f358 100644 --- a/CxxParser/cpp.l +++ b/CxxParser/cpp.l @@ -2,19 +2,18 @@ /* Included code before lex code */ /*************** Includes and Defines *****************************/ +#include +#include +#include +#include +#include +#include -#include "map" +#define YYSTYPE std::string #include "cpp_lexer.h" // YACC generated definitions based on C++ grammar -#include "errno.h" -#define YYSTYPE std::string #define ECHO -#include "string" -#include -#include -#include - extern std::string cl_scope_lval; extern std::string cl_var_lval; extern std::string cl_func_lval; @@ -22,7 +21,7 @@ extern std::string cl_typedef_lval; std::vector currentScope; -bool setLexerInput(const std::string &in, const std::map &ignoreTokens); +bool setLexerInput(const std::string &in, const std::map &ignoreTokens); void setUseIgnoreMacros(bool ignore); std::string getCurrentScope(); @@ -33,14 +32,14 @@ void cl_scope_less(int count); //we keep a very primitive map with only symbol name //that we encountered so far std::map g_symbols; -std::map g_macros; +std::map g_macros; -static std::map g_ignoreList; +static std::map g_ignoreList; static bool gs_useMacroIgnore = true; bool isaTYPE(char *string); -bool isaMACRO(char *string); -bool isignoredToken(char *string); +bool isaMACRO(char *string); +bool isignoredToken(char *string); static bool defineFound = false; @@ -57,7 +56,7 @@ static bool defineFound = false; RETURN_VAL(LE_TYPEDEFname);\ }else if(isaMACRO(yytext)){\ RETURN_VAL(LE_MACRO);\ - }else if(isignoredToken(yytext)){\ + }else if(isignoredToken(yytext)){\ }else{ RETURN_VAL(LE_IDENTIFIER);}\ } @@ -80,6 +79,7 @@ static bool defineFound = false; %} %option yylineno +%option never-interactive identifier [a-zA-Z_][0-9a-zA-Z_]* @@ -323,8 +323,8 @@ bool isaTYPE(char *string) { return g_symbols.find(string) != g_symbols.end(); } - -bool isignoredToken(char *string) + +bool isignoredToken(char *string) { std::map::iterator iter = g_ignoreList.find(string); if(iter == g_ignoreList.end()){ @@ -334,8 +334,8 @@ bool isignoredToken(char *string) /* it exist, but maybe it has a replacement */ return iter->second.empty(); } -} - +} + bool isaMACRO(char *string) { if(gs_useMacroIgnore) { @@ -413,8 +413,8 @@ bool setLexerInput(const std::string &in, const std::map - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#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. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384*5 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - 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 - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int 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 int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* 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 yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst 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 = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 146 -#define YY_END_OF_BUFFER 147 -static yyconst short int yy_acclist[618] = - { 0, - 147, 133, 146, 3, 133, 146, 5, 146, 4, 133, - 146, 97, 133, 146, 133, 146, 99, 133, 146, 92, - 133, 146, 133, 146, 83, 133, 146, 84, 133, 146, - 93, 133, 146, 94, 133, 146, 85, 133, 146, 95, - 133, 146, 91, 133, 146, 98, 133, 146, 78, 133, - 146, 77, 133, 146, 105, 133, 146, 106, 133, 146, - 100, 133, 146, 107, 133, 146, 101, 133, 146, 104, - 133, 146, 76, 133, 146, 76, 133, 146, 89, 133, - 146, 90, 133, 146, 102, 133, 146, 76, 133, 146, - 76, 133, 146, 76, 133, 146, 76, 133, 146, 76, - - 133, 146, 76, 133, 146, 76, 133, 146, 76, 133, - 146, 76, 133, 146, 76, 133, 146, 76, 133, 146, - 76, 133, 146, 76, 133, 146, 76, 133, 146, 76, - 133, 146, 76, 133, 146, 76, 133, 146, 76, 133, - 146, 87, 133, 146, 103, 133, 146, 88, 133, 146, - 96, 133, 146, 86, 133, 146, 141, 146, 134, 146, - 139, 141, 146, 135, 141, 146, 139, 141, 146, 140, - 146, 137, 146, 138, 140, 146, 143, 146, 142, 146, - 145, 146, 146, 145, 146, 3, 5, 4, 119, 82, - 124, 120, 129, 122, 112, 125, 113, 126, 110, 108, - - 80, 1, 2, 123, 80, 78, 78, 78, 77, 77, - 77, 109, 114, 116, 118, 117, 115, 76, 130, 76, - 76, 76, 76, 76, 76, 76, 76, 15, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 26, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 131, 121, 139, 139, 138, 144, - 81, 111, 132, 80, 80, 78, 79, 77, 127, 128, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - - 24, 76, 76, 76, 76, 76, 76, 76, 30, 76, - 76, 76, 76, 57, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 139, 80, 79, 79, 6, 76, 33, - 76, 76, 8, 76, 76, 9, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 17, 76, 18, 76, 76, - 20, 76, 76, 76, 76, 76, 76, 25, 76, 76, - 76, 76, 76, 31, 76, 32, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - - 76, 76, 76, 76, 65, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 47, 76, 76, 76, 139, 79, - 7, 76, 75, 76, 52, 76, 10, 76, 76, 76, - 76, 76, 76, 76, 19, 76, 21, 76, 76, 61, - 76, 23, 76, 76, 27, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - 37, 76, 76, 76, 76, 76, 76, 76, 76, 74, - 76, 76, 76, 76, 44, 76, 45, 76, 76, 73, - 76, 76, 76, 49, 76, 139, 76, 76, 76, 13, - 76, 54, 76, 16, 76, 76, 22, 76, 55, 76, - - 28, 76, 76, 56, 76, 76, 76, 76, 76, 34, - 76, 76, 76, 64, 76, 76, 76, 36, 76, 38, - 76, 51, 76, 39, 76, 40, 76, 41, 76, 42, - 76, 76, 50, 76, 76, 76, 76, 76, 76, 136, - 139, 76, 76, 12, 76, 14, 76, 76, 29, 76, - 76, 76, 76, 76, 63, 76, 76, 76, 76, 76, - 76, 43, 76, 76, 76, 66, 76, 76, 76, 11, - 76, 76, 76, 58, 76, 59, 76, 60, 76, 76, - 35, 76, 76, 76, 67, 76, 68, 76, 46, 76, - 48, 76, 76, 76, 53, 76, 62, 76, 76, 76, - - 71, 76, 76, 76, 76, 76, 76, 70, 76, 69, - 76, 76, 76, 76, 76, 72, 76 - } ; - -static yyconst short int yy_accept[467] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 7, 9, 12, 15, 17, 20, 23, - 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, - 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, - 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, - 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, - 145, 148, 151, 154, 157, 159, 161, 164, 167, 170, - 172, 174, 177, 179, 181, 183, 184, 186, 187, 188, - 188, 189, 190, 190, 191, 191, 192, 193, 194, 194, - 194, 195, 196, 197, 198, 199, 200, 201, 201, 202, - - 203, 204, 205, 206, 207, 207, 207, 208, 209, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 219, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 271, 271, 272, 272, 272, 273, 274, 274, - 275, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - - 294, 295, 296, 297, 298, 299, 300, 301, 303, 304, - 305, 306, 307, 308, 309, 311, 312, 313, 314, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, 339, 340, 341, 342, 343, 344, 345, 345, - 345, 345, 345, 345, 346, 347, 348, 350, 352, 353, - 355, 356, 358, 359, 360, 361, 362, 363, 364, 365, - 366, 368, 370, 371, 373, 374, 375, 376, 377, 378, - 380, 381, 382, 383, 384, 386, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - - 402, 403, 404, 405, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 417, 418, 419, 420, 420, 420, 420, - 420, 421, 423, 425, 427, 429, 430, 431, 432, 433, - 434, 435, 437, 439, 440, 442, 444, 445, 447, 448, - 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 463, 464, 465, 466, 467, 468, 469, - 470, 472, 473, 474, 475, 477, 479, 480, 482, 483, - 484, 486, 487, 488, 489, 490, 492, 494, 496, 497, - 499, 501, 503, 504, 506, 507, 508, 509, 510, 512, - 513, 514, 516, 517, 518, 520, 522, 524, 526, 528, - - 530, 532, 533, 535, 536, 537, 538, 539, 540, 542, - 543, 544, 546, 548, 549, 551, 552, 553, 554, 555, - 557, 558, 559, 560, 561, 562, 564, 565, 566, 568, - 569, 570, 572, 573, 574, 576, 578, 580, 581, 583, - 584, 585, 587, 589, 591, 593, 594, 595, 597, 599, - 600, 601, 603, 604, 605, 606, 607, 608, 610, 612, - 613, 614, 615, 616, 618, 618 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 7, 8, 9, 10, 1, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 23, - 23, 23, 23, 23, 23, 24, 24, 25, 26, 27, - 28, 29, 30, 1, 31, 31, 31, 31, 32, 33, - 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, - 34, 34, 34, 34, 36, 34, 34, 37, 34, 34, - 38, 39, 40, 41, 42, 1, 43, 44, 45, 46, - - 47, 48, 49, 50, 51, 34, 52, 53, 54, 55, - 56, 57, 34, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[71] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 5, 6, 1, 1, 1, 1, 1, 3, - 6, 6, 6, 7, 7, 7, 7, 1, 3, 1, - 1, 7, 5, 5, 6, 6, 6, 5, 7, 7, - 7, 7, 7, 7, 8, 7, 7, 8, 7, 8, - 7, 8, 7, 8, 7, 7, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[478] = - { 0, - 0, 811, 70, 0, 140, 0, 817, 816, 208, 209, - 818, 822, 211, 822, 224, 789, 210, 788, 208, 776, - 822, 822, 786, 204, 822, 214, 224, 229, 238, 231, - 788, 822, 195, 784, 206, 822, 0, 228, 822, 822, - 783, 749, 213, 233, 212, 240, 250, 753, 217, 231, - 209, 243, 236, 761, 259, 264, 257, 262, 757, 822, - 211, 822, 822, 822, 822, 822, 0, 822, 759, 822, - 822, 0, 822, 822, 822, 822, 784, 321, 822, 328, - 334, 822, 281, 822, 320, 822, 822, 822, 225, 322, - 822, 822, 822, 822, 822, 788, 822, 783, 324, 822, - - 822, 822, 328, 365, 346, 385, 260, 314, 0, 393, - 318, 320, 822, 774, 822, 822, 822, 773, 0, 344, - 761, 822, 739, 742, 750, 221, 753, 752, 739, 342, - 732, 737, 323, 319, 733, 730, 734, 732, 729, 735, - 725, 348, 346, 729, 728, 728, 718, 733, 732, 368, - 734, 371, 721, 361, 378, 725, 721, 347, 720, 716, - 384, 721, 713, 311, 719, 822, 822, 0, 721, 0, - 822, 425, 0, 822, 410, 0, 822, 822, 433, 822, - 415, 436, 822, 409, 822, 822, 822, 712, 714, 723, - 718, 719, 705, 703, 382, 410, 714, 716, 716, 710, - - 710, 705, 701, 698, 706, 709, 708, 0, 703, 693, - 701, 701, 693, 694, 0, 697, 694, 695, 0, 683, - 682, 690, 676, 677, 683, 684, 679, 672, 674, 676, - 683, 669, 667, 667, 669, 666, 668, 676, 675, 674, - 664, 668, 663, 657, 670, 672, 661, 662, 454, 485, - 452, 521, 444, 457, 436, 361, 0, 0, 660, 0, - 661, 0, 651, 649, 657, 646, 651, 645, 651, 649, - 0, 0, 654, 0, 643, 642, 646, 638, 642, 0, - 648, 648, 633, 638, 0, 0, 633, 648, 420, 636, - 646, 641, 636, 627, 625, 626, 623, 635, 440, 630, - - 635, 634, 625, 0, 614, 634, 440, 627, 619, 624, - 623, 610, 0, 610, 622, 613, 474, 0, 472, 0, - 822, 0, 0, 0, 625, 611, 612, 617, 616, 615, - 610, 0, 0, 605, 0, 0, 613, 0, 610, 611, - 609, 598, 594, 597, 601, 608, 590, 604, 603, 587, - 599, 590, 0, 598, 583, 594, 596, 580, 589, 595, - 0, 577, 589, 592, 0, 0, 579, 0, 590, 581, - 0, 577, 578, 557, 557, 551, 0, 0, 550, 0, - 0, 0, 540, 0, 520, 506, 518, 513, 0, 511, - 497, 0, 509, 497, 0, 0, 0, 0, 509, 0, - - 0, 490, 0, 501, 494, 500, 493, 489, 0, 498, - 493, 0, 0, 497, 0, 493, 479, 490, 488, 0, - 480, 468, 468, 478, 475, 0, 474, 474, 0, 472, - 456, 0, 469, 465, 0, 0, 0, 460, 0, 446, - 460, 0, 0, 0, 0, 442, 458, 0, 0, 453, - 440, 0, 439, 428, 427, 391, 350, 0, 0, 313, - 274, 248, 228, 0, 822, 569, 577, 585, 593, 597, - 601, 605, 611, 617, 621, 623, 625 - } ; - -static yyconst short int yy_def[478] = - { 0, - 465, 1, 465, 3, 465, 5, 466, 466, 467, 467, - 465, 465, 465, 465, 465, 465, 468, 465, 465, 469, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 470, 470, 465, 465, - 465, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 465, - 465, 465, 465, 465, 465, 465, 471, 465, 471, 465, - 465, 472, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 468, 465, 473, 465, 465, 465, 469, 474, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - - 465, 465, 465, 465, 465, 465, 465, 465, 475, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 470, 468, - 469, 465, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 465, 465, 471, 471, 472, - 465, 468, 476, 465, 469, 477, 465, 465, 465, 465, - 465, 465, 465, 475, 465, 465, 465, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 471, 468, 468, - 469, 469, 465, 465, 465, 465, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 471, 468, 250, 469, 252, - 465, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 471, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - - 470, 470, 470, 470, 470, 470, 470, 470, 471, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, - 470, 470, 470, 470, 0, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465 - } ; - -static yyconst short int yy_nxt[893] = - { 0, - 12, 13, 14, 15, 15, 15, 13, 16, 17, 12, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, - 37, 37, 37, 37, 38, 37, 37, 39, 12, 40, - 41, 37, 42, 43, 44, 45, 46, 47, 48, 37, - 49, 37, 50, 37, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 37, 37, 37, 60, 61, 62, 63, - 65, 65, 66, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - - 67, 67, 67, 67, 67, 67, 67, 65, 68, 65, - 65, 67, 67, 67, 67, 69, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 65, 65, 65, 65, - 70, 70, 71, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 72, 72, 72, 72, 72, 72, 72, 70, 70, 70, - 70, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - - 72, 72, 72, 72, 72, 72, 70, 70, 70, 70, - 76, 76, 78, 79, 80, 80, 80, 78, 84, 87, - 92, 114, 115, 77, 77, 80, 79, 81, 81, 81, - 80, 93, 94, 117, 118, 88, 120, 174, 166, 97, - 121, 95, 96, 98, 100, 99, 99, 99, 85, 101, - 103, 146, 110, 110, 110, 147, 102, 103, 130, 104, - 104, 105, 106, 90, 142, 111, 112, 131, 124, 106, - 125, 143, 107, 108, 109, 126, 132, 106, 167, 191, - 192, 144, 127, 111, 106, 128, 145, 464, 129, 84, - 107, 112, 133, 150, 134, 183, 151, 135, 108, 148, - - 137, 109, 138, 136, 149, 139, 463, 140, 153, 154, - 157, 161, 163, 158, 159, 162, 462, 164, 155, 85, - 183, 156, 78, 79, 80, 80, 80, 78, 160, 80, - 79, 80, 80, 80, 80, 80, 79, 81, 81, 81, - 80, 172, 172, 175, 175, 99, 99, 99, 183, 99, - 99, 99, 84, 185, 185, 179, 180, 461, 180, 179, - 180, 245, 180, 246, 202, 103, 183, 105, 105, 105, - 179, 180, 185, 200, 179, 180, 180, 106, 185, 203, - 180, 201, 85, 173, 103, 176, 104, 104, 105, 196, - 213, 460, 106, 211, 197, 321, 106, 236, 214, 107, - - 108, 181, 212, 181, 237, 215, 182, 182, 182, 230, - 222, 106, 103, 321, 110, 110, 110, 107, 223, 226, - 232, 227, 174, 224, 106, 108, 231, 111, 112, 240, - 228, 251, 251, 84, 241, 233, 182, 182, 182, 106, - 264, 265, 242, 255, 256, 111, 249, 249, 90, 253, - 459, 253, 266, 112, 254, 254, 254, 182, 182, 182, - 267, 255, 84, 85, 174, 254, 254, 254, 180, 256, - 180, 321, 344, 319, 319, 317, 317, 345, 254, 254, - 254, 355, 84, 180, 174, 363, 458, 457, 180, 180, - 90, 180, 85, 84, 364, 356, 321, 456, 455, 454, - - 453, 452, 451, 450, 180, 449, 318, 318, 318, 180, - 90, 448, 85, 447, 446, 318, 318, 318, 445, 444, - 443, 442, 441, 85, 440, 439, 438, 318, 318, 318, - 318, 318, 318, 174, 437, 436, 435, 434, 433, 432, - 431, 430, 320, 320, 320, 429, 428, 427, 426, 425, - 424, 320, 320, 320, 423, 422, 421, 420, 419, 90, - 418, 417, 416, 320, 320, 320, 320, 320, 320, 73, - 73, 73, 73, 73, 73, 73, 73, 75, 75, 75, - 75, 75, 75, 75, 75, 83, 415, 83, 83, 83, - 83, 83, 83, 89, 414, 89, 413, 89, 89, 89, - - 89, 119, 119, 119, 119, 168, 168, 168, 168, 170, - 170, 170, 170, 83, 83, 83, 412, 411, 83, 89, - 89, 89, 410, 409, 89, 184, 184, 250, 250, 252, - 252, 408, 407, 406, 405, 404, 403, 402, 401, 400, - 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, - 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, - 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, - 369, 368, 367, 366, 365, 362, 361, 360, 359, 358, - 357, 354, 353, 352, 351, 350, 349, 348, 347, 346, - 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, - - 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, - 323, 322, 316, 315, 314, 313, 312, 311, 310, 309, - 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, - 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, - 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, - 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, - 268, 263, 262, 261, 260, 259, 258, 257, 248, 247, - 244, 243, 239, 238, 235, 234, 229, 225, 221, 220, - 219, 218, 217, 216, 210, 209, 208, 207, 206, 205, - 204, 199, 198, 195, 194, 193, 190, 189, 188, 90, - - 187, 186, 178, 177, 171, 169, 165, 152, 141, 123, - 122, 116, 113, 91, 90, 86, 82, 465, 74, 74, - 64, 11, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465 - - } ; - -static yyconst short int yy_chk[893] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 9, 10, 13, 13, 13, 13, 13, 13, 17, 19, - 24, 33, 33, 9, 10, 15, 15, 15, 15, 15, - 15, 24, 26, 35, 35, 19, 38, 89, 61, 27, - 38, 26, 26, 27, 28, 27, 27, 27, 17, 28, - 30, 51, 30, 30, 30, 51, 28, 29, 45, 29, - 29, 29, 30, 89, 49, 30, 30, 45, 43, 29, - 43, 49, 29, 29, 29, 44, 45, 30, 61, 126, - 126, 50, 44, 30, 29, 44, 50, 463, 44, 83, - 29, 30, 46, 53, 46, 107, 53, 46, 29, 52, - - 47, 29, 47, 46, 52, 47, 462, 47, 55, 55, - 56, 57, 58, 56, 56, 57, 461, 58, 55, 83, - 107, 55, 78, 78, 78, 78, 78, 78, 56, 80, - 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, - 81, 85, 85, 90, 90, 99, 99, 99, 108, 103, - 103, 103, 120, 111, 112, 99, 99, 460, 99, 103, - 103, 164, 103, 164, 134, 105, 108, 105, 105, 105, - 99, 99, 112, 133, 103, 103, 99, 105, 111, 134, - 103, 133, 120, 85, 104, 90, 104, 104, 104, 130, - 143, 457, 105, 142, 130, 256, 104, 158, 143, 104, - - 104, 106, 142, 106, 158, 143, 106, 106, 106, 154, - 150, 104, 110, 256, 110, 110, 110, 104, 150, 152, - 155, 152, 175, 150, 110, 104, 154, 110, 110, 161, - 152, 175, 175, 172, 161, 155, 181, 181, 181, 110, - 195, 195, 161, 184, 184, 110, 172, 172, 175, 179, - 456, 179, 196, 110, 179, 179, 179, 182, 182, 182, - 196, 184, 249, 172, 251, 253, 253, 253, 182, 184, - 182, 255, 289, 251, 251, 249, 249, 289, 254, 254, - 254, 299, 317, 182, 319, 307, 455, 454, 182, 254, - 251, 254, 249, 250, 307, 299, 255, 453, 451, 450, - - 447, 446, 441, 440, 254, 438, 250, 250, 250, 254, - 319, 434, 317, 433, 431, 250, 250, 250, 430, 428, - 427, 425, 424, 250, 423, 422, 421, 250, 250, 250, - 250, 250, 250, 252, 419, 418, 417, 416, 414, 411, - 410, 408, 252, 252, 252, 407, 406, 405, 404, 402, - 399, 252, 252, 252, 394, 393, 391, 390, 388, 252, - 387, 386, 385, 252, 252, 252, 252, 252, 252, 466, - 466, 466, 466, 466, 466, 466, 466, 467, 467, 467, - 467, 467, 467, 467, 467, 468, 383, 468, 468, 468, - 468, 468, 468, 469, 379, 469, 376, 469, 469, 469, - - 469, 470, 470, 470, 470, 471, 471, 471, 471, 472, - 472, 472, 472, 473, 473, 473, 375, 374, 473, 474, - 474, 474, 373, 372, 474, 475, 475, 476, 476, 477, - 477, 370, 369, 367, 364, 363, 362, 360, 359, 358, - 357, 356, 355, 354, 352, 351, 350, 349, 348, 347, - 346, 345, 344, 343, 342, 341, 340, 339, 337, 334, - 331, 330, 329, 328, 327, 326, 325, 316, 315, 314, - 312, 311, 310, 309, 308, 306, 305, 303, 302, 301, - 300, 298, 297, 296, 295, 294, 293, 292, 291, 290, - 288, 287, 284, 283, 282, 281, 279, 278, 277, 276, - - 275, 273, 270, 269, 268, 267, 266, 265, 264, 263, - 261, 259, 248, 247, 246, 245, 244, 243, 242, 241, - 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, - 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, - 220, 218, 217, 216, 214, 213, 212, 211, 210, 209, - 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, - 197, 194, 193, 192, 191, 190, 189, 188, 169, 165, - 163, 162, 160, 159, 157, 156, 153, 151, 149, 148, - 147, 146, 145, 144, 141, 140, 139, 138, 137, 136, - 135, 132, 131, 129, 128, 127, 125, 124, 123, 121, - - 118, 114, 98, 96, 77, 69, 59, 54, 48, 42, - 41, 34, 31, 23, 20, 18, 16, 11, 8, 7, - 2, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465 - - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#define INITIAL 0 -/* Included code before lex code */ -/*************** Includes and Defines *****************************/ - - -#include "map" -#include "cpp_lexer.h" // YACC generated definitions based on C++ grammar -#include "errno.h" - -#define YYSTYPE std::string -#define ECHO - -#include "string" -#include -#include -#include - -extern std::string cl_expr_lval; -extern std::string cl_var_lval; - -bool setExprLexerInput(const std::string &in); -void cl_expr_lex_clean(); - -bool exprIsaTYPE(char *string); -bool exprIsaMACRO(char *string); -static bool defineFound = false; - -/* Prototypes */ -#define WHITE_RETURN(x) /* do nothing */ - -#define PA_KEYWORD_RETURN(x) RETURN_VAL(x) /* standard C PArser Keyword */ -#define CPP_KEYWORD_RETURN(x) PA_KEYWORD_RETURN(x) /* C++ keyword */ -#define PPPA_KEYWORD_RETURN(x) RETURN_VAL(x) /* both PreProcessor and PArser keyword */ -#define PP_KEYWORD_RETURN(x) IDENTIFIER_RETURN() - -#define IDENTIFIER_RETURN(){\ - if(exprIsaTYPE(yytext)){\ - RETURN_VAL(LE_TYPEDEFname);\ - }else if(exprIsaMACRO(yytext)){\ - RETURN_VAL(LE_MACRO);\ - }else{ RETURN_VAL(LE_IDENTIFIER);}\ - } - - -#define PPOP_RETURN(x) RETURN_VAL((int)*yytext) /* PreProcess and Parser operator */ -#define NAMED_PPOP_RETURN(x) RETURN_VAL(x) -#define ASCIIOP_RETURN(x) RETURN_VAL((int)*yytext) /* a single character operator */ -#define NAMEDOP_RETURN(x) RETURN_VAL(x) /* a multichar operator, with a name */ - -#define NUMERICAL_RETURN(x) RETURN_VAL(x) /* some sort of constant */ -#define LITERAL_RETURN(x) RETURN_VAL(x) /* a string literal */ -#define C_COMMENT_RETURN(x) RETURN_VAL(x) /* C Style comment */ -#define RETURN_VAL(x) {\ - cl_expr_lval = yytext;\ - return(x);} -#define PREPR 1 - -#define WRAP_PREP 2 - -#define CPP_COMMENT 3 - -#define C_COMMENT 4 - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 822 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - ++yylineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -{ - BEGIN C_COMMENT; - } - YY_BREAK -case 2: -YY_RULE_SETUP -{ - BEGIN CPP_COMMENT; - } - YY_BREAK -case 3: -YY_RULE_SETUP -{ - WHITE_RETURN(' '); - } - YY_BREAK -case 4: -YY_RULE_SETUP -{ - WHITE_RETURN(' '); - } - YY_BREAK -case 5: -YY_RULE_SETUP -{ - WHITE_RETURN('\n'); - } - YY_BREAK -case 6: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_AUTO);} - YY_BREAK -case 7: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_BREAK);} - YY_BREAK -case 8: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CASE);} - YY_BREAK -case 9: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CHAR);} - YY_BREAK -case 10: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CONST);} - YY_BREAK -case 11: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CONTINUE);} - YY_BREAK -case 12: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DEFAULT);} - YY_BREAK -case 13: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_DEFINE);} - YY_BREAK -case 14: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_OPDEFINED);} - YY_BREAK -case 15: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DO);} - YY_BREAK -case 16: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DOUBLE);} - YY_BREAK -case 17: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ELIF);} - YY_BREAK -case 18: -YY_RULE_SETUP -{PPPA_KEYWORD_RETURN(LE_ELSE);} - YY_BREAK -case 19: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ENDIF);} - YY_BREAK -case 20: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_ENUM);} - YY_BREAK -case 21: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ERROR);} - YY_BREAK -case 22: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_EXTERN);} - YY_BREAK -case 23: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_FLOAT);} - YY_BREAK -case 24: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_FOR);} - YY_BREAK -case 25: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_GOTO);} - YY_BREAK -case 26: -YY_RULE_SETUP -{PPPA_KEYWORD_RETURN(LE_IF);} - YY_BREAK -case 27: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_IFDEF);} - YY_BREAK -case 28: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_IFNDEF);} - YY_BREAK -case 29: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_INCLUDE); } - YY_BREAK -case 30: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_INT);} - YY_BREAK -case 31: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_LINE);} - YY_BREAK -case 32: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_LONG);} - YY_BREAK -case 33: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_BOOL);} - YY_BREAK -case 34: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_PRAGMA);} - YY_BREAK -case 35: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_REGISTER);} - YY_BREAK -case 36: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_RETURN);} - YY_BREAK -case 37: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SHORT);} - YY_BREAK -case 38: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIGNED);} - YY_BREAK -case 39: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIZEOF);} - YY_BREAK -case 40: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_STATIC);} - YY_BREAK -case 41: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_STRUCT);} - YY_BREAK -case 42: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SWITCH);} - YY_BREAK -case 43: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_TYPEDEF);} - YY_BREAK -case 44: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_UNDEF);} - YY_BREAK -case 45: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_UNION);} - YY_BREAK -case 46: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_UNSIGNED);} - YY_BREAK -case 47: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_VOID);} - YY_BREAK -case 48: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_VOLATILE);} - YY_BREAK -case 49: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_WHILE);} - YY_BREAK -case 50: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_TIME_T);} - YY_BREAK -case 51: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIZE_T);} - YY_BREAK -case 52: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CLASS);} - YY_BREAK -case 53: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_NAMESPACE);} - YY_BREAK -case 54: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DELETE);} - YY_BREAK -case 55: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_FRIEND);} - YY_BREAK -case 56: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_INLINE);} - YY_BREAK -case 57: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_NEW);} - YY_BREAK -case 58: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OPERATOR);} - YY_BREAK -case 59: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OVERLOAD);} - YY_BREAK -case 60: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OVERRIDE);} - YY_BREAK -case 61: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_FINAL);} - YY_BREAK -case 62: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PROTECTED);} - YY_BREAK -case 63: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PRIVATE);} - YY_BREAK -case 64: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PUBLIC);} - YY_BREAK -case 65: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_THIS);} - YY_BREAK -case 66: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_VIRTUAL);} - YY_BREAK -case 67: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_TEMPLATE);} - YY_BREAK -case 68: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_TYPENAME);} - YY_BREAK -case 69: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DYNAMIC_CAST);} - YY_BREAK -case 70: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_STATIC_CAST);} - YY_BREAK -case 71: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CONST_CAST);} - YY_BREAK -case 72: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_REINTERPRET_CAST);} - YY_BREAK -case 73: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_USING);} - YY_BREAK -case 74: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_THROW);} - YY_BREAK -case 75: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CATCH);} - YY_BREAK -case 76: -YY_RULE_SETUP -{IDENTIFIER_RETURN();} - YY_BREAK -case 77: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_INTEGERconstant);} - YY_BREAK -case 78: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_OCTALconstant);} - YY_BREAK -case 79: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_HEXconstant);} - YY_BREAK -case 80: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_FLOATINGconstant);} - YY_BREAK -case 81: -YY_RULE_SETUP -{ - NUMERICAL_RETURN(LE_CHARACTERconstant); - } - YY_BREAK -case 82: -YY_RULE_SETUP -{ - LITERAL_RETURN(LE_STRINGliteral);} - YY_BREAK -case 83: -YY_RULE_SETUP -{PPOP_RETURN(LE_LP);} - YY_BREAK -case 84: -YY_RULE_SETUP -{PPOP_RETURN(LE_RP);} - YY_BREAK -case 85: -YY_RULE_SETUP -{PPOP_RETURN(LE_COMMA);} - YY_BREAK -case 86: -YY_RULE_SETUP -{BEGIN PREPR;} - YY_BREAK -case 87: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LC);} - YY_BREAK -case 88: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_RC);} - YY_BREAK -case 89: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LB);} - YY_BREAK -case 90: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_RB);} - YY_BREAK -case 91: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_DOT);} - YY_BREAK -case 92: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_AND);} - YY_BREAK -case 93: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_STAR);} - YY_BREAK -case 94: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_PLUS);} - YY_BREAK -case 95: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_MINUS);} - YY_BREAK -case 96: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_NEGATE);} - YY_BREAK -case 97: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_NOT);} - YY_BREAK -case 98: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_DIV);} - YY_BREAK -case 99: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_MOD);} - YY_BREAK -case 100: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LT);} - YY_BREAK -case 101: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_GT);} - YY_BREAK -case 102: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_XOR);} - YY_BREAK -case 103: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_PIPE);} - YY_BREAK -case 104: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_QUESTION);} - YY_BREAK -case 105: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_COLON);} - YY_BREAK -case 106: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_SEMICOLON);} - YY_BREAK -case 107: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_ASSIGN);} - YY_BREAK -case 108: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DOTstar);} - YY_BREAK -case 109: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_CLCL);} - YY_BREAK -case 110: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ARROW);} - YY_BREAK -case 111: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ARROWstar);} - YY_BREAK -case 112: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ICR);} - YY_BREAK -case 113: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DECR);} - YY_BREAK -case 114: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LS);} - YY_BREAK -case 115: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_RS);} - YY_BREAK -case 116: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LE);} - YY_BREAK -case 117: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_GE);} - YY_BREAK -case 118: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_EQ);} - YY_BREAK -case 119: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_NE);} - YY_BREAK -case 120: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ANDAND);} - YY_BREAK -case 121: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_OROR);} - YY_BREAK -case 122: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MULTassign);} - YY_BREAK -case 123: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DIVassign);} - YY_BREAK -case 124: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MODassign);} - YY_BREAK -case 125: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_PLUSassign);} - YY_BREAK -case 126: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MINUSassign);} - YY_BREAK -case 127: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LSassign);} - YY_BREAK -case 128: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_RSassign);} - YY_BREAK -case 129: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ANDassign);} - YY_BREAK -case 130: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ERassign);} - YY_BREAK -case 131: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ORassign);} - YY_BREAK -case 132: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ELLIPSIS);} - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(PREPR): -case YY_STATE_EOF(WRAP_PREP): -case YY_STATE_EOF(CPP_COMMENT): -case YY_STATE_EOF(C_COMMENT): -{ - //reset lexer - yyterminate(); - } - YY_BREAK -case 133: -YY_RULE_SETUP -{return yytext[0];} - YY_BREAK -case 134: -YY_RULE_SETUP -{ - defineFound = false; - BEGIN INITIAL; - } - YY_BREAK -case 135: -YY_RULE_SETUP -{ - BEGIN WRAP_PREP; - } - YY_BREAK -case 136: -YY_RULE_SETUP -{ - defineFound = true; - } - YY_BREAK -case 137: -YY_RULE_SETUP -{ - BEGIN PREPR; - } - YY_BREAK -case 138: -YY_RULE_SETUP -{ - if(defineFound) - { - defineFound = false; - } - } - YY_BREAK -case 139: -YY_RULE_SETUP -{ - if(defineFound) - { - defineFound = false; - } - } - YY_BREAK -case 140: -YY_RULE_SETUP -{} - YY_BREAK -case 141: -YY_RULE_SETUP -{} - YY_BREAK -case 142: -YY_RULE_SETUP -{BEGIN INITIAL;} - YY_BREAK -case 143: -YY_RULE_SETUP -{} - YY_BREAK -case 144: -YY_RULE_SETUP -{BEGIN INITIAL;} - YY_BREAK -case 145: -YY_RULE_SETUP -{} - YY_BREAK -case 146: -YY_RULE_SETUP -ECHO; - YY_BREAK - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * 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->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have 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 - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - char *dest = yy_current_buffer->yy_ch_buf; - char *source = yytext_ptr; - int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - int yy_is_jam; - - YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 466 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 465); - if ( ! yy_is_jam ) - *yy_state_ptr++ = yy_current_state; - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; - char *yy_bp; -#endif - { - char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - int number_to_move = yy_n_chars + 2; - char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --yylineno; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++yylineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * 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; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - 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 *) yy_flex_alloc( 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 ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - 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; - - b = (YY_BUFFER_STATE) yy_flex_alloc( 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_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - 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 ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - 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. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - // exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* 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 - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif - - -bool exprIsaTYPE(char *string) -{ - return false; -} - -bool exprIsaMACRO(char *string) -{ - return false; -} - -void cl_expr_lex_clean() -{ - yy_flush_buffer(YY_CURRENT_BUFFER); - yy_delete_buffer(YY_CURRENT_BUFFER); - cl_expr_lineno = 1; -} - -/*******************************************************************/ -bool setExprLexerInput(const std::string &in) -{ - BEGIN INITIAL; - yy_scan_string(in.c_str()); - - //update the working file name - return true; -} - -int yywrap() -{ - return 1; -} diff --git a/CxxParser/cpp_expr_parser.cpp b/CxxParser/cpp_expr_parser.cpp deleted file mode 100644 index 4afdd8b4e2..0000000000 --- a/CxxParser/cpp_expr_parser.cpp +++ /dev/null @@ -1,976 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_expr_parse -#define yylex cl_expr_lex -#define yyerror cl_expr_error -#define yychar cl_expr_char -#define yyval cl_expr_val -#define yylval cl_expr_lval -#define yydebug cl_expr_debug -#define yynerrs cl_expr_nerrs -#define yyerrflag cl_expr_errflag -#define yyss cl_expr_ss -#define yyssp cl_expr_ssp -#define yyvs cl_expr_vs -#define yyvsp cl_expr_vsp -#define yylhs cl_expr_lhs -#define yylen cl_expr_len -#define yydefred cl_expr_defred -#define yydgoto cl_expr_dgoto -#define yysindex cl_expr_sindex -#define yyrindex cl_expr_rindex -#define yygindex cl_expr_gindex -#define yytable cl_expr_table -#define yycheck cl_expr_check -#define yyname cl_expr_name -#define yyrule cl_expr_rule -#define YYPREFIX "cl_expr_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include "string" -#include "vector" -#include "stdio.h" -#include "map" -#include "expression_result.h" - -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ - -void cl_expr_error(char *string); - -static ExpressionResult result; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_expr_text; -extern int cl_expr_lex(); -extern int cl_expr_parse(); -extern int cl_expr_lineno; -extern std::vector currentScope; -extern bool setExprLexerInput(const std::string &in); -extern void cl_expr_lex_clean(); - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define YYERRCODE 256 -short cl_expr_lhs[] = { -1, - 0, 0, 3, 1, 1, 4, 4, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 7, 7, 7, 8, 8, 8, 2, 2, - 2, 2, 2, 2, 14, 15, 15, 16, 16, 12, - 12, 12, 12, 18, 18, 19, 19, 10, 11, 11, - 11, 13, 13, 9, 9, 20, 17, 17, -}; -short cl_expr_len[] = { 2, - 0, 2, 0, 2, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, - 2, 2, 0, 1, 3, 4, 4, 7, 6, 2, - 3, 3, 5, 8, 2, 0, 3, 0, 1, 1, - 1, 1, 1, 0, 1, 0, 2, 2, 0, 1, - 1, 6, 3, 0, 2, 2, 0, 1, -}; -short cl_expr_defred[] = { 1, - 0, 5, 2, 0, 50, 51, 4, 0, 30, 40, - 41, 42, 43, 0, 0, 0, 0, 54, 31, 0, - 32, 0, 0, 55, 54, 0, 0, 58, 35, 56, - 0, 0, 0, 0, 46, 7, 54, 0, 24, 39, - 33, 0, 0, 53, 0, 0, 0, 0, 37, 29, - 0, 47, 45, 48, 0, 13, 8, 0, 9, 12, - 0, 0, 17, 0, 16, 0, 20, 46, 25, 46, - 34, 22, 21, 11, 10, 15, 14, 18, 19, 0, - 26, 27, 52, 0, 46, 28, -}; -short cl_expr_dgoto[] = { 1, - 3, 7, 4, 37, 67, 68, 38, 39, 26, 44, - 8, 17, 27, 21, 32, 41, 29, 54, 45, 24, -}; -short cl_expr_sindex[] = { 0, - -221, 0, 0, 3, 0, 0, 0, -17, 0, 0, - 0, 0, 0, -3, -254, -264, -14, 0, 0, -16, - 0, -87, 17, 0, 0, -227, 41, 0, 0, 0, - -175, 59, 40, -60, 0, 0, 0, -22, 0, 0, - 0, 78, -175, 0, -11, -203, -189, -175, 0, 0, - -5, 0, 0, 0, 71, 0, 0, -138, 0, 0, - -138, -118, 0, -118, 0, -57, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -175, - 0, 0, 0, 22, 0, 0, -}; -short cl_expr_rindex[] = { 0, - -25, 0, 0, -21, 0, 0, 0, -195, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 5, 9, 0, 0, 0, 0, 0, 0, 0, - -42, 13, 0, -12, 0, 0, 0, 0, 0, 0, - 0, 0, -42, 0, -34, 0, 0, -180, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -30, 0, 0, - 14, 65, 0, 72, 0, 73, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -42, - 0, 0, 0, 0, 0, 0, -}; -short cl_expr_gindex[] = { 0, - 0, 0, 0, 0, -46, 32, -32, 74, 16, 38, - 0, 0, 99, -10, 0, 0, 0, 0, 0, 0, -}; -#define YYTABLESIZE 363 -short cl_expr_table[] = { 43, - 57, 23, 80, 28, 57, 23, 44, 11, 36, 44, - 51, 11, 38, 11, 3, 78, 3, 79, 49, 23, - 49, 48, 14, 16, 15, 46, 53, 44, 46, 46, - 52, 11, 3, 3, 2, 55, 18, 19, 48, 49, - 57, 57, 57, 22, 57, 25, 57, 84, 36, 46, - 36, 10, 47, 20, 38, 10, 70, 10, 57, 57, - 6, 5, 57, 57, 57, 48, 36, 36, 56, 57, - 38, 38, 46, 58, 28, 10, 31, 6, 6, 59, - 34, 35, 6, 85, 60, 61, 62, 63, 6, 72, - 64, 65, 73, 6, 6, 6, 6, 36, 40, 6, - 6, 42, 15, 81, 20, 82, 15, 83, 15, 14, - 46, 71, 54, 14, 46, 14, 46, 50, 66, 56, - 57, 69, 86, 33, 58, 0, 15, 6, 0, 0, - 59, 0, 0, 14, 46, 60, 61, 62, 63, 56, - 57, 64, 65, 0, 74, 0, 0, 0, 0, 0, - 59, 0, 0, 0, 0, 60, 75, 76, 63, 0, - 0, 77, 65, 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, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 6, 6, 6, 6, 0, 0, 6, 6, 0, - 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, - 57, 0, 0, 0, 36, 6, 3, 0, 38, 0, - 49, 0, 30, 44, 9, 30, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 49, 0, 0, 0, - 0, 0, 57, 0, 0, 0, 57, 0, 0, 0, - 36, 0, 0, 0, 38, 0, 0, 0, 57, 0, - 0, 0, 57, 0, 0, 0, 36, 0, 0, 0, - 38, 3, 3, 3, 3, 49, 49, 49, 49, 10, - 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 57, 57, 57, - 57, 57, 57, 57, 57, 36, 36, 36, 36, 38, - 38, 38, 38, -}; -short cl_expr_check[] = { 60, - 0, 44, 60, 91, 0, 16, 41, 38, 0, 44, - 43, 42, 0, 44, 40, 62, 42, 64, 40, 62, - 42, 44, 40, 8, 42, 38, 38, 62, 41, 42, - 42, 62, 58, 59, 256, 46, 40, 292, 44, 62, - 40, 41, 42, 308, 40, 60, 42, 80, 40, 62, - 42, 38, 37, 308, 42, 42, 62, 44, 58, 59, - 58, 59, 58, 59, 60, 44, 58, 59, 258, 259, - 58, 59, 35, 263, 91, 62, 60, 258, 259, 269, - 308, 41, 263, 62, 274, 275, 276, 277, 269, 58, - 280, 281, 61, 274, 275, 276, 277, 273, 40, 280, - 281, 62, 38, 66, 308, 68, 42, 70, 44, 38, - 38, 41, 308, 42, 42, 44, 44, 40, 308, 258, - 259, 48, 85, 25, 263, -1, 62, 308, -1, -1, - 269, -1, -1, 62, 62, 274, 275, 276, 277, 258, - 259, 280, 281, -1, 263, -1, -1, -1, -1, -1, - 269, -1, -1, -1, -1, 274, 275, 276, 277, -1, - -1, 280, 281, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 258, 259, -1, -1, -1, - 263, -1, -1, -1, -1, -1, 269, -1, -1, -1, - -1, 274, 275, 276, 277, -1, -1, 280, 281, -1, - -1, -1, -1, -1, -1, 333, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, - 256, -1, -1, -1, 256, 308, 292, -1, 256, -1, - 292, -1, 333, 308, 292, 333, -1, -1, -1, -1, - -1, -1, 308, -1, -1, -1, 308, -1, -1, -1, - -1, -1, 292, -1, -1, -1, 292, -1, -1, -1, - 292, -1, -1, -1, 292, -1, -1, -1, 308, -1, - -1, -1, 308, -1, -1, -1, 308, -1, -1, -1, - 308, 347, 348, 349, 350, 347, 348, 349, 350, 347, - 348, 349, 350, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 347, 348, 349, - 350, 347, 348, 349, 350, 347, 348, 349, 350, 347, - 348, 349, 350, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 352 -#if YYDEBUG -char *cl_expr_name[] = { -"end-of-file",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,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,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,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,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,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,0,0,0, -0,0,0,"LE_AUTO","LE_DOUBLE","LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE","LE_LONG", -"LE_SWITCH","LE_CASE","LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR", -"LE_EXTERN","LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT", -"LE_UNSIGNED","LE_BOOL","LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID", -"LE_DEFAULT","LE_GOTO","LE_SIZEOF","LE_VOLATILE","LE_DO","LE_IF","LE_STATIC", -"LE_WHILE","LE_NEW","LE_DELETE","LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC", -"LE_PROTECTED","LE_PRIVATE","LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD", -"LE_OVERRIDE","LE_FINAL","LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH", -"LE_IDENTIFIER","LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T", -}; -char *cl_expr_rule[] = { -"$accept : translation_unit", -"translation_unit :", -"translation_unit : translation_unit primary_expr", -"$$1 :", -"primary_expr : $$1 simple_expr", -"primary_expr : error", -"const_spec :", -"const_spec : LE_CONST", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : basic_type_name_inter", -"basic_type_name : LE_SHORT basic_type_name", -"basic_type_name : LE_LONG basic_type_name", -"parameter_list :", -"parameter_list : template_parameter", -"parameter_list : parameter_list ',' template_parameter", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp", -"simple_expr : stmnt_starter special_cast '<' cast_type '>' '('", -"simple_expr : stmnt_starter LE_THIS", -"simple_expr : stmnt_starter '*' LE_THIS", -"simple_expr : stmnt_starter '*' identifier_name", -"simple_expr : stmnt_starter nested_scope_specifier identifier_name optional_template_init_list optinal_postifx", -"simple_expr : stmnt_starter '(' '(' cast_type ')' special_star_amp identifier_name ')'", -"identifier_name : LE_IDENTIFIER array_brackets", -"optional_template_init_list :", -"optional_template_init_list : '<' parameter_list '>'", -"optinal_postifx :", -"optinal_postifx : '('", -"special_cast : LE_DYNAMIC_CAST", -"special_cast : LE_STATIC_CAST", -"special_cast : LE_CONST_CAST", -"special_cast : LE_REINTERPRET_CAST", -"amp_item :", -"amp_item : '&'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : ':'", -"cast_type : nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp", -"cast_type : nested_scope_specifier LE_IDENTIFIER special_star_amp", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"array_brackets :", -"array_brackets : '['", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - -void expr_consumBracketsContent(char openBrace) -{ - char closeBrace; - - switch(openBrace) { - case '(': closeBrace = ')'; break; - case '[': closeBrace = ']'; break; - case '<': closeBrace = '>'; break; - case '{': closeBrace = '}'; break; - default: - openBrace = '('; - closeBrace = ')'; - break; - } - - int depth = 1; - while(depth > 0) - { - int ch = cl_expr_lex(); - //printf("ch=%d\n", ch); - //fflush(stdout); - if(ch == 0){ - break; - } - - if(ch == closeBrace) - { - depth--; - continue; - } - else if(ch == openBrace) - { - depth ++ ; - continue; - } - } -} - -void expr_FuncArgList() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_expr_lex(); - //printf("ch=%d\n", ch); - //fflush(stdout); - if(ch ==0){ - break; - } - - if(ch == ')') - { - depth--; - continue; - } - else if(ch == '(') - { - depth ++ ; - continue; - } - } -} - -void expr_consumeTemplateDecl() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_expr_lex(); - //printf("ch=%d\n", ch); - fflush(stdout); - if(ch ==0){ - break; - } - - if(ch == '>') - { - depth--; - continue; - } - else if(ch == '<') - { - depth ++ ; - continue; - } - } -} - -void expr_syncParser(){ - //dont do anything, a hook to allow us to implement some - //nice error recovery if needed -} - -// return the scope name at the end of the input string -ExpressionResult &parse_expression(const std::string &in) -{ - result.Reset(); - //provide the lexer with new input - if( !setExprLexerInput(in) ){ - return result; - } - - //printf("parsing...\n"); - cl_expr_parse(); - //do the lexer cleanup - cl_expr_lex_clean(); - - return result; -} -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - int yym, yyn, yystate; -#if YYDEBUG - char *yys; - extern char *getenv(); - - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 3: -{result.Reset();} -break; -case 5: -{ - yyclearin; /*clear lookahead token*/ - yyerrok; - /*fprintf(stderr, "CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_expr_text, cl_expr_lineno);*/ - /*fflush(stderr);*/ - expr_syncParser(); - } -break; -case 6: -{yyval = ""; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[0]; } -break; -case 16: -{ yyval = yyvsp[0]; } -break; -case 17: -{ yyval = yyvsp[0]; } -break; -case 18: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 19: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 20: -{ yyval = yyvsp[0]; } -break; -case 21: -{ yyval = yyvsp[-1] + " " + yyvsp[0];} -break; -case 22: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 23: -{yyval = "";} -break; -case 24: -{yyval = yyvsp[0];} -break; -case 25: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 26: -{ - if(yyvsp[-3].empty()) { - yyval = yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - - } else { - yyval = yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } - } -break; -case 27: -{ - if(yyvsp[-3].empty()) { - yyval = yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - - } else { - yyval = yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } - } -break; -case 28: -{ - if(yyvsp[-6].empty()) { - yyval = yyvsp[-5] + yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + " "; - } else { - yyval = yyvsp[-6] + " " + yyvsp[-5] + yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + " "; - } - } -break; -case 29: -{ - expr_FuncArgList(); - yyval = yyvsp[-2]; - result.m_isaType = true; - result.m_name = yyvsp[-2]; - result.m_isFunc = false; - /*printf("Rule 1\n");*/ - /*result.Print();*/ - } -break; -case 30: -{ - yyval = yyvsp[0]; - result.m_isaType = false; - result.m_name = yyval; - result.m_isFunc = false; - result.m_isThis = true; - result.m_isPtr = true; - /*result.Print();*/ - } -break; -case 31: -{ - yyval = yyvsp[0]; - result.m_isaType = false; - result.m_name = yyval; - result.m_isFunc = false; - result.m_isThis = true; - /*result.Print();*/ - } -break; -case 32: -{ - yyval = yyvsp[0]; - result.m_isaType = false; - result.m_name = yyval; - result.m_isFunc = false; - result.m_isThis = false; - result.m_isPtr = false; - /*result.Print();*/ - } -break; -case 33: -{ - result.m_isaType = false; - result.m_name = yyvsp[-2]; - result.m_isThis = false; - yyvsp[-3].erase(yyvsp[-3].find_last_not_of(":")+1); - result.m_scope = yyvsp[-3]; - result.m_isTemplate = yyvsp[-1].empty() ? false : true; - result.m_templateInitList = yyvsp[-1]; - /*result.Print();*/ - } -break; -case 34: -{ - yyval = yyvsp[-4]; - result.m_isaType = true; - result.m_name = yyval; - result.m_isFunc = false; - result.m_isThis = false; - /*result.Print();*/ - } -break; -case 35: -{yyval = yyvsp[-1];} -break; -case 36: -{yyval = "";} -break; -case 37: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 38: -{yyval = "";} -break; -case 39: -{ - yyval = yyvsp[0]; - expr_FuncArgList(); - result.m_isFunc = true; - } -break; -case 40: -{yyval = yyvsp[0];} -break; -case 41: -{yyval = yyvsp[0];} -break; -case 42: -{yyval = yyvsp[0];} -break; -case 43: -{yyval = yyvsp[0];} -break; -case 44: -{yyval = ""; } -break; -case 45: -{ yyval = yyvsp[0]; } -break; -case 46: -{yyval = ""; } -break; -case 47: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 48: -{ yyval = yyvsp[-1] + yyvsp[0]; } -break; -case 49: -{yyval = "";} -break; -case 50: -{ yyval = ";";} -break; -case 51: -{ yyval = ":";} -break; -case 52: -{ - yyval = yyvsp[-5] + yyvsp[-4]; - yyvsp[-5].erase(yyvsp[-5].find_last_not_of(":")+1); - result.m_scope = yyvsp[-5]; - result.m_name = yyvsp[-4]; - result.m_isPtr = (yyvsp[0].find("*") != (size_t)-1);; - result.m_isTemplate = true; - result.m_templateInitList = yyvsp[-3] + yyvsp[-2] + yyvsp[-1]; - } -break; -case 53: -{ - yyval = yyvsp[-2] + yyvsp[-1]; - yyvsp[-2].erase(yyvsp[-2].find_last_not_of(":")+1); - result.m_scope = yyvsp[-2]; - result.m_name = yyvsp[-1]; - result.m_isPtr = (yyvsp[0].find("*") != (size_t)-1);; - } -break; -case 54: -{yyval = "";} -break; -case 55: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 56: -{yyval = yyvsp[-1]+ yyvsp[0];} -break; -case 57: -{ yyval = ""; } -break; -case 58: -{ expr_consumBracketsContent('['); yyval = "[]";} -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CxxParser/cpp_func_parser.cpp b/CxxParser/cpp_func_parser.cpp deleted file mode 100644 index 021db08b52..0000000000 --- a/CxxParser/cpp_func_parser.cpp +++ /dev/null @@ -1,1050 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_func_parse -#define yylex cl_func_lex -#define yyerror cl_func_error -#define yychar cl_func_char -#define yyval cl_func_val -#define yylval cl_func_lval -#define yydebug cl_func_debug -#define yynerrs cl_func_nerrs -#define yyerrflag cl_func_errflag -#define yyss cl_func_ss -#define yyssp cl_func_ssp -#define yyvs cl_func_vs -#define yyvsp cl_func_vsp -#define yylhs cl_func_lhs -#define yylen cl_func_len -#define yydefred cl_func_defred -#define yydgoto cl_func_dgoto -#define yysindex cl_func_sindex -#define yyrindex cl_func_rindex -#define yygindex cl_func_gindex -#define yytable cl_func_table -#define yycheck cl_func_check -#define yyname cl_func_name -#define yyrule cl_func_rule -#define YYPREFIX "cl_func_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include "string" -#include "vector" -#include "stdio.h" -#include "map" -#include "function.h" - -#define YYDEBUG_LEXER_TEXT (cl_func_lval) -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ - -#ifdef yylex -#undef yylex -#define yylex cl_scope_lex -#endif - -int cl_func_parse(); -void cl_func_error(char *string); - -static FunctionList *g_funcs = NULL; -static clFunction curr_func; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_func_text; -extern int cl_scope_lex(); -extern bool setLexerInput(const std::string &in, const std::map &ignoreTokens); -extern int cl_scope_lineno; -extern void cl_scope_lex_clean(); - - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define YYERRCODE 256 -short cl_func_lhs[] = { -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 0, 0, 5, - 3, 3, 6, 6, 8, 8, 7, 7, 9, 9, - 10, 10, 10, 11, 11, 11, 15, 15, 15, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 20, 4, 21, 21, 23, 23, 23, 24, 24, 13, - 13, 22, 22, 25, 26, 25, 18, 18, 12, 12, - 27, 27, 28, 28, 14, 17, 17, 17, 19, 19, - 19, -}; -short cl_func_len[] = { 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 1, 0, 2, 0, - 2, 1, 0, 2, 1, 3, 1, 1, 0, 4, - 0, 1, 3, 4, 4, 7, 1, 2, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, - 0, 15, 0, 4, 0, 1, 1, 1, 1, 0, - 2, 0, 2, 2, 0, 4, 0, 1, 0, 1, - 0, 1, 0, 2, 2, 0, 1, 1, 3, 3, - 6, -}; -short cl_func_defred[] = { 18, - 0, 22, 19, 0, 97, 98, 21, 0, 0, 0, - 0, 88, 0, 27, 28, 25, 0, 0, 90, 80, - 24, 0, 30, 0, 0, 26, 6, 1, 0, 2, - 5, 3, 0, 10, 0, 9, 0, 12, 11, 17, - 93, 81, 80, 16, 15, 4, 8, 7, 13, 14, - 84, 0, 100, 0, 99, 0, 0, 32, 80, 0, - 94, 92, 95, 0, 0, 0, 0, 0, 93, 0, - 86, 68, 69, 56, 60, 61, 52, 53, 62, 63, - 64, 65, 54, 55, 59, 57, 70, 50, 51, 48, - 40, 41, 42, 43, 44, 45, 46, 47, 49, 58, - 0, 0, 39, 85, 38, 71, 33, 101, 0, 93, - 66, 67, 0, 0, 34, 35, 0, 0, 0, 0, - 93, 0, 0, 0, 36, 0, 83, 76, 77, 0, - 74, 78, 79, 72, -}; -short cl_func_dgoto[] = { 1, - 40, 41, 3, 7, 4, 16, 17, 18, 10, 57, - 58, 59, 24, 53, 67, 103, 8, 13, 25, 113, - 120, 124, 130, 134, 42, 60, 63, 54, -}; -short cl_func_sindex[] = { 0, - -247, 0, 0, 22, 0, 0, 0, -267, 7, -223, - -229, 0, -185, 0, 0, 0, -212, -26, 0, 0, - 0, -229, 0, 84, -185, 0, 0, 0, -181, 0, - 0, 0, 142, 0, 142, 0, -59, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -185, 0, 51, 0, -121, -11, 0, 0, -235, - 0, 0, 0, 1, -58, -203, 67, -185, 0, 113, - 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, - 68, 17, 0, 0, 0, 0, 0, 0, -56, 0, - 0, 0, -185, -185, 0, 0, -191, 8, 81, 62, - 0, -185, -189, -200, 0, 53, 0, 0, 0, -52, - 0, 0, 0, 0, -}; -short cl_func_rindex[] = { 0, - 75, 0, 0, -190, 0, 0, 0, -128, 0, -67, - 12, 0, 122, 0, 0, 0, 0, 0, 0, 0, - 0, 12, 0, 0, -120, 0, 0, 0, -27, 0, - 0, 0, -22, 0, -13, 0, -15, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -32, 0, -20, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 88, 0, 0, 122, 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, 78, 0, - 0, 0, -6, -32, 0, 0, 3, 0, 0, -46, - 0, -41, 0, -51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -}; -short cl_func_gindex[] = { 0, - 24, 59, 0, 0, 0, 110, 0, 0, 0, -64, - 69, 41, -33, -9, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -}; -#define YYTABLESIZE 494 -short cl_func_table[] = { 31, - 52, 104, 31, 114, 66, 89, 133, 75, 2, 56, - 4, 31, 82, 4, 4, 8, 4, 22, 8, 8, - 91, 8, 93, 91, 7, 70, 93, 7, 7, 31, - 7, 55, 68, 99, 4, 23, 9, 95, 97, 8, - 101, 91, 93, 91, 87, 92, 100, 94, 7, 118, - 69, 68, 89, 20, 89, 23, 49, 126, 50, 108, - 88, 73, 89, 73, 14, 43, 11, 96, 96, 121, - 132, 75, 96, 23, 12, 15, 82, 44, 96, 6, - 5, 45, 96, 96, 96, 96, 96, 19, 62, 96, - 96, 102, 61, 131, 96, 21, 68, 71, 4, 115, - 116, 128, 129, 8, 105, 91, 106, 96, 111, 112, - 93, 125, 7, 96, 119, 93, 89, 96, 93, 93, - 122, 93, 123, 127, 98, 73, 90, 37, 110, 29, - 29, 26, 20, 20, 29, 0, 107, 0, 0, 93, - 29, 0, 0, 0, 29, 29, 29, 29, 29, 0, - 0, 29, 29, 117, 0, 0, 0, 0, 0, 0, - 96, 96, 0, 0, 0, 0, 0, 0, 0, 29, - 0, 64, 89, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 0, 0, 0, 0, 65, 89, 0, 0, - 87, 87, 0, 0, 0, 87, 0, 0, 0, 0, - 0, 87, 0, 0, 0, 87, 87, 87, 87, 87, - 0, 0, 87, 87, 0, 0, 89, 89, 0, 0, - 0, 89, 29, 29, 0, 89, 89, 89, 0, 0, - 89, 0, 89, 89, 89, 89, 89, 0, 89, 89, - 87, 89, 89, 89, 89, 4, 0, 89, 89, 0, - 8, 0, 91, 0, 0, 82, 82, 93, 0, 7, - 0, 0, 0, 0, 0, 4, 89, 0, 0, 0, - 8, 0, 91, 51, 51, 89, 51, 93, 0, 7, - 4, 0, 0, 87, 87, 8, 0, 91, 0, 0, - 72, 73, 93, 0, 7, 89, 89, 0, 0, 89, - 85, 0, 0, 0, 73, 73, 0, 0, 0, 89, - 89, 0, 0, 0, 0, 0, 0, 0, 89, 89, - 0, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 20, 20, 85, 86, 0, 20, 0, 0, - 0, 27, 28, 20, 0, 0, 29, 20, 20, 20, - 20, 20, 30, 0, 20, 20, 0, 31, 32, 33, - 34, 0, 0, 35, 36, 0, 0, 0, 0, 0, - 27, 28, 20, 0, 0, 29, 0, 0, 20, 89, - 89, 30, 20, 0, 89, 0, 31, 32, 33, 34, - 89, 37, 35, 36, 0, 89, 89, 89, 89, 27, - 28, 89, 89, 0, 46, 0, 0, 0, 0, 0, - 30, 0, 0, 0, 0, 31, 32, 47, 34, 0, - 109, 48, 36, 0, 0, 20, 20, 0, 0, 89, - 0, 0, 0, 0, 38, 39, 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, 38, 39, 0, 0, 0, 0, 0, - 0, 0, 89, 89, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 38, 39, -}; -short cl_func_check[] = { 41, - 60, 60, 44, 60, 126, 126, 59, 59, 256, 43, - 38, 44, 59, 41, 42, 38, 44, 44, 41, 42, - 41, 44, 38, 44, 38, 59, 42, 41, 42, 62, - 44, 41, 44, 33, 62, 62, 304, 37, 38, 62, - 40, 62, 42, 43, 44, 45, 46, 47, 62, 114, - 62, 44, 59, 13, 61, 44, 33, 122, 35, 69, - 60, 59, 62, 61, 294, 25, 60, 258, 259, 62, - 123, 123, 263, 62, 298, 305, 123, 259, 269, 58, - 59, 263, 273, 274, 275, 276, 277, 273, 38, 280, - 281, 91, 42, 41, 94, 308, 44, 333, 126, 109, - 110, 302, 303, 126, 308, 126, 40, 298, 41, 93, - 126, 121, 126, 304, 306, 38, 123, 308, 41, 42, - 40, 44, 61, 313, 124, 123, 126, 40, 70, 258, - 259, 22, 58, 59, 263, -1, 68, -1, -1, 62, - 269, -1, -1, -1, 273, 274, 275, 276, 277, -1, - -1, 280, 281, 113, -1, -1, -1, -1, -1, -1, - 351, 352, -1, -1, -1, -1, -1, -1, -1, 298, - -1, 293, 293, -1, -1, -1, -1, -1, -1, 308, - -1, -1, -1, -1, -1, -1, 308, 308, -1, -1, - 258, 259, -1, -1, -1, 263, -1, -1, -1, -1, - -1, 269, -1, -1, -1, 273, 274, 275, 276, 277, - -1, -1, 280, 281, -1, -1, 258, 259, -1, -1, - -1, 263, 351, 352, -1, 258, 259, 269, -1, -1, - 263, -1, 274, 275, 276, 277, 269, -1, 280, 281, - 308, 274, 275, 276, 277, 273, -1, 280, 281, -1, - 273, -1, 273, -1, -1, 302, 303, 273, -1, 273, - -1, -1, -1, -1, -1, 293, 308, -1, -1, -1, - 293, -1, 293, 333, 333, 308, 333, 293, -1, 293, - 308, -1, -1, 351, 352, 308, -1, 308, -1, -1, - 290, 291, 308, -1, 308, 302, 303, -1, -1, 306, - 333, -1, -1, -1, 302, 303, -1, -1, -1, 351, - 352, -1, -1, -1, -1, -1, -1, -1, 351, 352, - -1, 321, 322, 323, 324, 325, 326, 327, 328, 329, - 330, 331, 258, 259, 334, 335, -1, 263, -1, -1, - -1, 258, 259, 269, -1, -1, 263, 273, 274, 275, - 276, 277, 269, -1, 280, 281, -1, 274, 275, 276, - 277, -1, -1, 280, 281, -1, -1, -1, -1, -1, - 258, 259, 298, -1, -1, 263, -1, -1, 304, 258, - 259, 269, 308, -1, 263, -1, 274, 275, 276, 277, - 269, 308, 280, 281, -1, 274, 275, 276, 277, 258, - 259, 280, 281, -1, 263, -1, -1, -1, -1, -1, - 269, -1, -1, -1, -1, 274, 275, 276, 277, -1, - 308, 280, 281, -1, -1, 351, 352, -1, -1, 308, - -1, -1, -1, -1, 351, 352, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 351, 352, -1, -1, -1, -1, -1, - -1, -1, 351, 352, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 351, 352, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 352 -#if YYDEBUG -char *cl_func_name[] = { -"end-of-file",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,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,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,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,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,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,"LE_AUTO","LE_DOUBLE", -"LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE","LE_LONG","LE_SWITCH","LE_CASE", -"LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR","LE_EXTERN","LE_RETURN", -"LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT","LE_UNSIGNED","LE_BOOL", -"LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID","LE_DEFAULT","LE_GOTO","LE_SIZEOF", -"LE_VOLATILE","LE_DO","LE_IF","LE_STATIC","LE_WHILE","LE_NEW","LE_DELETE", -"LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC","LE_PROTECTED","LE_PRIVATE", -"LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD","LE_OVERRIDE","LE_FINAL", -"LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH","LE_IDENTIFIER", -"LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T", -}; -char *cl_func_rule[] = { -"$accept : translation_unit", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name_inter : LE_TIME_T", -"basic_type_name_inter : LE_SIZE_T", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : LE_LONG LE_LONG", -"basic_type_name : LE_LONG LE_INT", -"basic_type_name : basic_type_name_inter", -"translation_unit :", -"translation_unit : translation_unit external_decl", -"$$1 :", -"external_decl : $$1 function_decl", -"external_decl : error", -"template_arg :", -"template_arg : template_specifiter LE_IDENTIFIER", -"template_arg_list : template_arg", -"template_arg_list : template_arg_list ',' template_arg", -"template_specifiter : LE_CLASS", -"template_specifiter : LE_TYPENAME", -"opt_template_qualifier :", -"opt_template_qualifier : LE_TEMPLATE '<' template_arg_list '>'", -"template_parameter_list :", -"template_parameter_list : template_parameter", -"template_parameter_list : template_parameter_list ',' template_parameter", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp", -"func_name : LE_IDENTIFIER", -"func_name : '~' LE_IDENTIFIER", -"func_name : LE_OPERATOR any_operator", -"any_operator : '+'", -"any_operator : '-'", -"any_operator : '*'", -"any_operator : '/'", -"any_operator : '%'", -"any_operator : '^'", -"any_operator : '&'", -"any_operator : '|'", -"any_operator : '~'", -"any_operator : '!'", -"any_operator : '<'", -"any_operator : '>'", -"any_operator : LE_LS", -"any_operator : LE_RS", -"any_operator : LE_ANDAND", -"any_operator : LE_OROR", -"any_operator : LE_ARROW", -"any_operator : LE_ARROWstar", -"any_operator : '.'", -"any_operator : LE_DOTstar", -"any_operator : LE_ICR", -"any_operator : LE_DECR", -"any_operator : LE_LE", -"any_operator : LE_GE", -"any_operator : LE_EQ", -"any_operator : LE_NE", -"any_operator : '(' ')'", -"any_operator : '[' ']'", -"any_operator : LE_NEW", -"any_operator : LE_DELETE", -"any_operator : ','", -"$$2 :", -"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec variable_decl const_spec nested_scope_specifier func_name '(' $$2 const_spec declare_throw opt_pure_virtual override_final_specifier func_postfix", -"declare_throw :", -"declare_throw : LE_THROW '(' template_parameter_list ')'", -"override_final_specifier :", -"override_final_specifier : LE_OVERRIDE", -"override_final_specifier : LE_FINAL", -"func_postfix : '{'", -"func_postfix : ';'", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"opt_pure_virtual :", -"opt_pure_virtual : '=' LE_OCTALconstant", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"$$3 :", -"scope_specifier : LE_IDENTIFIER '<' $$3 LE_CLCL", -"virtual_spec :", -"virtual_spec : LE_VIRTUAL", -"const_spec :", -"const_spec : LE_CONST", -"amp_item :", -"amp_item : '&'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : ':'", -"variable_decl : nested_scope_specifier basic_type_name special_star_amp", -"variable_decl : nested_scope_specifier LE_IDENTIFIER special_star_amp", -"variable_decl : nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - -void func_consumeFuncArgList() -{ - curr_func.m_signature = "("; - - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - if(ch == 0) - { - break; - } - - curr_func.m_signature += cl_func_lval; - curr_func.m_signature += " "; - if(ch == ')') - { - depth--; - continue; - } - else if(ch == '(') - { - depth ++ ; - continue; - } - } -} - -/** - * consume all token until matching closing brace is found - */ -void func_consumeDecl() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - //printf("ch=%d\n", ch); - //fflush(stdout); - if(ch ==0) - { - break; - } - if(ch == '}') - { - depth--; - continue; - } - else if(ch == '{') - { - depth ++ ; - continue; - } - } - -} - -void func_consumeTemplateDecl() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - //printf("ch=%d\n", ch); - //fflush(stdout); - if(ch ==0){ - break; - } - - if(ch == '>') - { - depth--; - continue; - } - else if(ch == '<') - { - depth ++ ; - continue; - } - } -} - -// return the scope name at the end of the input string -void get_functions(const std::string &in, FunctionList &li, const std::map &ignoreTokens) -{ - if( !setLexerInput(in, ignoreTokens) ) - { - return; - } - - g_funcs = &li; - - //call tghe main parsing routine - cl_func_parse(); - g_funcs = NULL; - - //do the lexer cleanup - cl_scope_lex_clean(); -} -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - int yym, yyn, yystate; -#if YYDEBUG - char *yys; - extern char *getenv(); - - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -{ yyval = yyvsp[0]; } -break; -case 2: -{ yyval = yyvsp[0]; } -break; -case 3: -{ yyval = yyvsp[0]; } -break; -case 4: -{ yyval = yyvsp[0]; } -break; -case 5: -{ yyval = yyvsp[0]; } -break; -case 6: -{ yyval = yyvsp[0]; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 16: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 17: -{ yyval = yyvsp[0]; } -break; -case 20: -{curr_func.Reset();} -break; -case 22: -{ - /*printf("CodeLite: syntax error, unexpected token '%s' found\n", cl_func_lval.c_str());*/ - } -break; -case 23: -{ yyval = "";} -break; -case 24: -{yyval = yyvsp[-1] + " " + yyvsp[0];} -break; -case 25: -{ yyval = yyvsp[0]; } -break; -case 26: -{ yyval = yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; } -break; -case 27: -{ yyval = yyvsp[0]; } -break; -case 28: -{ yyval = yyvsp[0]; } -break; -case 30: -{ yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 31: -{yyval = "";} -break; -case 32: -{yyval = yyvsp[0];} -break; -case 33: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 34: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 35: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 36: -{ - yyval = yyvsp[-6] + yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ; - } -break; -case 37: -{yyval = yyvsp[0];} -break; -case 38: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 39: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 71: -{func_consumeFuncArgList();} -break; -case 72: -{ - /*trim down trailing '::' from scope name*/ - yyvsp[-9].erase(yyvsp[-9].find_last_not_of(":")+1); - curr_func.m_isVirtual = yyvsp[-12].find("virtual") != std::string::npos; - curr_func.m_isPureVirtual = yyvsp[-2].find("=") != std::string::npos; - curr_func.m_isConst = yyvsp[-4].find("const") != std::string::npos; - curr_func.m_isFinal = yyvsp[-1].find("final") != std::string::npos; - curr_func.m_name = yyvsp[-7]; - curr_func.m_scope = yyvsp[-8]; - curr_func.m_retrunValusConst = yyvsp[-11]; - curr_func.m_lineno = cl_scope_lineno; - curr_func.m_throws = yyvsp[-3]; - curr_func.m_returnValue.m_rightSideConst = yyvsp[-9]; - curr_func.m_returnValue.m_isConst = !yyvsp[-11].empty(); - if(g_funcs) - { - g_funcs->push_back(curr_func); - } - curr_func.Reset(); - } -break; -case 73: -{yyval = "";} -break; -case 74: -{yyval = yyvsp[-1];} -break; -case 75: -{yyval = "";} -break; -case 80: -{yyval = "";} -break; -case 81: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 82: -{yyval = "";} -break; -case 83: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 84: -{yyval = yyvsp[-1]+ yyvsp[0];} -break; -case 85: -{func_consumeTemplateDecl();} -break; -case 86: -{yyval = yyvsp[-3] + yyvsp[0];} -break; -case 87: -{yyval = ""; } -break; -case 88: -{ yyval = yyvsp[0]; } -break; -case 89: -{yyval = ""; } -break; -case 90: -{ yyval = yyvsp[0]; } -break; -case 91: -{yyval = ""; } -break; -case 92: -{ yyval = yyvsp[0]; } -break; -case 93: -{yyval = ""; } -break; -case 94: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 95: -{ yyval = yyvsp[-1] + yyvsp[0]; } -break; -case 96: -{yyval = "";} -break; -case 97: -{ yyval = ";";} -break; -case 98: -{ yyval = ":";} -break; -case 99: -{ - yyvsp[-2].erase(yyvsp[-2].find_last_not_of(":")+1); - curr_func.m_returnValue.m_type = yyvsp[-1]; - curr_func.m_returnValue.m_typeScope = yyvsp[-2]; - curr_func.m_returnValue.m_starAmp = yyvsp[0]; - curr_func.m_returnValue.m_isPtr = (yyvsp[0].find("*") != (size_t)-1); - yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - } -break; -case 100: -{ - yyvsp[-2].erase(yyvsp[-2].find_last_not_of(":")+1); - curr_func.m_returnValue.m_type = yyvsp[-1]; - curr_func.m_returnValue.m_typeScope = yyvsp[-2]; - curr_func.m_returnValue.m_starAmp = yyvsp[0]; - curr_func.m_returnValue.m_isPtr = (yyvsp[0].find("*") != (size_t)-1); - yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0] ; - } -break; -case 101: -{ - yyvsp[-5].erase(yyvsp[-5].find_last_not_of(":")+1); - curr_func.m_returnValue.m_type = yyvsp[-4]; - curr_func.m_returnValue.m_typeScope = yyvsp[-5]; - curr_func.m_returnValue.m_starAmp = yyvsp[0]; - curr_func.m_returnValue.m_isPtr = (yyvsp[0].find("*") != (size_t)-1); - curr_func.m_returnValue.m_isTemplate = true; - curr_func.m_returnValue.m_templateDecl = yyvsp[-2]; - yyval = yyvsp[-5] + yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] ; - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CxxParser/cpp_func_parser.y b/CxxParser/cpp_func_parser.y index 8f2c37ce5c..7d9b3c1f70 100644 --- a/CxxParser/cpp_func_parser.y +++ b/CxxParser/cpp_func_parser.y @@ -19,6 +19,9 @@ #define yylex cl_scope_lex #endif +void yyerror(const char *s) {} +void func_consumeTemplateDecl(); +void func_consumeFuncArgList(); int cl_func_parse(); void cl_func_error(char *string); @@ -315,8 +318,6 @@ variable_decl : nested_scope_specifier basic_type_name special_star_amp } ; %% -void yyerror(char *s) {} - void func_consumeFuncArgList() { curr_func.m_signature = "("; diff --git a/CxxParser/cpp_lexer.cpp b/CxxParser/cpp_lexer.cpp deleted file mode 100644 index c7cd5fd150..0000000000 --- a/CxxParser/cpp_lexer.cpp +++ /dev/null @@ -1,2805 +0,0 @@ -#define yy_create_buffer cl_scope__create_buffer -#define yy_delete_buffer cl_scope__delete_buffer -#define yy_scan_buffer cl_scope__scan_buffer -#define yy_scan_string cl_scope__scan_string -#define yy_scan_bytes cl_scope__scan_bytes -#define yy_flex_debug cl_scope__flex_debug -#define yy_init_buffer cl_scope__init_buffer -#define yy_flush_buffer cl_scope__flush_buffer -#define yy_load_buffer_state cl_scope__load_buffer_state -#define yy_switch_to_buffer cl_scope__switch_to_buffer -#define yyin cl_scope_in -#define yyleng cl_scope_leng -#define yylex cl_scope_lex -#define yyout cl_scope_out -#define yyrestart cl_scope_restart -#define yytext cl_scope_text -#define yylineno cl_scope_lineno -#define yywrap cl_scope_wrap - -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#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. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384*5 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - 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 - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int 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 int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* 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 yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst 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 = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 149 -#define YY_END_OF_BUFFER 150 -static yyconst short int yy_acclist[652] = - { 0, - 150, 136, 149, 3, 136, 149, 5, 149, 4, 136, - 149, 100, 136, 149, 136, 149, 102, 136, 149, 95, - 136, 149, 136, 149, 86, 136, 149, 87, 136, 149, - 96, 136, 149, 97, 136, 149, 88, 136, 149, 98, - 136, 149, 94, 136, 149, 101, 136, 149, 81, 136, - 149, 80, 136, 149, 108, 136, 149, 109, 136, 149, - 103, 136, 149, 110, 136, 149, 104, 136, 149, 107, - 136, 149, 79, 136, 149, 79, 136, 149, 92, 136, - 149, 93, 136, 149, 105, 136, 149, 79, 136, 149, - 79, 136, 149, 79, 136, 149, 79, 136, 149, 79, - - 136, 149, 79, 136, 149, 79, 136, 149, 79, 136, - 149, 79, 136, 149, 79, 136, 149, 79, 136, 149, - 79, 136, 149, 79, 136, 149, 79, 136, 149, 79, - 136, 149, 79, 136, 149, 79, 136, 149, 79, 136, - 149, 79, 136, 149, 90, 136, 149, 106, 136, 149, - 91, 136, 149, 99, 136, 149, 3, 136, 149, 89, - 136, 149, 144, 149, 137, 149, 142, 144, 149, 138, - 144, 149, 142, 144, 149, 143, 149, 140, 149, 141, - 143, 149, 146, 149, 145, 149, 148, 149, 149, 148, - 149, 3, 5, 4, 122, 85, 127, 123, 132, 125, - - 115, 128, 116, 129, 113, 111, 83, 1, 2, 126, - 83, 81, 81, 81, 80, 80, 80, 112, 117, 119, - 121, 120, 118, 79, 133, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 15, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 26, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 134, 124, 3, 89, 142, 142, 141, 147, - 84, 114, 135, 83, 83, 81, 82, 80, 130, 131, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 24, 79, 79, 79, 79, 79, 79, 79, - 30, 79, 79, 79, 79, 57, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 142, 83, 82, 82, 79, - 6, 79, 33, 79, 79, 8, 79, 79, 9, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 17, 79, 18, 79, 79, 20, 79, 79, 79, 79, - 79, 79, 25, 79, 79, 79, 79, 79, 31, 79, - - 32, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 65, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 47, - 79, 79, 79, 142, 82, 79, 7, 79, 75, 79, - 52, 79, 10, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 19, 79, 21, 79, 79, 61, 79, 23, - 79, 79, 27, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 37, 79, - 79, 79, 79, 79, 79, 79, 79, 74, 79, 79, - 79, 79, 44, 79, 45, 79, 79, 73, 79, 79, - - 79, 49, 79, 142, 79, 79, 79, 79, 13, 79, - 54, 79, 79, 79, 16, 79, 79, 22, 79, 55, - 79, 28, 79, 79, 56, 79, 79, 79, 79, 79, - 34, 79, 79, 79, 64, 79, 79, 79, 36, 79, - 38, 79, 51, 79, 39, 79, 40, 79, 41, 79, - 42, 79, 79, 50, 79, 79, 79, 79, 79, 79, - 139, 142, 79, 79, 79, 12, 79, 14, 79, 79, - 79, 79, 29, 79, 79, 79, 79, 79, 63, 79, - 79, 79, 79, 79, 79, 43, 79, 79, 79, 66, - 79, 79, 79, 79, 11, 79, 79, 79, 79, 79, - - 58, 79, 59, 79, 60, 79, 79, 35, 79, 79, - 79, 67, 79, 68, 79, 46, 79, 48, 79, 79, - 79, 78, 79, 77, 79, 79, 53, 79, 62, 79, - 79, 79, 76, 79, 71, 79, 79, 79, 79, 79, - 79, 70, 79, 69, 79, 79, 79, 79, 79, 72, - 79 - } ; - -static yyconst short int yy_accept[494] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 7, 9, 12, 15, 17, 20, 23, - 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, - 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, - 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, - 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, - 145, 148, 151, 154, 157, 160, 163, 165, 167, 170, - 173, 176, 178, 180, 183, 185, 187, 189, 190, 192, - 193, 194, 194, 195, 196, 196, 197, 197, 198, 199, - 200, 200, 200, 201, 202, 203, 204, 205, 206, 207, - - 207, 208, 209, 210, 211, 212, 213, 213, 213, 214, - 215, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 225, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 250, 251, 252, 253, - 254, 255, 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, 281, 281, - 282, 282, 282, 283, 284, 284, 285, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 315, 316, 317, 318, - 319, 320, 321, 323, 324, 325, 326, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 357, 357, 357, - 357, 357, 358, 359, 360, 361, 363, 365, 366, 368, - 369, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 383, 385, 386, 388, 389, 390, 391, 392, - 393, 395, 396, 397, 398, 399, 401, 403, 404, 405, - - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 417, 418, 419, 420, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 432, 433, 434, 435, 435, 435, - 435, 435, 436, 437, 439, 441, 443, 445, 446, 447, - 448, 449, 450, 451, 452, 453, 455, 457, 458, 460, - 462, 463, 465, 466, 467, 468, 469, 470, 471, 472, - 473, 474, 475, 476, 477, 478, 479, 481, 482, 483, - 484, 485, 486, 487, 488, 490, 491, 492, 493, 495, - 497, 498, 500, 501, 502, 504, 505, 506, 507, 508, - 509, 511, 513, 514, 515, 517, 518, 520, 522, 524, - - 525, 527, 528, 529, 530, 531, 533, 534, 535, 537, - 538, 539, 541, 543, 545, 547, 549, 551, 553, 554, - 556, 557, 558, 559, 560, 561, 563, 564, 565, 566, - 568, 570, 571, 572, 573, 575, 576, 577, 578, 579, - 581, 582, 583, 584, 585, 586, 588, 589, 590, 592, - 593, 594, 595, 597, 598, 599, 600, 601, 603, 605, - 607, 608, 610, 611, 612, 614, 616, 618, 620, 621, - 622, 624, 626, 627, 629, 631, 632, 633, 635, 637, - 638, 639, 640, 641, 642, 644, 646, 647, 648, 649, - 650, 652, 652 - - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 7, 8, 9, 10, 1, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 23, - 23, 23, 23, 23, 23, 24, 24, 25, 26, 27, - 28, 29, 30, 1, 31, 31, 31, 31, 32, 33, - 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, - 34, 34, 34, 34, 36, 34, 34, 37, 34, 34, - 38, 39, 40, 41, 42, 1, 43, 44, 45, 46, - - 47, 48, 49, 50, 51, 34, 52, 53, 54, 55, - 56, 57, 34, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[71] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 5, 6, 1, 1, 1, 1, 1, 3, - 6, 6, 6, 7, 7, 7, 7, 1, 3, 1, - 1, 7, 5, 5, 6, 6, 6, 5, 7, 7, - 7, 7, 7, 7, 8, 7, 7, 8, 7, 8, - 7, 8, 7, 8, 7, 7, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[505] = - { 0, - 0, 69, 79, 0, 149, 0, 857, 856, 217, 218, - 858, 861, 220, 861, 233, 829, 219, 828, 217, 816, - 861, 861, 826, 213, 861, 223, 233, 238, 247, 240, - 828, 861, 45, 824, 46, 861, 0, 234, 861, 861, - 823, 808, 788, 188, 235, 221, 249, 239, 792, 225, - 247, 218, 248, 238, 800, 264, 269, 262, 267, 796, - 861, 261, 861, 861, 333, 861, 861, 861, 0, 861, - 798, 861, 861, 0, 861, 861, 861, 861, 823, 342, - 861, 348, 354, 861, 303, 861, 303, 861, 861, 861, - 293, 308, 861, 861, 861, 861, 861, 827, 861, 822, - - 341, 861, 861, 861, 358, 363, 380, 396, 305, 197, - 0, 406, 335, 344, 861, 813, 861, 861, 861, 812, - 0, 353, 800, 861, 792, 777, 780, 788, 18, 791, - 790, 777, 280, 778, 769, 774, 318, 361, 770, 767, - 771, 769, 766, 772, 762, 329, 372, 766, 765, 765, - 755, 770, 769, 358, 771, 384, 758, 182, 365, 762, - 758, 385, 757, 753, 388, 758, 750, 317, 756, 861, - 861, 458, 861, 0, 758, 0, 861, 447, 0, 861, - 427, 0, 861, 861, 454, 861, 457, 460, 861, 439, - 861, 861, 861, 758, 748, 750, 759, 754, 755, 741, - - 739, 386, 445, 750, 401, 752, 752, 746, 746, 741, - 737, 734, 742, 745, 744, 0, 739, 729, 737, 737, - 729, 730, 0, 733, 730, 731, 0, 719, 718, 726, - 712, 713, 719, 720, 715, 708, 710, 712, 719, 705, - 703, 703, 705, 702, 704, 712, 711, 710, 700, 704, - 699, 693, 706, 708, 697, 698, 476, 507, 481, 543, - 467, 488, 436, 402, 703, 0, 0, 695, 0, 696, - 0, 686, 684, 692, 681, 686, 680, 675, 684, 684, - 682, 0, 0, 687, 0, 676, 675, 679, 671, 675, - 0, 681, 681, 666, 671, 0, 0, 666, 681, 448, - - 669, 679, 674, 669, 660, 658, 659, 656, 668, 463, - 663, 668, 667, 658, 0, 647, 667, 463, 660, 652, - 657, 656, 643, 0, 643, 655, 646, 412, 0, 418, - 0, 861, 647, 0, 0, 0, 657, 643, 644, 649, - 648, 637, 636, 645, 640, 0, 0, 635, 0, 0, - 643, 0, 640, 641, 639, 628, 624, 627, 631, 638, - 620, 634, 633, 617, 629, 620, 0, 628, 613, 624, - 626, 610, 619, 625, 0, 607, 619, 622, 0, 0, - 609, 0, 620, 611, 0, 614, 601, 614, 597, 597, - 610, 0, 599, 598, 0, 601, 0, 0, 0, 598, - - 0, 597, 583, 576, 571, 0, 562, 525, 0, 537, - 525, 0, 0, 0, 0, 539, 0, 0, 520, 0, - 531, 524, 530, 520, 519, 0, 514, 527, 522, 0, - 0, 510, 506, 521, 0, 517, 503, 514, 512, 0, - 511, 499, 492, 503, 500, 0, 498, 498, 0, 496, - 495, 478, 0, 475, 474, 488, 485, 0, 0, 0, - 482, 0, 469, 483, 0, 0, 0, 0, 480, 464, - 0, 0, 479, 0, 0, 470, 455, 0, 0, 448, - 442, 427, 398, 412, 0, 0, 333, 279, 250, 221, - 0, 861, 591, 599, 607, 615, 619, 623, 627, 633, - - 639, 643, 645, 647 - } ; - -static yyconst short int yy_def[505] = - { 0, - 492, 1, 492, 3, 492, 5, 493, 493, 494, 494, - 492, 492, 492, 492, 492, 492, 495, 492, 492, 496, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 497, 497, 492, 492, - 492, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 492, 492, 492, 492, 492, 492, 492, 492, 498, 492, - 498, 492, 492, 499, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 495, 492, 500, 492, 492, 492, - 496, 501, 492, 492, 492, 492, 492, 492, 492, 492, - - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 502, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 497, 495, 496, 492, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 492, - 492, 492, 492, 498, 498, 499, 492, 495, 503, 492, - 496, 504, 492, 492, 492, 492, 492, 492, 492, 502, - 492, 492, 492, 497, 497, 497, 497, 497, 497, 497, - - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 498, 495, 495, 496, 496, - 492, 492, 492, 492, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 498, 495, 258, 496, - 260, 492, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 498, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 498, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 0, 492, 492, 492, 492, 492, 492, 492, 492, - - 492, 492, 492, 492 - } ; - -static yyconst short int yy_nxt[932] = - { 0, - 12, 13, 14, 15, 15, 15, 13, 16, 17, 12, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, - 37, 37, 37, 37, 38, 37, 37, 39, 12, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 37, - 50, 37, 51, 37, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 37, 37, 37, 61, 62, 63, 64, - 65, 116, 117, 119, 120, 65, 198, 199, 66, 67, - 67, 68, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 69, - 69, 69, 69, 69, 69, 69, 67, 70, 67, 67, - 69, 69, 69, 69, 71, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 67, 67, 67, 67, 72, - 72, 73, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 74, - 74, 74, 74, 74, 74, 74, 72, 72, 72, 72, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 72, 72, 72, 72, 78, - 78, 80, 81, 82, 82, 82, 80, 86, 89, 94, - 238, 189, 79, 79, 82, 81, 83, 83, 83, 82, - 95, 96, 122, 127, 90, 128, 123, 239, 99, 189, - 97, 98, 100, 102, 101, 101, 101, 87, 103, 105, - 150, 112, 112, 112, 151, 104, 105, 133, 106, 106, - 107, 108, 146, 134, 113, 114, 135, 129, 108, 147, - 491, 109, 110, 111, 130, 136, 108, 131, 170, 141, - 132, 142, 113, 108, 143, 154, 144, 148, 155, 109, - - 114, 137, 149, 138, 152, 180, 139, 110, 490, 153, - 111, 86, 140, 157, 158, 161, 165, 167, 162, 163, - 166, 489, 168, 159, 178, 178, 160, 203, 171, 181, - 181, 92, 204, 164, 172, 81, 82, 82, 82, 172, - 189, 87, 173, 80, 81, 82, 82, 82, 80, 82, - 81, 82, 82, 82, 82, 82, 81, 83, 83, 83, - 82, 86, 101, 101, 101, 189, 179, 253, 208, 254, - 191, 182, 185, 186, 219, 186, 209, 488, 191, 101, - 101, 101, 105, 220, 106, 106, 107, 185, 186, 185, - 186, 87, 186, 186, 108, 191, 191, 109, 110, 105, - - 230, 107, 107, 107, 185, 186, 210, 240, 231, 108, - 186, 108, 187, 232, 187, 109, 221, 188, 188, 188, - 86, 211, 241, 110, 222, 105, 108, 112, 112, 112, - 180, 223, 234, 248, 235, 244, 332, 108, 249, 180, - 113, 114, 245, 236, 273, 274, 250, 278, 259, 259, - 87, 279, 108, 487, 332, 86, 92, 486, 113, 172, - 81, 82, 82, 82, 172, 92, 114, 173, 257, 257, - 261, 332, 261, 263, 264, 262, 262, 262, 188, 188, - 188, 188, 188, 188, 86, 87, 485, 275, 262, 262, - 262, 263, 186, 180, 186, 276, 332, 328, 328, 264, - - 358, 484, 330, 330, 369, 359, 483, 186, 377, 262, - 262, 262, 186, 482, 87, 86, 481, 378, 370, 92, - 186, 480, 186, 479, 478, 477, 476, 475, 329, 329, - 329, 474, 473, 472, 471, 186, 470, 329, 329, 329, - 186, 469, 468, 467, 466, 87, 465, 464, 463, 329, - 329, 329, 329, 329, 329, 180, 462, 461, 460, 459, - 458, 457, 456, 455, 331, 331, 331, 454, 453, 452, - 451, 450, 449, 331, 331, 331, 448, 447, 446, 445, - 444, 92, 443, 442, 441, 331, 331, 331, 331, 331, - 331, 75, 75, 75, 75, 75, 75, 75, 75, 77, - - 77, 77, 77, 77, 77, 77, 77, 85, 440, 85, - 85, 85, 85, 85, 85, 91, 439, 91, 438, 91, - 91, 91, 91, 121, 121, 121, 121, 174, 174, 174, - 174, 176, 176, 176, 176, 85, 85, 85, 437, 436, - 85, 91, 91, 91, 435, 434, 91, 190, 190, 258, - 258, 260, 260, 433, 432, 431, 430, 429, 428, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, - 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, - - 386, 385, 384, 383, 382, 381, 380, 379, 376, 375, - 374, 373, 372, 371, 368, 367, 366, 365, 364, 363, - 362, 361, 360, 357, 356, 355, 354, 353, 352, 351, - 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, - 340, 339, 338, 337, 336, 335, 334, 333, 327, 326, - 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, - 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, - 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, - 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, - 285, 284, 283, 282, 281, 280, 277, 272, 271, 270, - - 269, 268, 267, 266, 265, 256, 255, 252, 251, 247, - 246, 243, 242, 237, 233, 229, 228, 227, 226, 225, - 224, 218, 217, 216, 215, 214, 213, 212, 207, 206, - 205, 202, 201, 200, 197, 196, 195, 194, 92, 193, - 192, 184, 183, 177, 175, 169, 156, 145, 126, 125, - 124, 118, 115, 93, 92, 88, 84, 492, 76, 76, - 11, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492 - } ; - -static yyconst short int yy_chk[932] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 33, 33, 35, 35, 2, 129, 129, 2, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 9, - 10, 13, 13, 13, 13, 13, 13, 17, 19, 24, - 158, 110, 9, 10, 15, 15, 15, 15, 15, 15, - 24, 26, 38, 44, 19, 44, 38, 158, 27, 110, - 26, 26, 27, 28, 27, 27, 27, 17, 28, 30, - 52, 30, 30, 30, 52, 28, 29, 46, 29, 29, - 29, 30, 50, 46, 30, 30, 46, 45, 29, 50, - 490, 29, 29, 29, 45, 46, 30, 45, 62, 48, - 45, 48, 30, 29, 48, 54, 48, 51, 54, 29, - - 30, 47, 51, 47, 53, 91, 47, 29, 489, 53, - 29, 85, 47, 56, 56, 57, 58, 59, 57, 57, - 58, 488, 59, 56, 87, 87, 56, 133, 62, 92, - 92, 91, 133, 57, 65, 65, 65, 65, 65, 65, - 109, 85, 65, 80, 80, 80, 80, 80, 80, 82, - 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, - 83, 122, 101, 101, 101, 109, 87, 168, 137, 168, - 113, 92, 101, 101, 146, 101, 137, 487, 114, 105, - 105, 105, 106, 146, 106, 106, 106, 101, 101, 105, - 105, 122, 105, 101, 106, 113, 114, 106, 106, 107, - - 154, 107, 107, 107, 105, 105, 138, 159, 154, 106, - 105, 107, 108, 154, 108, 106, 147, 108, 108, 108, - 328, 138, 159, 106, 147, 112, 107, 112, 112, 112, - 330, 147, 156, 165, 156, 162, 264, 112, 165, 181, - 112, 112, 162, 156, 202, 202, 165, 205, 181, 181, - 328, 205, 112, 484, 264, 178, 330, 483, 112, 172, - 172, 172, 172, 172, 172, 181, 112, 172, 178, 178, - 185, 263, 185, 190, 190, 185, 185, 185, 187, 187, - 187, 188, 188, 188, 257, 178, 482, 203, 261, 261, - 261, 190, 188, 259, 188, 203, 263, 257, 257, 190, - - 300, 481, 259, 259, 310, 300, 480, 188, 318, 262, - 262, 262, 188, 477, 257, 258, 476, 318, 310, 259, - 262, 473, 262, 470, 469, 464, 463, 461, 258, 258, - 258, 457, 456, 455, 454, 262, 452, 258, 258, 258, - 262, 451, 450, 448, 447, 258, 445, 444, 443, 258, - 258, 258, 258, 258, 258, 260, 442, 441, 439, 438, - 437, 436, 434, 433, 260, 260, 260, 432, 429, 428, - 427, 425, 424, 260, 260, 260, 423, 422, 421, 419, - 416, 260, 411, 410, 408, 260, 260, 260, 260, 260, - 260, 493, 493, 493, 493, 493, 493, 493, 493, 494, - - 494, 494, 494, 494, 494, 494, 494, 495, 407, 495, - 495, 495, 495, 495, 495, 496, 405, 496, 404, 496, - 496, 496, 496, 497, 497, 497, 497, 498, 498, 498, - 498, 499, 499, 499, 499, 500, 500, 500, 403, 402, - 500, 501, 501, 501, 400, 396, 501, 502, 502, 503, - 503, 504, 504, 394, 393, 391, 390, 389, 388, 387, - 386, 384, 383, 381, 378, 377, 376, 374, 373, 372, - 371, 370, 369, 368, 366, 365, 364, 363, 362, 361, - 360, 359, 358, 357, 356, 355, 354, 353, 351, 348, - 345, 344, 343, 342, 341, 340, 339, 338, 337, 333, - - 327, 326, 325, 323, 322, 321, 320, 319, 317, 316, - 314, 313, 312, 311, 309, 308, 307, 306, 305, 304, - 303, 302, 301, 299, 298, 295, 294, 293, 292, 290, - 289, 288, 287, 286, 284, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 270, 268, 265, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, - 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, - 234, 233, 232, 231, 230, 229, 228, 226, 225, 224, - 222, 221, 220, 219, 218, 217, 215, 214, 213, 212, - 211, 210, 209, 208, 207, 206, 204, 201, 200, 199, - - 198, 197, 196, 195, 194, 175, 169, 167, 166, 164, - 163, 161, 160, 157, 155, 153, 152, 151, 150, 149, - 148, 145, 144, 143, 142, 141, 140, 139, 136, 135, - 134, 132, 131, 130, 128, 127, 126, 125, 123, 120, - 116, 100, 98, 79, 71, 60, 55, 49, 43, 42, - 41, 34, 31, 23, 20, 18, 16, 11, 8, 7, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#define INITIAL 0 -/* Included code before lex code */ -/*************** Includes and Defines *****************************/ - - -#include "map" -#include "cpp_lexer.h" // YACC generated definitions based on C++ grammar -#include "errno.h" - -#define YYSTYPE std::string -#define ECHO - -#include "string" -#include -#include -#include - -extern std::string cl_scope_lval; -extern std::string cl_var_lval; -extern std::string cl_func_lval; -extern std::string cl_typedef_lval; - -std::vector currentScope; - -bool setLexerInput(const std::string &in, const std::map &ignoreTokens); -void setUseIgnoreMacros(bool ignore); - -std::string getCurrentScope(); -void printScopeName(); -void cl_scope_lex_clean(); -void cl_scope_less(int count); - -//we keep a very primitive map with only symbol name -//that we encountered so far -std::map g_symbols; -std::map g_macros; - -static std::map g_ignoreList; -static bool gs_useMacroIgnore = true; - -bool isaTYPE(char *string); -bool isaMACRO(char *string); -bool isignoredToken(char *string); - -static bool defineFound = false; - -/* Prototypes */ -#define WHITE_RETURN(x) /* do nothing */ - -#define PA_KEYWORD_RETURN(x) RETURN_VAL(x) /* standard C PArser Keyword */ -#define CPP_KEYWORD_RETURN(x) PA_KEYWORD_RETURN(x) /* C++ keyword */ -#define PPPA_KEYWORD_RETURN(x) RETURN_VAL(x) /* both PreProcessor and PArser keyword */ -#define PP_KEYWORD_RETURN(x) IDENTIFIER_RETURN() - -#define IDENTIFIER_RETURN(){\ - if(isaTYPE(yytext)){\ - RETURN_VAL(LE_TYPEDEFname);\ - }else if(isaMACRO(yytext)){\ - RETURN_VAL(LE_MACRO);\ - }else if(isignoredToken(yytext)){\ - }else{ RETURN_VAL(LE_IDENTIFIER);}\ - } - - -#define PPOP_RETURN(x) RETURN_VAL((int)*yytext) /* PreProcess and Parser operator */ -#define NAMED_PPOP_RETURN(x) RETURN_VAL(x) -#define ASCIIOP_RETURN(x) RETURN_VAL((int)*yytext) /* a single character operator */ -#define NAMEDOP_RETURN(x) RETURN_VAL(x) /* a multichar operator, with a name */ - -#define NUMERICAL_RETURN(x) RETURN_VAL(x) /* some sort of constant */ -#define LITERAL_RETURN(x) RETURN_VAL(x) /* a string literal */ -#define C_COMMENT_RETURN(x) RETURN_VAL(x) /* C Style comment */ -#define RETURN_VAL(x) {\ - cl_scope_lval = yytext;\ - cl_var_lval = yytext;\ - cl_func_lval = yytext;\ - cl_typedef_lval = yytext;\ - return(x);} - -#define PREPR 1 - -#define WRAP_PREP 2 - -#define CPP_COMMENT 3 - -#define C_COMMENT 4 - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 493 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 861 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - ++yylineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -{ - BEGIN C_COMMENT; - } - YY_BREAK -case 2: -YY_RULE_SETUP -{ - BEGIN CPP_COMMENT; - } - YY_BREAK -case 3: -YY_RULE_SETUP -{ - WHITE_RETURN(' '); - } - YY_BREAK -case 4: -YY_RULE_SETUP -{ - WHITE_RETURN(' '); - } - YY_BREAK -case 5: -YY_RULE_SETUP -{ - WHITE_RETURN('\n'); - } - YY_BREAK -case 6: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_AUTO);} - YY_BREAK -case 7: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_BREAK);} - YY_BREAK -case 8: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CASE);} - YY_BREAK -case 9: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CHAR);} - YY_BREAK -case 10: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CONST);} - YY_BREAK -case 11: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_CONTINUE);} - YY_BREAK -case 12: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DEFAULT);} - YY_BREAK -case 13: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_DEFINE);} - YY_BREAK -case 14: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_OPDEFINED);} - YY_BREAK -case 15: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DO);} - YY_BREAK -case 16: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_DOUBLE);} - YY_BREAK -case 17: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ELIF);} - YY_BREAK -case 18: -YY_RULE_SETUP -{PPPA_KEYWORD_RETURN(LE_ELSE);} - YY_BREAK -case 19: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ENDIF);} - YY_BREAK -case 20: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_ENUM);} - YY_BREAK -case 21: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_ERROR);} - YY_BREAK -case 22: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_EXTERN);} - YY_BREAK -case 23: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_FLOAT);} - YY_BREAK -case 24: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_FOR);} - YY_BREAK -case 25: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_GOTO);} - YY_BREAK -case 26: -YY_RULE_SETUP -{PPPA_KEYWORD_RETURN(LE_IF);} - YY_BREAK -case 27: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_IFDEF);} - YY_BREAK -case 28: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_IFNDEF);} - YY_BREAK -case 29: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_INCLUDE); } - YY_BREAK -case 30: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_INT);} - YY_BREAK -case 31: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_LINE);} - YY_BREAK -case 32: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_LONG);} - YY_BREAK -case 33: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_BOOL);} - YY_BREAK -case 34: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_PRAGMA);} - YY_BREAK -case 35: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_REGISTER);} - YY_BREAK -case 36: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_RETURN);} - YY_BREAK -case 37: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SHORT);} - YY_BREAK -case 38: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIGNED);} - YY_BREAK -case 39: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIZEOF);} - YY_BREAK -case 40: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_STATIC);} - YY_BREAK -case 41: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_STRUCT);} - YY_BREAK -case 42: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SWITCH);} - YY_BREAK -case 43: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_TYPEDEF);} - YY_BREAK -case 44: -YY_RULE_SETUP -{PP_KEYWORD_RETURN(LE_UNDEF);} - YY_BREAK -case 45: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_UNION);} - YY_BREAK -case 46: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_UNSIGNED);} - YY_BREAK -case 47: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_VOID);} - YY_BREAK -case 48: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_VOLATILE);} - YY_BREAK -case 49: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_WHILE);} - YY_BREAK -case 50: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_TIME_T);} - YY_BREAK -case 51: -YY_RULE_SETUP -{PA_KEYWORD_RETURN(LE_SIZE_T);} - YY_BREAK -case 52: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CLASS);} - YY_BREAK -case 53: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_NAMESPACE);} - YY_BREAK -case 54: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DELETE);} - YY_BREAK -case 55: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_FRIEND);} - YY_BREAK -case 56: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_INLINE);} - YY_BREAK -case 57: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_NEW);} - YY_BREAK -case 58: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OPERATOR);} - YY_BREAK -case 59: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OVERLOAD);} - YY_BREAK -case 60: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_OVERRIDE);} - YY_BREAK -case 61: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_FINAL);} - YY_BREAK -case 62: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PROTECTED);} - YY_BREAK -case 63: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PRIVATE);} - YY_BREAK -case 64: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_PUBLIC);} - YY_BREAK -case 65: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_THIS);} - YY_BREAK -case 66: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_VIRTUAL);} - YY_BREAK -case 67: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_TEMPLATE);} - YY_BREAK -case 68: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_TYPENAME);} - YY_BREAK -case 69: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DYNAMIC_CAST);} - YY_BREAK -case 70: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_STATIC_CAST);} - YY_BREAK -case 71: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CONST_CAST);} - YY_BREAK -case 72: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_REINTERPRET_CAST);} - YY_BREAK -case 73: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_USING);} - YY_BREAK -case 74: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_THROW);} - YY_BREAK -case 75: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_CATCH);} - YY_BREAK -case 76: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DECLSPEC);} - YY_BREAK -case 77: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DLLIMPORT);} - YY_BREAK -case 78: -YY_RULE_SETUP -{CPP_KEYWORD_RETURN(LE_DLLIEXPORT);} - YY_BREAK -case 79: -YY_RULE_SETUP -{IDENTIFIER_RETURN();} - YY_BREAK -case 80: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_INTEGERconstant);} - YY_BREAK -case 81: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_OCTALconstant);} - YY_BREAK -case 82: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_HEXconstant);} - YY_BREAK -case 83: -YY_RULE_SETUP -{NUMERICAL_RETURN(LE_FLOATINGconstant);} - YY_BREAK -case 84: -YY_RULE_SETUP -{ - NUMERICAL_RETURN(LE_CHARACTERconstant); - } - YY_BREAK -case 85: -YY_RULE_SETUP -{ - LITERAL_RETURN(LE_STRINGliteral);} - YY_BREAK -case 86: -YY_RULE_SETUP -{PPOP_RETURN(LE_LP);} - YY_BREAK -case 87: -YY_RULE_SETUP -{PPOP_RETURN(LE_RP);} - YY_BREAK -case 88: -YY_RULE_SETUP -{PPOP_RETURN(LE_COMMA);} - YY_BREAK -case 89: -YY_RULE_SETUP -{BEGIN PREPR;} - YY_BREAK -case 90: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LC);} - YY_BREAK -case 91: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_RC);} - YY_BREAK -case 92: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LB);} - YY_BREAK -case 93: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_RB);} - YY_BREAK -case 94: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_DOT);} - YY_BREAK -case 95: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_AND);} - YY_BREAK -case 96: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_STAR);} - YY_BREAK -case 97: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_PLUS);} - YY_BREAK -case 98: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_MINUS);} - YY_BREAK -case 99: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_NEGATE);} - YY_BREAK -case 100: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_NOT);} - YY_BREAK -case 101: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_DIV);} - YY_BREAK -case 102: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_MOD);} - YY_BREAK -case 103: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_LT);} - YY_BREAK -case 104: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_GT);} - YY_BREAK -case 105: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_XOR);} - YY_BREAK -case 106: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_PIPE);} - YY_BREAK -case 107: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_QUESTION);} - YY_BREAK -case 108: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_COLON);} - YY_BREAK -case 109: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_SEMICOLON);} - YY_BREAK -case 110: -YY_RULE_SETUP -{ASCIIOP_RETURN(LE_ASSIGN);} - YY_BREAK -case 111: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DOTstar);} - YY_BREAK -case 112: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_CLCL);} - YY_BREAK -case 113: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ARROW);} - YY_BREAK -case 114: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ARROWstar);} - YY_BREAK -case 115: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ICR);} - YY_BREAK -case 116: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DECR);} - YY_BREAK -case 117: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LS);} - YY_BREAK -case 118: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_RS);} - YY_BREAK -case 119: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LE);} - YY_BREAK -case 120: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_GE);} - YY_BREAK -case 121: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_EQ);} - YY_BREAK -case 122: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_NE);} - YY_BREAK -case 123: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ANDAND);} - YY_BREAK -case 124: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_OROR);} - YY_BREAK -case 125: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MULTassign);} - YY_BREAK -case 126: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_DIVassign);} - YY_BREAK -case 127: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MODassign);} - YY_BREAK -case 128: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_PLUSassign);} - YY_BREAK -case 129: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_MINUSassign);} - YY_BREAK -case 130: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_LSassign);} - YY_BREAK -case 131: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_RSassign);} - YY_BREAK -case 132: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ANDassign);} - YY_BREAK -case 133: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ERassign);} - YY_BREAK -case 134: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ORassign);} - YY_BREAK -case 135: -YY_RULE_SETUP -{NAMEDOP_RETURN(LE_ELLIPSIS);} - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(PREPR): -case YY_STATE_EOF(WRAP_PREP): -case YY_STATE_EOF(CPP_COMMENT): -case YY_STATE_EOF(C_COMMENT): -{ - //reset lexer - yyterminate(); - } - YY_BREAK -case 136: -YY_RULE_SETUP -{return yytext[0];} - YY_BREAK -case 137: -YY_RULE_SETUP -{ - defineFound = false; - BEGIN INITIAL; - } - YY_BREAK -case 138: -YY_RULE_SETUP -{ - BEGIN WRAP_PREP; - } - YY_BREAK -case 139: -YY_RULE_SETUP -{ - defineFound = true; - } - YY_BREAK -case 140: -YY_RULE_SETUP -{ - BEGIN PREPR; - } - YY_BREAK -case 141: -YY_RULE_SETUP -{ - if(defineFound) - { - defineFound = false; - g_macros[yytext] = true; - } - } - YY_BREAK -case 142: -YY_RULE_SETUP -{ - if(defineFound) - { - defineFound = false; - g_macros[yytext] = true; - } - } - YY_BREAK -case 143: -YY_RULE_SETUP -{} - YY_BREAK -case 144: -YY_RULE_SETUP -{} - YY_BREAK -case 145: -YY_RULE_SETUP -{BEGIN INITIAL;} - YY_BREAK -case 146: -YY_RULE_SETUP -{} - YY_BREAK -case 147: -YY_RULE_SETUP -{BEGIN INITIAL;} - YY_BREAK -case 148: -YY_RULE_SETUP -{} - YY_BREAK -case 149: -YY_RULE_SETUP -ECHO; - YY_BREAK - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * 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->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have 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 - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - char *dest = yy_current_buffer->yy_ch_buf; - char *source = yytext_ptr; - int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 493 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - int yy_is_jam; - - YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 493 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 492); - if ( ! yy_is_jam ) - *yy_state_ptr++ = yy_current_state; - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; - char *yy_bp; -#endif - { - char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - int number_to_move = yy_n_chars + 2; - char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --yylineno; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++yylineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * 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; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - 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 *) yy_flex_alloc( 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 ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - 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; - - b = (YY_BUFFER_STATE) yy_flex_alloc( 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_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - 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 ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - 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. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - // exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* 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 - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif - - -bool isaTYPE(char *string) -{ - return g_symbols.find(string) != g_symbols.end(); -} - -bool isignoredToken(char *string) -{ - std::map::iterator iter = g_ignoreList.find(string); - if(iter == g_ignoreList.end()){ - /* this string is not in the ignore macro list */ - return false; - } else { - /* it exist, but maybe it has a replacement */ - return iter->second.empty(); - } -} - -bool isaMACRO(char *string) -{ - if(gs_useMacroIgnore) { - return g_macros.find(string) != g_macros.end(); - }else{ - return false; - } -} - -void cl_scope_lex_clean() -{ - yy_flush_buffer(YY_CURRENT_BUFFER); - yy_delete_buffer(YY_CURRENT_BUFFER); - cl_scope_lineno = 1; - currentScope.clear(); - g_symbols.clear(); - g_macros.clear(); -} - -/** - * scope util functions - */ -void printScopeName() -{ - /* - if(currentScope.empty()) - { - printf("%d: current scope is global scope\n", cl_scope_lineno ); - } - else - { - printf("%d: current scope is %s\n", cl_scope_lineno, getCurrentScope().c_str()); - } - */ -} - -void increaseScope() -{ - static int value = 0; - std::string scopeName("__anon_"); - - char buf[100]; - sprintf(buf, "%d", value++); - scopeName += buf; - currentScope.push_back(scopeName); -} - -std::string getCurrentScope() -{ - //format scope name - std::string scope; - if(currentScope.empty()){ - return ""; - } - - std::vector tmpscope(currentScope); - - while( tmpscope.empty() == false ){ - std::string _scope = tmpscope.front(); - tmpscope.erase(tmpscope.begin()); - - if(_scope.find("__anon_") == (size_t)-1 && _scope.empty() == false){ - scope += _scope; - scope += "::"; - } - } - - //remove the trailing '::' - scope.erase(scope.find_last_not_of(":")+1); - return scope; -} - -/*******************************************************************/ -bool setLexerInput(const std::string &in, const std::map &ignoreTokens) -{ - BEGIN INITIAL; - yy_scan_string(in.c_str()); - - g_ignoreList = ignoreTokens; - - //update the working file name - return true; -} - -void setUseIgnoreMacros(bool ignore) { - gs_useMacroIgnore = ignore; -} - -int yywrap(){ - return 1; -} - -void cl_scope_less(int count){ - yyless(count); -} diff --git a/CxxParser/cpp_lexer.h b/CxxParser/cpp_lexer.h deleted file mode 100644 index d25bcf6ae6..0000000000 --- a/CxxParser/cpp_lexer.h +++ /dev/null @@ -1,99 +0,0 @@ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define LE_DECLSPEC 353 -#define LE_DLLIMPORT 354 -#define LE_DLLIEXPORT 355 diff --git a/CxxParser/cpp_scope_grammar.y b/CxxParser/cpp_scope_grammar.y index 94941c7327..27ddeacfc7 100644 --- a/CxxParser/cpp_scope_grammar.y +++ b/CxxParser/cpp_scope_grammar.y @@ -19,6 +19,12 @@ static void readClassName(); static std::string className; static std::string templateInitList; +void yyerror(const char *s) {} +void consumeDecl(); +void consumeFuncArgList(); +void consumeInitializationList(); +void consumeNotIncluding(int ch); +void consumeTemplateDecl(); int cl_scope_parse(); void cl_scope_error(char *string); void syncParser(); @@ -443,8 +449,6 @@ union_decl : stmnt_starter LE_UNION LE_IDENTIFIER '{' } ; %% -void yyerror(char *s) {} - void syncParser(){ //move lexer to the next ';' line or scope opening '{' //int ch = cl_scope_lex(); @@ -526,13 +530,13 @@ void readClassName() break; } else if( c == ':' && !className.empty() ) { - // we got the class name, and we found ':' - // read all tokens up until the first open brace - while (true) { - NEXT_TOK(); - if( c == (int)'{') { - return; - } + // we got the class name, and we found ':' + // read all tokens up until the first open brace + while (true) { + NEXT_TOK(); + if( c == (int)'{') { + return; + } } } else { className.clear(); diff --git a/CxxParser/cpp_variables_grammar.y b/CxxParser/cpp_variables_grammar.y index a4715fd195..ec539ffa84 100644 --- a/CxxParser/cpp_variables_grammar.y +++ b/CxxParser/cpp_variables_grammar.y @@ -22,6 +22,9 @@ void cl_scope_error(char *string); int cl_var_parse(); void syncParser(); +void yyerror(const char *s) {} +void var_consumeAutoAssignment(const std::string& varname); +std::string var_consumBracketsContent(char openBrace); void var_consumeDefaultValue(char c1, char c2); void var_consumeDefaultValueIfNeeded(); @@ -385,7 +388,7 @@ variables : stmnt_starter LE_AUTO LE_IDENTIFIER '=' {var_consumeAutoAs optional_struct_name : /* empty */ | LE_IDENTIFIER | '*' LE_IDENTIFIER - | '**' LE_IDENTIFIER + | '*' '*' LE_IDENTIFIER ; fully_qualified_identifier_name: LE_IDENTIFIER {$$ = $1;} @@ -538,7 +541,6 @@ variable_decl : const_or_volatile_spec basic_type_name } ; %% -void yyerror(char *s) {} void var_consumeAutoAssignment(const std::string& varname) { diff --git a/CxxParser/expr_grammar.y b/CxxParser/expr_grammar.y index 281245cbed..ca70ce6fe4 100644 --- a/CxxParser/expr_grammar.y +++ b/CxxParser/expr_grammar.y @@ -13,6 +13,11 @@ #define YYSTYPE std::string #define YYDEBUG 0 /* get the pretty debugging code to compile*/ +void yyerror(const char *s) {} + +void expr_consumBracketsContent(char openBrace); +void expr_FuncArgList(); +void expr_syncParser(); void cl_expr_error(char *string); static ExpressionResult result; @@ -304,8 +309,6 @@ array_brackets : /* empty */ { $$ = ""; } | '[' { expr_consumBracketsContent('['); $$ = "[]";} ; %% -void yyerror(char *s) {} - void expr_consumBracketsContent(char openBrace) { char closeBrace; diff --git a/CxxParser/expr_lexer.l b/CxxParser/expr_lexer.l index 568eda29a4..e3b2d32c47 100644 --- a/CxxParser/expr_lexer.l +++ b/CxxParser/expr_lexer.l @@ -56,6 +56,7 @@ static bool defineFound = false; %} %option yylineno +%option never-interactive identifier [a-zA-Z_][0-9a-zA-Z_]* diff --git a/CxxParser/main.cpp b/CxxParser/main.cpp index 17075f47dc..3edd56cfad 100644 --- a/CxxParser/main.cpp +++ b/CxxParser/main.cpp @@ -1,11 +1,10 @@ //test the parser -#include "windows.h" -#include "stdio.h" -#include "errno.h" -#include "string.h" -#include "vector" -#include "string" -#include "map" +#include +#include +#include +#include +#include +#include #include "code_completion_api.h" void testScopeParser(char *buf); diff --git a/CxxParser/scope_parser.cpp b/CxxParser/scope_parser.cpp deleted file mode 100644 index 1d8ebee4bb..0000000000 --- a/CxxParser/scope_parser.cpp +++ /dev/null @@ -1,1362 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_scope_parse -#define yylex cl_scope_lex -#define yyerror cl_scope_error -#define yychar cl_scope_char -#define yyval cl_scope_val -#define yylval cl_scope_lval -#define yydebug cl_scope_debug -#define yynerrs cl_scope_nerrs -#define yyerrflag cl_scope_errflag -#define yyss cl_scope_ss -#define yyssp cl_scope_ssp -#define yyvs cl_scope_vs -#define yyvsp cl_scope_vsp -#define yylhs cl_scope_lhs -#define yylen cl_scope_len -#define yydefred cl_scope_defred -#define yydgoto cl_scope_dgoto -#define yysindex cl_scope_sindex -#define yyrindex cl_scope_rindex -#define yygindex cl_scope_gindex -#define yytable cl_scope_table -#define yycheck cl_scope_check -#define yyname cl_scope_name -#define yyrule cl_scope_rule -#define YYPREFIX "cl_scope_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include -#include -#include -#include -#include - -#define YYDEBUG_LEXER_TEXT (cl_scope_lval) -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ -static std::string readInitializer(const char* delim); -static void readClassName(); - -static std::string className; - -static std::string templateInitList; -int cl_scope_parse(); -void cl_scope_error(char *string); -void syncParser(); - -static std::vector gs_additionlNS; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_scope_text; -extern int cl_scope_lex(); -extern bool setLexerInput(const std::string &in, const std::map &ignoreTokens); -extern int cl_scope_lineno; -extern std::vector currentScope; -extern void printScopeName(); /*print the current scope name*/ -extern void increaseScope(); /*increase scope with anonymouse value*/ -extern std::string getCurrentScope(); -extern void cl_scope_lex_clean(); -extern void cl_scope_less(int count); - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define LE_DECLSPEC 353 -#define LE_DLLIMPORT 354 -#define LE_DLLIEXPORT 355 -#define YYERRCODE 256 -short cl_scope_lhs[] = { -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 0, 0, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 14, - 14, 14, 16, 16, 15, 15, 17, 17, 18, 18, - 18, 19, 19, 19, 10, 9, 9, 4, 11, 12, - 13, 24, 24, 25, 25, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 27, 27, 28, 28, - 5, 31, 8, 32, 8, 33, 8, 21, 21, 34, - 35, 34, 29, 29, 20, 20, 36, 36, 37, 37, - 22, 23, 23, 23, 30, 30, 30, 39, 6, 40, - 40, 40, 40, 41, 38, 38, 38, 7, -}; -short cl_scope_len[] = { 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 1, 0, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 3, 1, 3, 1, 1, 0, 4, 0, 1, - 3, 4, 4, 7, 5, 5, 3, 3, 1, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, - 2, 0, 12, 0, 9, 0, 11, 0, 2, 2, - 0, 4, 0, 1, 0, 1, 0, 1, 0, 2, - 2, 0, 1, 1, 3, 3, 6, 0, 7, 0, - 2, 2, 2, 2, 0, 1, 3, 4, -}; -short cl_scope_defred[] = { 17, - 0, 29, 0, 0, 123, 50, 49, 51, 124, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 0, 101, 108, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 47, 0, 53, 52, 114, 48, 0, 0, - 109, 128, 138, 35, 36, 33, 0, 0, 0, 116, - 108, 110, 111, 45, 0, 0, 0, 38, 46, 0, - 108, 0, 0, 0, 136, 32, 34, 6, 1, 0, - 2, 5, 3, 0, 10, 0, 9, 0, 0, 11, - 0, 16, 119, 0, 0, 112, 0, 134, 0, 129, - 15, 14, 4, 8, 7, 12, 13, 84, 85, 72, - 76, 77, 68, 69, 78, 79, 80, 81, 70, 71, - 75, 73, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 57, 86, 66, 67, 56, 58, 59, 60, - 61, 62, 63, 64, 65, 74, 0, 0, 55, 0, - 126, 0, 54, 0, 125, 104, 0, 0, 133, 132, - 131, 137, 82, 83, 0, 40, 108, 120, 118, 121, - 106, 0, 102, 0, 119, 0, 0, 97, 98, 105, - 0, 41, 127, 0, 119, 0, 0, 0, 42, 43, - 107, 0, 0, 0, 0, 103, 119, 0, 44, 100, -}; -short cl_scope_dgoto[] = { 1, - 82, 83, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 46, 47, 48, 28, 155, 156, 157, - 29, 141, 21, 38, 84, 139, 170, 183, 39, 61, - 171, 162, 167, 41, 62, 160, 142, 64, 55, 88, - 65, -}; -short cl_scope_sindex[] = { 0, - -3, 0, -269, -259, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -241, 0, 0, -239, -236, 28, -25, -211, -202, -2, - 5, -268, 0, -175, 0, 0, 0, 0, -144, -58, - 0, 0, 0, 0, 0, 0, -172, -12, -52, 0, - 0, 0, 0, 0, -171, 77, -268, 0, 0, 129, - 0, -194, 79, -23, 0, 0, 0, 0, 0, -163, - 0, 0, 0, -150, 0, -150, 0, -33, -48, 0, - -204, 0, 0, 101, -201, 0, -179, 0, -171, 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, 0, - 0, 0, 0, 0, 0, 0, 102, 49, 0, -144, - 0, 74, 0, 105, 0, 0, -19, 111, 0, 0, - 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, - 0, -28, 0, -144, 0, 158, -144, 0, 0, 0, - -144, 0, 0, -18, 0, 21, -152, -144, 0, 0, - 0, 116, 34, -10, -144, 0, 0, 4, 0, 0, -}; -short cl_scope_rindex[] = { 0, - -111, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 78, 0, 0, 0, 0, 0, -149, 104, 0, 0, - 0, -8, 0, 0, 0, 0, 0, 0, 193, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -22, 23, -8, 0, 0, 0, - 0, 0, -20, 0, 0, 0, 0, 0, 0, 24, - 0, 0, 0, 32, 0, 37, 0, 0, 42, 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, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, - 0, -24, 0, 0, 0, 0, 120, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 0, 0, 44, 0, 0, 0, - -107, 0, 0, 2, 0, 0, 45, -9, 0, 0, - 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, -}; -short cl_scope_gindex[] = { 0, - 41, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 114, 0, 0, 0, -88, 9, -21, - -4, -64, 0, 0, 33, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 85, -}; -#define YYTABLESIZE 544 -short cl_scope_table[] = { 135, - 54, 53, 39, 130, 132, 39, 137, 53, 128, 127, - 124, 140, 136, 129, 122, 115, 117, 51, 145, 117, - 89, 135, 34, 130, 24, 44, 125, 123, 126, 169, - 25, 57, 164, 164, 39, 30, 45, 117, 22, 119, - 53, 178, 119, 119, 190, 119, 60, 164, 35, 58, - 165, 187, 39, 30, 9, 5, 85, 138, 23, 8, - 131, 4, 26, 119, 4, 4, 31, 4, 30, 8, - 59, 31, 8, 8, 7, 8, 27, 7, 7, 119, - 7, 54, 36, 119, 31, 4, 37, 32, 78, 184, - 133, 78, 134, 8, 168, 91, 188, 33, 7, 92, - 173, 90, 135, 143, 130, 40, 147, 68, 69, 179, - 180, 159, 93, 144, 96, 158, 97, 148, 71, 6, - 42, 7, 189, 72, 73, 94, 75, 43, 50, 95, - 77, 149, 49, 150, 151, 56, 63, 66, 86, 87, - 146, 154, 153, 181, 161, 176, 122, 122, 122, 177, - 163, 122, 166, 182, 122, 185, 186, 122, 108, 54, - 122, 122, 122, 122, 122, 122, 115, 99, 122, 122, - 67, 175, 172, 152, 0, 0, 0, 0, 0, 0, - 0, 122, 122, 0, 0, 0, 122, 0, 0, 0, - 0, 0, 122, 0, 0, 0, 122, 0, 115, 0, - 80, 0, 0, 37, 0, 0, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, - 115, 0, 0, 0, 115, 0, 0, 0, 0, 113, - 115, 0, 0, 0, 0, 115, 115, 115, 115, 122, - 0, 115, 115, 0, 0, 0, 0, 0, 115, 115, - 0, 0, 2, 115, 81, 0, 98, 99, 0, 115, - 0, 3, 0, 0, 115, 115, 115, 115, 117, 115, - 115, 115, 0, 0, 52, 0, 0, 0, 0, 0, - 52, 0, 0, 117, 52, 0, 0, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 115, 0, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 115, 52, 52, 4, 4, 0, 115, 0, - 0, 0, 0, 111, 8, 0, 0, 0, 0, 7, - 0, 4, 0, 0, 119, 37, 37, 37, 0, 8, - 37, 115, 0, 0, 7, 0, 37, 0, 0, 119, - 37, 37, 37, 37, 37, 0, 0, 37, 37, 0, - 0, 113, 113, 0, 0, 0, 113, 0, 0, 0, - 37, 37, 113, 0, 0, 37, 113, 113, 113, 113, - 113, 0, 0, 113, 113, 37, 68, 69, 0, 0, - 0, 70, 0, 0, 0, 0, 113, 71, 0, 0, - 0, 0, 72, 73, 74, 75, 0, 0, 76, 77, - 0, 113, 0, 0, 0, 68, 69, 0, 0, 0, - 70, 78, 0, 0, 115, 115, 71, 0, 37, 115, - 0, 72, 73, 74, 75, 115, 79, 76, 77, 0, - 115, 115, 115, 115, 0, 0, 115, 115, 0, 0, - 115, 115, 0, 0, 113, 115, 0, 0, 0, 0, - 0, 115, 0, 0, 0, 174, 115, 115, 115, 115, - 0, 0, 115, 115, 115, 0, 0, 0, 0, 80, - 0, 0, 0, 0, 0, 115, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 115, 0, 0, 0, 0, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 115, 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, 115, -}; -short cl_scope_check[] = { 33, - 59, 60, 41, 37, 38, 44, 40, 60, 42, 43, - 44, 60, 46, 47, 126, 123, 41, 39, 83, 44, - 44, 44, 27, 44, 266, 294, 60, 61, 62, 58, - 272, 44, 44, 44, 44, 44, 305, 62, 308, 38, - 60, 60, 41, 42, 41, 44, 51, 44, 260, 62, - 62, 62, 62, 62, 58, 59, 61, 91, 318, 63, - 94, 38, 304, 62, 41, 42, 44, 44, 308, 38, - 123, 308, 41, 42, 38, 44, 318, 41, 42, 38, - 44, 40, 294, 42, 62, 62, 298, 60, 293, 178, - 124, 293, 126, 62, 123, 259, 185, 123, 62, 263, - 165, 125, 125, 308, 125, 308, 308, 258, 259, 174, - 175, 38, 263, 81, 74, 42, 76, 85, 269, 123, - 123, 125, 187, 274, 275, 276, 277, 123, 273, 280, - 281, 311, 308, 313, 314, 308, 308, 61, 333, 61, - 40, 93, 41, 123, 40, 167, 258, 259, 260, 171, - 40, 263, 157, 306, 266, 40, 123, 269, 308, 40, - 272, 273, 274, 275, 276, 277, 123, 123, 280, 281, - 57, 166, 164, 89, -1, -1, -1, -1, -1, -1, - -1, 293, 294, -1, -1, -1, 298, -1, -1, -1, - -1, -1, 304, -1, -1, -1, 308, -1, 306, -1, - 351, -1, -1, 126, -1, -1, 318, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 258, - 259, -1, -1, -1, 263, -1, -1, -1, -1, 126, - 269, -1, -1, -1, -1, 274, 275, 276, 277, 351, - -1, 280, 281, -1, -1, -1, -1, -1, 258, 259, - -1, -1, 256, 263, 126, -1, 290, 291, -1, 269, - -1, 265, -1, -1, 274, 275, 276, 277, 293, 308, - 280, 281, -1, -1, 333, -1, -1, -1, -1, -1, - 333, -1, -1, 308, 333, -1, -1, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 308, -1, - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 351, 333, 333, 319, 293, -1, 126, -1, - -1, -1, -1, 333, 293, -1, -1, -1, -1, 293, - -1, 308, -1, -1, 293, 258, 259, 260, -1, 308, - 263, 351, -1, -1, 308, -1, 269, -1, -1, 308, - 273, 274, 275, 276, 277, -1, -1, 280, 281, -1, - -1, 258, 259, -1, -1, -1, 263, -1, -1, -1, - 293, 294, 269, -1, -1, 298, 273, 274, 275, 276, - 277, -1, -1, 280, 281, 308, 258, 259, -1, -1, - -1, 263, -1, -1, -1, -1, 293, 269, -1, -1, - -1, -1, 274, 275, 276, 277, -1, -1, 280, 281, - -1, 308, -1, -1, -1, 258, 259, -1, -1, -1, - 263, 293, -1, -1, 258, 259, 269, -1, 351, 263, - -1, 274, 275, 276, 277, 269, 308, 280, 281, -1, - 274, 275, 276, 277, -1, -1, 280, 281, -1, -1, - 258, 259, -1, -1, 351, 263, -1, -1, -1, -1, - -1, 269, -1, -1, -1, 308, 274, 275, 276, 277, - -1, -1, 280, 281, 308, -1, -1, -1, -1, 351, - -1, -1, -1, -1, -1, 293, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 308, -1, -1, -1, -1, -1, -1, -1, 351, -1, - -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 351, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 355 -#if YYDEBUG -char *cl_scope_name[] = { -"end-of-file",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,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,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,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,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,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,"LE_AUTO", -"LE_DOUBLE","LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE","LE_LONG","LE_SWITCH", -"LE_CASE","LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR","LE_EXTERN", -"LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT","LE_UNSIGNED","LE_BOOL", -"LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID","LE_DEFAULT","LE_GOTO","LE_SIZEOF", -"LE_VOLATILE","LE_DO","LE_IF","LE_STATIC","LE_WHILE","LE_NEW","LE_DELETE", -"LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC","LE_PROTECTED","LE_PRIVATE", -"LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD","LE_OVERRIDE","LE_FINAL", -"LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH","LE_IDENTIFIER", -"LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T","LE_DECLSPEC","LE_DLLIMPORT", -"LE_DLLIEXPORT", -}; -char *cl_scope_rule[] = { -"$accept : translation_unit", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name_inter : LE_SIZE_T", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : LE_LONG LE_LONG", -"basic_type_name : LE_LONG LE_INT", -"basic_type_name : basic_type_name_inter", -"translation_unit :", -"translation_unit : translation_unit external_decl", -"external_decl : class_decl", -"external_decl : dummy_case", -"external_decl : enum_decl", -"external_decl : union_decl", -"external_decl : function_decl", -"external_decl : namespace_decl", -"external_decl : using_namespace", -"external_decl : scope_reducer", -"external_decl : scope_increaer", -"external_decl : question_expression", -"external_decl : error", -"template_arg :", -"template_arg : template_specifiter LE_IDENTIFIER", -"template_arg : template_specifiter LE_IDENTIFIER '='", -"template_arg_list : template_arg", -"template_arg_list : template_arg_list ',' template_arg", -"template_specifiter : LE_CLASS", -"template_specifiter : LE_TYPENAME", -"opt_template_qualifier :", -"opt_template_qualifier : LE_TEMPLATE '<' template_arg_list '>'", -"template_parameter_list :", -"template_parameter_list : template_parameter", -"template_parameter_list : template_parameter_list ',' template_parameter", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp", -"using_namespace : LE_USING LE_NAMESPACE nested_scope_specifier LE_IDENTIFIER ';'", -"namespace_decl : stmnt_starter LE_NAMESPACE nested_scope_specifier LE_IDENTIFIER '{'", -"namespace_decl : stmnt_starter LE_NAMESPACE '{'", -"class_decl : stmnt_starter opt_template_qualifier class_keyword", -"scope_reducer : '}'", -"scope_increaer : '{'", -"question_expression : '?'", -"class_keyword : LE_CLASS", -"class_keyword : LE_STRUCT", -"func_name : LE_IDENTIFIER", -"func_name : LE_OPERATOR any_operator", -"any_operator : '+'", -"any_operator : '='", -"any_operator : '*'", -"any_operator : '/'", -"any_operator : '%'", -"any_operator : '^'", -"any_operator : '&'", -"any_operator : '|'", -"any_operator : '~'", -"any_operator : '!'", -"any_operator : '<'", -"any_operator : '>'", -"any_operator : LE_LS", -"any_operator : LE_RS", -"any_operator : LE_ANDAND", -"any_operator : LE_OROR", -"any_operator : LE_ARROW", -"any_operator : LE_ARROWstar", -"any_operator : '.'", -"any_operator : LE_DOTstar", -"any_operator : LE_ICR", -"any_operator : LE_DECR", -"any_operator : LE_LE", -"any_operator : LE_GE", -"any_operator : LE_EQ", -"any_operator : LE_NE", -"any_operator : '(' ')'", -"any_operator : '[' ']'", -"any_operator : LE_NEW", -"any_operator : LE_DELETE", -"any_operator : ','", -"any_operator : LE_MULTassign", -"any_operator : LE_DIVassign", -"any_operator : LE_MODassign", -"any_operator : LE_PLUSassign", -"any_operator : LE_MINUSassign", -"any_operator : LE_LSassign", -"any_operator : LE_RSassign", -"any_operator : LE_ANDassign", -"any_operator : LE_ERassign", -"any_operator : LE_ORassign", -"optional_initialization_list : '{'", -"optional_initialization_list : ':'", -"declare_throw :", -"declare_throw : LE_THROW '(' template_parameter_list ')'", -"dummy_case : LE_CASE LE_IDENTIFIER", -"$$1 :", -"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec variable_decl nested_scope_specifier func_name '(' $$1 const_spec declare_throw '{'", -"$$2 :", -"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec nested_scope_specifier func_name '(' $$2 optional_initialization_list", -"$$3 :", -"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec nested_scope_specifier '~' func_name '(' $$3 const_spec '{'", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"$$4 :", -"scope_specifier : LE_IDENTIFIER '<' $$4 LE_CLCL", -"virtual_spec :", -"virtual_spec : LE_VIRTUAL", -"const_spec :", -"const_spec : LE_CONST", -"amp_item :", -"amp_item : '&'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : ':'", -"variable_decl : nested_scope_specifier basic_type_name special_star_amp", -"variable_decl : nested_scope_specifier LE_IDENTIFIER special_star_amp", -"variable_decl : nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp", -"$$5 :", -"enum_decl : stmnt_starter LE_ENUM LE_IDENTIFIER '{' $$5 enum_arg_list '}'", -"enum_optional_assign :", -"enum_optional_assign : '=' LE_HEXconstant", -"enum_optional_assign : '=' LE_OCTALconstant", -"enum_optional_assign : '=' LE_INTEGERconstant", -"enum_argument : LE_IDENTIFIER enum_optional_assign", -"enum_arg_list :", -"enum_arg_list : enum_argument", -"enum_arg_list : enum_arg_list ',' enum_argument", -"union_decl : stmnt_starter LE_UNION LE_IDENTIFIER '{'", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - -void syncParser(){ - //move lexer to the next ';' line or scope opening '{' - //int ch = cl_scope_lex(); -} - -//swallow all tokens up to the first '{' -void consumeInitializationList(){ - while( true ){ - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - if(ch == '{'){ - break; - } - } -} - -void consumeFuncArgList(){ - int depth = 1; - while(depth > 0){ - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - if(ch == ')'){ - depth--; - continue; - } - else if(ch == '('){ - depth ++ ; - continue; - } - } -} - -void readClassName() -{ -#define NEXT_TOK() c = cl_scope_lex(); if(c == 0) {className.clear(); return;} -#define BREAK_IF_NOT(x) if(c != (int)x) {className.clear(); break;} -#define BREAK_IF_NOT2(x, y) if(c != (int)x && c != (int)y) break; -#define BREAK_IF(x) if(c == (int)x) break; - - className.clear(); - - // look ahead and see if we can see another - while( true ){ - int c = cl_scope_lex(); - if(c == 0){ // EOF? - className.clear(); - break; - } - - if(c == LE_MACRO || c == LE_FINAL) { - continue; - - } else if(c == LE_IDENTIFIER) { - className = cl_scope_text; - - } else if(c == LE_DECLSPEC && className.empty()) { - // found decl sepc - - // Next token is '(' - NEXT_TOK(); - BREAK_IF_NOT('('); - - // Next token is LE_DLLIMPORT or LE_DLLEXPORT - NEXT_TOK(); - BREAK_IF_NOT2(LE_DLLIEXPORT, LE_DLLIMPORT); - - // Next token should be closing brace - NEXT_TOK(); - BREAK_IF_NOT(')'); - - } else if( (c == '{') && (!className.empty()) ){ - // The following is the class content - break; - - } else if( c == ':' && !className.empty() ) { - // we got the class name, and we found ':' - // read all tokens up until the first open brace - while (true) { - NEXT_TOK(); - if( c == (int)'{') { - return; - } - } - } else { - className.clear(); - break; - - } - } -} - -/** - * consume all token until matching closing brace is found - */ -void consumeDecl() -{ - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - if(ch ==0) - { - break; - } - if(ch == '}') - { - depth--; - if(depth == 0) currentScope.pop_back();//reduce the scope - continue; - } - else if(ch == '{') - { - depth ++ ; - continue; - } - } - -} - -void consumeTemplateDecl() -{ - templateInitList.clear(); - int dep = 0; - while( true ){ - int c = cl_scope_lex(); - if(c == 0){ // EOF? - break; - } - - if(c == '>' && dep == 0){ - templateInitList += cl_scope_text; - break; - - } else { - templateInitList += cl_scope_text; - templateInitList += " "; - } - - switch(c) { - case (int)'<': - dep++; - break; - case (int)'>': - dep--; - break; - default: - break; - } - } - - if(templateInitList.empty() == false) - templateInitList.insert(0, "<"); -} - -std::string readInitializer(const char* delim) -{ - std::string intializer; - int dep = 0; - while( true ){ - int c = cl_scope_lex(); - if(c == 0){ // EOF? - break; - } - - if(strchr(delim, (char)c) && dep == 0){ - cl_scope_less(0); - break; - - } else { - intializer += cl_scope_text; - intializer += " "; - } - - switch(c) { - case (int)'<': - dep++; - break; - case (int)'>': - dep--; - break; - default: - break; - } - } - return intializer; -} -//swallow all tokens up to the first '{' -void consumeNotIncluding(int ch){ - while( true ){ - int c = cl_scope_lex(); - if(c == 0){ // EOF? - break; - } - - //keep the function signature - if(c == ch){ - cl_scope_less(0); - break; - } - } -} - -// return the scope name at the end of the input string -std::string get_scope_name( const std::string &in, - std::vector &additionalNS, - const std::map &ignoreTokens) -{ - if( !setLexerInput(in, ignoreTokens) ){ - return ""; - } - - //call tghe main parsing routine - cl_scope_parse(); - std::string scope = getCurrentScope(); - //do the lexer cleanup - cl_scope_lex_clean(); - - for(size_t i=0; i= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -{ yyval = yyvsp[0]; } -break; -case 2: -{ yyval = yyvsp[0]; } -break; -case 3: -{ yyval = yyvsp[0]; } -break; -case 4: -{ yyval = yyvsp[0]; } -break; -case 5: -{ yyval = yyvsp[0]; } -break; -case 6: -{ yyval = yyvsp[0]; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 16: -{ yyval = yyvsp[0]; } -break; -case 29: -{ - /*printf("CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_scope_text, cl_scope_lineno);*/ - /*syncParser();*/ - } -break; -case 30: -{ yyval = "";} -break; -case 31: -{yyval = yyvsp[-1] + " " + yyvsp[0];} -break; -case 32: -{yyval = yyvsp[-2] + " " + yyvsp[-1] + "=" + readInitializer(",>");} -break; -case 33: -{ yyval = yyvsp[0]; } -break; -case 34: -{ yyval = yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; } -break; -case 35: -{ yyval = yyvsp[0]; } -break; -case 36: -{ yyval = yyvsp[0]; } -break; -case 38: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - } -break; -case 39: -{yyval = "";} -break; -case 40: -{yyval = yyvsp[0];} -break; -case 41: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 42: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 43: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 44: -{ - yyval = yyvsp[-6] + yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ; - } -break; -case 45: -{ - gs_additionlNS.push_back(yyvsp[-2]+yyvsp[-1]); - } -break; -case 46: -{ - currentScope.push_back(yyvsp[-2]+yyvsp[-1]); - - } -break; -case 47: -{ - /*anonymouse namespace*/ - increaseScope(); - - } -break; -case 48: -{ - readClassName(); - /*increase the scope level*/ - if(className.empty() == false) { - currentScope.push_back( className ); - printScopeName(); - } - } -break; -case 49: -{ - if(currentScope.empty()) - { - /*fatal error!*/ - /*printf("CodeLite: fatal error - cant go beyond global scope!\n");*/ - } - else - { - currentScope.pop_back(); - printScopeName(); - } - } -break; -case 50: -{ - /*increase random scope*/ - increaseScope(); - printScopeName(); - } -break; -case 51: -{ - consumeNotIncluding(';'); - } -break; -case 52: -{yyval = yyvsp[0];} -break; -case 53: -{yyval = yyvsp[0];} -break; -case 54: -{yyval = yyvsp[0];} -break; -case 55: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 82: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 83: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 97: -{yyval = '{';} -break; -case 98: -{consumeInitializationList() /*eat everything including the open brace*/;} -break; -case 99: -{yyval = "";} -break; -case 100: -{yyval = yyvsp[-1];} -break; -case 101: -{ - /* eat up all tokens not including the ':'*/ - consumeNotIncluding(':'); -} -break; -case 102: -{consumeFuncArgList();} -break; -case 103: -{ - /*printf("found function %s\n", $7.c_str());*/ - /*trim down trailing '::' from scope name*/ - if(yyvsp[-6].find_last_not_of(":") != std::string::npos){ - yyvsp[-6].erase(yyvsp[-6].find_last_not_of(":")+1); - } - currentScope.push_back(yyvsp[-6]); - printScopeName(); - } -break; -case 104: -{consumeFuncArgList();} -break; -case 105: -{ - - /*trim down trailing '::' from scope name*/ - if(yyvsp[-4].find_last_not_of(":") != std::string::npos){ - yyvsp[-4].erase(yyvsp[-4].find_last_not_of(":")+1); - } - currentScope.push_back(yyvsp[-4]); - printScopeName(); - } -break; -case 106: -{consumeFuncArgList();} -break; -case 107: -{ - - /*trim down trailing '::' from scope name*/ - if(yyvsp[-6].find_last_not_of(":") != std::string::npos){ - yyvsp[-6].erase(yyvsp[-6].find_last_not_of(":")+1); - } - currentScope.push_back(yyvsp[-6]); - printScopeName(); - } -break; -case 108: -{yyval = "";} -break; -case 109: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 110: -{yyval = yyvsp[-1]+ yyvsp[0];} -break; -case 111: -{consumeTemplateDecl();} -break; -case 112: -{yyval = yyvsp[-3] + yyvsp[0];} -break; -case 113: -{yyval = ""; } -break; -case 114: -{ yyval = yyvsp[0]; } -break; -case 115: -{yyval = ""; } -break; -case 116: -{ yyval = yyvsp[0]; } -break; -case 117: -{yyval = ""; } -break; -case 118: -{ yyval = yyvsp[0]; } -break; -case 119: -{yyval = ""; } -break; -case 120: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 121: -{ yyval = yyvsp[-1] + yyvsp[0]; } -break; -case 122: -{yyval = "";} -break; -case 123: -{ yyval = ";";} -break; -case 124: -{ yyval = ":";} -break; -case 125: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0] ;} -break; -case 126: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0] ;} -break; -case 127: -{yyval = yyvsp[-5] + yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] ;} -break; -case 128: -{currentScope.push_back(yyvsp[-1]); printScopeName();} -break; -case 129: -{ - currentScope.pop_back();/*reduce the scope*/ - printScopeName(); - /*printf("found enum: %s, args are: %s\n", $2.c_str(), $5.c_str());*/ - } -break; -case 130: -{yyval = "";} -break; -case 131: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 132: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 133: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 134: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 135: -{yyval = "";} -break; -case 136: -{yyval = yyvsp[0];} -break; -case 137: -{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];} -break; -case 138: -{ - currentScope.push_back(yyvsp[-1]); - printScopeName(); - consumeDecl(); - printScopeName(); - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CxxParser/sed.exe b/CxxParser/sed.exe deleted file mode 100644 index 0390cb858f..0000000000 Binary files a/CxxParser/sed.exe and /dev/null differ diff --git a/CxxParser/typedef_grammar.y b/CxxParser/typedef_grammar.y index 324078867e..45c322e69e 100644 --- a/CxxParser/typedef_grammar.y +++ b/CxxParser/typedef_grammar.y @@ -19,6 +19,8 @@ #define YYSTYPE std::string #define YYDEBUG 0 /* get the pretty debugging code to compile*/ +void yyerror(const char *s) {} + int cl_typedef_parse(); void syncParser(); static std::string typedef_consumBracketsContent(char openBrace); @@ -39,7 +41,7 @@ static std::string s_templateInitList; extern char *cl_scope_text; extern int cl_scope_lex(); extern void cl_scope_less(int count); -extern int cl_scope_lineno; +extern int cl_scope_lineno; extern void cl_scope_lex_clean(); extern bool setLexerInput(const std::string &in, const std::map &ignoreMap); extern void setUseIgnoreMacros(bool ignore); @@ -262,7 +264,7 @@ variable_decl : const_spec basic_type_name s_tmpString.clear(); } | const_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' - { + { $$ = $1 + " " + $2 + $3 + " " + $4 + $5 + $6; $2.erase($2.find_last_not_of(":")+1); curr_var.m_typeScope = $2; @@ -295,8 +297,6 @@ variable_decl : const_spec basic_type_name ; %% -void yyerror(char *s) {} - std::string typedef_consumBracketsContent(char openBrace) { diff --git a/CxxParser/typedef_parser.cpp b/CxxParser/typedef_parser.cpp deleted file mode 100644 index 0da70f4941..0000000000 --- a/CxxParser/typedef_parser.cpp +++ /dev/null @@ -1,963 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_typedef_parse -#define yylex cl_typedef_lex -#define yyerror cl_typedef_error -#define yychar cl_typedef_char -#define yyval cl_typedef_val -#define yylval cl_typedef_lval -#define yydebug cl_typedef_debug -#define yynerrs cl_typedef_nerrs -#define yyerrflag cl_typedef_errflag -#define yyss cl_typedef_ss -#define yyssp cl_typedef_ssp -#define yyvs cl_typedef_vs -#define yyvsp cl_typedef_vsp -#define yylhs cl_typedef_lhs -#define yylen cl_typedef_len -#define yydefred cl_typedef_defred -#define yydgoto cl_typedef_dgoto -#define yysindex cl_typedef_sindex -#define yyrindex cl_typedef_rindex -#define yygindex cl_typedef_gindex -#define yytable cl_typedef_table -#define yycheck cl_typedef_check -#define yyname cl_typedef_name -#define yyrule cl_typedef_rule -#define YYPREFIX "cl_typedef_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include "string" -#include "vector" -#include "stdio.h" -#include "map" -#include "variable.h" -#include "cl_typedef.h" - -#ifdef yylex -#undef yylex -#define yylex cl_scope_lex -#endif - -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ - -int cl_typedef_parse(); -void syncParser(); -static std::string typedef_consumBracketsContent(char openBrace); -static void typedef_consumeDefaultValue(char c1, char c2); - -static VariableList * gs_vars = NULL; -static std::vector gs_names; -static bool g_isUsedWithinFunc = false; -static std::string s_tmpString; -static Variable curr_var; -static clTypedefList gs_typedefs; -static clTypedef gs_currentTypedef; -static std::string s_templateInitList; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_scope_text; -extern int cl_scope_lex(); -extern void cl_scope_less(int count); -extern int cl_scope_lineno; -extern void cl_scope_lex_clean(); -extern bool setLexerInput(const std::string &in, const std::map &ignoreMap); -extern void setUseIgnoreMacros(bool ignore); - - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define YYERRCODE 256 -short cl_typedef_lhs[] = { -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 0, 0, 5, 3, 3, - 4, 4, 8, 9, 7, 7, 10, 13, 10, 14, - 14, 14, 15, 15, 15, 18, 18, 17, 17, 16, - 16, 16, 16, 16, 19, 19, 20, 20, 12, 6, - 6, 6, 6, 6, 11, 11, 11, 21, 11, 11, -}; -short cl_typedef_len[] = { 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 1, 0, 2, 0, 2, 1, - 6, 8, 2, 1, 0, 1, 0, 0, 3, 0, - 1, 3, 4, 4, 7, 2, 5, 0, 2, 0, - 1, 2, 2, 3, 0, 1, 0, 2, 2, 0, - 1, 1, 1, 1, 2, 3, 6, 0, 6, 4, -}; -short cl_typedef_defred[] = { 16, - 0, 20, 17, 0, 51, 52, 53, 54, 19, 0, - 0, 0, 0, 26, 0, 28, 0, 0, 0, 47, - 0, 29, 24, 0, 0, 43, 0, 23, 0, 6, - 1, 38, 0, 2, 5, 3, 0, 10, 0, 9, - 15, 55, 0, 0, 44, 21, 48, 46, 49, 0, - 14, 13, 4, 8, 7, 11, 12, 0, 39, 0, - 0, 36, 0, 0, 0, 58, 0, 31, 38, 22, - 0, 59, 0, 0, 0, 0, 32, 37, 0, 47, - 0, 33, 34, 0, 0, 35, -}; -short cl_typedef_dgoto[] = { 1, - 41, 42, 3, 9, 4, 10, 15, 19, 24, 13, - 20, 28, 22, 67, 68, 69, 43, 59, 49, 29, - 72, -}; -short cl_typedef_sindex[] = { 0, - -222, 0, 0, -50, 0, 0, 0, 0, 0, -235, - -264, -1, -254, 0, -207, 0, -237, 11, -237, 0, - 20, 0, 0, 23, 30, 0, 26, 0, 22, 0, - 0, 0, -180, 0, 0, 0, -30, 0, -30, 0, - 0, 0, -220, -264, 0, 0, 0, 0, 0, -219, - 0, 0, 0, 0, 0, 0, 0, -59, 0, -207, - -60, 0, -207, 27, -207, 0, -7, 0, 0, 0, - -5, 0, -207, -243, -85, -243, 0, 0, -58, 0, - -207, 0, 0, -4, -243, 0, -}; -short cl_typedef_rindex[] = { 0, - -55, 0, 0, -252, 0, 0, 0, 0, 0, -223, - -182, 0, 0, 0, -158, 0, 0, -129, 0, 0, - -211, 0, 0, 0, -105, 0, 0, 0, -15, 0, - 0, 0, -32, 0, 0, 0, -31, 0, -24, 0, - 0, 0, 0, -182, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -23, 0, -158, - -17, 0, -39, 0, -39, 0, 0, 0, 0, 0, - 0, 0, -76, -16, 0, 0, 0, 0, 12, 0, - -39, 0, 0, 0, 12, 0, -}; -short cl_typedef_gindex[] = { 0, - 43, 28, 0, 0, 0, 0, 60, 46, 88, 0, - 0, -34, 0, -33, 35, 2, -8, 0, 0, 0, - 0, -}; -#define YYTABLESIZE 301 -short cl_typedef_table[] = { 65, - 63, 81, 18, 18, 30, 4, 8, 8, 5, 4, - 8, 4, 8, 7, 56, 50, 21, 7, 56, 7, - 60, 57, 30, 50, 60, 57, 4, 8, 45, 4, - 8, 71, 11, 2, 7, 56, 73, 7, 73, 73, - 14, 60, 57, 45, 82, 83, 45, 84, 26, 47, - 86, 50, 25, 47, 74, 47, 76, 85, 16, 48, - 75, 21, 66, 47, 17, 18, 50, 18, 12, 18, - 23, 45, 6, 47, 7, 25, 25, 25, 51, 56, - 25, 57, 52, 44, 46, 70, 25, 58, 61, 78, - 25, 25, 25, 25, 25, 27, 38, 25, 25, 40, - 40, 40, 80, 60, 40, 64, 27, 77, 0, 0, - 40, 0, 0, 0, 0, 40, 40, 40, 40, 0, - 0, 40, 40, 0, 0, 25, 0, 0, 41, 41, - 41, 0, 0, 41, 0, 0, 0, 0, 0, 41, - 0, 0, 0, 0, 41, 41, 41, 41, 0, 40, - 41, 41, 42, 42, 42, 0, 0, 42, 0, 0, - 0, 0, 0, 42, 0, 0, 0, 0, 42, 42, - 42, 42, 30, 31, 42, 42, 0, 33, 41, 0, - 0, 40, 40, 34, 0, 0, 40, 0, 35, 36, - 37, 38, 40, 0, 39, 40, 0, 40, 40, 40, - 40, 0, 42, 40, 40, 0, 0, 0, 0, 0, - 0, 0, 18, 0, 0, 0, 0, 0, 40, 40, - 0, 0, 79, 40, 0, 0, 0, 30, 31, 40, - 0, 40, 53, 0, 40, 40, 40, 40, 34, 0, - 40, 40, 0, 35, 36, 54, 38, 0, 18, 55, - 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 0, 0, 40, 0, - 0, 0, 62, 62, 62, 4, 8, 30, 31, 32, - 0, 0, 33, 7, 56, 0, 0, 0, 34, 0, - 60, 57, 45, 35, 36, 37, 38, 0, 0, 39, - 40, -}; -short cl_typedef_check[] = { 60, - 60, 60, 58, 59, 44, 38, 38, 58, 59, 42, - 42, 44, 44, 38, 38, 268, 15, 42, 42, 44, - 38, 38, 62, 32, 42, 42, 59, 59, 44, 62, - 62, 65, 268, 256, 59, 59, 44, 62, 44, 44, - 305, 59, 59, 59, 79, 80, 62, 81, 38, 38, - 85, 304, 42, 42, 62, 44, 62, 62, 60, 38, - 69, 60, 123, 42, 319, 273, 319, 123, 304, 125, - 308, 42, 123, 62, 125, 258, 259, 260, 259, 37, - 263, 39, 263, 61, 59, 59, 269, 308, 308, 333, - 273, 274, 275, 276, 277, 319, 308, 280, 281, 258, - 259, 260, 75, 44, 263, 60, 19, 73, -1, -1, - 269, -1, -1, -1, -1, 274, 275, 276, 277, -1, - -1, 280, 281, -1, -1, 308, -1, -1, 258, 259, - 260, -1, -1, 263, -1, -1, -1, -1, -1, 269, - -1, -1, -1, -1, 274, 275, 276, 277, -1, 308, - 280, 281, 258, 259, 260, -1, -1, 263, -1, -1, - -1, -1, -1, 269, -1, -1, -1, -1, 274, 275, - 276, 277, 258, 259, 280, 281, -1, 263, 308, -1, - -1, 258, 259, 269, -1, -1, 263, -1, 274, 275, - 276, 277, 269, -1, 280, 281, -1, 274, 275, 276, - 277, -1, 308, 280, 281, -1, -1, -1, -1, -1, - -1, -1, 268, -1, -1, -1, -1, -1, 258, 259, - -1, -1, 308, 263, -1, -1, -1, 258, 259, 269, - -1, 308, 263, -1, 274, 275, 276, 277, 269, -1, - 280, 281, -1, 274, 275, 276, 277, -1, 304, 280, - 281, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 319, -1, -1, -1, -1, 308, -1, - -1, -1, 333, 333, 333, 308, 308, 258, 259, 260, - -1, -1, 263, 308, 308, -1, -1, -1, 269, -1, - 308, 308, 308, 274, 275, 276, 277, -1, -1, 280, - 281, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 352 -#if YYDEBUG -char *cl_typedef_name[] = { -"end-of-file",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,"'*'",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,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,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,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,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,0,0, -0,0,0,0,"LE_AUTO","LE_DOUBLE","LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE", -"LE_LONG","LE_SWITCH","LE_CASE","LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR", -"LE_EXTERN","LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT", -"LE_UNSIGNED","LE_BOOL","LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID", -"LE_DEFAULT","LE_GOTO","LE_SIZEOF","LE_VOLATILE","LE_DO","LE_IF","LE_STATIC", -"LE_WHILE","LE_NEW","LE_DELETE","LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC", -"LE_PROTECTED","LE_PRIVATE","LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD", -"LE_OVERRIDE","LE_FINAL","LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH", -"LE_IDENTIFIER","LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T", -}; -char *cl_typedef_rule[] = { -"$accept : translation_unit", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : LE_LONG LE_LONG", -"basic_type_name : LE_LONG LE_INT", -"basic_type_name : basic_type_name_inter", -"translation_unit :", -"translation_unit : translation_unit external_decl", -"$$1 :", -"external_decl : $$1 typedefs", -"external_decl : error", -"typedefs : stmnt_starter LE_TYPEDEF opt_typename_specifier real_type new_name ';'", -"typedefs : stmnt_starter opt_template_qualifier LE_USING new_name '=' opt_typename_specifier real_type ';'", -"real_type : variable_decl special_star_amp", -"new_name : LE_IDENTIFIER", -"opt_typename_specifier :", -"opt_typename_specifier : LE_TYPENAME", -"opt_template_qualifier :", -"$$2 :", -"opt_template_qualifier : LE_TEMPLATE '<' $$2", -"parameter_list :", -"parameter_list : template_parameter", -"parameter_list : parameter_list ',' template_parameter", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"scope_specifier : LE_IDENTIFIER '<' parameter_list '>' LE_CLCL", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"const_spec :", -"const_spec : LE_CONST", -"const_spec : LE_CONST '*'", -"const_spec : LE_CONST '&'", -"const_spec : LE_CONST '*' '*'", -"amp_item :", -"amp_item : '&'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : '{'", -"stmnt_starter : '}'", -"stmnt_starter : ':'", -"variable_decl : const_spec basic_type_name", -"variable_decl : const_spec nested_scope_specifier LE_IDENTIFIER", -"variable_decl : const_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>'", -"$$3 :", -"variable_decl : const_spec LE_STRUCT nested_scope_specifier LE_IDENTIFIER '{' $$3", -"variable_decl : const_spec LE_STRUCT nested_scope_specifier LE_IDENTIFIER", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - - -std::string typedef_consumBracketsContent(char openBrace) -{ - char closeBrace; - - switch(openBrace) { - case '(': closeBrace = ')'; break; - case '[': closeBrace = ']'; break; - case '<': closeBrace = '>'; break; - case '{': closeBrace = '}'; break; - default: - openBrace = '('; - closeBrace = ')'; - break; - } - - std::string consumedData; - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - - if(ch == closeBrace) - { - consumedData.erase(0, consumedData.find_first_not_of(" ")); - consumedData.erase(consumedData.find_last_not_of(" ")+1); - consumedData += cl_scope_text; - - depth--; - continue; - } - else if(ch == openBrace) - { - consumedData.erase(0, consumedData.find_first_not_of(" ")); - consumedData.erase(consumedData.find_last_not_of(" ")+1); - consumedData += cl_scope_text; - - depth ++ ; - continue; - } - - consumedData += cl_scope_text; - consumedData += " "; - } - - return consumedData; -} - -void typedef_consumeDefaultValue(char c1, char c2) -{ - int depth = 0; - - while (depth >= 0) { - int ch = cl_scope_lex(); - if(ch == 0) { break;} - - if(ch == c1 && depth == 0) { - cl_scope_less(0); - break; - } - - if(ch == c2 && depth == 0) { - cl_scope_less(0); - break; - } - - curr_var.m_defaultValue += cl_scope_text; - if(ch == ')' || ch == '}'){ - depth--; - continue; - } else if(ch == '(' || ch == '{') { - depth ++ ; - continue; - } - } -} - -void do_clean_up() -{ - gs_vars = NULL; - - // restore settings - setUseIgnoreMacros(true); - g_isUsedWithinFunc = false; - gs_typedefs.clear(); - - //do the lexer cleanup - cl_scope_lex_clean(); -} - -// return the scope name at the end of the input string -void get_typedefs(const std::string &in, clTypedefList &li) -{ - std::map dummy; - - // provide the lexer with new input - if( !setLexerInput(in, dummy) ){ - return; - } - - // set the parser local output to our variable list - cl_typedef_parse(); - li = gs_typedefs; - - do_clean_up(); -} -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - int yym, yyn, yystate; -#if YYDEBUG - char *yys; - extern char *getenv(); - - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -{ yyval = yyvsp[0]; } -break; -case 2: -{ yyval = yyvsp[0]; } -break; -case 3: -{ yyval = yyvsp[0]; } -break; -case 4: -{ yyval = yyvsp[0]; } -break; -case 5: -{ yyval = yyvsp[0]; } -break; -case 6: -{ yyval = yyvsp[0]; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[0]; } -break; -case 18: -{curr_var.Reset(); gs_names.clear(); s_tmpString.clear(); gs_currentTypedef.clear(); s_templateInitList.clear();} -break; -case 20: -{ - yyclearin; /*clear lookahead token*/ - yyerrok; -/* printf("CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_scope_text, cl_scope_lineno);*/ - } -break; -case 21: -{ - if(gs_currentTypedef.m_realType.m_templateDecl.empty()) - gs_currentTypedef.m_realType.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - gs_typedefs.push_back(gs_currentTypedef); - - } -break; -case 22: -{ - if(gs_currentTypedef.m_realType.m_templateDecl.empty()) - gs_currentTypedef.m_realType.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - gs_typedefs.push_back(gs_currentTypedef); - } -break; -case 23: -{ - gs_currentTypedef.m_realType = curr_var; - gs_currentTypedef.m_realType.m_isPtr = (yyvsp[0].find("*") != std::string::npos); - } -break; -case 24: -{ gs_currentTypedef.m_name = yyvsp[0]; } -break; -case 25: -{ yyval = ""; } -break; -case 26: -{ yyval = yyvsp[0]; } -break; -case 28: -{s_tmpString = typedef_consumBracketsContent('<');} -break; -case 29: -{ - yyval = yyvsp[-2] + yyvsp[-1] + s_tmpString; - s_tmpString.clear(); - } -break; -case 30: -{yyval = "";} -break; -case 31: -{yyval = yyvsp[0];} -break; -case 32: -{yyval = yyvsp[-2] + yyvsp[-1] + " " + yyvsp[0];} -break; -case 33: -{ - yyval = yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 34: -{ - yyval = yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 35: -{ - yyval = yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ; - } -break; -case 36: -{yyval = yyvsp[-1]+ yyvsp[0]; } -break; -case 37: -{yyval = yyvsp[-4] ; s_templateInitList = yyvsp[-3] + yyvsp[-2] + yyvsp[-1];} -break; -case 38: -{yyval = "";} -break; -case 39: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 40: -{yyval = ""; } -break; -case 41: -{ yyval = yyvsp[0]; } -break; -case 42: -{ yyval = yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval; } -break; -case 43: -{ yyval = yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval; } -break; -case 44: -{ yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval;} -break; -case 45: -{yyval = ""; } -break; -case 46: -{ yyval = yyvsp[0]; } -break; -case 47: -{yyval = ""; } -break; -case 48: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 49: -{ yyval = yyvsp[-1] + yyvsp[0]; } -break; -case 50: -{yyval = "";} -break; -case 51: -{ yyval = ";";} -break; -case 52: -{ yyval = "{";} -break; -case 53: -{ yyval = "}";} -break; -case 54: -{ yyval = ":";} -break; -case 55: -{ - yyval = yyvsp[-1] + " " + yyvsp[0]; - yyvsp[0].erase(yyvsp[0].find_last_not_of(":")+1); - curr_var.m_type = yyvsp[0]; - curr_var.m_isBasicType = true; - curr_var.m_isConst = !yyvsp[-1].empty(); - } -break; -case 56: -{ - yyval = yyvsp[-2] + " " + yyvsp[-1] + yyvsp[0]; - yyvsp[-1].erase(yyvsp[-1].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-1]; - curr_var.m_type = yyvsp[0]; - curr_var.m_isConst = !yyvsp[-2].empty(); - s_tmpString.clear(); - } -break; -case 57: -{ - yyval = yyvsp[-5] + " " + yyvsp[-4] + yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - yyvsp[-4].erase(yyvsp[-4].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-4]; - curr_var.m_type = yyvsp[-3]; - curr_var.m_isTemplate = true; - curr_var.m_templateDecl = yyvsp[-2] +yyvsp[-1] +yyvsp[0]; - curr_var.m_isConst = !yyvsp[-5].empty(); - s_tmpString.clear(); - } -break; -case 58: -{s_tmpString = typedef_consumBracketsContent('{');} -break; -case 59: -{ - yyval = yyvsp[-5] + " " + yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + s_tmpString; - yyvsp[-3].erase(yyvsp[-3].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-3]; - curr_var.m_type = yyvsp[-2]; - curr_var.m_isTemplate = false; - curr_var.m_isConst = !yyvsp[-5].empty(); - s_tmpString.clear(); - } -break; -case 60: -{ - yyval = yyvsp[-4]; - yyvsp[-1].erase(yyvsp[-1].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-1]; - curr_var.m_type = yyvsp[0]; - curr_var.m_isTemplate = false; - curr_var.m_isConst = !yyvsp[-3].empty(); - s_tmpString.clear(); - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/CxxParser/var_parser.cpp b/CxxParser/var_parser.cpp deleted file mode 100644 index 7f821deea0..0000000000 --- a/CxxParser/var_parser.cpp +++ /dev/null @@ -1,1422 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define yyparse cl_var_parse -#define yylex cl_var_lex -#define yyerror cl_var_error -#define yychar cl_var_char -#define yyval cl_var_val -#define yylval cl_var_lval -#define yydebug cl_var_debug -#define yynerrs cl_var_nerrs -#define yyerrflag cl_var_errflag -#define yyss cl_var_ss -#define yyssp cl_var_ssp -#define yyvs cl_var_vs -#define yyvsp cl_var_vsp -#define yylhs cl_var_lhs -#define yylen cl_var_len -#define yydefred cl_var_defred -#define yydgoto cl_var_dgoto -#define yysindex cl_var_sindex -#define yyrindex cl_var_rindex -#define yygindex cl_var_gindex -#define yytable cl_var_table -#define yycheck cl_var_check -#define yyname cl_var_name -#define yyrule cl_var_rule -#define YYPREFIX "cl_var_" -/* Copyright Eran Ifrah(c)*/ -/*************** Includes and Defines *****************************/ -#include "string" -#include "vector" -#include "stdio.h" -#include "map" -#include "variable.h" -#include "cl_typedef.h" - -#ifdef yylex -#undef yylex -#define yylex cl_scope_lex -#endif - -#define YYSTYPE std::string -#define YYDEBUG 0 /* get the pretty debugging code to compile*/ - -void cl_scope_error(char *string); -int cl_var_parse(); -void syncParser(); -void var_consumeDefaultValue(char c1, char c2); -void var_consumeDefaultValueIfNeeded(); - -static VariableList * gs_vars = NULL; -static std::vector gs_names; -static bool g_isUsedWithinFunc = false; -static std::string s_tmpString; -static Variable curr_var; -static std::string s_templateInitList; -static bool isBasicType = false; - -/*---------------------------------------------*/ -/* externs defined in the lexer*/ -/*---------------------------------------------*/ -extern char *cl_scope_text; -extern int cl_scope_lex(); -extern void cl_scope_less(int count); - -extern int cl_scope_lineno; -extern std::vector currentScope; -extern bool setLexerInput(const std::string &in, const std::map &ignoreMap); -extern void setUseIgnoreMacros(bool ignore); -extern void cl_scope_lex_clean(); - -/*************** Standard ytab.c continues here *********************/ -#define LE_AUTO 257 -#define LE_DOUBLE 258 -#define LE_INT 259 -#define LE_STRUCT 260 -#define LE_BREAK 261 -#define LE_ELSE 262 -#define LE_LONG 263 -#define LE_SWITCH 264 -#define LE_CASE 265 -#define LE_ENUM 266 -#define LE_REGISTER 267 -#define LE_TYPEDEF 268 -#define LE_CHAR 269 -#define LE_EXTERN 270 -#define LE_RETURN 271 -#define LE_UNION 272 -#define LE_CONST 273 -#define LE_FLOAT 274 -#define LE_SHORT 275 -#define LE_UNSIGNED 276 -#define LE_BOOL 277 -#define LE_CONTINUE 278 -#define LE_FOR 279 -#define LE_SIGNED 280 -#define LE_VOID 281 -#define LE_DEFAULT 282 -#define LE_GOTO 283 -#define LE_SIZEOF 284 -#define LE_VOLATILE 285 -#define LE_DO 286 -#define LE_IF 287 -#define LE_STATIC 288 -#define LE_WHILE 289 -#define LE_NEW 290 -#define LE_DELETE 291 -#define LE_THIS 292 -#define LE_OPERATOR 293 -#define LE_CLASS 294 -#define LE_PUBLIC 295 -#define LE_PROTECTED 296 -#define LE_PRIVATE 297 -#define LE_VIRTUAL 298 -#define LE_FRIEND 299 -#define LE_INLINE 300 -#define LE_OVERLOAD 301 -#define LE_OVERRIDE 302 -#define LE_FINAL 303 -#define LE_TEMPLATE 304 -#define LE_TYPENAME 305 -#define LE_THROW 306 -#define LE_CATCH 307 -#define LE_IDENTIFIER 308 -#define LE_STRINGliteral 309 -#define LE_FLOATINGconstant 310 -#define LE_INTEGERconstant 311 -#define LE_CHARACTERconstant 312 -#define LE_OCTALconstant 313 -#define LE_HEXconstant 314 -#define LE_POUNDPOUND 315 -#define LE_CComment 316 -#define LE_CPPComment 317 -#define LE_NAMESPACE 318 -#define LE_USING 319 -#define LE_TYPEDEFname 320 -#define LE_ARROW 321 -#define LE_ICR 322 -#define LE_DECR 323 -#define LE_LS 324 -#define LE_RS 325 -#define LE_LE 326 -#define LE_GE 327 -#define LE_EQ 328 -#define LE_NE 329 -#define LE_ANDAND 330 -#define LE_OROR 331 -#define LE_ELLIPSIS 332 -#define LE_CLCL 333 -#define LE_DOTstar 334 -#define LE_ARROWstar 335 -#define LE_MULTassign 336 -#define LE_DIVassign 337 -#define LE_MODassign 338 -#define LE_PLUSassign 339 -#define LE_MINUSassign 340 -#define LE_LSassign 341 -#define LE_RSassign 342 -#define LE_ANDassign 343 -#define LE_ERassign 344 -#define LE_ORassign 345 -#define LE_MACRO 346 -#define LE_DYNAMIC_CAST 347 -#define LE_STATIC_CAST 348 -#define LE_CONST_CAST 349 -#define LE_REINTERPRET_CAST 350 -#define LE_SIZE_T 351 -#define LE_TIME_T 352 -#define YYERRCODE 256 -short cl_var_lhs[] = { -1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 0, 0, 5, - 3, 3, 3, 6, 6, 6, 7, 7, 7, 12, - 13, 16, 4, 19, 4, 4, 4, 4, 4, 4, - 4, 14, 14, 14, 14, 24, 24, 15, 15, 23, - 23, 26, 18, 27, 18, 22, 22, 21, 21, 21, - 21, 20, 20, 20, 20, 20, 25, 25, 9, 9, - 28, 28, 8, 8, 8, 8, 8, 8, 8, 29, - 29, 30, 30, 31, 31, 10, 11, 11, 11, 11, - 11, 17, 17, 17, 17, -}; -short cl_var_len[] = { 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 2, 2, 0, 2, 0, - 2, 3, 1, 0, 1, 3, 4, 4, 7, 0, - 0, 0, 13, 0, 8, 6, 6, 6, 5, 5, - 3, 0, 1, 2, 2, 1, 2, 1, 3, 1, - 1, 0, 2, 0, 5, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 5, 0, 2, - 0, 1, 0, 2, 2, 2, 3, 1, 2, 0, - 1, 0, 1, 0, 2, 3, 0, 1, 1, 1, - 1, 2, 3, 6, 4, -}; -short cl_var_defred[] = { 18, - 0, 23, 0, 19, 0, 6, 1, 0, 2, 5, - 0, 0, 10, 0, 9, 12, 11, 15, 0, 88, - 0, 89, 0, 90, 91, 21, 0, 0, 17, 16, - 4, 3, 8, 7, 13, 14, 22, 0, 0, 78, - 0, 84, 84, 0, 84, 0, 79, 72, 0, 76, - 74, 69, 92, 0, 0, 0, 0, 0, 0, 41, - 77, 0, 0, 70, 0, 85, 81, 0, 0, 30, - 0, 0, 67, 0, 0, 56, 57, 40, 83, 86, - 0, 39, 31, 0, 0, 52, 0, 0, 0, 25, - 69, 59, 60, 61, 38, 37, 0, 62, 84, 63, - 34, 65, 64, 66, 36, 53, 47, 0, 0, 0, - 0, 0, 0, 0, 0, 26, 68, 0, 84, 0, - 54, 35, 0, 27, 28, 43, 0, 0, 0, 55, - 0, 44, 45, 32, 0, 0, 29, 48, 0, 33, - 0, 49, -}; -short cl_var_dgoto[] = { 1, - 18, 19, 4, 26, 5, 89, 90, 91, 54, 55, - 27, 83, 97, 129, 139, 136, 42, 85, 114, 105, - 95, 78, 28, 86, 64, 106, 130, 51, 68, 80, - 56, -}; -short cl_var_sindex[] = { 0, - -26, 0, -219, 0, -23, 0, 0, -219, 0, 0, - -219, 274, 0, 274, 0, 0, 0, 0, -48, 0, - -168, 0, -168, 0, 0, 0, 94, -289, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -168, -30, 0, - 302, 0, 0, -256, 0, 13, 0, 0, 26, 0, - 0, 0, 0, -234, -168, 69, -168, 16, -168, 0, - 0, -228, -54, 0, -19, 0, 0, 22, -18, 0, - -202, -53, 0, -168, 6, 0, 0, 0, 0, 0, - 6, 0, 0, -53, 51, 0, -200, -168, -42, 0, - 0, 0, 0, 0, 0, 0, -159, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -29, -168, -210, - 322, -133, -202, 70, -210, 0, 0, -46, 0, -37, - 0, 0, -168, 0, 0, 0, -180, -172, 15, 0, - -13, 0, 0, 0, -210, -37, 0, 0, -6, 0, - -37, 0, -}; -short cl_var_rindex[] = { 0, - -40, 0, 0, 0, 212, 0, 0, 93, 0, 0, - 118, 131, 0, 145, 0, 0, 0, 0, 0, 0, - -187, 0, 236, 0, 0, 0, 265, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 25, 55, 0, - -169, 0, 0, 0, 0, 0, 0, 0, 81, 0, - 0, 0, 0, 0, -17, 144, -17, 0, -167, 0, - 0, 0, 37, 0, 0, 0, 0, 169, 0, 0, - 0, 158, 0, 106, 1, 0, 0, 0, 0, 0, - 1, 0, 0, 574, 0, 0, 0, 106, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 331, 183, - 0, 0, 0, 0, 0, 0, 0, 330, 0, 17, - 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 330, 4, 0, 0, 0, 0, - 4, 0, -}; -short cl_var_gindex[] = { 0, - 20, 5, 0, 0, 0, -59, 34, 92, -49, -15, - 0, 0, 0, -71, 0, 0, 91, 0, 0, 0, - 63, 77, 0, 35, -62, 0, 0, 0, 0, 0, - 0, -}; -#define YYTABLESIZE 697 -short cl_var_table[] = { 20, - 58, 109, 62, 20, 127, 74, 88, 50, 87, 3, - 37, 49, 29, 123, 109, 30, 23, 20, 20, 110, - 21, 77, 77, 73, 76, 76, 73, 57, 108, 59, - 109, 35, 115, 36, 25, 20, 58, 141, 6, 7, - 58, 111, 46, 8, 58, 53, 93, 42, 135, 9, - 87, 58, 140, 60, 10, 11, 12, 13, 58, 58, - 14, 15, 42, 131, 138, 73, 92, 61, 73, 142, - 73, 73, 73, 63, 93, 73, 70, 93, 93, 72, - 93, 73, 20, 113, 20, 79, 73, 73, 73, 73, - 102, 103, 73, 73, 99, 71, 94, 38, 71, 22, - 93, 24, 124, 125, 39, 84, 67, 107, 112, 98, - 66, 100, 41, 43, 41, 119, 40, 45, 41, 137, - 73, 75, 117, 58, 75, 58, 120, 132, 122, 47, - 4, 16, 17, 4, 4, 133, 4, 134, 69, 42, - 73, 104, 116, 96, 51, 82, 65, 121, 69, 24, - 71, 4, 0, 0, 4, 3, 4, 0, 3, 3, - 0, 3, 0, 73, 73, 0, 0, 24, 8, 0, - 0, 8, 8, 101, 8, 0, 3, 0, 0, 3, - 0, 3, 7, 0, 80, 7, 7, 80, 7, 8, - 0, 0, 8, 0, 8, 95, 0, 0, 95, 95, - 0, 95, 0, 7, 0, 80, 7, 80, 7, 82, - 0, 0, 82, 0, 0, 0, 20, 20, 20, 20, - 94, 95, 20, 94, 94, 20, 94, 0, 20, 2, - 82, 0, 20, 20, 20, 20, 20, 0, 0, 20, - 20, 0, 0, 0, 20, 0, 94, 0, 0, 0, - 0, 0, 0, 0, 48, 0, 58, 58, 58, 58, - 58, 0, 0, 58, 0, 0, 58, 20, 0, 58, - 126, 0, 0, 58, 58, 58, 58, 58, 73, 73, - 58, 58, 73, 73, 73, 58, 73, 73, 75, 81, - 73, 0, 0, 73, 0, 0, 0, 0, 73, 73, - 73, 73, 93, 0, 73, 73, 0, 0, 58, 93, - 20, 20, 71, 71, 71, 128, 0, 71, 0, 0, - 0, 93, 0, 71, 0, 0, 0, 0, 71, 71, - 71, 71, 73, 0, 71, 71, 0, 0, 75, 75, - 75, 0, 0, 75, 93, 0, 0, 0, 0, 75, - 44, 58, 58, 0, 75, 75, 75, 75, 4, 38, - 75, 75, 71, 73, 73, 4, 39, 84, 73, 0, - 0, 84, 0, 84, 73, 73, 73, 4, 40, 73, - 73, 73, 73, 3, 0, 73, 73, 0, 75, 0, - 3, 84, 0, 84, 0, 0, 8, 0, 0, 0, - 4, 0, 3, 8, 0, 71, 71, 0, 0, 80, - 7, 0, 0, 73, 0, 8, 80, 7, 0, 0, - 0, 0, 0, 95, 0, 3, 0, 0, 80, 7, - 95, 75, 75, 0, 82, 0, 0, 0, 8, 0, - 0, 82, 95, 0, 0, 0, 0, 0, 94, 0, - 0, 80, 7, 82, 0, 94, 73, 73, 0, 0, - 0, 0, 0, 0, 0, 95, 0, 94, 87, 87, - 87, 87, 0, 0, 87, 0, 82, 87, 0, 0, - 87, 0, 0, 0, 87, 87, 87, 87, 87, 0, - 94, 87, 87, 73, 73, 73, 87, 0, 73, 0, - 0, 0, 0, 0, 73, 0, 0, 0, 0, 73, - 73, 73, 73, 0, 0, 73, 73, 0, 0, 87, - 0, 0, 73, 73, 73, 0, 0, 73, 0, 0, - 0, 6, 7, 73, 0, 0, 31, 0, 73, 73, - 73, 73, 9, 73, 73, 73, 0, 10, 32, 33, - 13, 0, 0, 34, 15, 0, 0, 0, 0, 6, - 7, 52, 87, 87, 8, 0, 0, 50, 0, 0, - 9, 0, 73, 0, 0, 10, 11, 12, 13, 6, - 7, 14, 15, 0, 8, 0, 73, 73, 73, 73, - 9, 0, 0, 73, 0, 10, 11, 12, 13, 73, - 0, 14, 15, 0, 73, 73, 73, 73, 0, 0, - 73, 73, 0, 46, 46, 73, 73, 46, 0, 0, - 0, 0, 0, 0, 16, 17, 0, 0, 0, 118, - 0, 0, 46, 0, 46, 0, 0, 0, 73, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, - 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, - 0, 73, 73, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 46, -}; -short cl_var_check[] = { 40, - 0, 44, 52, 44, 42, 60, 60, 38, 71, 36, - 59, 42, 8, 60, 44, 11, 40, 58, 59, 62, - 44, 41, 41, 41, 44, 44, 44, 43, 88, 45, - 44, 12, 62, 14, 58, 59, 36, 44, 258, 259, - 40, 91, 332, 263, 44, 41, 41, 44, 62, 269, - 113, 308, 59, 41, 274, 275, 276, 277, 58, 59, - 280, 281, 59, 123, 136, 41, 61, 42, 44, 141, - 258, 259, 260, 308, 38, 263, 61, 41, 42, 308, - 44, 269, 123, 99, 125, 64, 274, 275, 276, 277, - 40, 41, 280, 281, 44, 41, 91, 266, 44, 123, - 64, 125, 118, 119, 273, 308, 38, 308, 268, 59, - 42, 61, 21, 23, 23, 111, 285, 27, 27, 135, - 308, 41, 333, 123, 44, 125, 260, 308, 59, 38, - 38, 351, 352, 41, 42, 308, 44, 123, 308, 123, - 308, 91, 109, 81, 332, 69, 55, 113, 57, 44, - 59, 59, -1, -1, 62, 38, 64, -1, 41, 42, - -1, 44, -1, 351, 352, -1, -1, 62, 38, -1, - -1, 41, 42, 123, 44, -1, 59, -1, -1, 62, - -1, 64, 38, -1, 41, 41, 42, 44, 44, 59, - -1, -1, 62, -1, 64, 38, -1, -1, 41, 42, - -1, 44, -1, 59, -1, 62, 62, 64, 64, 41, - -1, -1, 44, -1, -1, -1, 257, 258, 259, 260, - 38, 64, 263, 41, 42, 266, 44, -1, 269, 256, - 62, -1, 273, 274, 275, 276, 277, -1, -1, 280, - 281, -1, -1, -1, 285, -1, 64, -1, -1, -1, - -1, -1, -1, -1, 285, -1, 256, 257, 258, 259, - 260, -1, -1, 263, -1, -1, 266, 308, -1, 269, - 308, -1, -1, 273, 274, 275, 276, 277, 333, 333, - 280, 281, 258, 259, 260, 285, 333, 263, 308, 308, - 308, -1, -1, 269, -1, -1, -1, -1, 274, 275, - 276, 277, 266, -1, 280, 281, -1, -1, 308, 273, - 351, 352, 258, 259, 260, 353, -1, 263, -1, -1, - -1, 285, -1, 269, -1, -1, -1, -1, 274, 275, - 276, 277, 308, -1, 280, 281, -1, -1, 258, 259, - 260, -1, -1, 263, 308, -1, -1, -1, -1, 269, - 257, 351, 352, -1, 274, 275, 276, 277, 266, 266, - 280, 281, 308, 258, 259, 273, 273, 38, 263, -1, - -1, 42, -1, 44, 269, 351, 352, 285, 285, 274, - 275, 276, 277, 266, -1, 280, 281, -1, 308, -1, - 273, 62, -1, 64, -1, -1, 266, -1, -1, -1, - 308, -1, 285, 273, -1, 351, 352, -1, -1, 266, - 266, -1, -1, 308, -1, 285, 273, 273, -1, -1, - -1, -1, -1, 266, -1, 308, -1, -1, 285, 285, - 273, 351, 352, -1, 266, -1, -1, -1, 308, -1, - -1, 273, 285, -1, -1, -1, -1, -1, 266, -1, - -1, 308, 308, 285, -1, 273, 351, 352, -1, -1, - -1, -1, -1, -1, -1, 308, -1, 285, 257, 258, - 259, 260, -1, -1, 263, -1, 308, 266, -1, -1, - 269, -1, -1, -1, 273, 274, 275, 276, 277, -1, - 308, 280, 281, 258, 259, 260, 285, -1, 263, -1, - -1, -1, -1, -1, 269, -1, -1, -1, -1, 274, - 275, 276, 277, -1, -1, 280, 281, -1, -1, 308, - -1, -1, 258, 259, 260, -1, -1, 263, -1, -1, - -1, 258, 259, 269, -1, -1, 263, -1, 274, 275, - 276, 277, 269, 308, 280, 281, -1, 274, 275, 276, - 277, -1, -1, 280, 281, -1, -1, -1, -1, 258, - 259, 260, 351, 352, 263, -1, -1, 332, -1, -1, - 269, -1, 308, -1, -1, 274, 275, 276, 277, 258, - 259, 280, 281, -1, 263, -1, 351, 352, 258, 259, - 269, -1, -1, 263, -1, 274, 275, 276, 277, 269, - -1, 280, 281, -1, 274, 275, 276, 277, -1, -1, - 280, 281, -1, 40, 41, 351, 352, 44, -1, -1, - -1, -1, -1, -1, 351, 352, -1, -1, -1, 308, - -1, -1, 59, -1, 61, -1, -1, -1, 308, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 351, 352, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, - -1, -1, 351, 352, -1, -1, -1, -1, -1, -1, - -1, 351, 352, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 123, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif -#define YYMAXTOKEN 353 -#if YYDEBUG -char *cl_var_name[] = { -"end-of-file",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,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,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,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,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,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,0,"LE_AUTO","LE_DOUBLE","LE_INT","LE_STRUCT", -"LE_BREAK","LE_ELSE","LE_LONG","LE_SWITCH","LE_CASE","LE_ENUM","LE_REGISTER", -"LE_TYPEDEF","LE_CHAR","LE_EXTERN","LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT", -"LE_SHORT","LE_UNSIGNED","LE_BOOL","LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID", -"LE_DEFAULT","LE_GOTO","LE_SIZEOF","LE_VOLATILE","LE_DO","LE_IF","LE_STATIC", -"LE_WHILE","LE_NEW","LE_DELETE","LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC", -"LE_PROTECTED","LE_PRIVATE","LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD", -"LE_OVERRIDE","LE_FINAL","LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH", -"LE_IDENTIFIER","LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant", -"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND", -"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname", -"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE", -"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar", -"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign", -"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign", -"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST", -"LE_REINTERPRET_CAST","LE_SIZE_T","LE_TIME_T","\"**\"", -}; -char *cl_var_rule[] = { -"$accept : translation_unit", -"basic_type_name_inter : LE_INT", -"basic_type_name_inter : LE_CHAR", -"basic_type_name_inter : LE_SHORT", -"basic_type_name_inter : LE_LONG", -"basic_type_name_inter : LE_FLOAT", -"basic_type_name_inter : LE_DOUBLE", -"basic_type_name_inter : LE_SIGNED", -"basic_type_name_inter : LE_UNSIGNED", -"basic_type_name_inter : LE_VOID", -"basic_type_name_inter : LE_BOOL", -"basic_type_name_inter : LE_TIME_T", -"basic_type_name_inter : LE_SIZE_T", -"basic_type_name : LE_UNSIGNED basic_type_name_inter", -"basic_type_name : LE_SIGNED basic_type_name_inter", -"basic_type_name : basic_type_name_inter", -"basic_type_name : LE_SHORT basic_type_name", -"basic_type_name : LE_LONG basic_type_name", -"translation_unit :", -"translation_unit : translation_unit external_decl", -"$$1 :", -"external_decl : $$1 variables", -"external_decl : '$' basic_type_name ';'", -"external_decl : error", -"parameter_list :", -"parameter_list : template_parameter", -"parameter_list : parameter_list ',' template_parameter", -"template_parameter : const_or_volatile_spec nested_scope_specifier LE_IDENTIFIER special_star_amp", -"template_parameter : const_or_volatile_spec nested_scope_specifier basic_type_name special_star_amp", -"template_parameter : const_or_volatile_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp", -"$$2 :", -"$$3 :", -"$$4 :", -"variables : stmnt_starter LE_AUTO LE_IDENTIFIER '=' $$2 $$3 LE_TYPEDEF LE_STRUCT optional_struct_name '{' $$4 typedef_name_list ';'", -"$$5 :", -"variables : stmnt_starter variable_decl special_star_amp const_or_volatile_spec variable_name_list '{' $$5 ';'", -"variables : stmnt_starter variable_decl special_star_amp const_or_volatile_spec variable_name_list postfix", -"variables : '(' variable_decl special_star_amp const_or_volatile_spec LE_IDENTIFIER postfix2", -"variables : ',' variable_decl special_star_amp const_or_volatile_spec LE_IDENTIFIER postfix2", -"variables : '(' variable_decl special_star_amp const_or_volatile_spec postfix3", -"variables : ',' variable_decl special_star_amp const_or_volatile_spec postfix3", -"variables : ellipsis_prefix LE_ELLIPSIS ')'", -"optional_struct_name :", -"optional_struct_name : LE_IDENTIFIER", -"optional_struct_name : '*' LE_IDENTIFIER", -"optional_struct_name : \"**\" LE_IDENTIFIER", -"fully_qualified_identifier_name : LE_IDENTIFIER", -"fully_qualified_identifier_name : scope_specifier LE_IDENTIFIER", -"typedef_name_list : optional_struct_name", -"typedef_name_list : typedef_name_list ',' optional_struct_name", -"ellipsis_prefix : '('", -"ellipsis_prefix : ','", -"$$6 :", -"variable_name_list : fully_qualified_identifier_name $$6", -"$$7 :", -"variable_name_list : variable_name_list ',' special_star_amp fully_qualified_identifier_name $$7", -"postfix3 : ','", -"postfix3 : ')'", -"postfix2 :", -"postfix2 : '='", -"postfix2 : ')'", -"postfix2 : '['", -"postfix : ';'", -"postfix : '='", -"postfix : ')'", -"postfix : '('", -"postfix : '['", -"scope_specifier : LE_IDENTIFIER LE_CLCL", -"scope_specifier : LE_IDENTIFIER '<' parameter_list '>' LE_CLCL", -"nested_scope_specifier :", -"nested_scope_specifier : nested_scope_specifier scope_specifier", -"volatile_qualifier :", -"volatile_qualifier : LE_VOLATILE", -"const_or_volatile_spec :", -"const_or_volatile_spec : LE_CONST volatile_qualifier", -"const_or_volatile_spec : LE_CONST '*'", -"const_or_volatile_spec : LE_CONST '&'", -"const_or_volatile_spec : LE_CONST '*' '*'", -"const_or_volatile_spec : LE_VOLATILE", -"const_or_volatile_spec : LE_ENUM const_or_volatile_spec", -"amp_item :", -"amp_item : '&'", -"at_list :", -"at_list : '@'", -"star_list :", -"star_list : star_list '*'", -"special_star_amp : star_list amp_item at_list", -"stmnt_starter :", -"stmnt_starter : ';'", -"stmnt_starter : '{'", -"stmnt_starter : '}'", -"stmnt_starter : ':'", -"variable_decl : const_or_volatile_spec basic_type_name", -"variable_decl : const_or_volatile_spec nested_scope_specifier LE_IDENTIFIER", -"variable_decl : const_or_volatile_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>'", -"variable_decl : const_or_volatile_spec LE_STRUCT nested_scope_specifier LE_IDENTIFIER", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -void yyerror(char *s) {} - -void var_consumeAutoAssignment(const std::string& varname) -{ - // Collect everything until we encounter the first ';' - std::string expression; - while ( true ) { - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - if ( ch == ';' ) { - // add an auto variable - Variable var; - var.m_name = varname; - var.m_isAuto = true; - var.m_completeType.swap(expression); - curr_var.m_lineno = cl_scope_lineno; - - s_templateInitList.clear(); - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - - break; - } else { - expression.append( cl_scope_text ).append(" "); - } - } -} - -std::string var_consumBracketsContent(char openBrace) -{ - char closeBrace; - - switch(openBrace) { - case '(': closeBrace = ')'; break; - case '[': closeBrace = ']'; break; - case '<': closeBrace = '>'; break; - case '{': closeBrace = '}'; break; - default: - openBrace = '('; - closeBrace = ')'; - break; - } - - std::string consumedData; - int depth = 1; - while(depth > 0) - { - int ch = cl_scope_lex(); - if(ch == 0){ - break; - } - - - if(ch == closeBrace) - { - consumedData.erase(0, consumedData.find_first_not_of(" ")); - consumedData.erase(consumedData.find_last_not_of(" ")+1); - consumedData += cl_scope_text; - - depth--; - continue; - } - else if(ch == openBrace) - { - consumedData.erase(0, consumedData.find_first_not_of(" ")); - consumedData.erase(consumedData.find_last_not_of(" ")+1); - consumedData += cl_scope_text; - - depth ++ ; - continue; - } - - consumedData += cl_scope_text; - consumedData += " "; - } - - return consumedData; -} - -void var_consumeDefaultValueIfNeeded() -{ - int ch = cl_scope_lex(); - if(ch != '=') { - cl_scope_less(0); - return; - } - var_consumeDefaultValue(';', ','); -} - -void var_consumeDefaultValue(char c1, char c2) -{ - int depth = 0; - - curr_var.m_defaultValue.clear(); - while (depth >= 0) { - int ch = cl_scope_lex(); - if(ch == 0) { break;} - - if(ch == c1 && depth == 0) { - cl_scope_less(0); - break; - } - - if(ch == c2 && depth == 0) { - cl_scope_less(0); - break; - } - - curr_var.m_defaultValue += cl_scope_text; - if(ch == ')' || ch == '}'){ - depth--; - continue; - } else if(ch == '(' || ch == '{') { - depth ++ ; - continue; - } - } -} - -void clean_up() -{ - gs_vars = NULL; - - // restore settings - setUseIgnoreMacros(true); - g_isUsedWithinFunc = false; - isBasicType = false; - - //do the lexer cleanup - cl_scope_lex_clean(); -} - -// return the scope name at the end of the input string -void get_variables(const std::string &in, VariableList &li, const std::map &ignoreMap, bool isUsedWithinFunc) -{ - //provide the lexer with new input - if( !setLexerInput(in, ignoreMap) ){ - return; - } - - //set the parser local output to our variable list - gs_vars = &li; - setUseIgnoreMacros(false); - - // the 'g_isUsedWithinFunc' allows us to parse variabels without name - // this is typical when used as function declaration (e.g. void setValue(bool);) - g_isUsedWithinFunc = isUsedWithinFunc; - - //call tghe main parsing routine - cl_var_parse(); - clean_up(); -} - -bool is_primitive_type(const std::string &in) -{ - std::string input = "@"; // Hack the input string... - input += in; - input += ";"; - - const std::map ignoreMap; - if(!setLexerInput(input, ignoreMap)) { - return false; - } - - isBasicType = false; - cl_var_parse(); - bool res = isBasicType; - clean_up(); - return res; -} -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - int yym, yyn, yystate; -#if YYDEBUG - char *yys; - extern char *getenv(); - - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -{ yyval = yyvsp[0]; } -break; -case 2: -{ yyval = yyvsp[0]; } -break; -case 3: -{ yyval = yyvsp[0]; } -break; -case 4: -{ yyval = yyvsp[0]; } -break; -case 5: -{ yyval = yyvsp[0]; } -break; -case 6: -{ yyval = yyvsp[0]; } -break; -case 7: -{ yyval = yyvsp[0]; } -break; -case 8: -{ yyval = yyvsp[0]; } -break; -case 9: -{ yyval = yyvsp[0]; } -break; -case 10: -{ yyval = yyvsp[0]; } -break; -case 11: -{ yyval = yyvsp[0]; } -break; -case 12: -{ yyval = yyvsp[0]; } -break; -case 13: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 14: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 15: -{ yyval = yyvsp[0]; } -break; -case 16: -{ yyval = yyvsp[-1] + " " + yyvsp[0];} -break; -case 17: -{ yyval = yyvsp[-1] + " " + yyvsp[0]; } -break; -case 20: -{curr_var.Reset(); gs_names.clear(); s_tmpString.clear(); s_templateInitList.clear();} -break; -case 22: -{ - isBasicType = true; - } -break; -case 23: -{ - yyclearin; /*clear lookahead token*/ - yyerrok; -/* printf("CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_var_lval.c_str(), cl_scope_lineno);*/ - } -break; -case 24: -{yyval = "";} -break; -case 25: -{yyval = yyvsp[0];} -break; -case 26: -{yyval = yyvsp[-2] + yyvsp[-1] + " " + yyvsp[0];} -break; -case 27: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 28: -{ - yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] +yyvsp[0]; - } -break; -case 29: -{ - yyval = yyvsp[-6] + yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ; - } -break; -case 30: -{var_consumeAutoAssignment(yyvsp[-1]);} -break; -case 31: -{} -break; -case 32: -{var_consumBracketsContent('{');} -break; -case 33: -{ - } -break; -case 34: -{var_consumBracketsContent('{');} -break; -case 35: -{ - if(gs_vars) - { - Variable var; - std::string pattern; - curr_var.m_isPtr = (yyvsp[-5].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-5]; - curr_var.m_lineno = cl_scope_lineno; - curr_var.m_rightSideConst = yyvsp[-4]; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - for(size_t i=0; i< gs_names.size(); i++) - { - /*create new variable for every variable name found*/ - var = curr_var; - var.m_pattern = yyvsp[-6] + " " + yyvsp[-5] + " " + yyvsp[-4] ; - if(var.m_completeType.empty()) { - var.m_completeType = yyvsp[-6] + " " + yyvsp[-5] + " " + yyvsp[-4] ; - } - var.m_name = gs_names.at(i).m_name; - var.m_defaultValue = gs_names.at(i).m_defaultValue; - - if(i != 0) { - var.m_isPtr = gs_names.at(i).m_isPtr; - var.m_starAmp = gs_names.at(i).m_starAmp; - } - gs_vars->push_back(var); - } - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 36: -{ - if(gs_vars) - { - Variable var; - std::string pattern; - curr_var.m_isPtr = (yyvsp[-3].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-3]; - curr_var.m_lineno = cl_scope_lineno; - curr_var.m_rightSideConst = yyvsp[-2]; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - for(size_t i=0; i< gs_names.size(); i++) - { - /*create new variable for every variable name found*/ - var = curr_var; - var.m_pattern = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] ; - if(var.m_completeType.empty()) { - var.m_completeType = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] ; - } - var.m_name = gs_names.at(i).m_name; - var.m_defaultValue = gs_names.at(i).m_defaultValue; - - if(i != 0) { - var.m_isPtr = gs_names.at(i).m_isPtr; - var.m_starAmp = gs_names.at(i).m_starAmp; - } - gs_vars->push_back(var); - } - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 37: -{ - if(gs_vars) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_completeType = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] ; - curr_var.m_isPtr = (yyvsp[-3].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-3]; - curr_var.m_arrayBrackets = yyvsp[0]; - curr_var.m_rightSideConst= yyvsp[-2]; - curr_var.m_lineno = cl_scope_lineno; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - /*create new variable for every variable name found*/ - var = curr_var; - var.m_name = yyvsp[-1]; - gs_vars->push_back(var); - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 38: -{ - if(gs_vars && g_isUsedWithinFunc) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_completeType = yyvsp[-4] + " " + yyvsp[-3] + " " + yyvsp[-2] ; - curr_var.m_isPtr = (yyvsp[-3].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-3]; - curr_var.m_arrayBrackets = yyvsp[0]; - curr_var.m_rightSideConst = yyvsp[-2]; - curr_var.m_lineno = cl_scope_lineno; - - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - /*create new variable for every variable name found*/ - var = curr_var; - var.m_name = yyvsp[-1]; - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 39: -{ - if(gs_vars && g_isUsedWithinFunc) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_completeType = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_isPtr = (yyvsp[-2].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-2]; - curr_var.m_rightSideConst= yyvsp[-1]; - curr_var.m_lineno = cl_scope_lineno; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - /*create new variable for every variable name found*/ - var = curr_var; - var.m_name = ""; - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - } - if(yyvsp[0] == ",") { - cl_scope_less(0); - } - } -break; -case 40: -{ - if(gs_vars && g_isUsedWithinFunc) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_completeType = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1]; - curr_var.m_isPtr = (yyvsp[-2].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-2]; - curr_var.m_lineno = cl_scope_lineno; - curr_var.m_rightSideConst= yyvsp[-1]; - if(curr_var.m_templateDecl.empty()) - curr_var.m_templateDecl = s_templateInitList; - s_templateInitList.clear(); - - /*create new variable for every variable name found*/ - var = curr_var; - var.m_name = ""; - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - } - if(yyvsp[0] == ",") { - cl_scope_less(0); - } - } -break; -case 41: -{ - /* special type of argument: Ellipsis, can only be at the end of function argument */ - if(gs_vars && g_isUsedWithinFunc) - { - Variable var; - std::string pattern; - curr_var.m_pattern = yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; - curr_var.m_completeType = yyvsp[-1]; - curr_var.m_isPtr = false; - curr_var.m_starAmp = ""; - curr_var.m_lineno = cl_scope_lineno; - curr_var.m_isEllipsis = true; - - var = curr_var; - gs_vars->push_back(var); - - curr_var.Reset(); - gs_names.clear(); - } - } -break; -case 46: -{yyval = yyvsp[0];} -break; -case 47: -{yyval = yyvsp[0];} -break; -case 50: -{yyval = yyvsp[0];} -break; -case 51: -{yyval = yyvsp[0];} -break; -case 52: -{var_consumeDefaultValueIfNeeded();} -break; -case 53: -{ - curr_var.m_name = yyvsp[-1]; - gs_names.push_back(curr_var); - } -break; -case 54: -{var_consumeDefaultValueIfNeeded();} -break; -case 55: -{ - /*collect all the names*/ - curr_var.m_name = yyvsp[-1]; - curr_var.m_isPtr = (yyvsp[-2].find("*") != (size_t)-1); - curr_var.m_starAmp = yyvsp[-2]; - gs_names.push_back(curr_var); - yyval = yyvsp[-4] + yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1]; - } -break; -case 58: -{yyval = "";} -break; -case 59: -{var_consumeDefaultValue(',', ')'); yyval = ""; } -break; -case 60: -{ yyval = ""; } -break; -case 61: -{ yyval = yyvsp[0] + var_consumBracketsContent('[');} -break; -case 65: -{ yyval = yyvsp[0] + var_consumBracketsContent('(');} -break; -case 66: -{ yyval = yyvsp[0] + var_consumBracketsContent('[');} -break; -case 67: -{ - yyval = yyvsp[-1]+ yyvsp[0]; - } -break; -case 68: -{ - yyval = yyvsp[-4] + yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - s_templateInitList = yyvsp[-3] + yyvsp[-2] + yyvsp[-1]; - } -break; -case 69: -{yyval = "";} -break; -case 70: -{ yyval = yyvsp[-1] + yyvsp[0];} -break; -case 71: -{ yyval = ""; } -break; -case 72: -{ yyval = yyvsp[0]; curr_var.m_isVolatile = true; } -break; -case 73: -{ yyval = ""; } -break; -case 74: -{ yyval = yyvsp[-1]; } -break; -case 75: -{ yyval = yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval; } -break; -case 76: -{ yyval = yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval; } -break; -case 77: -{ yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; curr_var.m_rightSideConst = yyval;} -break; -case 78: -{ yyval = yyvsp[0]; curr_var.m_isVolatile = true; } -break; -case 79: -{ curr_var.m_enumInTypeDecl = true; } -break; -case 80: -{yyval = ""; } -break; -case 81: -{ yyval = yyvsp[0]; } -break; -case 82: -{yyval = "";} -break; -case 83: -{yyval = "*";} -break; -case 84: -{yyval = ""; } -break; -case 85: -{yyval = yyvsp[-1] + yyvsp[0];} -break; -case 86: -{ yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]; } -break; -case 87: -{yyval = "";} -break; -case 88: -{ yyval = ";";} -break; -case 89: -{ yyval = "{";} -break; -case 90: -{ yyval = "}";} -break; -case 91: -{ yyval = ":";} -break; -case 92: -{ - yyval = yyvsp[-1] + " " + yyvsp[0]; - yyvsp[0].erase(yyvsp[0].find_last_not_of(":")+1); - curr_var.m_type = yyvsp[0]; - curr_var.m_isBasicType = true; - curr_var.m_isConst = (yyvsp[-1].find("const") != std::string::npos); - } -break; -case 93: -{ - yyval = yyvsp[-2] + " " + yyvsp[-1] + yyvsp[0]; - yyvsp[-1].erase(yyvsp[-1].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-1]; - curr_var.m_type = yyvsp[0]; - curr_var.m_isConst = (yyvsp[-2].find("const") != std::string::npos); - s_tmpString.clear(); - } -break; -case 94: -{ - yyval = yyvsp[-5] + " " + yyvsp[-4] + yyvsp[-3] + " " + yyvsp[-2] + yyvsp[-1] + yyvsp[0]; - yyvsp[-4].erase(yyvsp[-4].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-4]; - curr_var.m_type = yyvsp[-3]; - curr_var.m_isTemplate = true; - curr_var.m_templateDecl = yyvsp[-2] +yyvsp[-1] +yyvsp[0]; - curr_var.m_isConst = (yyvsp[-5].find("const") != std::string::npos); - s_tmpString.clear(); - } -break; -case 95: -{ - yyval = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; - yyvsp[-1].erase(yyvsp[-1].find_last_not_of(":")+1); - curr_var.m_typeScope = yyvsp[-1]; - curr_var.m_type = yyvsp[0]; - curr_var.m_isTemplate = !curr_var.m_templateDecl.empty(); - curr_var.m_completeType = yyvsp[-1] + yyvsp[0]; - curr_var.m_isConst = (yyvsp[-3].find("const") != std::string::npos); - s_tmpString.clear(); - } -break; - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -}