mirror of
https://github.com/tars-node/tars2node.git
synced 2024-03-22 13:10:56 +08:00
update to tars version
This commit is contained in:
parent
22b483e618
commit
9db3eaeba3
|
@ -52,7 +52,7 @@ ELSE ()
|
||||||
ENDIF (UNIX)
|
ENDIF (UNIX)
|
||||||
|
|
||||||
#编译的可执行程序输出目录
|
#编译的可执行程序输出目录
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PLATFORM}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${PLATFORM}/)
|
||||||
|
|
||||||
# define
|
# define
|
||||||
add_definitions(-DTARS_VERSION="${TARS_VERSION}")
|
add_definitions(-DTARS_VERSION="${TARS_VERSION}")
|
||||||
|
|
BIN
bin/mac/tars2node
Executable file
BIN
bin/mac/tars2node
Executable file
Binary file not shown.
BIN
bin/window/Release/tars2node.exe
Executable file
BIN
bin/window/Release/tars2node.exe
Executable file
Binary file not shown.
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
#define FLEX_SCANNER
|
#define FLEX_SCANNER
|
||||||
#define YY_FLEX_MAJOR_VERSION 2
|
#define YY_FLEX_MAJOR_VERSION 2
|
||||||
#define YY_FLEX_MINOR_VERSION 6
|
#define YY_FLEX_MINOR_VERSION 5
|
||||||
#define YY_FLEX_SUBMINOR_VERSION 0
|
#define YY_FLEX_SUBMINOR_VERSION 35
|
||||||
#if YY_FLEX_SUBMINOR_VERSION > 0
|
#if YY_FLEX_SUBMINOR_VERSION > 0
|
||||||
#define FLEX_BETA
|
#define FLEX_BETA
|
||||||
#endif
|
#endif
|
||||||
|
@ -47,6 +47,7 @@ typedef int16_t flex_int16_t;
|
||||||
typedef uint16_t flex_uint16_t;
|
typedef uint16_t flex_uint16_t;
|
||||||
typedef int32_t flex_int32_t;
|
typedef int32_t flex_int32_t;
|
||||||
typedef uint32_t flex_uint32_t;
|
typedef uint32_t flex_uint32_t;
|
||||||
|
typedef uint64_t flex_uint64_t;
|
||||||
#else
|
#else
|
||||||
typedef signed char flex_int8_t;
|
typedef signed char flex_int8_t;
|
||||||
typedef short int flex_int16_t;
|
typedef short int flex_int16_t;
|
||||||
|
@ -54,6 +55,7 @@ typedef int flex_int32_t;
|
||||||
typedef unsigned char flex_uint8_t;
|
typedef unsigned char flex_uint8_t;
|
||||||
typedef unsigned short int flex_uint16_t;
|
typedef unsigned short int flex_uint16_t;
|
||||||
typedef unsigned int flex_uint32_t;
|
typedef unsigned int flex_uint32_t;
|
||||||
|
#endif /* ! C99 */
|
||||||
|
|
||||||
/* Limits of integral types. */
|
/* Limits of integral types. */
|
||||||
#ifndef INT8_MIN
|
#ifndef INT8_MIN
|
||||||
|
@ -84,8 +86,6 @@ typedef unsigned int flex_uint32_t;
|
||||||
#define UINT32_MAX (4294967295U)
|
#define UINT32_MAX (4294967295U)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* ! C99 */
|
|
||||||
|
|
||||||
#endif /* ! FLEXINT_H */
|
#endif /* ! FLEXINT_H */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -142,15 +142,7 @@ typedef unsigned int flex_uint32_t;
|
||||||
|
|
||||||
/* Size of default input buffer. */
|
/* Size of default input buffer. */
|
||||||
#ifndef YY_BUF_SIZE
|
#ifndef YY_BUF_SIZE
|
||||||
#ifdef __ia64__
|
|
||||||
/* On IA-64, the buffer size is 16k, not 8k.
|
|
||||||
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
|
|
||||||
* Ditto for the __ia64__ case accordingly.
|
|
||||||
*/
|
|
||||||
#define YY_BUF_SIZE 32768
|
|
||||||
#else
|
|
||||||
#define YY_BUF_SIZE 16384
|
#define YY_BUF_SIZE 16384
|
||||||
#endif /* __ia64__ */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The state buf must be large enough to hold one state per character in the main buffer.
|
/* The state buf must be large enough to hold one state per character in the main buffer.
|
||||||
|
@ -184,18 +176,11 @@ extern FILE *yyin, *yyout;
|
||||||
*/
|
*/
|
||||||
#define YY_LESS_LINENO(n) \
|
#define YY_LESS_LINENO(n) \
|
||||||
do { \
|
do { \
|
||||||
int yyl;\
|
yy_size_t yyl;\
|
||||||
for ( yyl = n; yyl < yyleng; ++yyl )\
|
for ( yyl = n; yyl < yyleng; ++yyl )\
|
||||||
if ( yytext[yyl] == '\n' )\
|
if ( yytext[yyl] == '\n' )\
|
||||||
--yylineno;\
|
--yylineno;\
|
||||||
}while(0)
|
}while(0)
|
||||||
#define YY_LINENO_REWIND_TO(dst) \
|
|
||||||
do {\
|
|
||||||
const char *p;\
|
|
||||||
for ( p = yy_cp-1; p >= (dst); --p)\
|
|
||||||
if ( *p == '\n' )\
|
|
||||||
--yylineno;\
|
|
||||||
}while(0)
|
|
||||||
|
|
||||||
/* Return all but the first "n" matched characters back to the input stream. */
|
/* Return all but the first "n" matched characters back to the input stream. */
|
||||||
#define yyless(n) \
|
#define yyless(n) \
|
||||||
|
@ -230,7 +215,7 @@ struct yy_buffer_state
|
||||||
/* Number of characters read into yy_ch_buf, not including EOB
|
/* Number of characters read into yy_ch_buf, not including EOB
|
||||||
* characters.
|
* characters.
|
||||||
*/
|
*/
|
||||||
int yy_n_chars;
|
yy_size_t yy_n_chars;
|
||||||
|
|
||||||
/* Whether we "own" the buffer - i.e., we know we created it,
|
/* Whether we "own" the buffer - i.e., we know we created it,
|
||||||
* and can realloc() it to grow it, and should free() it to
|
* and can realloc() it to grow it, and should free() it to
|
||||||
|
@ -300,7 +285,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
|
||||||
|
|
||||||
/* yy_hold_char holds the character lost when yytext is formed. */
|
/* yy_hold_char holds the character lost when yytext is formed. */
|
||||||
static char yy_hold_char;
|
static char yy_hold_char;
|
||||||
static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||||
yy_size_t yyleng;
|
yy_size_t yyleng;
|
||||||
|
|
||||||
/* Points to current character in buffer. */
|
/* Points to current character in buffer. */
|
||||||
|
@ -372,17 +357,11 @@ extern int yylineno;
|
||||||
int yylineno = 1;
|
int yylineno = 1;
|
||||||
|
|
||||||
extern char *yytext;
|
extern char *yytext;
|
||||||
#ifdef yytext_ptr
|
|
||||||
#undef yytext_ptr
|
|
||||||
#endif
|
|
||||||
#define yytext_ptr yytext
|
#define yytext_ptr yytext
|
||||||
|
|
||||||
static yy_state_type yy_get_previous_state (void );
|
static yy_state_type yy_get_previous_state (void );
|
||||||
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
|
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
|
||||||
static int yy_get_next_buffer (void );
|
static int yy_get_next_buffer (void );
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 3
|
|
||||||
__attribute__((__noreturn__))
|
|
||||||
#endif
|
|
||||||
static void yy_fatal_error (yyconst char msg[] );
|
static void yy_fatal_error (yyconst char msg[] );
|
||||||
|
|
||||||
/* Done after the current pattern has been matched and before the
|
/* Done after the current pattern has been matched and before the
|
||||||
|
@ -390,7 +369,7 @@ static void yy_fatal_error (yyconst char msg[] );
|
||||||
*/
|
*/
|
||||||
#define YY_DO_BEFORE_ACTION \
|
#define YY_DO_BEFORE_ACTION \
|
||||||
(yytext_ptr) = yy_bp; \
|
(yytext_ptr) = yy_bp; \
|
||||||
yyleng = (size_t) (yy_cp - yy_bp); \
|
yyleng = (yy_size_t) (yy_cp - yy_bp); \
|
||||||
(yy_hold_char) = *yy_cp; \
|
(yy_hold_char) = *yy_cp; \
|
||||||
*yy_cp = '\0'; \
|
*yy_cp = '\0'; \
|
||||||
(yy_c_buf_p) = yy_cp;
|
(yy_c_buf_p) = yy_cp;
|
||||||
|
@ -414,7 +393,7 @@ static yyconst flex_int16_t yy_accept[52] =
|
||||||
0
|
0
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst YY_CHAR yy_ec[256] =
|
static yyconst flex_int32_t yy_ec[256] =
|
||||||
{ 0,
|
{ 0,
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
|
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
|
||||||
4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
|
4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
@ -446,14 +425,14 @@ static yyconst YY_CHAR yy_ec[256] =
|
||||||
1, 1, 1, 1, 1
|
1, 1, 1, 1, 1
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst YY_CHAR yy_meta[29] =
|
static yyconst flex_int32_t yy_meta[29] =
|
||||||
{ 0,
|
{ 0,
|
||||||
1, 2, 3, 2, 1, 1, 2, 1, 4, 4,
|
1, 2, 3, 2, 1, 1, 2, 1, 4, 4,
|
||||||
1, 1, 5, 5, 5, 1, 6, 6, 6, 2,
|
1, 1, 5, 5, 5, 1, 6, 6, 6, 2,
|
||||||
6, 6, 6, 2, 2, 2, 2, 2
|
6, 6, 6, 2, 2, 2, 2, 2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst flex_uint16_t yy_base[58] =
|
static yyconst flex_int16_t yy_base[58] =
|
||||||
{ 0,
|
{ 0,
|
||||||
0, 0, 119, 118, 122, 125, 125, 125, 125, 97,
|
0, 0, 119, 118, 122, 125, 125, 125, 125, 97,
|
||||||
18, 21, 29, 31, 25, 104, 48, 125, 114, 83,
|
18, 21, 29, 31, 25, 104, 48, 125, 114, 83,
|
||||||
|
@ -473,7 +452,7 @@ static yyconst flex_int16_t yy_def[58] =
|
||||||
0, 51, 51, 51, 51, 51, 51
|
0, 51, 51, 51, 51, 51, 51
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst flex_uint16_t yy_nxt[154] =
|
static yyconst flex_int16_t yy_nxt[154] =
|
||||||
{ 0,
|
{ 0,
|
||||||
6, 7, 8, 7, 9, 10, 6, 6, 11, 11,
|
6, 7, 8, 7, 9, 10, 6, 6, 11, 11,
|
||||||
12, 13, 14, 15, 15, 16, 17, 17, 17, 17,
|
12, 13, 14, 15, 15, 16, 17, 17, 17, 17,
|
||||||
|
@ -534,7 +513,7 @@ int yy_flex_debug = 0;
|
||||||
#define YY_MORE_ADJ 0
|
#define YY_MORE_ADJ 0
|
||||||
#define YY_RESTORE_YY_MORE_OFFSET
|
#define YY_RESTORE_YY_MORE_OFFSET
|
||||||
char *yytext;
|
char *yytext;
|
||||||
#line 1 "tars.l"
|
#line 1 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
/**
|
/**
|
||||||
* Tencent is pleased to support the open source community by making Tars available.
|
* Tencent is pleased to support the open source community by making Tars available.
|
||||||
*
|
*
|
||||||
|
@ -550,14 +529,13 @@ char *yytext;
|
||||||
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
#line 20 "tars.l"
|
#line 20 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define YYSTYPE GrammarBasePtr
|
#define YYSTYPE GrammarBasePtr
|
||||||
|
|
||||||
#include "parse.h"
|
#include "parse.h"
|
||||||
|
@ -583,20 +561,17 @@ struct include_file_state
|
||||||
include_file_state include_file_stack[MAX_INCLUDE_DEPTH];
|
include_file_state include_file_stack[MAX_INCLUDE_DEPTH];
|
||||||
int include_file_stack_ptr = 0;
|
int include_file_stack_ptr = 0;
|
||||||
|
|
||||||
|
int isatty(int)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#line 588 "tars.lex.cpp"
|
|
||||||
|
#line 571 "tars.lex.cpp"
|
||||||
|
|
||||||
#define INITIAL 0
|
#define INITIAL 0
|
||||||
#define INCL 1
|
#define INCL 1
|
||||||
|
|
||||||
#ifndef YY_NO_UNISTD_H
|
|
||||||
/* Special case for "unistd.h", since it is non-ANSI. We include it way
|
|
||||||
* down here because we want the user's section 1 to have been scanned first.
|
|
||||||
* The user has a chance to override it with an option.
|
|
||||||
*/
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef YY_EXTRA_TYPE
|
#ifndef YY_EXTRA_TYPE
|
||||||
#define YY_EXTRA_TYPE void *
|
#define YY_EXTRA_TYPE void *
|
||||||
#endif
|
#endif
|
||||||
|
@ -618,11 +593,11 @@ void yyset_extra (YY_EXTRA_TYPE user_defined );
|
||||||
|
|
||||||
FILE *yyget_in (void );
|
FILE *yyget_in (void );
|
||||||
|
|
||||||
void yyset_in (FILE * _in_str );
|
void yyset_in (FILE * in_str );
|
||||||
|
|
||||||
FILE *yyget_out (void );
|
FILE *yyget_out (void );
|
||||||
|
|
||||||
void yyset_out (FILE * _out_str );
|
void yyset_out (FILE * out_str );
|
||||||
|
|
||||||
yy_size_t yyget_leng (void );
|
yy_size_t yyget_leng (void );
|
||||||
|
|
||||||
|
@ -630,7 +605,7 @@ char *yyget_text (void );
|
||||||
|
|
||||||
int yyget_lineno (void );
|
int yyget_lineno (void );
|
||||||
|
|
||||||
void yyset_lineno (int _line_number );
|
void yyset_lineno (int line_number );
|
||||||
|
|
||||||
/* Macros after this point can all be overridden by user definitions in
|
/* Macros after this point can all be overridden by user definitions in
|
||||||
* section 1.
|
* section 1.
|
||||||
|
@ -644,12 +619,8 @@ extern int yywrap (void );
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef YY_NO_UNPUT
|
|
||||||
|
|
||||||
static void yyunput (int c,char *buf_ptr );
|
static void yyunput (int c,char *buf_ptr );
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef yytext_ptr
|
#ifndef yytext_ptr
|
||||||
static void yy_flex_strncpy (char *,yyconst char *,int );
|
static void yy_flex_strncpy (char *,yyconst char *,int );
|
||||||
#endif
|
#endif
|
||||||
|
@ -670,12 +641,7 @@ static int input (void );
|
||||||
|
|
||||||
/* Amount of stuff to slurp up with each read. */
|
/* Amount of stuff to slurp up with each read. */
|
||||||
#ifndef YY_READ_BUF_SIZE
|
#ifndef YY_READ_BUF_SIZE
|
||||||
#ifdef __ia64__
|
|
||||||
/* On IA-64, the buffer size is 16k, not 8k */
|
|
||||||
#define YY_READ_BUF_SIZE 16384
|
|
||||||
#else
|
|
||||||
#define YY_READ_BUF_SIZE 8192
|
#define YY_READ_BUF_SIZE 8192
|
||||||
#endif /* __ia64__ */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Copy whatever the last rule matched to the standard output. */
|
/* Copy whatever the last rule matched to the standard output. */
|
||||||
|
@ -683,7 +649,7 @@ static int input (void );
|
||||||
/* This used to be an fputs(), but since the string might contain NUL's,
|
/* This used to be an fputs(), but since the string might contain NUL's,
|
||||||
* we now use fwrite().
|
* we now use fwrite().
|
||||||
*/
|
*/
|
||||||
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
|
#define ECHO fwrite( yytext, yyleng, 1, yyout )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
||||||
|
@ -694,7 +660,7 @@ static int input (void );
|
||||||
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
||||||
{ \
|
{ \
|
||||||
int c = '*'; \
|
int c = '*'; \
|
||||||
size_t n; \
|
yy_size_t n; \
|
||||||
for ( n = 0; n < max_size && \
|
for ( n = 0; n < max_size && \
|
||||||
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
||||||
buf[n] = (char) c; \
|
buf[n] = (char) c; \
|
||||||
|
@ -762,7 +728,7 @@ extern int yylex (void);
|
||||||
|
|
||||||
/* Code executed at the end of each rule. */
|
/* Code executed at the end of each rule. */
|
||||||
#ifndef YY_BREAK
|
#ifndef YY_BREAK
|
||||||
#define YY_BREAK /*LINTED*/break;
|
#define YY_BREAK break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define YY_RULE_SETUP \
|
#define YY_RULE_SETUP \
|
||||||
|
@ -772,10 +738,15 @@ extern int yylex (void);
|
||||||
*/
|
*/
|
||||||
YY_DECL
|
YY_DECL
|
||||||
{
|
{
|
||||||
yy_state_type yy_current_state;
|
register yy_state_type yy_current_state;
|
||||||
char *yy_cp, *yy_bp;
|
register char *yy_cp, *yy_bp;
|
||||||
int yy_act;
|
register int yy_act;
|
||||||
|
|
||||||
|
#line 67 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
|
|
||||||
|
|
||||||
|
#line 749 "tars.lex.cpp"
|
||||||
|
|
||||||
if ( !(yy_init) )
|
if ( !(yy_init) )
|
||||||
{
|
{
|
||||||
(yy_init) = 1;
|
(yy_init) = 1;
|
||||||
|
@ -802,13 +773,7 @@ YY_DECL
|
||||||
yy_load_buffer_state( );
|
yy_load_buffer_state( );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
while ( 1 ) /* loops until end-of-file is reached */
|
||||||
#line 63 "tars.l"
|
|
||||||
|
|
||||||
|
|
||||||
#line 810 "tars.lex.cpp"
|
|
||||||
|
|
||||||
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
|
|
||||||
{
|
{
|
||||||
yy_cp = (yy_c_buf_p);
|
yy_cp = (yy_c_buf_p);
|
||||||
|
|
||||||
|
@ -824,7 +789,7 @@ YY_DECL
|
||||||
yy_match:
|
yy_match:
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
|
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
|
||||||
if ( yy_accept[yy_current_state] )
|
if ( yy_accept[yy_current_state] )
|
||||||
{
|
{
|
||||||
(yy_last_accepting_state) = yy_current_state;
|
(yy_last_accepting_state) = yy_current_state;
|
||||||
|
@ -875,12 +840,12 @@ do_action: /* This label is used only to access EOF actions. */
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 65 "tars.l"
|
#line 69 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{ BEGIN(INCL); }
|
{ BEGIN(INCL); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 2:
|
case 2:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 67 "tars.l"
|
#line 71 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
if ( include_file_stack_ptr >= MAX_INCLUDE_DEPTH )
|
if ( include_file_stack_ptr >= MAX_INCLUDE_DEPTH )
|
||||||
{
|
{
|
||||||
|
@ -913,7 +878,7 @@ YY_RULE_SETUP
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case YY_STATE_EOF(INITIAL):
|
case YY_STATE_EOF(INITIAL):
|
||||||
case YY_STATE_EOF(INCL):
|
case YY_STATE_EOF(INCL):
|
||||||
#line 97 "tars.l"
|
#line 101 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
--include_file_stack_ptr;
|
--include_file_stack_ptr;
|
||||||
if ( include_file_stack_ptr < 0 )
|
if ( include_file_stack_ptr < 0 )
|
||||||
|
@ -932,18 +897,18 @@ case YY_STATE_EOF(INCL):
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 3:
|
case 3:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 113 "tars.l"
|
#line 117 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
return TARS_SCOPE_DELIMITER;
|
return TARS_SCOPE_DELIMITER;
|
||||||
}
|
}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 4:
|
case 4:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 117 "tars.l"
|
#line 121 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
// C++的注释风格
|
// C++ comment
|
||||||
bool end = false;
|
bool e = false;
|
||||||
while(!end)
|
while(!e)
|
||||||
{
|
{
|
||||||
int input = yyinput();
|
int input = yyinput();
|
||||||
if(input == '\n')
|
if(input == '\n')
|
||||||
|
@ -953,19 +918,19 @@ YY_RULE_SETUP
|
||||||
|
|
||||||
if(input == '\n' || input == EOF)
|
if(input == '\n' || input == EOF)
|
||||||
{
|
{
|
||||||
end = true;
|
e = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 5:
|
case 5:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 135 "tars.l"
|
#line 139 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
// C的注释风格
|
// C comment
|
||||||
bool end = false;
|
bool e = false;
|
||||||
string comment = yytext + 2;
|
string comment = yytext + 2;
|
||||||
while(!end)
|
while(!e)
|
||||||
{
|
{
|
||||||
int input = yyinput();
|
int input = yyinput();
|
||||||
switch(input)
|
switch(input)
|
||||||
|
@ -975,7 +940,7 @@ YY_RULE_SETUP
|
||||||
int nextInput = yyinput();
|
int nextInput = yyinput();
|
||||||
if(nextInput == '/')
|
if(nextInput == '/')
|
||||||
{
|
{
|
||||||
end = true;
|
e = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -992,9 +957,8 @@ YY_RULE_SETUP
|
||||||
}
|
}
|
||||||
case EOF:
|
case EOF:
|
||||||
{
|
{
|
||||||
//到文件尾部, 但是没有出现*/
|
|
||||||
g_parse->error("EOF in comment");
|
g_parse->error("EOF in comment");
|
||||||
end = true;
|
e = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -1006,13 +970,13 @@ YY_RULE_SETUP
|
||||||
}
|
}
|
||||||
if(comment[0] == '*')
|
if(comment[0] == '*')
|
||||||
{
|
{
|
||||||
//注释内容暂时未处理
|
//todo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 6:
|
case 6:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 184 "tars.l"
|
#line 187 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
StringGrammarPtr ident = new StringGrammar;
|
StringGrammarPtr ident = new StringGrammar;
|
||||||
ident->v = yytext;
|
ident->v = yytext;
|
||||||
|
@ -1023,7 +987,7 @@ YY_RULE_SETUP
|
||||||
case 7:
|
case 7:
|
||||||
/* rule 7 can match eol */
|
/* rule 7 can match eol */
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 191 "tars.l"
|
#line 194 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
StringGrammarPtr ident = new StringGrammar;
|
StringGrammarPtr ident = new StringGrammar;
|
||||||
ident->v = yytext;
|
ident->v = yytext;
|
||||||
|
@ -1036,18 +1000,18 @@ YY_RULE_SETUP
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 8:
|
case 8:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 201 "tars.l"
|
#line 204 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
StringGrammarPtr str = new StringGrammar;
|
StringGrammarPtr str = new StringGrammar;
|
||||||
bool end = false;
|
bool e = false;
|
||||||
while(!end)
|
while(!e)
|
||||||
{
|
{
|
||||||
int input = yyinput();
|
int input = yyinput();
|
||||||
switch(input)
|
switch(input)
|
||||||
{
|
{
|
||||||
case '"':
|
case '"':
|
||||||
{
|
{
|
||||||
end = true;
|
e = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '\n':
|
case '\n':
|
||||||
|
@ -1151,7 +1115,7 @@ YY_RULE_SETUP
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 9:
|
case 9:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 313 "tars.l"
|
#line 316 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
errno = 0;
|
errno = 0;
|
||||||
IntergerGrammarPtr ptr = new IntergerGrammar;
|
IntergerGrammarPtr ptr = new IntergerGrammar;
|
||||||
|
@ -1159,10 +1123,10 @@ YY_RULE_SETUP
|
||||||
|
|
||||||
string value = yytext;
|
string value = yytext;
|
||||||
const char* beg = value.c_str();
|
const char* beg = value.c_str();
|
||||||
char* end = 0;
|
char* e = 0;
|
||||||
|
|
||||||
ptr->v = strtoll(beg, &end, 0);
|
ptr->v = strtoll(beg, &e, 0);
|
||||||
if(!(errno == 0 && beg != end))
|
if(!(errno == 0 && beg != e))
|
||||||
{
|
{
|
||||||
assert(ptr->v != 0);
|
assert(ptr->v != 0);
|
||||||
string err = "integer constant `";
|
string err = "integer constant `";
|
||||||
|
@ -1176,7 +1140,7 @@ YY_RULE_SETUP
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 10:
|
case 10:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 335 "tars.l"
|
#line 338 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
errno = 0;
|
errno = 0;
|
||||||
FloatGrammarPtr ptr = new FloatGrammar;
|
FloatGrammarPtr ptr = new FloatGrammar;
|
||||||
|
@ -1211,7 +1175,7 @@ YY_RULE_SETUP
|
||||||
case 11:
|
case 11:
|
||||||
/* rule 11 can match eol */
|
/* rule 11 can match eol */
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 366 "tars.l"
|
#line 369 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
if(yytext[0] == '\n')
|
if(yytext[0] == '\n')
|
||||||
{
|
{
|
||||||
|
@ -1221,7 +1185,7 @@ YY_RULE_SETUP
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 12:
|
case 12:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 373 "tars.l"
|
#line 376 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
{
|
{
|
||||||
if(yytext[0] < 32 || yytext[0] > 126)
|
if(yytext[0] < 32 || yytext[0] > 126)
|
||||||
{
|
{
|
||||||
|
@ -1240,10 +1204,10 @@ YY_RULE_SETUP
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 13:
|
case 13:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 389 "tars.l"
|
#line 392 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
ECHO;
|
ECHO;
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
#line 1247 "tars.lex.cpp"
|
#line 1211 "tars.lex.cpp"
|
||||||
|
|
||||||
case YY_END_OF_BUFFER:
|
case YY_END_OF_BUFFER:
|
||||||
{
|
{
|
||||||
|
@ -1372,7 +1336,6 @@ ECHO;
|
||||||
"fatal flex scanner internal error--no action found" );
|
"fatal flex scanner internal error--no action found" );
|
||||||
} /* end of action switch */
|
} /* end of action switch */
|
||||||
} /* end of scanning one token */
|
} /* end of scanning one token */
|
||||||
} /* end of user's declarations */
|
|
||||||
} /* end of yylex */
|
} /* end of yylex */
|
||||||
|
|
||||||
/* yy_get_next_buffer - try to read in a new buffer
|
/* yy_get_next_buffer - try to read in a new buffer
|
||||||
|
@ -1384,9 +1347,9 @@ ECHO;
|
||||||
*/
|
*/
|
||||||
static int yy_get_next_buffer (void)
|
static int yy_get_next_buffer (void)
|
||||||
{
|
{
|
||||||
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
|
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
|
||||||
char *source = (yytext_ptr);
|
register char *source = (yytext_ptr);
|
||||||
yy_size_t number_to_move, i;
|
register int number_to_move, i;
|
||||||
int ret_val;
|
int ret_val;
|
||||||
|
|
||||||
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
|
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
|
||||||
|
@ -1415,7 +1378,7 @@ static int yy_get_next_buffer (void)
|
||||||
/* Try to read more data. */
|
/* Try to read more data. */
|
||||||
|
|
||||||
/* First move last chars to start of buffer. */
|
/* First move last chars to start of buffer. */
|
||||||
number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
|
number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
|
||||||
|
|
||||||
for ( i = 0; i < number_to_move; ++i )
|
for ( i = 0; i < number_to_move; ++i )
|
||||||
*(dest++) = *(source++);
|
*(dest++) = *(source++);
|
||||||
|
@ -1435,7 +1398,7 @@ static int yy_get_next_buffer (void)
|
||||||
{ /* Not enough room in the buffer - grow it. */
|
{ /* Not enough room in the buffer - grow it. */
|
||||||
|
|
||||||
/* just a shorter name for the current buffer */
|
/* just a shorter name for the current buffer */
|
||||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
|
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
|
||||||
|
|
||||||
int yy_c_buf_p_offset =
|
int yy_c_buf_p_offset =
|
||||||
(int) ((yy_c_buf_p) - b->yy_ch_buf);
|
(int) ((yy_c_buf_p) - b->yy_ch_buf);
|
||||||
|
@ -1497,9 +1460,9 @@ static int yy_get_next_buffer (void)
|
||||||
else
|
else
|
||||||
ret_val = EOB_ACT_CONTINUE_SCAN;
|
ret_val = EOB_ACT_CONTINUE_SCAN;
|
||||||
|
|
||||||
if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
|
if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
|
||||||
/* Extend the array by 50%, plus the number we really need. */
|
/* Extend the array by 50%, plus the number we really need. */
|
||||||
int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
|
yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
|
||||||
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
|
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
|
||||||
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
||||||
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
|
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
|
||||||
|
@ -1518,14 +1481,14 @@ static int yy_get_next_buffer (void)
|
||||||
|
|
||||||
static yy_state_type yy_get_previous_state (void)
|
static yy_state_type yy_get_previous_state (void)
|
||||||
{
|
{
|
||||||
yy_state_type yy_current_state;
|
register yy_state_type yy_current_state;
|
||||||
char *yy_cp;
|
register char *yy_cp;
|
||||||
|
|
||||||
yy_current_state = (yy_start);
|
yy_current_state = (yy_start);
|
||||||
|
|
||||||
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
|
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);
|
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
|
||||||
if ( yy_accept[yy_current_state] )
|
if ( yy_accept[yy_current_state] )
|
||||||
{
|
{
|
||||||
(yy_last_accepting_state) = yy_current_state;
|
(yy_last_accepting_state) = yy_current_state;
|
||||||
|
@ -1550,10 +1513,10 @@ static int yy_get_next_buffer (void)
|
||||||
*/
|
*/
|
||||||
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
|
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
|
||||||
{
|
{
|
||||||
int yy_is_jam;
|
register int yy_is_jam;
|
||||||
char *yy_cp = (yy_c_buf_p);
|
register char *yy_cp = (yy_c_buf_p);
|
||||||
|
|
||||||
YY_CHAR yy_c = 1;
|
register YY_CHAR yy_c = 1;
|
||||||
if ( yy_accept[yy_current_state] )
|
if ( yy_accept[yy_current_state] )
|
||||||
{
|
{
|
||||||
(yy_last_accepting_state) = yy_current_state;
|
(yy_last_accepting_state) = yy_current_state;
|
||||||
|
@ -1568,14 +1531,12 @@ static int yy_get_next_buffer (void)
|
||||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||||
yy_is_jam = (yy_current_state == 51);
|
yy_is_jam = (yy_current_state == 51);
|
||||||
|
|
||||||
return yy_is_jam ? 0 : yy_current_state;
|
return yy_is_jam ? 0 : yy_current_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef YY_NO_UNPUT
|
static void yyunput (int c, register char * yy_bp )
|
||||||
|
|
||||||
static void yyunput (int c, char * yy_bp )
|
|
||||||
{
|
{
|
||||||
char *yy_cp;
|
register char *yy_cp;
|
||||||
|
|
||||||
yy_cp = (yy_c_buf_p);
|
yy_cp = (yy_c_buf_p);
|
||||||
|
|
||||||
|
@ -1585,10 +1546,10 @@ static int yy_get_next_buffer (void)
|
||||||
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
|
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
|
||||||
{ /* need to shift things up to make room */
|
{ /* need to shift things up to make room */
|
||||||
/* +2 for EOB chars. */
|
/* +2 for EOB chars. */
|
||||||
yy_size_t number_to_move = (yy_n_chars) + 2;
|
register yy_size_t number_to_move = (yy_n_chars) + 2;
|
||||||
char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
|
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
|
||||||
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
|
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
|
||||||
char *source =
|
register char *source =
|
||||||
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
|
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
|
||||||
|
|
||||||
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
||||||
|
@ -1614,8 +1575,6 @@ static int yy_get_next_buffer (void)
|
||||||
(yy_c_buf_p) = yy_cp;
|
(yy_c_buf_p) = yy_cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef YY_NO_INPUT
|
#ifndef YY_NO_INPUT
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
static int yyinput (void)
|
static int yyinput (void)
|
||||||
|
@ -1664,7 +1623,7 @@ static int yy_get_next_buffer (void)
|
||||||
case EOB_ACT_END_OF_FILE:
|
case EOB_ACT_END_OF_FILE:
|
||||||
{
|
{
|
||||||
if ( yywrap( ) )
|
if ( yywrap( ) )
|
||||||
return EOF;
|
return 0;
|
||||||
|
|
||||||
if ( ! (yy_did_buffer_switch_on_eof) )
|
if ( ! (yy_did_buffer_switch_on_eof) )
|
||||||
YY_NEW_FILE;
|
YY_NEW_FILE;
|
||||||
|
@ -1770,7 +1729,7 @@ static void yy_load_buffer_state (void)
|
||||||
if ( ! b )
|
if ( ! b )
|
||||||
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
||||||
|
|
||||||
b->yy_buf_size = (yy_size_t)size;
|
b->yy_buf_size = size;
|
||||||
|
|
||||||
/* yy_ch_buf has to be 2 characters longer than the size given because
|
/* yy_ch_buf has to be 2 characters longer than the size given because
|
||||||
* we need to put in 2 end-of-buffer characters.
|
* we need to put in 2 end-of-buffer characters.
|
||||||
|
@ -1805,6 +1764,10 @@ static void yy_load_buffer_state (void)
|
||||||
yyfree((void *) b );
|
yyfree((void *) b );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
|
extern int isatty (int );
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
/* Initializes or reinitializes a buffer.
|
/* Initializes or reinitializes a buffer.
|
||||||
* This function is sometimes called more than once on the same buffer,
|
* This function is sometimes called more than once on the same buffer,
|
||||||
* such as during a yyrestart() or at EOF.
|
* such as during a yyrestart() or at EOF.
|
||||||
|
@ -1925,7 +1888,7 @@ static void yyensure_buffer_stack (void)
|
||||||
* scanner will even need a stack. We use 2 instead of 1 to avoid an
|
* scanner will even need a stack. We use 2 instead of 1 to avoid an
|
||||||
* immediate realloc on the next call.
|
* immediate realloc on the next call.
|
||||||
*/
|
*/
|
||||||
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
|
num_to_alloc = 1;
|
||||||
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
|
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
|
||||||
(num_to_alloc * sizeof(struct yy_buffer_state*)
|
(num_to_alloc * sizeof(struct yy_buffer_state*)
|
||||||
);
|
);
|
||||||
|
@ -1942,7 +1905,7 @@ static void yyensure_buffer_stack (void)
|
||||||
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
|
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
|
||||||
|
|
||||||
/* Increase the buffer to prepare for a possible push. */
|
/* Increase the buffer to prepare for a possible push. */
|
||||||
yy_size_t grow_size = 8 /* arbitrary grow size */;
|
int grow_size = 8 /* arbitrary grow size */;
|
||||||
|
|
||||||
num_to_alloc = (yy_buffer_stack_max) + grow_size;
|
num_to_alloc = (yy_buffer_stack_max) + grow_size;
|
||||||
(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
|
(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
|
||||||
|
@ -2009,8 +1972,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
|
||||||
|
|
||||||
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
|
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
|
||||||
* scan from a @e copy of @a bytes.
|
* scan from a @e copy of @a bytes.
|
||||||
* @param yybytes the byte buffer to scan
|
* @param bytes the byte buffer to scan
|
||||||
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
|
* @param len the number of bytes in the buffer pointed to by @a bytes.
|
||||||
*
|
*
|
||||||
* @return the newly allocated buffer state object.
|
* @return the newly allocated buffer state object.
|
||||||
*/
|
*/
|
||||||
|
@ -2018,8 +1981,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
|
||||||
{
|
{
|
||||||
YY_BUFFER_STATE b;
|
YY_BUFFER_STATE b;
|
||||||
char *buf;
|
char *buf;
|
||||||
yy_size_t n;
|
yy_size_t n, i;
|
||||||
yy_size_t i;
|
|
||||||
|
|
||||||
/* Get memory for full buffer, including space for trailing EOB's. */
|
/* Get memory for full buffer, including space for trailing EOB's. */
|
||||||
n = _yybytes_len + 2;
|
n = _yybytes_len + 2;
|
||||||
|
@ -2050,7 +2012,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
|
||||||
|
|
||||||
static void yy_fatal_error (yyconst char* msg )
|
static void yy_fatal_error (yyconst char* msg )
|
||||||
{
|
{
|
||||||
(void) fprintf( stderr, "%s\n", msg );
|
(void) fprintf( stderr, "%s\n", msg );
|
||||||
exit( YY_EXIT_FAILURE );
|
exit( YY_EXIT_FAILURE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2116,29 +2078,29 @@ char *yyget_text (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set the current line number.
|
/** Set the current line number.
|
||||||
* @param _line_number line number
|
* @param line_number
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void yyset_lineno (int _line_number )
|
void yyset_lineno (int line_number )
|
||||||
{
|
{
|
||||||
|
|
||||||
yylineno = _line_number;
|
yylineno = line_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set the input stream. This does not discard the current
|
/** Set the input stream. This does not discard the current
|
||||||
* input buffer.
|
* input buffer.
|
||||||
* @param _in_str A readable stream.
|
* @param in_str A readable stream.
|
||||||
*
|
*
|
||||||
* @see yy_switch_to_buffer
|
* @see yy_switch_to_buffer
|
||||||
*/
|
*/
|
||||||
void yyset_in (FILE * _in_str )
|
void yyset_in (FILE * in_str )
|
||||||
{
|
{
|
||||||
yyin = _in_str ;
|
yyin = in_str ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void yyset_out (FILE * _out_str )
|
void yyset_out (FILE * out_str )
|
||||||
{
|
{
|
||||||
yyout = _out_str ;
|
yyout = out_str ;
|
||||||
}
|
}
|
||||||
|
|
||||||
int yyget_debug (void)
|
int yyget_debug (void)
|
||||||
|
@ -2146,9 +2108,9 @@ int yyget_debug (void)
|
||||||
return yy_flex_debug;
|
return yy_flex_debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
void yyset_debug (int _bdebug )
|
void yyset_debug (int bdebug )
|
||||||
{
|
{
|
||||||
yy_flex_debug = _bdebug ;
|
yy_flex_debug = bdebug ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int yy_init_globals (void)
|
static int yy_init_globals (void)
|
||||||
|
@ -2211,8 +2173,7 @@ int yylex_destroy (void)
|
||||||
#ifndef yytext_ptr
|
#ifndef yytext_ptr
|
||||||
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
|
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
|
||||||
{
|
{
|
||||||
|
register int i;
|
||||||
int i;
|
|
||||||
for ( i = 0; i < n; ++i )
|
for ( i = 0; i < n; ++i )
|
||||||
s1[i] = s2[i];
|
s1[i] = s2[i];
|
||||||
}
|
}
|
||||||
|
@ -2221,7 +2182,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
|
||||||
#ifdef YY_NEED_STRLEN
|
#ifdef YY_NEED_STRLEN
|
||||||
static int yy_flex_strlen (yyconst char * s )
|
static int yy_flex_strlen (yyconst char * s )
|
||||||
{
|
{
|
||||||
int n;
|
register int n;
|
||||||
for ( n = 0; s[n]; ++n )
|
for ( n = 0; s[n]; ++n )
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -2231,12 +2192,11 @@ static int yy_flex_strlen (yyconst char * s )
|
||||||
|
|
||||||
void *yyalloc (yy_size_t size )
|
void *yyalloc (yy_size_t size )
|
||||||
{
|
{
|
||||||
return (void *) malloc( size );
|
return (void *) malloc( size );
|
||||||
}
|
}
|
||||||
|
|
||||||
void *yyrealloc (void * ptr, yy_size_t size )
|
void *yyrealloc (void * ptr, yy_size_t size )
|
||||||
{
|
{
|
||||||
|
|
||||||
/* The cast to (char *) in the following accommodates both
|
/* The cast to (char *) in the following accommodates both
|
||||||
* implementations that use char* generic pointers, and those
|
* implementations that use char* generic pointers, and those
|
||||||
* that use void* generic pointers. It works with the latter
|
* that use void* generic pointers. It works with the latter
|
||||||
|
@ -2249,12 +2209,12 @@ void *yyrealloc (void * ptr, yy_size_t size )
|
||||||
|
|
||||||
void yyfree (void * ptr )
|
void yyfree (void * ptr )
|
||||||
{
|
{
|
||||||
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
|
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YYTABLES_NAME "yytables"
|
#define YYTABLES_NAME "yytables"
|
||||||
|
|
||||||
#line 389 "tars.l"
|
#line 392 "/Volumes/MyData/centos/TarsCloud/framework/tarscpp/tools/tarsgrammar/tars.l"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,13 +1,14 @@
|
||||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
/* A Bison parser, made by GNU Bison 2.3. */
|
||||||
|
|
||||||
/* Bison interface for Yacc-like parsers in C
|
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||||
|
|
||||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
(at your option) any later version.
|
any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
@ -15,7 +16,9 @@
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
/* As a special exception, you may create a larger work that contains
|
/* As a special exception, you may create a larger work that contains
|
||||||
part or all of the Bison parser skeleton and distribute that work
|
part or all of the Bison parser skeleton and distribute that work
|
||||||
|
@ -30,65 +33,87 @@
|
||||||
This special exception was added by the Free Software Foundation in
|
This special exception was added by the Free Software Foundation in
|
||||||
version 2.2 of Bison. */
|
version 2.2 of Bison. */
|
||||||
|
|
||||||
#ifndef YY_YY_TARS_TAB_HPP_INCLUDED
|
/* Tokens. */
|
||||||
# define YY_YY_TARS_TAB_HPP_INCLUDED
|
|
||||||
/* Debug traces. */
|
|
||||||
#ifndef YYDEBUG
|
|
||||||
# define YYDEBUG 1
|
|
||||||
#endif
|
|
||||||
#if YYDEBUG
|
|
||||||
extern int yydebug;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Token type. */
|
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
enum yytokentype
|
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||||
{
|
know about them. */
|
||||||
TARS_VOID = 258,
|
enum yytokentype {
|
||||||
TARS_STRUCT = 259,
|
TARS_VOID = 258,
|
||||||
TARS_BOOL = 260,
|
TARS_STRUCT = 259,
|
||||||
TARS_BYTE = 261,
|
TARS_BOOL = 260,
|
||||||
TARS_SHORT = 262,
|
TARS_BYTE = 261,
|
||||||
TARS_INT = 263,
|
TARS_SHORT = 262,
|
||||||
TARS_DOUBLE = 264,
|
TARS_INT = 263,
|
||||||
TARS_FLOAT = 265,
|
TARS_DOUBLE = 264,
|
||||||
TARS_LONG = 266,
|
TARS_FLOAT = 265,
|
||||||
TARS_STRING = 267,
|
TARS_LONG = 266,
|
||||||
TARS_VECTOR = 268,
|
TARS_STRING = 267,
|
||||||
TARS_MAP = 269,
|
TARS_VECTOR = 268,
|
||||||
TARS_NAMESPACE = 270,
|
TARS_MAP = 269,
|
||||||
TARS_INTERFACE = 271,
|
TARS_NAMESPACE = 270,
|
||||||
TARS_IDENTIFIER = 272,
|
TARS_INTERFACE = 271,
|
||||||
TARS_OUT = 273,
|
TARS_IDENTIFIER = 272,
|
||||||
TARS_OP = 274,
|
TARS_OUT = 273,
|
||||||
TARS_KEY = 275,
|
TARS_OP = 274,
|
||||||
TARS_ROUTE_KEY = 276,
|
TARS_KEY = 275,
|
||||||
TARS_REQUIRE = 277,
|
TARS_ROUTE_KEY = 276,
|
||||||
TARS_OPTIONAL = 278,
|
TARS_REQUIRE = 277,
|
||||||
TARS_CONST_INTEGER = 279,
|
TARS_OPTIONAL = 278,
|
||||||
TARS_CONST_FLOAT = 280,
|
TARS_CONST_INTEGER = 279,
|
||||||
TARS_FALSE = 281,
|
TARS_CONST_FLOAT = 280,
|
||||||
TARS_TRUE = 282,
|
TARS_FALSE = 281,
|
||||||
TARS_STRING_LITERAL = 283,
|
TARS_TRUE = 282,
|
||||||
TARS_SCOPE_DELIMITER = 284,
|
TARS_STRING_LITERAL = 283,
|
||||||
TARS_CONST = 285,
|
TARS_SCOPE_DELIMITER = 284,
|
||||||
TARS_ENUM = 286,
|
TARS_CONST = 285,
|
||||||
TARS_UNSIGNED = 287,
|
TARS_ENUM = 286,
|
||||||
BAD_CHAR = 288
|
TARS_UNSIGNED = 287,
|
||||||
};
|
BAD_CHAR = 288
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
/* Tokens. */
|
||||||
|
#define TARS_VOID 258
|
||||||
|
#define TARS_STRUCT 259
|
||||||
|
#define TARS_BOOL 260
|
||||||
|
#define TARS_BYTE 261
|
||||||
|
#define TARS_SHORT 262
|
||||||
|
#define TARS_INT 263
|
||||||
|
#define TARS_DOUBLE 264
|
||||||
|
#define TARS_FLOAT 265
|
||||||
|
#define TARS_LONG 266
|
||||||
|
#define TARS_STRING 267
|
||||||
|
#define TARS_VECTOR 268
|
||||||
|
#define TARS_MAP 269
|
||||||
|
#define TARS_NAMESPACE 270
|
||||||
|
#define TARS_INTERFACE 271
|
||||||
|
#define TARS_IDENTIFIER 272
|
||||||
|
#define TARS_OUT 273
|
||||||
|
#define TARS_OP 274
|
||||||
|
#define TARS_KEY 275
|
||||||
|
#define TARS_ROUTE_KEY 276
|
||||||
|
#define TARS_REQUIRE 277
|
||||||
|
#define TARS_OPTIONAL 278
|
||||||
|
#define TARS_CONST_INTEGER 279
|
||||||
|
#define TARS_CONST_FLOAT 280
|
||||||
|
#define TARS_FALSE 281
|
||||||
|
#define TARS_TRUE 282
|
||||||
|
#define TARS_STRING_LITERAL 283
|
||||||
|
#define TARS_SCOPE_DELIMITER 284
|
||||||
|
#define TARS_CONST 285
|
||||||
|
#define TARS_ENUM 286
|
||||||
|
#define TARS_UNSIGNED 287
|
||||||
|
#define BAD_CHAR 288
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Value type. */
|
|
||||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||||
typedef int YYSTYPE;
|
typedef int YYSTYPE;
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
extern YYSTYPE yylval;
|
extern YYSTYPE yylval;
|
||||||
|
|
||||||
int yyparse (void);
|
|
||||||
|
|
||||||
#endif /* !YY_YY_TARS_TAB_HPP_INCLUDED */
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/**
|
||||||
* Tencent is pleased to support the open source community by making Tars available.
|
* Tencent is pleased to support the open source community by making Tars available.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
|
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/**
|
||||||
* Tencent is pleased to support the open source community by making Tars available.
|
* Tencent is pleased to support the open source community by making Tars available.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
|
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/**
|
||||||
* Tencent is pleased to support the open source community by making Tars available.
|
* Tencent is pleased to support the open source community by making Tars available.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
|
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
|
||||||
|
@ -600,4 +600,32 @@ string TarsParse::printHeaderRemark()
|
||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string TarsParse::getFileName(const string &fileName)
|
||||||
|
{
|
||||||
|
string tmpFileName = fileName;
|
||||||
|
string::size_type pos = tmpFileName.rfind('/');
|
||||||
|
if(pos != string::npos)
|
||||||
|
{
|
||||||
|
tmpFileName = tmpFileName.substr(pos + 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pos = tmpFileName.rfind('\\');
|
||||||
|
if(pos != string::npos)
|
||||||
|
{
|
||||||
|
tmpFileName = tmpFileName.substr(pos + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tars::TC_File::excludeFileExt(tmpFileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
string TarsParse::replaceFileName(const string &fileName, const string &ext)
|
||||||
|
{
|
||||||
|
return tars::TC_File::excludeFileExt(getFileName(fileName)) + "." + ext;
|
||||||
|
}
|
||||||
|
|
||||||
|
string TarsParse::getAbsoluteFileName(const string &baseDir, const string &fileName)
|
||||||
|
{
|
||||||
|
return baseDir + FILE_SEP + fileName;
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/**
|
||||||
* Tencent is pleased to support the open source community by making Tars available.
|
* Tencent is pleased to support the open source community by making Tars available.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
|
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
|
||||||
|
@ -309,7 +309,7 @@ public:
|
||||||
|
|
||||||
* 设置include的tars文件全部从当前文件搜寻
|
* 设置include的tars文件全部从当前文件搜寻
|
||||||
*/
|
*/
|
||||||
void setUseCurrentPath(const bool & bEnable) { _bUseCurrentPath = bEnable; }
|
void setUseCurrentPath(bool bEnable) { _bUseCurrentPath = bEnable; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找tars文件时,设置include路径
|
* 查找tars文件时,设置include路径
|
||||||
|
@ -321,6 +321,29 @@ public:
|
||||||
_vIncludePath.insert(_vIncludePath.end(), v.begin(), v.end());
|
_vIncludePath.insert(_vIncludePath.end(), v.begin(), v.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param fileName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
string getFileName(const string &fileName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* replace ext
|
||||||
|
* @param fileName
|
||||||
|
* @param ext
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
string replaceFileName(const string &fileName, const string &ext);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get absolute filename
|
||||||
|
* @param baseDir
|
||||||
|
* @param fileName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
string getAbsoluteFileName(const string &baseDir, const string &fileName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* 添加名字空间
|
* 添加名字空间
|
||||||
|
|
Loading…
Reference in New Issue
Block a user