]> granicus.if.org Git - flex/commitdiff
Added yy_top_state()
authorVern Paxson <vern@ee.lbl.gov>
Thu, 16 Dec 1993 20:46:12 +0000 (20:46 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Thu, 16 Dec 1993 20:46:12 +0000 (20:46 +0000)
FlexLexer.h
flex.skl

index c90f30d57f14bde5a0e8c76ccf2e9b48d9d14a4d..87636e32f9abbd4ef4e29282de80391149134ba0 100644 (file)
@@ -122,7 +122,8 @@ protected:
        int* yy_start_stack;
 
        void yy_push_state( int new_state );
-       int yy_pop_state();
+       void yy_pop_state();
+       int yy_top_state();
 
        yy_state_type yy_get_previous_state();
        yy_state_type yy_try_NUL_trans( yy_state_type current_state );
index 4f0429e3010d2e9a95d309a0161b839e6831fb78..a6be4d9154c88b167bc4890a666d24234ee6f2ca 100644 (file)
--- a/flex.skl
+++ b/flex.skl
@@ -236,6 +236,7 @@ static int yy_start_stack_depth = 0;
 static int *yy_start_stack = 0;
 static void yy_push_state YY_PROTO(( int new_state ));
 static void yy_pop_state YY_PROTO(( void ));
+static int yy_top_state YY_PROTO(( void ));
 %*
 
 #define yy_new_buffer yy_create_buffer
@@ -1099,6 +1100,16 @@ void yyFlexLexer::yy_pop_state()
        }
 
 
+%-
+static int yy_top_state()
+%+
+int yyFlexLexer::yy_top_state()
+%*
+       {
+       return yy_start_stack[yy_start_stack_ptr - 1];
+       }
+
+
 %-
 #ifdef YY_USE_PROTOS
 static void yy_fatal_error( const char msg[] )