]> granicus.if.org Git - flex/commitdiff
YY_USER_ACTION generated now for each case in action switch
authorVern Paxson <vern@ee.lbl.gov>
Sun, 5 Dec 1993 17:07:59 +0000 (17:07 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Sun, 5 Dec 1993 17:07:59 +0000 (17:07 +0000)
flex.skl
nfa.c

index b30016db994e633dfecf9dbf508dc55dec0040dd..62597ccbb420a7fd6e9682f3bb40ec4401c826aa 100644 (file)
--- a/flex.skl
+++ b/flex.skl
@@ -310,6 +310,13 @@ static void yy_fatal_error YY_PROTO(( const char msg[] ));
 %*
 #endif
 
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
 /* Code executed at the end of each rule. */
 #ifndef YY_BREAK
 #define YY_BREAK break;
@@ -377,13 +384,6 @@ yy_find_action:
 
                YY_DO_BEFORE_ACTION;
 
-#ifdef YY_USER_ACTION
-               if ( yy_act != YY_END_OF_BUFFER )
-                       {
-                       YY_USER_ACTION;
-                       }
-#endif
-
 %% code for yylineno update goes here, if -l option
 
 do_action:     /* This label is used only to access EOF actions. */
diff --git a/nfa.c b/nfa.c
index 9be63e1c907648fad5068246ebe69c88773e9a16..24241768b28d43390fb8a36b06cd43f0daeff1b0 100644 (file)
--- a/nfa.c
+++ b/nfa.c
@@ -262,6 +262,12 @@ int mach, variable_trail_rule, headcnt, trailcnt;
                        }
                }
 
+       /* Okay, in the action code at this point yytext and yyleng have
+        * their proper final values for this rule, so here's the point
+        * to do any user action.
+        */
+       add_action( "YY_USER_ACTION\n" );
+
        line_directive_out( (FILE *) 0 );
        }