diff options
-rw-r--r-- | flex.skl | 7 | ||||
-rw-r--r-- | main.c | 10 | ||||
-rw-r--r-- | tests/test-c++-multiple-scanners/Makefile.am | 1 |
3 files changed, 11 insertions, 7 deletions
@@ -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. */ @@ -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"); diff --git a/tests/test-c++-multiple-scanners/Makefile.am b/tests/test-c++-multiple-scanners/Makefile.am index d8da4a6..f6dfedc 100644 --- a/tests/test-c++-multiple-scanners/Makefile.am +++ b/tests/test-c++-multiple-scanners/Makefile.am @@ -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 |