]> granicus.if.org Git - flex/commitdiff
Fixed prefix of yyalloc,yyfree,yyrealloc in C++ scanner.
authorJohn Millaway <john43@users.sourceforge.net>
Fri, 22 Nov 2002 20:38:04 +0000 (20:38 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Fri, 22 Nov 2002 20:38:04 +0000 (20:38 +0000)
Removed yylex_destroy from C++ scanner.

flex.skl
main.c
tests/test-c++-multiple-scanners/Makefile.am

index 1a46a022ded04d3ead7a89d103c8ed3f14c53514..d2689be34e40ff6ec1bdeb7a13888db107fe924c 100644 (file)
--- a/flex.skl
+++ b/flex.skl
@@ -446,7 +446,6 @@ YY_BUFFER_STATE yy_scan_bytes YY_PARAMS(( yyconst char *bytes, int len YY_PROTO_
 
 %pop
 
-
 void *yyalloc YY_PARAMS(( yy_size_t YY_PROTO_LAST_ARG ));
 void *yyrealloc YY_PARAMS(( void *, yy_size_t YY_PROTO_LAST_ARG ));
 void yyfree YY_PARAMS(( void * YY_PROTO_LAST_ARG ));
@@ -2084,11 +2083,11 @@ int yylex_init( ptr_yy_globals )
 
 %endif
 
+%push
+%c-only SNIP! this currently causes conflicts with the c++ scanner
 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
 int yylex_destroy  YYFARGS0(void)
 {
-%push
-%c-only SNIP! this currently causes conflicts with the c++ scanner
     /* Destroy the current (main) buffer. */
     yy_delete_buffer( YY_G(yy_current_buffer) YY_CALL_LAST_ARG );
     YY_G(yy_current_buffer) = NULL;
@@ -2109,9 +2108,9 @@ int yylex_destroy  YYFARGS0(void)
     /* Destroy the main struct (reentrant only). */
     yyfree ( yyscanner YY_CALL_LAST_ARG );
 %endif
-%pop
     return 0;
 }
+%pop
 
 
 /* Internal utility routines. */
diff --git a/main.c b/main.c
index a168920057b203ea9510097d25ca6845bfdad33a..c25c48fd96f5052ee0501c8e62a35aa70eb94aaf 100644 (file)
--- a/main.c
+++ b/main.c
@@ -421,9 +421,6 @@ void check_options ()
                        GEN_PREFIX ("get_text");
                        GEN_PREFIX ("get_lineno");
                        GEN_PREFIX ("set_lineno");
-                       GEN_PREFIX ("alloc");
-                       GEN_PREFIX ("realloc");
-                       GEN_PREFIX ("free");
 
                        outn ("#ifdef YY_BISON_BRIDGE");
                        GEN_PREFIX ("get_lval");
@@ -434,6 +431,13 @@ void check_options ()
 
                }
 
+        /* The alloc/realloc/free functions are used internally by the
+         * generated scanner for both and C++.
+         */
+        GEN_PREFIX ("alloc");
+        GEN_PREFIX ("realloc");
+        GEN_PREFIX ("free");
+
                if (!reentrant)
                        GEN_PREFIX ("lineno");
 
index d8da4a69c7702e0868bc94568627e95b7c6ce401..f6dfedc0fbcf69d9cdc4e43c00f821d740e63649 100644 (file)
@@ -21,6 +21,7 @@
 
 
 FLEX = $(top_builddir)/flex
+builddir = @builddir@
 
 EXTRA_DIST = scanner-1.l scanner-2.l main.cpp
 CLEANFILES = scanner-1.cpp test-c++-multiple-scanners OUTPUT $(OBJS) scanner-2.cpp