diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-08-04 02:13:52 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-08-04 02:13:52 +0000 |
commit | 9291891faa5a1c8e1aa0d362dc38cfc33f80991f (patch) | |
tree | 5f15006cef3d366c1ffb3840f5fda428c28ed2ab /wiretap | |
parent | e96687e6b1d5c273ccea4ad31dfedbb045f5f8e9 (diff) |
Add a script as a front-end for Flex, to work around various problems,
such as the fact that Flex strips all but the last component of the "-o"
argument, and that it doesn't generate a header file to declare routines
the generated lexical analyzer defines. Use that script when building
lexical analyzers, and, for each lexical analyzer, include the generated
header file in the generated analyzer.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22446 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/Makefile.am | 7 | ||||
-rw-r--r-- | wiretap/Makefile.common | 4 | ||||
-rw-r--r-- | wiretap/Makefile.nmake | 8 | ||||
-rw-r--r-- | wiretap/ascend-scanner.l | 3 | ||||
-rw-r--r-- | wiretap/k12text.l | 1 |
5 files changed, 18 insertions, 5 deletions
diff --git a/wiretap/Makefile.am b/wiretap/Makefile.am index 982526e86b..ecfc04692f 100644 --- a/wiretap/Makefile.am +++ b/wiretap/Makefile.am @@ -66,6 +66,7 @@ EXTRA_DIST = \ config.h.win32 \ Makefile.common \ Makefile.nmake \ + runlex.sh \ wtap.def \ file_util.c \ $(GENERATOR_SOURCES) \ @@ -74,6 +75,12 @@ EXTRA_DIST = \ libwiretap_la_LIBADD = libwiretap_generated.la libwiretap_la_DEPENDENCIES = libwiretap_generated.la +RUNLEX = $(top_srcdir)/runlex.sh + +ascend-scanner_lex.h : ascend-scanner.c + +k12text_lex.h : k12text.c + ascend-grammar.c : ascend-grammar.y @if [ -z "$(YACC)" ]; then \ echo "Neither bison nor byacc has been found"; \ diff --git a/wiretap/Makefile.common b/wiretap/Makefile.common index 4e2fbd5b55..1c67f09826 100644 --- a/wiretap/Makefile.common +++ b/wiretap/Makefile.common @@ -123,7 +123,9 @@ GENERATED_C_FILES = \ # The header files that they generate. GENERATED_HEADER_FILES = \ - ascend-grammar.h + ascend-grammar.h \ + ascend-scanner_lex.h \ + k12text_lex.h # All the generated files. GENERATED_FILES = $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES) diff --git a/wiretap/Makefile.nmake b/wiretap/Makefile.nmake index 26170c68be..fdf2e627bd 100644 --- a/wiretap/Makefile.nmake +++ b/wiretap/Makefile.nmake @@ -40,13 +40,17 @@ wiretap-$(WTAP_VERSION).dll : $(OBJECTS) wtap.def ..\image\wiretap.res $(OBJECTS): config.h -ascend-grammar.c ascend-grammar.h : ascend-grammar.y - $(YACC) $(YACC_OPTS) -d -p ascend ascend-grammar.y -o ascend-grammar.c +RUNLEX = ..\runlex.sh +ascend-scanner_lex.h : ascend-scanner.c ascend-scanner.obj : ascend-scanner.c ascend-grammar.h +k12text_lex.h : k12text.c k12text.obj : k12text.c +ascend-grammar.c ascend-grammar.h : ascend-grammar.y + $(YACC) $(YACC_OPTS) -d -p ascend ascend-grammar.y -o ascend-grammar.c + config.h : config.h.win32 ..\config.nmake sed -e s/@VERSION@/$(WTAP_VERSION)/ \ -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \ diff --git a/wiretap/ascend-scanner.l b/wiretap/ascend-scanner.l index a586078c63..0d63d63b94 100644 --- a/wiretap/ascend-scanner.l +++ b/wiretap/ascend-scanner.l @@ -54,6 +54,7 @@ #include "ascend-grammar.h" #include "ascend-int.h" #include "file_wrappers.h" +#include "ascend-scanner_lex.h"" FILE_T yy_fh; extern char *ascend_ra_ptr; @@ -61,8 +62,6 @@ extern char *ascend_ra_last; #define YY_INPUT(buf,result,max_size) { int c = file_getc(yy_fh); \ result = (c==EOF) ? YY_NULL : (buf[0] = c, 1); } -#define YY_NEVER_INTERACTIVE 1 - int at_eof; int mul, scratch; diff --git a/wiretap/k12text.l b/wiretap/k12text.l index 6494c5fee9..f69b2d7197 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -62,6 +62,7 @@ #include "file_wrappers.h" #include "buffer.h" #include "k12.h" +#include "k12text_lex.h" static guint h; static guint m; |