#define yyconst
#endif
+#undef YY_USE_PROTOS
+#define YY_USE_PROTOS
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE yyrestart( yyin TSRMLS_CC )
#define YY_END_OF_BUFFER_CHAR 0
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
} \
while ( 0 )
-#define unput(c) yyunput( c, yytext_ptr )
+#define unput(c) yyunput( c, yytext_ptr TSRMLS_CC )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
};
%- Standard (non-C++) definition
-static YY_BUFFER_STATE yy_current_buffer = 0;
+#define yy_current_buffer SCNG(current_buffer)
%*
/* We provide macros for accessing buffer states in case in the
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 */
+#define yy_c_buf_p SCNG(c_buf_p)
+#define yy_init SCNG(init)
+#define yy_start SCNG(start)
+
+#ifdef ZTS
+#define TSRMLS_D void ***tsrm_ls
+#define TSRMLS_DC , TSRMLS_D
+#define TSRMLS_C tsrm_ls
+#define TSRMLS_CC , TSRMLS_C
+#else
+#define TSRMLS_D
+#define TSRMLS_DC
+#define TSRMLS_C
+#define TSRMLS_CC
+#endif
/* 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 yyrestart YY_PROTO(( FILE *input_file TSRMLS_DC ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer TSRMLS_DC ));
+void yy_load_buffer_state YY_PROTO(( TSRMLS_D ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size TSRMLS_DC ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b TSRMLS_DC ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file TSRMLS_DC ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b TSRMLS_DC ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer TSRMLS_CC )
-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 TSRMLS_DC ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str TSRMLS_DC ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len TSRMLS_DC ));
-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 ));
#define yy_set_interactive(is_interactive) \
{ \
if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer = yy_create_buffer( SCNG(yyin), YY_BUF_SIZE TSRMLS_CC ); \
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_create_buffer( SCNG(yyin), YY_BUF_SIZE TSRMLS_CC ); \
yy_current_buffer->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
+#ifdef ZTS
+#undef yyleng
+#define yyleng SCNG(yy_leng)
+#undef yytext
+#define yytext SCNG(yy_text)
+#undef yytext_ptr
+#define yytext_ptr SCNG(yy_text)
+#endif
+
%- Standard (non-C++) definition
-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 yy_state_type yy_get_previous_state YY_PROTO(( TSRMLS_D ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state TSRMLS_DC ));
+static int yy_get_next_buffer YY_PROTO(( TSRMLS_D ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
%*
+#undef TSRMLS_D
+#undef TSRMLS_DC
+#undef TSRMLS_C
+#undef TSRMLS_CC
+
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
%-
#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+static void yyunput YY_PROTO(( int c, char *buf_ptr TSRMLS_DC ));
#endif
%*
#ifndef YY_NO_INPUT
%- Standard (non-C++) definition
#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
+static int 3 YY_PROTO(( TSRMLS_D ));
#else
-static int input YY_PROTO(( void ));
+static int input YY_PROTO(( TSRMLS_D ));
#endif
%*
#endif
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 ));
+static void yy_push_state YY_PROTO(( int new_state TSRMLS_DC ));
#endif
#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
+static void yy_pop_state YY_PROTO(( TSRMLS_D ));
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
/* 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 )
+#define ECHO (void) fwrite( yytext, yyleng, 1, SCNG(yyout) )
%+ C++ definition
#define ECHO LexerOutput( yytext, yyleng )
%*
%*
#endif
+
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
if ( ! yy_start )
yy_start = 1; /* first start state */
- if ( ! yyin )
+ if ( ! SCNG(yyin) )
%-
- yyin = stdin;
+ SCNG(yyin) = stdin;
%+
- yyin = &cin;
+ SCNG(yyin) = &cin;
%*
- if ( ! yyout )
+ if ( ! SCNG(yyout) )
%-
- yyout = stdout;
+ SCNG(yyout) = stdout;
%+
- yyout = &cout;
+ SCNG(yyout) = &cout;
%*
if ( ! yy_current_buffer )
yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
+ yy_create_buffer( SCNG(yyin), YY_BUF_SIZE TSRMLS_CC );
- yy_load_buffer_state();
+ yy_load_buffer_state(TSRMLS_C);
}
while ( 1 ) /* loops until end-of-file is reached */
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state(TSRMLS_C);
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* will run more slowly).
*/
- yy_next_state = yy_try_NUL_trans( yy_current_state );
+ yy_next_state = yy_try_NUL_trans( yy_current_state TSRMLS_CC );
yy_bp = yytext_ptr + YY_MORE_ADJ;
}
}
- else switch ( yy_get_next_buffer() )
+ else switch ( yy_get_next_buffer(TSRMLS_C) )
{
case EOB_ACT_END_OF_FILE:
{
yy_c_buf_p =
yytext_ptr + yy_amount_of_matched_text;
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state(TSRMLS_C);
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
yy_c_buf_p =
&yy_current_buffer->yy_ch_buf[yy_n_chars];
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state(TSRMLS_C);
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
%+
yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
{
- yyin = arg_yyin;
- yyout = arg_yyout;
+ SCNG(yyin) = arg_yyin;
+ SCNG(yyout) = arg_yyout;
yy_c_buf_p = 0;
yy_init = 1;
yy_start = 0;
yyFlexLexer::~yyFlexLexer()
{
delete yy_state_buf;
- yy_delete_buffer( yy_current_buffer );
+ yy_delete_buffer( yy_current_buffer TSRMLS_CC );
}
void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
{
if ( new_in )
{
- yy_delete_buffer( yy_current_buffer );
- yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
+ yy_delete_buffer( SCNG(yy_current_buffer TSRMLS_CC ) );
+ yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE TSRMLS_CC ) TSRMLS_CC );
}
if ( new_out )
- yyout = new_out;
+ SCNG(yyout) = new_out;
}
int yyFlexLexer::LexerInput( char* buf, int max_size )
{
- if ( yyin->eof() || yyin->fail() )
+ if ( SCNG(yyin)->eof() || SCNG(yyin)->fail() )
return 0;
if (yy_current_buffer->yy_is_interactive) {
- yyin->get( buf[0] );
+ SCNG(yyin)->get( buf[0] );
- if ( yyin->eof() )
+ if ( SCNG(yyin)->eof() )
return 0;
- if ( yyin->bad() )
+ if ( SCNG(yyin)->bad() )
return -1;
return 1;
} else {
- (void) yyin->read( buf, max_size );
+ (void) SCNG(yyin)->read( buf, max_size );
- if ( yyin->bad() )
+ if ( SCNG(yyin)->bad() )
return -1;
else
- return yyin->gcount();
+ return SCNG(yyin)->gcount();
}
}
void yyFlexLexer::LexerOutput( const char* buf, int size )
{
- (void) yyout->write( buf, size );
+ (void) SCNG(yyout)->write( buf, size );
}
%*
*/
%-
-static int yy_get_next_buffer()
+static int yy_get_next_buffer(TSRMLS_D)
%+
-int yyFlexLexer::yy_get_next_buffer()
+int yyFlexLexer::yy_get_next_buffer(TSRMLS_D)
%*
{
register char *dest = yy_current_buffer->yy_ch_buf;
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
+ yyrestart( SCNG(yyin) TSRMLS_CC );
}
else
/* yy_get_previous_state - get the state just before the EOB char was reached */
%-
-static yy_state_type yy_get_previous_state()
+static yy_state_type yy_get_previous_state(TSRMLS_D)
%+
-yy_state_type yyFlexLexer::yy_get_previous_state()
+yy_state_type yyFlexLexer::yy_get_previous_state(TSRMLS_D)
%*
{
register yy_state_type yy_current_state;
%-
#ifdef YY_USE_PROTOS
-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 TSRMLS_DC )
#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
+static yy_state_type yy_try_NUL_trans( yy_current_state TSRMLS_CC )
yy_state_type yy_current_state;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
-yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
+yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state TSRMLS_DC )
%*
{
register int yy_is_jam;
%-
#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
+static void yyunput( int c, register char *yy_bp TSRMLS_DC )
#else
-static void yyunput( c, yy_bp )
+static void yyunput( c, yy_bp TSRMLS_CC )
int c;
register char *yy_bp;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
-void yyFlexLexer::yyunput( int c, register char* yy_bp )
+void yyFlexLexer::yyunput( int c, register char* yy_bp TSRMLS_DC )
%*
{
register char *yy_cp = yy_c_buf_p;
%-
#ifdef __cplusplus
-static int yyinput()
+static int yyinput(TSRMLS_D)
#else
-static int input()
+static int input(TSRMLS_C)
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
-int yyFlexLexer::yyinput()
+int yyFlexLexer::yyinput(TSRMLS_D)
%*
{
int c;
int offset = yy_c_buf_p - yytext_ptr;
++yy_c_buf_p;
- switch ( yy_get_next_buffer() )
+ switch ( yy_get_next_buffer(TSRMLS_C) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
*/
/* Reset buffer status. */
- yyrestart( yyin );
+ yyrestart( SCNG(yyin) TSRMLS_CC );
/* fall through */
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
#ifdef __cplusplus
- return yyinput();
+ return yyinput(TSRMLS_C);
#else
- return input();
+ return input(TSRMLS_C);
#endif
}
%-
#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
+void yyrestart( FILE *input_file TSRMLS_DC )
#else
-void yyrestart( input_file )
+void yyrestart( input_file TSRMLS_CC )
FILE *input_file;
#endif
%+
-void yyFlexLexer::yyrestart( istream* input_file )
+void yyFlexLexer::yyrestart( istream* input_file TSRMLS_DC )
%*
{
if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+ yy_current_buffer = yy_create_buffer( SCNG(yyin), YY_BUF_SIZE TSRMLS_CC );
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
+ yy_init_buffer( yy_current_buffer, input_file TSRMLS_CC );
+ yy_load_buffer_state(TSRMLS_C);
}
%-
#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer TSRMLS_DC)
#else
-void yy_switch_to_buffer( new_buffer )
+void yy_switch_to_buffer( new_buffer TSRMLS_CC)
YY_BUFFER_STATE new_buffer;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
-void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer TSRMLS_DC )
%*
{
if ( yy_current_buffer == new_buffer )
}
yy_current_buffer = new_buffer;
- yy_load_buffer_state();
+ yy_load_buffer_state(TSRMLS_C);
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
%-
#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
+void yy_load_buffer_state( TSRMLS_D )
#else
-void yy_load_buffer_state()
+void yy_load_buffer_state(TSRMLS_C)
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
void yyFlexLexer::yy_load_buffer_state()
{
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;
+ SCNG(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 )
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size TSRMLS_DC )
#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
+YY_BUFFER_STATE yy_create_buffer( file, size TSRMLS_CC )
FILE *file;
int size;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
-YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
+YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size TSRMLS_DC )
%*
{
YY_BUFFER_STATE b;
b->yy_is_our_buffer = 1;
- yy_init_buffer( b, file );
+ yy_init_buffer( b, file TSRMLS_CC );
return b;
}
%-
#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
+void yy_delete_buffer( YY_BUFFER_STATE b TSRMLS_DC )
#else
-void yy_delete_buffer( b )
+void yy_delete_buffer( b TSRMLS_CC )
YY_BUFFER_STATE b;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
-void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
+void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b TSRMLS_DC )
%*
{
if ( ! b )
#endif
#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file TSRMLS_DC )
#else
-void yy_init_buffer( b, file )
+void yy_init_buffer( b, file TSRMLS_CC )
YY_BUFFER_STATE b;
FILE *file;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
extern "C" int isatty YY_PROTO(( int ));
-void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
+void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file TSRMLS_DC )
%*
{
- yy_flush_buffer( b );
+ yy_flush_buffer( b TSRMLS_CC );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
%-
#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
+void yy_flush_buffer( YY_BUFFER_STATE b TSRMLS_DC )
#else
-void yy_flush_buffer( b )
+void yy_flush_buffer( b TSRMLS_CC )
YY_BUFFER_STATE b;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
-void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
+void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b TSRMLS_DC )
%*
{
if ( ! b )
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == yy_current_buffer )
- yy_load_buffer_state();
+ yy_load_buffer_state(TSRMLS_C);
}
%*
#ifndef YY_NO_SCAN_BUFFER
%-
#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size TSRMLS_DC )
#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
+YY_BUFFER_STATE yy_scan_buffer( base, size TSRMLS_CC )
char *base;
yy_size_t size;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
{
YY_BUFFER_STATE b;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- yy_switch_to_buffer( b );
+ yy_switch_to_buffer( b TSRMLS_CC );
return b;
}
#ifndef YY_NO_SCAN_STRING
%-
#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str TSRMLS_DC )
#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
+YY_BUFFER_STATE yy_scan_string( yy_str TSRMLS_CC )
yyconst char *yy_str;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
{
int len;
for ( len = 0; yy_str[len]; ++len )
;
- return yy_scan_bytes( yy_str, len );
+ return yy_scan_bytes( yy_str, len TSRMLS_CC );
}
%*
#endif
#ifndef YY_NO_SCAN_BYTES
%-
#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len TSRMLS_DC )
#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+YY_BUFFER_STATE yy_scan_bytes( bytes, len TSRMLS_CC )
yyconst char *bytes;
int len;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
{
YY_BUFFER_STATE b;
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer( buf, n );
+ b = yy_scan_buffer( buf, n TSRMLS_CC);
if ( ! b )
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
#ifndef YY_NO_PUSH_STATE
%-
#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
+static void yy_push_state( int new_state TSRMLS_DC )
#else
-static void yy_push_state( new_state )
+static void yy_push_state( new_state TSRMLS_CC )
int new_state;
+#ifdef ZTS
+void ***tsrm_ls;
+#endif
#endif
%+
-void yyFlexLexer::yy_push_state( int new_state )
+void yyFlexLexer::yy_push_state( int new_state TSRMLS_DC )
%*
{
if ( yy_start_stack_ptr >= yy_start_stack_depth )
#ifndef YY_NO_POP_STATE
%-
-static void yy_pop_state()
+static void yy_pop_state(TSRMLS_D)
%+
-void yyFlexLexer::yy_pop_state()
+void yyFlexLexer::yy_pop_state(TSRMLS_D)
%*
{
if ( --yy_start_stack_ptr < 0 )
#include "zend_variables.h"
#include "zend_operators.h"
-#ifdef ZTS
+#ifdef __cplusplus
# include <fstream.h>
# ifdef HAVE_STDIOSTR_H
# include <stdiostr.h>
# include <unistd.h>
#endif
-#ifdef ZTS
+#ifdef __cplusplus
#define YY_DECL int ZendFlexLexer::lex_scan(zval *zendlval TSRMLS_DC)
#else
#define YY_DECL int lex_scan(zval *zendlval TSRMLS_DC)
# define MY_INPUT input
#endif
-#include "zend_istdiostream.h"
+
+/* Globals Macros */
+#define SCNG LANG_SCNG
+#ifdef ZTS
+ZEND_API ts_rsrc_id language_scanner_globals_id;
+#else
+ZEND_API zend_scanner_globals language_scanner_globals;
+#endif
+
#define YY_FATAL_ERROR zend_fatal_scanner_error
static inline void save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
{
-#ifndef ZTS
+#ifndef __cplusplus
memcpy(&lex_state->buffer_state,&YY_CURRENT_BUFFER,sizeof(YY_BUFFER_STATE));
lex_state->in = yyin;
lex_state->state = YYSTATE;
static inline void restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
{
-#ifndef ZTS
+#ifndef __cplusplus
YY_BUFFER_STATE original_buffer_state = YY_CURRENT_BUFFER;
if (lex_state->buffer_state) {
- yy_switch_to_buffer(lex_state->buffer_state);
+ yy_switch_to_buffer(lex_state->buffer_state TSRMLS_CC);
} else {
YY_CURRENT_BUFFER = NULL;
}
- yy_delete_buffer(original_buffer_state);
+ yy_delete_buffer(original_buffer_state TSRMLS_CC);
yyin = lex_state->in;
BEGIN(lex_state->state);
#else
* which doesn't really contain open files, but references to their names/paths
*/
break;
-#ifdef ZTS
+#ifdef __cplusplus
case ZEND_HANDLE_FSTREAM:
delete ((ifstream *) fh->handle.is);
break;
case ZEND_HANDLE_FP:
return fh1->handle.fp==fh2->handle.fp;
break;
-#ifdef ZTS
+#ifdef __cplusplus
case ZEND_HANDLE_FSTREAM:
case ZEND_HANDLE_STDIOSTREAM:
return fh1->handle.is==fh2->handle.is;
{
char *file_path=NULL;
-#ifndef ZTS
+#ifndef __cplusplus
switch (file_handle->type) {
case ZEND_HANDLE_FILENAME:
file_handle->handle.fp = zend_fopen(file_handle->filename, &file_handle->opened_path);
}
/* Reset the scanner for scanning the new file */
yyin = file_handle->handle.fp;
- yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
+ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC);
BEGIN(INITIAL);
#else
switch (file_handle->type) {
return retval;
}
-#ifndef ZTS
-static inline int prepare_string_for_scanning(zval *str, char *filename)
+#ifndef __cplusplus
+static inline int prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC)
#else
static inline int prepare_string_for_scanning(zval *str, istrstream **input_stream, char *filename TSRMLS_DC)
#endif
{
-#ifndef ZTS
+#ifndef __cplusplus
/* enforce two trailing NULLs for flex... */
STR_REALLOC(str->value.str.val, str->value.str.len+2);
str->value.str.val[str->value.str.len+1]=0;
yyin=NULL;
- yy_scan_buffer(str->value.str.val, str->value.str.len+2);
+ yy_scan_buffer(str->value.str.val, str->value.str.len+2 TSRMLS_CC);
#else
*input_stream = new istrstream(str->value.str.val, str->value.str.len);
CG(ZFL) = new ZendFlexLexer;
zval tmp;
int compiler_result;
zend_bool original_in_compilation = CG(in_compilation);
-#ifdef ZTS
+#ifdef __cplusplus
istrstream *input_stream;
#endif
source_string = &tmp;
save_lexical_state(&original_lex_state TSRMLS_CC);
-#ifndef ZTS
- if (prepare_string_for_scanning(source_string, filename)==FAILURE) {
+#ifndef __cplusplus
+ if (prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) {
#else
if (prepare_string_for_scanning(source_string, &input_stream, filename TSRMLS_CC)==FAILURE) {
#endif
} else {
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
CG(active_op_array) = op_array;
-#ifndef ZTS
+#ifndef __cplusplus
BEGIN(ST_IN_SCRIPTING);
#else
CG(ZFL)->BeginState(ST_IN_SCRIPTING);
}
restore_lexical_state(&original_lex_state TSRMLS_CC);
}
-#ifdef ZTS
+#ifdef __cplusplus
delete input_stream;
#endif
zval_dtor(&tmp);
{
zend_lex_state original_lex_state;
zval tmp = *str;
-#ifdef ZTS
+#ifdef __cplusplus
istrstream *input_stream;
#endif
str = &tmp;
zval_copy_ctor(str);
save_lexical_state(&original_lex_state TSRMLS_CC);
-#ifndef ZTS
- if (prepare_string_for_scanning(str, str_name)==FAILURE) {
+#ifndef __cplusplus
+ if (prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) {
#else
if (prepare_string_for_scanning(str, &input_stream, str_name TSRMLS_CC)==FAILURE) {
#endif
}
zend_highlight(syntax_highlighter_ini TSRMLS_CC);
restore_lexical_state(&original_lex_state TSRMLS_CC);
-#ifdef ZTS
+#ifdef __cplusplus
delete input_stream;
#endif
zval_dtor(str);
}
END_EXTERN_C()
-#ifdef ZTS
+#ifdef __cplusplus
BEGIN_EXTERN_C()
int lex_scan(zval *zendlval TSRMLS_DC)
{
}
<ST_IN_SCRIPTING,ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"->" {
- yy_push_state(ST_LOOKING_FOR_PROPERTY);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
return T_OBJECT_OPERATOR;
}
<ST_LOOKING_FOR_PROPERTY>{LABEL} {
- yy_pop_state();
+ yy_pop_state(TSRMLS_C);
zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
<ST_LOOKING_FOR_PROPERTY>{ANY_CHAR} {
yyless(0);
- yy_pop_state();
+ yy_pop_state(TSRMLS_C);
}
<ST_IN_SCRIPTING>"::" {
<ST_IN_SCRIPTING>"{" {
- yy_push_state(ST_IN_SCRIPTING);
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return '{';
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"${" {
- yy_push_state(ST_LOOKING_FOR_VARNAME);
+ yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
<ST_IN_SCRIPTING>"}" {
/* This is a temporary fix which is dependant on flex and it's implementation */
if (yy_start_stack_ptr) {
- yy_pop_state();
+ yy_pop_state(TSRMLS_C);
}
return '}';
}
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
- yy_pop_state();
- yy_push_state(ST_IN_SCRIPTING);
+ yy_pop_state(TSRMLS_C);
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return T_STRING_VARNAME;
}
<ST_LOOKING_FOR_VARNAME>{ANY_CHAR} {
yyless(0);
- yy_pop_state();
- yy_push_state(ST_IN_SCRIPTING);
+ yy_pop_state(TSRMLS_C);
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
zendlval->value.lval = (long) yytext[0];
- yy_push_state(ST_IN_SCRIPTING);
+ yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
}