]> granicus.if.org Git - flex/commitdiff
YY_SKIP_YYWRAP
authorVern Paxson <vern@ee.lbl.gov>
Sat, 17 Dec 1994 18:40:26 +0000 (18:40 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Sat, 17 Dec 1994 18:40:26 +0000 (18:40 +0000)
yyFlexLexer constructor, destructor

flex.skl

index abf2760dd4b5004b691468d609dcd30da7c4505c..b9e81cbecd144e8a55232da17267ba45a9421005 100644 (file)
--- a/flex.skl
+++ b/flex.skl
@@ -274,7 +274,7 @@ static void yy_flex_free YY_PROTO(( void * ));
 
 %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
 
-#ifndef yywrap
+#ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
 extern "C" int yywrap YY_PROTO(( void ));
 #else
@@ -635,6 +635,38 @@ do_action: /* This label is used only to access EOF actions. */
        } /* end of yylex */
 
 %+
+yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
+       {
+       yyin = arg_yyin;
+       yyout = arg_yyout;
+       yy_c_buf_p = 0;
+       yy_init = 1;
+       yy_start = 0;
+
+       yy_did_buffer_switch_on_eof = 0;
+
+       yy_looking_for_trail_begin = 0;
+       yy_more_flag = 0;
+       yy_more_len = 0;
+
+       yy_start_stack_ptr = yy_start_stack_depth = 0;
+       yy_start_stack = 0;
+
+       yy_current_buffer = 0;
+
+#ifdef YY_USES_REJECT
+       yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
+#else
+       yy_state_buf = 0;
+#endif
+       }
+
+yyFlexLexer::~yyFlexLexer()
+       {
+       delete yy_state_buf;
+       yy_delete_buffer( yy_current_buffer );
+       }
+
 #ifdef YY_INTERACTIVE
 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
 #else