*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+#ifdef YY_REENTRANT
+
+/* For use wherever a Global is accessed or assigned. */
+#define YY_G(var) (((struct yy_globals_t*)yy_globals)->var)
+
+/* For use in function prototypes to append the additional argument. */
+#ifdef YY_USE_PROTOS
+#define YY_LAST_ARG , void * yy_globals
+#define YY_ONLY_ARG void * yy_globals
+#else
+#define YY_LAST_ARG , yy_globals
+#define YY_ONLY_ARG yy_globals
+#define YY_DECL_LAST_ARG void * yy_globals;
+#endif
+
+/* For use in function calls to pass the additional argument. */
+#define YY_CALL_LAST_ARG , yy_globals
+#define YY_CALL_ONLY_ARG yy_globals
+
+/* For convenience. */
+#define yyin_r YY_G(yyin)
+#define yyout_r YY_G(yyout)
+#define yyextra_r YY_G(yyextra)
+#define yyleng_r YY_G(yyleng)
+#define yytext_r YY_G(yytext)
+#define yylineno_r YY_G(yylineno)
+
+int yylex_init YY_PROTO((void** scanner));
+int yylex_destroy YY_PROTO((void* scanner));
+
+#else /* not YY_REENTRANT */
+
+ /* Define these macros to be no-ops. */
+#define YY_G(var) (var)
+#define YY_LAST_ARG
+#define YY_ONLY_ARG void
+#define YY_CALL_LAST_ARG
+#define YY_CALL_ONLY_ARG
+#define YY_DECL_LAST_ARG
+#endif
+
/* 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 *
+#define BEGIN YY_G(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 YY_START ((YY_G(yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE yyrestart( YY_G(yyin) YY_CALL_LAST_ARG )
#define YY_END_OF_BUFFER_CHAR 0
typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#ifndef YY_REENTRANT
extern int yyleng;
+#endif
+
%-
+#ifndef YY_REENTRANT
extern FILE *yyin, *yyout;
+#endif
%*
#define EOB_ACT_CONTINUE_SCAN 0
do \
{ \
/* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
+ *yy_cp = YY_G(yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_G(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 )
+#define unput(c) yyunput( c, yytext_ptr YY_CALL_LAST_ARG )
/* 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
+#ifndef YY_REENTRANT
static YY_BUFFER_STATE yy_current_buffer = 0;
+#endif
%*
/* We provide macros for accessing buffer states in case in the
%- Standard (non-C++) definition
+
+#ifndef YY_REENTRANT
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
*/
static int yy_did_buffer_switch_on_eof;
-void yyrestart YY_PROTO(( FILE *input_file ));
+#endif /* end !YY_REENTRANT */
-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 )
+void yyrestart YY_PROTO(( FILE *input_file YY_LAST_ARG ));
-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 ));
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer YY_LAST_ARG ));
+void yy_load_buffer_state YY_PROTO(( YY_ONLY_ARG ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size YY_LAST_ARG ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b YY_LAST_ARG ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file YY_LAST_ARG ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b YY_LAST_ARG ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_G(yy_current_buffer) YY_CALL_LAST_ARG)
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size YY_LAST_ARG ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str YY_LAST_ARG ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len YY_LAST_ARG ));
%*
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_is_interactive = is_interactive; \
+ if ( ! YY_G(yy_current_buffer) ) \
+ YY_G(yy_current_buffer) = \
+ yy_create_buffer( YY_G(yyin), YY_BUF_SIZE YY_CALL_LAST_ARG); \
+ YY_G(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; \
+ if ( ! YY_G(yy_current_buffer) ) \
+ YY_G(yy_current_buffer) = \
+ yy_create_buffer( YY_G(yyin), YY_BUF_SIZE YY_CALL_LAST_ARG); \
+ YY_G(yy_current_buffer)->yy_at_bol = at_bol; \
}
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_G(yy_current_buffer)->yy_at_bol)
%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
%- 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(( YY_ONLY_ARG ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state YY_LAST_ARG));
+static int yy_get_next_buffer YY_PROTO(( YY_ONLY_ARG ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
%*
#define YY_DO_BEFORE_ACTION \
yytext_ptr = yy_bp; \
%% code to fiddle yytext and yyleng for yymore() goes here
- yy_hold_char = *yy_cp; \
+ YY_G(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
%% code to copy yytext_ptr to yytext[] goes here, if %array
- yy_c_buf_p = yy_cp;
+ YY_G(yy_c_buf_p) = yy_cp;
+
+%*
%% data tables for the DFA and the user's section 1 definitions go here
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+%- Reentrant structure and macros (non-C++).
+#ifdef YY_REENTRANT
+
+struct yy_globals_t
+ {
+
+ /* User-defined. Not touched by flex. */
+ YY_EXTRA_TYPE yyextra;
+
+ /* The rest are the same as the globals declared in the non-reentrant scanner. */
+ FILE *yyin, *yyout;
+ YY_BUFFER_STATE yy_current_buffer;
+ char yy_hold_char;
+ int yy_n_chars;
+ int yyleng;
+ char *yy_c_buf_p;
+ int yy_init;
+ int yy_start;
+ int yy_did_buffer_switch_on_eof;
+ int yy_start_stack_ptr;
+ int yy_start_stack_depth;
+ int *yy_start_stack;
+ yy_state_type yy_last_accepting_state;
+ char* yy_last_accepting_cpos;
+
+ int yylineno;
+
+#ifdef YY_TEXT_IS_ARRAY
+ char yytext[YYLMAX];
+ char *yytext_ptr;
+ int yy_more_offset;
+ int yy_prev_more_offset;
+#else
+ char *yytext;
+ int yy_more_flag;
+ int yy_more_len;
+#endif
+
+#ifdef YY_REENTRANT_BISON_PURE
+ YYSTYPE * yylval;
+#ifdef YYLTYPE
+ YYLTYPE * yylloc;
+#endif
+#endif
+
+ };
+
+static int yy_init_globals YY_PROTO(( void * ));
+
+/* This must go here because YYSTYPE and YYLSTYPE are included
+ * from bison output in section 1.*/
+#ifdef YY_REENTRANT_BISON_PURE
+# define yylval_r YY_G(yylval)
+# ifdef YYLTYPE
+# define yylloc_r YY_G(yylloc)
+# endif
+#endif
+
+#endif /* end if YY_REENTRANT */
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+#ifndef YY_NO_GET_EXTRA
+YY_EXTRA_TYPE yyget_extra YY_PROTO(( YY_ONLY_ARG ));
+#endif
+
+#ifndef YY_NO_SET_EXTRA
+void yyset_extra YY_PROTO(( YY_EXTRA_TYPE user_defined YY_LAST_ARG ));
+#endif
+
+#ifndef YY_NO_GET_IN
+FILE *yyget_in YY_PROTO(( YY_ONLY_ARG ));
+#endif
+
+#ifndef YY_NO_SET_IN
+void yyset_in YY_PROTO(( FILE * in_str YY_LAST_ARG ));
+#endif
+
+#ifndef YY_NO_GET_OUT
+FILE *yyget_out YY_PROTO(( YY_ONLY_ARG ));
+#endif
+
+#ifndef YY_NO_SET_OUT
+void yyset_out YY_PROTO(( FILE * out_str YY_LAST_ARG ));
+#endif
+
+#ifndef YY_NO_GET_LENG
+int yyget_leng YY_PROTO(( YY_ONLY_ARG ));
+#endif
+
+#ifndef YY_NO_GET_TEXT
+char *yyget_text YY_PROTO(( YY_ONLY_ARG ));
+#endif
+
+#ifndef YY_NO_GET_LINENO
+int yyget_lineno YY_PROTO(( YY_ONLY_ARG ));
+#endif
+
+#ifndef YY_NO_SET_LINENO
+void yyset_lineno YY_PROTO(( int line_number YY_LAST_ARG ));
+#endif
+
+#ifdef YY_REENTRANT_BISON_PURE
+#ifndef YY_NO_GET_LVAL
+YYSTYPE * yyget_lval YY_PROTO(( YY_ONLY_ARG ));
+#endif
+void yyset_lval YY_PROTO(( YYSTYPE * yylvalp YY_LAST_ARG ));
+#ifdef YYLTYPE
+#ifndef YY_NO_GET_LLOC
+ YYLTYPE *yyget_lloc YY_PROTO(( YY_ONLY_ARG ));
+#endif
+#ifndef YY_NO_SET_LLOC
+ void yyset_lloc YY_PROTO(( YYLTYPE * yyllocp YY_LAST_ARG ));
+#endif
+#endif /* YYLTYPE */
+#endif /* YY_REENTRANT_BISON_PURE */
+
/* 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 ));
+extern "C" int yywrap YY_PROTO(( YY_ONLY_ARG ));
#else
-extern int yywrap YY_PROTO(( void ));
+extern int yywrap YY_PROTO(( YY_ONLY_ARG ));
#endif
#endif
%-
#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+static void yyunput YY_PROTO(( int c, char *buf_ptr YY_LAST_ARG));
#endif
%*
#ifndef YY_NO_INPUT
%- Standard (non-C++) definition
#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
+static int yyinput YY_PROTO(( YY_ONLY_ARG ));
#else
-static int input YY_PROTO(( void ));
+static int input YY_PROTO(( YY_ONLY_ARG ));
#endif
%*
#endif
#if YY_STACK_USED
+#ifndef YY_REENTRANT
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
+#endif
#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 YY_LAST_ARG));
#endif
#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
+static void yy_pop_state YY_PROTO(( YY_ONLY_ARG ));
#endif
#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
+static int yy_top_state YY_PROTO(( YY_ONLY_ARG ));
#endif
#else
/* 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( YY_G(yytext), YY_G(yyleng), 1, YY_G(yyout) )
%+ C++ definition
#define ECHO LexerOutput( yytext, yyleng )
%*
*/
#ifndef YY_DECL
%- Standard (non-C++) definition
-#define YY_DECL int yylex YY_PROTO(( void ))
+
+/* If the bison pure parser is used, then bison will provide
+ one or two additional arguments. */
+
+#ifdef YY_REENTRANT_BISON_PURE
+# ifdef YYLTYPE
+# ifdef YY_USE_PROTOS
+# define YY_LEX_ARGS (YYSTYPE * yylvalp, YYLTYPE * yyllocp YY_LAST_ARG)
+# else
+# define YY_LEX_ARGS (yylvalp, yyllocp YY_LAST_ARG) \
+ YYSTYPE * yylvalp; YYLTYPE * yyllocp; YY_DECL_LAST_ARG
+# endif
+# else
+# ifdef YY_USE_PROTOS
+# define YY_LEX_ARGS (YYSTYPE * yylvalp YY_LAST_ARG)
+# else
+# define YY_LEX_ARGS (yylvalp YY_LAST_ARG) \
+ YYSTYPE * yylvalp; YY_DECL_LAST_ARG
+# endif
+# endif
+#else
+# ifdef YY_USE_PROTOS
+# define YY_LEX_ARGS (YY_ONLY_ARG)
+# else
+# define YY_LEX_ARGS (YY_ONLY_ARG) YY_DECL_LAST_ARG
+# endif
+#endif
+
+#define YY_DECL int yylex YY_LEX_ARGS
%+ C++ definition
#define YY_DECL int yyFlexLexer::yylex()
%*
%% user's declarations go here
- if ( yy_init )
+#ifdef YY_REENTRANT_BISON_PURE
+ YY_G(yylval) = yylvalp;
+#ifdef YYLTYPE
+ YY_G(yylloc) = yyllocp;
+#endif
+#endif
+
+ if ( YY_G(yy_init) )
{
- yy_init = 0;
+ YY_G(yy_init) = 0;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
- if ( ! yy_start )
- yy_start = 1; /* first start state */
+ if ( ! YY_G(yy_start) )
+ YY_G(yy_start) = 1; /* first start state */
- if ( ! yyin )
+ if ( ! YY_G(yyin) )
%-
- yyin = stdin;
+ YY_G(yyin) = stdin;
%+
yyin = &cin;
%*
- if ( ! yyout )
+ if ( ! YY_G(yyout) )
%-
- yyout = stdout;
+ YY_G(yyout) = stdout;
%+
yyout = &cout;
%*
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
+ if ( ! YY_G(yy_current_buffer) )
+ YY_G(yy_current_buffer) =
+ yy_create_buffer( YY_G(yyin), YY_BUF_SIZE YY_CALL_LAST_ARG);
- yy_load_buffer_state();
+ yy_load_buffer_state( YY_CALL_ONLY_ARG );
}
while ( 1 ) /* loops until end-of-file is reached */
{
%% yymore()-related code goes here
- yy_cp = yy_c_buf_p;
+ yy_cp = YY_G(yy_c_buf_p);
/* Support of yytext. */
- *yy_cp = yy_hold_char;
+ *yy_cp = YY_G(yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
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_cp = YY_G(yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ if ( YY_G(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
* 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;
+ YY_G(yy_n_chars) = YY_G(yy_current_buffer)->yy_n_chars;
+ YY_G(yy_current_buffer)->yy_input_file = YY_G(yyin);
+ YY_G(yy_current_buffer)->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* 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] )
+ if ( YY_G(yy_c_buf_p) <= &YY_G(yy_current_buffer)->yy_ch_buf[YY_G(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_G(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( YY_CALL_ONLY_ARG );
/* 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 YY_CALL_LAST_ARG);
yy_bp = yytext_ptr + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
+ yy_cp = ++YY_G(yy_c_buf_p);
yy_current_state = yy_next_state;
goto yy_match;
}
}
}
- else switch ( yy_get_next_buffer() )
+ else switch ( yy_get_next_buffer( YY_CALL_ONLY_ARG ) )
{
case EOB_ACT_END_OF_FILE:
{
- yy_did_buffer_switch_on_eof = 0;
+ YY_G(yy_did_buffer_switch_on_eof) = 0;
- if ( yywrap() )
+ if ( yywrap( YY_CALL_ONLY_ARG ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+ YY_G(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 )
+ if ( ! YY_G(yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
+ YY_G(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( YY_CALL_ONLY_ARG );
- yy_cp = yy_c_buf_p;
+ yy_cp = YY_G(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_G(yy_c_buf_p) =
+ &YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars)];
- yy_current_state = yy_get_previous_state();
+ yy_current_state = yy_get_previous_state( YY_CALL_ONLY_ARG );
- yy_cp = yy_c_buf_p;
+ yy_cp = YY_G(yy_c_buf_p);
yy_bp = yytext_ptr + YY_MORE_ADJ;
goto yy_find_action;
}
{
delete [] yy_state_buf;
yy_flex_free( yy_start_stack );
- yy_delete_buffer( yy_current_buffer );
+ yy_delete_buffer( yy_current_buffer YY_CALL_LAST_ARG);
}
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( yy_current_buffer YY_CALL_LAST_ARG);
+ yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE YY_CALL_LAST_ARG) YY_CALL_LAST_ARG);
}
if ( new_out )
*/
%-
-static int yy_get_next_buffer()
+#ifdef YY_USE_PROTOS
+static int yy_get_next_buffer(YY_ONLY_ARG)
+#else
+static int yy_get_next_buffer(YY_ONLY_ARG)
+YY_DECL_LAST_ARG
+#endif
%+
int yyFlexLexer::yy_get_next_buffer()
%*
{
- register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *dest = YY_G(yy_current_buffer)->yy_ch_buf;
register char *source = yytext_ptr;
register int number_to_move, i;
int ret_val;
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ if ( YY_G(yy_c_buf_p) > &YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars) + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
- if ( yy_current_buffer->yy_fill_buffer == 0 )
+ if ( YY_G(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 )
+ if ( YY_G(yy_c_buf_p) - yytext_ptr - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+ number_to_move = (int) (YY_G(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 )
+ if ( YY_G(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;
+ YY_G(yy_current_buffer)->yy_n_chars = YY_G(yy_n_chars) = 0;
else
{
int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
+ YY_G(yy_current_buffer)->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
#else
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
+ YY_BUFFER_STATE b = YY_G(yy_current_buffer);
int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
+ (int) (YY_G(yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+ YY_G(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
- num_to_read = yy_current_buffer->yy_buf_size -
+ num_to_read = YY_G(yy_current_buffer)->yy_buf_size -
number_to_move - 1;
#endif
}
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_INPUT( (&YY_G(yy_current_buffer)->yy_ch_buf[number_to_move]),
+ YY_G(yy_n_chars), num_to_read );
- yy_current_buffer->yy_n_chars = yy_n_chars;
+ YY_G(yy_current_buffer)->yy_n_chars = YY_G(yy_n_chars);
}
- if ( yy_n_chars == 0 )
+ if ( YY_G(yy_n_chars) == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
+ yyrestart( YY_G(yyin) YY_CALL_LAST_ARG);
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
+ YY_G(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;
+ YY_G(yy_n_chars) += number_to_move;
+ YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+ yytext_ptr = &YY_G(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()
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_get_previous_state(YY_ONLY_ARG)
+#else
+static yy_state_type yy_get_previous_state(YY_ONLY_ARG)
+YY_DECL_LAST_ARG
+#endif
%+
yy_state_type yyFlexLexer::yy_get_previous_state()
%*
%% code to get the start state into yy_current_state goes here
- 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_G(yy_c_buf_p); ++yy_cp )
{
%% code to find the next state goes here
}
%-
#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 YY_LAST_ARG )
#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
+static yy_state_type yy_try_NUL_trans( yy_current_state YY_LAST_ARG )
yy_state_type yy_current_state;
+YY_DECL_LAST_ARG
#endif
%+
yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
%-
#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 YY_LAST_ARG )
#else
-static void yyunput( c, yy_bp )
+static void yyunput( c, yy_bp YY_LAST_ARG)
int c;
register char *yy_bp;
+YY_DECL_LAST_ARG
#endif
%+
-void yyFlexLexer::yyunput( int c, register char* yy_bp )
+void yyFlexLexer::yyunput( int c, register char* yy_bp YY_LAST_ARG)
%*
{
- register char *yy_cp = yy_c_buf_p;
+ register char *yy_cp = YY_G(yy_c_buf_p);
/* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
+ *yy_cp = YY_G(yy_hold_char);
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ if ( yy_cp < YY_G(yy_current_buffer)->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
+ register int number_to_move = YY_G(yy_n_chars) + 2;
+ register char *dest = &YY_G(yy_current_buffer)->yy_ch_buf[
+ YY_G(yy_current_buffer)->yy_buf_size + 2];
register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
+ &YY_G(yy_current_buffer)->yy_ch_buf[number_to_move];
- while ( source > yy_current_buffer->yy_ch_buf )
+ while ( source > YY_G(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;
+ YY_G(yy_current_buffer)->yy_n_chars =
+ YY_G(yy_n_chars) = YY_G(yy_current_buffer)->yy_buf_size;
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ if ( yy_cp < YY_G(yy_current_buffer)->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
%% update yylineno here
yytext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
+ YY_G(yy_hold_char) = *yy_cp;
+ YY_G(yy_c_buf_p) = yy_cp;
}
%-
#endif /* ifndef YY_NO_UNPUT */
%-
#ifndef YY_NO_INPUT
#ifdef __cplusplus
-static int yyinput()
+static int yyinput(YY_ONLY_ARG)
+#else
+#ifdef YY_USE_PROTOS
+static int input(YY_ONLY_ARG)
#else
-static int input()
+static int input(YY_ONLY_ARG)
+ YY_DECL_LAST_ARG
+#endif
#endif
%+
int yyFlexLexer::yyinput()
{
int c;
- *yy_c_buf_p = yy_hold_char;
+ *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ if ( *YY_G(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] )
+ if ( YY_G(yy_c_buf_p) < &YY_G(yy_current_buffer)->yy_ch_buf[YY_G(yy_n_chars)] )
/* This was really a NUL. */
- *yy_c_buf_p = '\0';
+ *YY_G(yy_c_buf_p) = '\0';
else
{ /* need more input */
- int offset = yy_c_buf_p - yytext_ptr;
- ++yy_c_buf_p;
+ int offset = YY_G(yy_c_buf_p) - yytext_ptr;
+ ++YY_G(yy_c_buf_p);
- switch ( yy_get_next_buffer() )
+ switch ( yy_get_next_buffer( YY_CALL_ONLY_ARG ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
*/
/* Reset buffer status. */
- yyrestart( yyin );
+ yyrestart( YY_G(yyin) YY_CALL_LAST_ARG);
/* fall through */
case EOB_ACT_END_OF_FILE:
{
- if ( yywrap() )
+ if ( yywrap( YY_CALL_ONLY_ARG ) )
return EOF;
- if ( ! yy_did_buffer_switch_on_eof )
+ if ( ! YY_G(yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
#ifdef __cplusplus
- return yyinput();
+ return yyinput(YY_CALL_ONLY_ARG);
#else
- return input();
+ return input(YY_CALL_ONLY_ARG);
#endif
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + offset;
+ YY_G(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;
+ c = *(unsigned char *) YY_G(yy_c_buf_p); /* cast for 8-bit char's */
+ *YY_G(yy_c_buf_p) = '\0'; /* preserve yytext */
+ YY_G(yy_hold_char) = *++YY_G(yy_c_buf_p);
%% update BOL and yylineno
%-
#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
+void yyrestart( FILE *input_file YY_LAST_ARG)
#else
-void yyrestart( input_file )
+void yyrestart( input_file YY_LAST_ARG)
FILE *input_file;
+YY_DECL_LAST_ARG
#endif
%+
void yyFlexLexer::yyrestart( istream* input_file )
%*
{
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+ if ( ! YY_G(yy_current_buffer) )
+ YY_G(yy_current_buffer) =
+ yy_create_buffer( YY_G(yyin), YY_BUF_SIZE YY_CALL_LAST_ARG);
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
+ yy_init_buffer( YY_G(yy_current_buffer), input_file YY_CALL_LAST_ARG);
+ yy_load_buffer_state( YY_CALL_ONLY_ARG );
}
%-
#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer YY_LAST_ARG )
#else
-void yy_switch_to_buffer( new_buffer )
+void yy_switch_to_buffer( new_buffer YY_LAST_ARG )
YY_BUFFER_STATE new_buffer;
+YY_DECL_LAST_ARG
#endif
%+
void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
%*
{
- if ( yy_current_buffer == new_buffer )
+ if ( YY_G(yy_current_buffer) == new_buffer )
return;
- if ( yy_current_buffer )
+ if ( YY_G(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_G(yy_c_buf_p) = YY_G(yy_hold_char);
+ YY_G(yy_current_buffer)->yy_buf_pos = YY_G(yy_c_buf_p);
+ YY_G(yy_current_buffer)->yy_n_chars = YY_G(yy_n_chars);
}
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
+ YY_G(yy_current_buffer) = new_buffer;
+ yy_load_buffer_state( YY_CALL_ONLY_ARG );
/* 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;
+ YY_G(yy_did_buffer_switch_on_eof) = 1;
}
%-
#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
+void yy_load_buffer_state( YY_ONLY_ARG )
#else
-void yy_load_buffer_state()
+void yy_load_buffer_state(YY_ONLY_ARG )
+YY_DECL_LAST_ARG
#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;
- yy_hold_char = *yy_c_buf_p;
+ YY_G(yy_n_chars) = YY_G(yy_current_buffer)->yy_n_chars;
+ yytext_ptr = YY_G(yy_c_buf_p) = YY_G(yy_current_buffer)->yy_buf_pos;
+ YY_G(yyin) = YY_G(yy_current_buffer)->yy_input_file;
+ YY_G(yy_hold_char) = *YY_G(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 YY_LAST_ARG)
#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
+YY_BUFFER_STATE yy_create_buffer( file, size YY_LAST_ARG)
FILE *file;
int size;
+YY_DECL_LAST_ARG
#endif
%+
YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
b->yy_is_our_buffer = 1;
- yy_init_buffer( b, file );
+ yy_init_buffer( b, file YY_CALL_LAST_ARG);
return b;
}
%-
#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
+void yy_delete_buffer( YY_BUFFER_STATE b YY_LAST_ARG)
#else
-void yy_delete_buffer( b )
+void yy_delete_buffer( b YY_LAST_ARG)
YY_BUFFER_STATE b;
+YY_DECL_LAST_ARG
#endif
%+
void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
if ( ! b )
return;
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
+ if ( b == YY_G(yy_current_buffer) )
+ YY_G(yy_current_buffer) = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
yy_flex_free( (void *) b->yy_ch_buf );
#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 YY_LAST_ARG)
#else
-void yy_init_buffer( b, file )
+void yy_init_buffer( b, file YY_LAST_ARG)
YY_BUFFER_STATE b;
FILE *file;
+YY_DECL_LAST_ARG
#endif
%+
%*
{
- yy_flush_buffer( b );
+ yy_flush_buffer( b YY_CALL_LAST_ARG);
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 YY_LAST_ARG )
#else
-void yy_flush_buffer( b )
+void yy_flush_buffer( b YY_LAST_ARG )
YY_BUFFER_STATE b;
+YY_DECL_LAST_ARG
#endif
%+
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
+ if ( b == YY_G(yy_current_buffer) )
+ yy_load_buffer_state( YY_CALL_ONLY_ARG );
}
%*
#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 YY_LAST_ARG )
#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
+YY_BUFFER_STATE yy_scan_buffer( base, size YY_LAST_ARG )
char *base;
yy_size_t size;
+YY_DECL_LAST_ARG
#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 YY_CALL_LAST_ARG );
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 YY_LAST_ARG )
#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
+YY_BUFFER_STATE yy_scan_string( yy_str YY_LAST_ARG)
yyconst char *yy_str;
+YY_DECL_LAST_ARG
#endif
{
int len;
for ( len = 0; yy_str[len]; ++len )
;
- return yy_scan_bytes( yy_str, len );
+ return yy_scan_bytes( yy_str, len YY_CALL_LAST_ARG);
}
%*
#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 YY_LAST_ARG)
#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+YY_BUFFER_STATE yy_scan_bytes( bytes, len YY_LAST_ARG)
yyconst char *bytes;
+YY_DECL_LAST_ARG
int len;
#endif
{
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer( buf, n );
+ b = yy_scan_buffer( buf, n YY_CALL_LAST_ARG);
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 YY_LAST_ARG)
#else
-static void yy_push_state( new_state )
+static void yy_push_state( new_state YY_LAST_ARG)
int new_state;
+YY_DECL_LAST_ARG
#endif
%+
void yyFlexLexer::yy_push_state( int new_state )
%*
{
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ if ( YY_G(yy_start_stack_ptr) >= YY_G(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 );
+ YY_G(yy_start_stack_depth) += YY_START_STACK_INCR;
+ new_size = YY_G(yy_start_stack_depth) * sizeof( int );
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
+ if ( ! YY_G(yy_start_stack) )
+ YY_G(yy_start_stack) = (int *) yy_flex_alloc( new_size );
else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
+ YY_G(yy_start_stack) = (int *) yy_flex_realloc(
+ (void *) YY_G(yy_start_stack), new_size );
- if ( ! yy_start_stack )
+ if ( ! YY_G(yy_start_stack) )
YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
}
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
+ YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START;
BEGIN(new_state);
}
#ifndef YY_NO_POP_STATE
%-
-static void yy_pop_state()
+#ifdef YY_USE_PROTOS
+static void yy_pop_state( YY_ONLY_ARG )
+#else
+static void yy_pop_state( YY_ONLY_ARG )
+YY_DECL_LAST_ARG
+#endif
%+
void yyFlexLexer::yy_pop_state()
%*
{
- if ( --yy_start_stack_ptr < 0 )
+ if ( --YY_G(yy_start_stack_ptr) < 0 )
YY_FATAL_ERROR( "start-condition stack underflow" );
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ BEGIN(YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)]);
}
#endif
#ifndef YY_NO_TOP_STATE
%-
-static int yy_top_state()
+#ifdef YY_USE_PROTOS
+static int yy_top_state( YY_ONLY_ARG )
+#else
+static int yy_top_state( YY_ONLY_ARG )
+YY_DECL_LAST_ARG
+#endif
%+
int yyFlexLexer::yy_top_state()
%*
{
- return yy_start_stack[yy_start_stack_ptr - 1];
+ return YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr) - 1];
}
#endif
#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 );
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; \
+ YY_G(yytext)[YY_G(yyleng)] = YY_G(yy_hold_char); \
+ YY_G(yy_c_buf_p) = YY_G(yytext) + n; \
+ YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); \
+ *YY_G(yy_c_buf_p) = '\0'; \
+ YY_G(yyleng) = n; \
} \
while ( 0 )
+
+#ifdef YY_REENTRANT
+
+/* Accessor methods (get/set functions) to struct members. */
+
+#ifndef YY_NO_GET_EXTRA
+#ifdef YY_USE_PROTOS
+YY_EXTRA_TYPE yyget_extra( YY_ONLY_ARG )
+#else
+YY_EXTRA_TYPE yyget_extra( YY_ONLY_ARG )
+ YY_DECL_LAST_ARG
+#endif
+{
+ return YY_G(yyextra);
+}
+#endif /* !YY_NO_GET_EXTRA */
+
+#ifndef YY_NO_GET_LINENO
+# ifdef YY_USE_PROTOS
+int yyget_lineno( YY_ONLY_ARG )
+# else
+int yyget_lineno( YY_ONLY_ARG )
+ YY_DECL_LAST_ARG
+# endif
+{
+ return YY_G(yylineno);
+}
+#endif /* !YY_NO_GET_LINENO */
+
+#ifndef YY_NO_GET_IN
+#ifdef YY_USE_PROTOS
+FILE *yyget_in( YY_ONLY_ARG )
+#else
+FILE *yyget_in( YY_ONLY_ARG )
+ YY_DECL_LAST_ARG
+#endif
+{
+ return YY_G(yyin);
+}
+#endif /* !YY_NO_GET_IN */
+
+#ifndef YY_NO_GET_OUT
+#ifdef YY_USE_PROTOS
+FILE *yyget_out( YY_ONLY_ARG )
+#else
+FILE *yyget_out( YY_ONLY_ARG )
+ YY_DECL_LAST_ARG
+#endif
+{
+ return YY_G(yyout);
+}
+#endif /* !YY_NO_GET_OUT */
+
+#ifndef YY_NO_GET_LENG
+#ifdef YY_USE_PROTOS
+int yyget_leng( YY_ONLY_ARG )
+#else
+int yyget_leng( YY_ONLY_ARG )
+ YY_DECL_LAST_ARG
+#endif
+{
+ return YY_G(yyleng);
+}
+#endif /* !YY_NO_GET_LENG */
+
+#ifndef YY_NO_GET_TEXT
+#ifdef YY_USE_PROTOS
+char *yyget_text( YY_ONLY_ARG )
+#else
+char *yyget_text( YY_ONLY_ARG )
+ YY_DECL_LAST_ARG
+#endif
+{
+ return YY_G(yytext);
+}
+#endif /* !YY_NO_GET_TEXT */
+
+#ifndef YY_NO_SET_EXTRA
+#ifdef YY_USE_PROTOS
+void yyset_extra( YY_EXTRA_TYPE user_defined YY_LAST_ARG )
+#else
+void yyset_extra( user_defined YY_LAST_ARG )
+ YY_EXTRA_TYPE user_defined;
+ YY_DECL_LAST_ARG
+#endif
+{
+ YY_G(yyextra) = user_defined ;
+}
+#endif /* !YY_NO_SET_EXTRA */
+
+#ifndef YY_NO_SET_LINENO
+# ifdef YY_USE_PROTOS
+void yyset_lineno( int line_number YY_LAST_ARG )
+# else
+void yyset_lineno( line_number YY_LAST_ARG )
+ int line_number;
+ YY_DECL_LAST_ARG
+# endif
+{
+ YY_G(yylineno) = line_number;
+}
+#endif /* !YY_NO_SET_LINENO */
+
+
+#ifndef YY_NO_SET_IN
+#ifdef YY_USE_PROTOS
+void yyset_in( FILE * in_str YY_LAST_ARG )
+#else
+void yyset_in( in_str YY_LAST_ARG )
+ FILE * in_str;
+ YY_DECL_LAST_ARG
+#endif
+{
+ YY_G(yyin) = in_str ;
+}
+#endif /* !YY_NO_SET_IN */
+
+#ifndef YY_NO_SET_OUT
+#ifdef YY_USE_PROTOS
+void yyset_out( FILE * out_str YY_LAST_ARG )
+#else
+void yyset_out( out_str YY_LAST_ARG )
+ FILE * out_str;
+ YY_DECL_LAST_ARG
+#endif
+{
+ YY_G(yyout) = out_str ;
+}
+#endif /* !YY_NO_SET_OUT */
+
+/* Accessor methods for yylval and yylloc */
+
+#ifdef YY_REENTRANT_BISON_PURE
+#ifndef YY_NO_GET_LVAL
+#ifdef YY_USE_PROTOS
+YYSTYPE * yyget_lval( YY_ONLY_ARG )
+#else
+YYSTYPE * yyget_lval( YY_ONLY_ARG )
+ YY_DECL_LAST_ARG
+#endif
+{
+ return YY_G(yylval);
+}
+#endif /* !YY_NO_GET_LVAL */
+
+#ifndef YY_NO_SET_LVAL
+#ifdef YY_USE_PROTOS
+void yyset_lval( YYSTYPE * yylvalp YY_LAST_ARG )
+#else
+void yyset_lval( yylvalp YY_LAST_ARG )
+ YYSTYPE * yylvalp;
+ YY_DECL_LAST_ARG
+#endif
+{
+ YY_G(yylval) = yylvalp;
+}
+#endif /* !YY_NO_SET_LVAL */
+
+#ifdef YYLTYPE
+#ifndef YY_NO_GET_LLOC
+#ifdef YY_USE_PROTOS
+YYLTYPE *yyget_lloc( YY_ONLY_ARG )
+#else
+YYLTYPE *yyget_lloc( YY_ONLY_ARG )
+ YY_DECL_LAST_ARG
+#endif
+{
+ return YY_G(yylloc);
+}
+#endif /* !YY_NO_GET_LLOC */
+
+#ifndef YY_NO_SET_LLOC
+#ifdef YY_USE_PROTOS
+void yyset_lloc( YYLTYPE * yyllocp YY_LAST_ARG )
+#else
+void yyset_lloc( yyllocp YY_LAST_ARG )
+ YYLTYPE * yyllocp;
+ YY_DECL_LAST_ARG
+#endif
+{
+ YY_G(yylloc) = yyllocp;
+}
+#endif /* !YY_NO_SET_LLOC */
+
+#endif /* YYLTYPE */
+#endif /* YY_REENTRANT_BISON_PURE */
+
+
+#ifdef YY_USE_PROTOS
+static int yy_init_globals( void* yy_globals)
+#else
+static int yy_init_globals( yy_globals )
+ void* yy_globals;
+#endif
+ {
+ /* Initialization is the same as for the non-reentrant scanner.
+ This function is called once per scanner lifetime. */
+
+ /* We do not touch yylineno unless the option is enabled. */
+#ifdef YY_USE_LINENO
+ YY_G(yylineno) = 1;
+#endif
+ YY_G(yy_current_buffer) = 0;
+ YY_G(yy_c_buf_p) = (char *) 0;
+ YY_G(yy_init) = 1;
+ YY_G(yy_start) = 0;
+ YY_G(yy_start_stack_ptr) = 0;
+ YY_G(yy_start_stack_depth) = 0;
+ YY_G(yy_start_stack) = (int *) 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+ YY_G(yyin) = stdin;
+ YY_G(yyout) = stdout;
+#else
+ YY_G(yyin) = (FILE *) 0;
+ YY_G(yyout) = (FILE *) 0;
+#endif
+ return 0;
+ }
+
+/* User-visible API */
+#ifdef YY_USE_PROTOS
+int yylex_init( void** ptr_yy_globals)
+#else
+int yylex_init( ptr_yy_globals )
+ void** ptr_yy_globals;
+#endif
+ {
+ *ptr_yy_globals = (void *) yy_flex_alloc ( sizeof( struct yy_globals_t ) );
+ yy_init_globals ( *ptr_yy_globals );
+ return 0;
+ }
+
+#ifdef YY_USE_PROTOS
+int yylex_destroy( void* ptr_yy_globals )
+#else
+int yylex_destroy( ptr_yy_globals )
+ void* ptr_yy_globals;
+#endif
+ {
+ if( ptr_yy_globals )
+ {
+ yy_flex_free ( ptr_yy_globals );
+ }
+ return 0;
+ }
+
+#endif /* End YY_REENTRANT */
+
/* Internal utility routines. */
#ifndef yytext_ptr
#if YY_MAIN
int main()
{
+
+#ifdef YY_REENTRANT
+ void *lexer;
+ yylex_init(&lexer);
+ yylex( lexer );
+ yylex_destroy( lexer);
+
+#else
yylex();
+#endif
+
return 0;
}
#endif
indent_up();
indent_puts( "{" );
- indent_puts( "yy_last_accepting_state = yy_current_state;" );
- indent_puts( "yy_last_accepting_cpos = yy_cp;" );
+ indent_puts( "YY_G(yy_last_accepting_state) = yy_current_state;" );
+ indent_puts( "YY_G(yy_last_accepting_cpos) = yy_cp;" );
indent_puts( "}" );
indent_down();
}
indent_puts( "case 0: /* must back up */" );
indent_puts( "/* undo the effects of YY_DO_BEFORE_ACTION */" );
- indent_puts( "*yy_cp = yy_hold_char;" );
+ indent_puts( "*yy_cp = YY_G(yy_hold_char);" );
if ( fullspd || fulltbl )
- indent_puts( "yy_cp = yy_last_accepting_cpos + 1;" );
+ indent_puts( "yy_cp = YY_G(yy_last_accepting_cpos) + 1;" );
else
/* Backing-up info for compressed tables is taken \after/
* yy_cp has been incremented for the next state.
*/
- indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+ indent_puts( "yy_cp = YY_G(yy_last_accepting_cpos);" );
- indent_puts( "yy_current_state = yy_last_accepting_state;" );
+ indent_puts( "yy_current_state = YY_G(yy_last_accepting_state);" );
indent_puts( "goto yy_find_action;" );
outc( '\n' );
indent_puts( "if ( yy_act == 0 )" );
indent_up();
indent_puts( "{ /* have to back up */" );
- indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+ indent_puts( "yy_cp = YY_G(yy_last_accepting_cpos);" );
indent_puts(
- "yy_current_state = yy_last_accepting_state;" );
+ "yy_current_state = YY_G(yy_last_accepting_state);" );
indent_puts( "yy_act = yy_accept[yy_current_state];" );
indent_puts( "}" );
indent_down();
/* Do the guaranteed-needed backing up to figure out
* the match.
*/
- indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+ indent_puts( "yy_cp = YY_G(yy_last_accepting_cpos);" );
indent_puts(
- "yy_current_state = yy_last_accepting_state;" );
+ "yy_current_state = YY_G(yy_last_accepting_state);" );
}
}
}
/* We're going to need yy_cp lying around for the call
* below to gen_backing_up().
*/
- indent_puts( "register char *yy_cp = yy_c_buf_p;" );
+ indent_puts( "register char *yy_cp = YY_G(yy_c_buf_p);" );
outc( '\n' );
if ( bol_needed )
{
indent_puts(
- "yy_current_state = yy_start_state_list[yy_start + YY_AT_BOL()];" );
+ "yy_current_state = yy_start_state_list[YY_G(yy_start) + YY_AT_BOL()];" );
}
else
indent_puts(
- "yy_current_state = yy_start_state_list[yy_start];" );
+ "yy_current_state = yy_start_state_list[YY_G(yy_start)];" );
}
else
{
- indent_puts( "yy_current_state = yy_start;" );
+ indent_puts( "yy_current_state = YY_G(yy_start);" );
if ( bol_needed )
indent_puts( "yy_current_state += YY_AT_BOL();" );
if ( yymore_used && ! yytext_is_array )
{
- indent_puts( "yytext_ptr -= yy_more_len; \\" );
- indent_puts( "yyleng = (int) (yy_cp - yytext_ptr); \\" );
+ indent_puts( "YY_G(yytext_ptr) -= YY_G(yy_more_len); \\" );
+ indent_puts( "YY_G(yyleng) = (int) (yy_cp - YY_G(yytext_ptr)); \\" );
}
else
- indent_puts( "yyleng = (int) (yy_cp - yy_bp); \\" );
+ indent_puts( "YY_G(yyleng) = (int) (yy_cp - yy_bp); \\" );
/* Now also deal with copying yytext_ptr to yytext if needed. */
skelout();
{
if ( yymore_used )
indent_puts(
- "if ( yyleng + yy_more_offset >= YYLMAX ) \\" );
+ "if ( YY_G(yyleng) + YY_G(yy_more_offset) >= YYLMAX ) \\" );
else
- indent_puts( "if ( yyleng >= YYLMAX ) \\" );
+ indent_puts( "if ( YY_G(yyleng) >= YYLMAX ) \\" );
indent_up();
indent_puts(
if ( yymore_used )
{
indent_puts(
-"yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \\" );
- indent_puts( "yyleng += yy_more_offset; \\" );
+"yy_flex_strncpy( &YY_G(yytext)[YY_G(yy_more_offset)], YY_G(yytext_ptr), YY_G(yyleng) + 1 ); \\" );
+ indent_puts( "YY_G(yyleng) += YY_G(yy_more_offset); \\" );
indent_puts(
- "yy_prev_more_offset = yy_more_offset; \\" );
- indent_puts( "yy_more_offset = 0; \\" );
+ "YY_G(yy_prev_more_offset) = YY_G(yy_more_offset); \\" );
+ indent_puts( "YY_G(yy_more_offset) = 0; \\" );
}
else
{
indent_puts(
- "yy_flex_strncpy( yytext, yytext_ptr, yyleng + 1 ); \\" );
+ "yy_flex_strncpy( YY_G(yytext), YY_G(yytext_ptr), YY_G(yyleng) + 1 ); \\" );
}
}
*/
if ( num_backing_up > 0 && ! reject )
{
- if ( ! C_plus_plus )
+ if ( ! C_plus_plus && !reentrant)
{
indent_puts(
"static yy_state_type yy_last_accepting_state;" );
outn( "#define REJECT \\" );
outn( "{ \\" ); /* } for vi */
outn(
- "*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \\" );
+ "*yy_cp = YY_G(yy_hold_char); /* undo effects of setting up yytext */ \\" );
outn(
"yy_cp = yy_full_match; /* restore poss. backed-over text */ \\" );
{
if ( yytext_is_array )
{
+ outn( "#ifndef YY_REENTRANT");
indent_puts( "static int yy_more_offset = 0;" );
indent_puts(
"static int yy_prev_more_offset = 0;" );
- }
- else
+ outn( "#endif" );
+ }
+ else if( !reentrant )
{
+ outn( "#ifndef YY_REENTRANT");
indent_puts( "static int yy_more_flag = 0;" );
indent_puts( "static int yy_more_len = 0;" );
+ outn( "#endif" );
}
}
if ( yytext_is_array )
{
indent_puts(
- "#define yymore() (yy_more_offset = yy_flex_strlen( yytext ))" );
+ "#define yymore() (YY_G(yy_more_offset) = yy_flex_strlen( YY_G(yytext) ))" );
indent_puts( "#define YY_NEED_STRLEN" );
indent_puts( "#define YY_MORE_ADJ 0" );
indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET \\" );
indent_up();
indent_puts( "{ \\" );
- indent_puts( "yy_more_offset = yy_prev_more_offset; \\" );
- indent_puts( "yyleng -= yy_more_offset; \\" );
+ indent_puts( "YY_G(yy_more_offset) = YY_G(yy_prev_more_offset); \\" );
+ indent_puts( "YY_G(yyleng) -= YY_G(yy_more_offset); \\" );
indent_puts( "}" );
indent_down();
}
else
{
- indent_puts( "#define yymore() (yy_more_flag = 1)" );
- indent_puts( "#define YY_MORE_ADJ yy_more_len" );
+ indent_puts( "#define yymore() (YY_G(yy_more_flag) = 1)" );
+ indent_puts( "#define YY_MORE_ADJ YY_G(yy_more_len)" );
indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET" );
}
}
outn( "#ifndef YYLMAX" );
outn( "#define YYLMAX 8192" );
outn( "#endif\n" );
+ outn( "#ifndef YY_REENTRANT" );
outn( "char yytext[YYLMAX];" );
outn( "char *yytext_ptr;" );
+ outn( "#endif" );
}
- else
+ else
+ {
+ outn( "#ifndef YY_REENTRANT" );
outn( "char *yytext;" );
+ outn( "#endif" );
+ }
}
out( &action_array[defs1_offset] );
if ( use_read )
{
outn(
-"\tif ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \\" );
+"\tif ( (result = read( fileno(YY_G(yyin)), (char *) buf, max_size )) < 0 ) \\" );
outn(
"\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );" );
}
else
{
outn(
- "\tif ( yy_current_buffer->yy_is_interactive ) \\" );
+ "\tif ( YY_G(yy_current_buffer)->yy_is_interactive ) \\" );
outn( "\t\t{ \\" );
outn( "\t\tint c = '*', n; \\" );
outn( "\t\tfor ( n = 0; n < max_size && \\" );
- outn( "\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\" );
+ outn( "\t\t\t (c = getc( YY_G(yyin) )) != EOF && c != '\\n'; ++n ) \\" );
outn( "\t\t\tbuf[n] = (char) c; \\" );
outn( "\t\tif ( c == '\\n' ) \\" );
outn( "\t\t\tbuf[n++] = (char) c; \\" );
- outn( "\t\tif ( c == EOF && ferror( yyin ) ) \\" );
+ outn( "\t\tif ( c == EOF && ferror( YY_G(yyin) ) ) \\" );
outn(
"\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\" );
outn( "\t\tresult = n; \\" );
outn( "\t\t} \\" );
outn(
- "\telse if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \\" );
- outn( "\t\t && ferror( yyin ) ) \\" );
+ "\telse if ( ((result = fread( buf, 1, max_size, YY_G(yyin) )) == 0) \\" );
+ outn( "\t\t && ferror( YY_G(yyin) ) ) \\" );
outn(
"\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );" );
}
indent_up();
if ( bol_needed )
{
- indent_puts( "if ( yyleng > 0 ) \\" );
+ indent_puts( "if ( YY_G(yyleng) > 0 ) \\" );
indent_up();
- indent_puts( "yy_current_buffer->yy_at_bol = \\" );
- indent_puts( "\t\t(yytext[yyleng - 1] == '\\n'); \\" );
+ indent_puts( "YY_G(yy_current_buffer)->yy_at_bol = \\" );
+ indent_puts( "\t\t(YY_G(yytext)[YY_G(yyleng) - 1] == '\\n'); \\" );
indent_down();
}
indent_puts( "YY_USER_ACTION" );
if ( yymore_used && ! yytext_is_array )
{
- indent_puts( "yy_more_len = 0;" );
- indent_puts( "if ( yy_more_flag )" );
+ indent_puts( "YY_G(yy_more_len) = 0;" );
+ indent_puts( "if ( YY_G(yy_more_flag) )" );
indent_up();
indent_puts( "{" );
- indent_puts( "yy_more_len = yy_c_buf_p - yytext_ptr;" );
- indent_puts( "yy_more_flag = 0;" );
+ indent_puts( "YY_G(yy_more_len) = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);" );
+ indent_puts( "YY_G(yy_more_flag) = 0;" );
indent_puts( "}" );
indent_down();
}
"fprintf( stderr, \"--accepting rule at line %d (\\\"%s\\\")\\n\"," );
indent_puts(
- " yy_rule_linenum[yy_act], yytext );" );
+ " yy_rule_linenum[yy_act], YY_G(yytext) );" );
}
indent_down();
{
indent_puts(
"fprintf( stderr, \"--accepting default rule (\\\"%s\\\")\\n\"," );
- indent_puts( " yytext );" );
+ indent_puts( " YY_G(yytext) );" );
}
indent_down();
set_indent( 4 );
if ( fullspd || fulltbl )
- indent_puts( "yy_cp = yy_c_buf_p;" );
+ indent_puts( "yy_cp = YY_G(yy_c_buf_p);" );
else
{ /* compressed table */
/* Do the guaranteed-needed backing up to figure
* out the match.
*/
- indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+ indent_puts( "yy_cp = YY_G(yy_last_accepting_cpos);" );
indent_puts(
- "yy_current_state = yy_last_accepting_state;" );
+ "yy_current_state = YY_G(yy_last_accepting_state);" );
}
else
* yy_current_state was set up by
* yy_get_previous_state().
*/
- indent_puts( "yy_cp = yy_c_buf_p;" );
+ indent_puts( "yy_cp = YY_G(yy_c_buf_p);" );
}
{ /* update yylineno inside of unput() */
indent_puts( "if ( c == '\\n' )" );
indent_up();
- indent_puts( "--yylineno;" );
+ indent_puts( "--YY_G(yylineno);" );
indent_down();
}
/* Update BOL and yylineno inside of input(). */
if ( bol_needed )
{
- indent_puts( "yy_current_buffer->yy_at_bol = (c == '\\n');" );
+ indent_puts( "YY_G(yy_current_buffer)->yy_at_bol = (c == '\\n');" );
if ( do_yylineno )
{
- indent_puts( "if ( yy_current_buffer->yy_at_bol )" );
+ indent_puts( "if ( YY_G(yy_current_buffer)->yy_at_bol )" );
indent_up();
- indent_puts( "++yylineno;" );
+ indent_puts( "++YY_G(yylineno);" );
indent_down();
}
}
{
indent_puts( "if ( c == '\\n' )" );
indent_up();
- indent_puts( "++yylineno;" );
+ indent_puts( "++YY_G(yylineno);" );
indent_down();
}