49 #ifndef __FLEX_LEXER_H
51 #define __FLEX_LEXER_H
55 # define FLEX_STD std::
60 struct yy_buffer_state;
61 typedef int yy_state_type;
65 virtual ~FlexLexer() { }
67 const char* YYText()
const {
return yytext; }
68 int YYLeng()
const {
return yyleng; }
71 yy_switch_to_buffer(
struct yy_buffer_state* new_buffer ) = 0;
72 virtual struct yy_buffer_state*
73 yy_create_buffer( FLEX_STD istream* s,
int size ) = 0;
74 virtual void yy_delete_buffer(
struct yy_buffer_state* b ) = 0;
75 virtual void yyrestart( FLEX_STD istream* s ) = 0;
77 virtual int yylex() = 0;
80 int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 )
82 switch_streams( new_in, new_out );
88 virtual void switch_streams( FLEX_STD istream* new_in = 0,
89 FLEX_STD ostream* new_out = 0 ) = 0;
91 int lineno()
const {
return yylineno; }
93 int debug()
const {
return yy_flex_debug; }
94 void set_debug(
int flag ) { yy_flex_debug = flag; }
106 #if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
110 #define yyFlexLexerOnce
114 class yyFlexLexer :
public FlexLexer {
118 yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 );
120 virtual ~yyFlexLexer();
122 void yy_switch_to_buffer(
struct yy_buffer_state* new_buffer );
123 struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s,
int size );
124 void yy_delete_buffer(
struct yy_buffer_state* b );
125 void yyrestart( FLEX_STD istream* s );
127 void yypush_buffer_state(
struct yy_buffer_state* new_buffer );
128 void yypop_buffer_state();
131 virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 );
132 virtual int yywrap();
135 virtual int LexerInput(
char* buf,
int max_size );
136 virtual void LexerOutput(
const char* buf,
int size );
137 virtual void LexerError(
const char* msg );
139 void yyunput(
int c,
char* buf_ptr );
142 void yy_load_buffer_state();
143 void yy_init_buffer(
struct yy_buffer_state* b, FLEX_STD istream* s );
144 void yy_flush_buffer(
struct yy_buffer_state* b );
146 int yy_start_stack_ptr;
147 int yy_start_stack_depth;
150 void yy_push_state(
int new_state );
154 yy_state_type yy_get_previous_state();
155 yy_state_type yy_try_NUL_trans( yy_state_type current_state );
156 int yy_get_next_buffer();
158 FLEX_STD istream* yyin;
159 FLEX_STD ostream* yyout;
175 int yy_did_buffer_switch_on_eof;
178 size_t yy_buffer_stack_top;
179 size_t yy_buffer_stack_max;
180 struct yy_buffer_state ** yy_buffer_stack;
181 void yyensure_buffer_stack(
void);
186 yy_state_type yy_last_accepting_state;
187 char* yy_last_accepting_cpos;
189 yy_state_type* yy_state_buf;
190 yy_state_type* yy_state_ptr;
197 int yy_looking_for_trail_begin;
202 int yy_prev_more_offset;