diff options
author | Manoj Srivastava <srivasta@debian.org> | 2003-12-03 10:38:02 +0000 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2003-12-03 10:38:02 +0000 |
commit | edc848712307fe5c881364e12e520e9fe58d9969 (patch) | |
tree | 1c055587d094d006b61c425136149350f326f106 /MISC/Borland |
Initial import of the 2.5.4a branch
git-archimport-id: srivasta@debian.org--2003-primary/flex--upstream--2.5--base-0
Diffstat (limited to 'MISC/Borland')
-rw-r--r-- | MISC/Borland/Makefile | 163 | ||||
-rw-r--r-- | MISC/Borland/NOTES | 66 | ||||
-rw-r--r-- | MISC/Borland/config.h | 29 |
3 files changed, 258 insertions, 0 deletions
diff --git a/MISC/Borland/Makefile b/MISC/Borland/Makefile new file mode 100644 index 0000000..3b20090 --- /dev/null +++ b/MISC/Borland/Makefile @@ -0,0 +1,163 @@ +############################################################################### +# Makefile for flex 2.5.0.6 (beta) with Borland C/C++ version 4.02 +# +# This will probably need to be adjusted for your existing lexer/parser +# generators. See definitions for FLEX and YACC near the bottom of the +# makefile. +# +# This makefile builds initflex.exe and flex.exe by default. It +# removes initflex.exe after making flex.exe. After that, you may +# choose to try alternate compression options for your everyday flex +# executable. +# +# This will build flex with the large model. Don't use huge, but if you +# feel like experimenting with other models, post your success stories to +# comp.compilers, OK? +# +# This makefile does *not* implement the big testing found in "makefile.in". +# +# I also assume the availability of sed and the gnu file utilities on the +# system - they're readily available, so if you don't have them, why not? +# <grin> +# +# The resulting generated lexer (the real goal, right?) will compile +# (and run nicely, too) as a .c file, as well as being included such as +# extern "C" { #include "lexyyc" } in a .cplusplus file. +# +############################################################################### + +DEBUG = 1 + +.autodepend + +all: initflex.exe flex.exe + rm initflex.exe initflex.map + +############################################################################### +# +# standard utilitities? ha. +# + +CC = bcc +CPP = bcc + +############################################################################### +# + +MODEL = l + +!if $(DEBUG) == 1 +!message Building with debug. +debugCompile = -v +debugLink = /v +!else +!message Building without debug. +debugCompile = +debugLink = +!endif + +LOADER = c0$(MODEL).obj +LIBS = c$(MODEL).lib +LINKFLAGS = $(debugLink) + +DATASEG = -dc -Ff +SizeOPT = -Os -G- +Defines = + +COMMON = -A -c -m$(MODEL) $(SizeOPT) $(DATASEG) $(Defines) $(debugCompile) +CFLAGS = -o$@ $(COMMON) +CCFLAGS = -o$@ $(COMMON) -Pcc + +############################################################################### + +.SUFFIXES: .cc + +.cc.obj: + $(CPP) $(CCFLAGS) $< + +.c.obj: + $(CPP) $(CFLAGS) $< + +############################################################################### +# +# source & object files +# + +BASESRC = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \ + sym.c tblcmp.c yylex.c skel.c + +INITSRC = $(BASESRC) initscan.c + +INITOBJS = $(INITSRC:.c=.obj) + +SRC = $(BASESRC) scan.c + +OBJS = $(SRC:.c=.obj) + +objects: $(OBJS) + @echo $(OBJS) + +############################################################################### +# +# Executable +# + +initflex.exe: $(INITOBJS) + tlink $(LINKFLAGS) @&&! +$(LOADER) $** +$&.exe + +$(LIBS) +! + +flex.exe: $(OBJS) + tlink $(LINKFLAGS) @&&! +$(LOADER) $** +$&.exe + +$(LIBS) +! + +# +############################################################################### +# +# Lex files +# + +FLEX = .\initflex +FLEX_FLAGS = -ist + +scan.c: scan.l + $(FLEX) $(FLEX_FLAGS) scan.l >scan.tmp + sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c + @rm scan.tmp + +############################################################################### +# +# YACC files +# + +YACC = .\bison +YFLAGS = -vdyl + +parse.c: parse.y + $(YACC) -ydl parse.y + @sed "/extern char.*malloc/d" <y_tab.c >parse.c + @rm -f y_tab.c + @mv y_tab.h parse.h + +############################################################################### +# +# cleanup +# + +clean: + -rm *.obj *.map initflex.exe + +realclean: clean + -rm flex.exe + +# +# end Makefile +# +############################################################################### diff --git a/MISC/Borland/NOTES b/MISC/Borland/NOTES new file mode 100644 index 0000000..caac3cc --- /dev/null +++ b/MISC/Borland/NOTES @@ -0,0 +1,66 @@ +Received: from 128.140.1.1 by ee.lbl.gov for <vern@ee.lbl.gov> (8.6.9/1.43r) + id PAA03966; Tue, 24 Jan 1995 15:03:57 -0800 +Received: from larry-le0.cc.emory.edu by + emoryu1.cc.emory.edu (5.65/Emory_cc.4.0.1) via SMTP + id AA24158 ; Tue, 24 Jan 95 17:18:18 -0500 +From: tkane01@unix.cc.emory.edu (Terrence O Kane) +Received: by larry.cc.emory.edu (5.0) id AA21979; Tue, 24 Jan 1995 17:17:40 -0500 +Message-Id: <9501242217.AA21979@larry.cc.emory.edu> +Subject: Re: Beta test for DOS +To: vern@ee.lbl.gov (Vern Paxson) +Date: Tue, 24 Jan 1995 17:17:38 -0500 (EST) +In-Reply-To: <199501232138.NAA11430@daffy.ee.lbl.gov> from "Vern Paxson" at Jan 23, 95 01:38:02 pm +X-Mailer: ELM [version 2.4 PL23] +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +Content-Length: 5792 + +Vern, + +I've made flex 2.5.0.6 successfully with no changes to the source +code at all. I'm including the Borland 4.02 makefile and config.h +at the end of this message. + +When you're ready for release, I'll be happy to take care of getting +the appropriate archive files up to Simtel if you wish. + +I have not used this version for any of my "work-related" scanners +yet, but have run the fastwc benchmark. The compiles were for large +memory model and optimization for fastest possible code. The test +machine was a Pentium-90 (hey! timing output was integer!) with +enhanced IDE on a PCI bus and no file system caching. I ran the +test on two different input files. + +(Times are in seconds.) + +The first input was a typical postscript file concatenated 10 times; +by typical, I mean that there were relatively few spaces, lots of lines +with no space, using lots of parentheses. + + lines words characters + 91200 356260 5889240 + + mywc 8.89 + wc1s 15.22 default + wc1 10.82 -Cf + wc2 10.16 -Cf + wc3 9.17 -Cf + wc4 9.22 -Cf + wc5 10.98 -Cf + +The second test run was on a file that consisted of 20 concatenations +of 'misc/flex.man'. + + lines words characters + 69960 305140 2399960 + + mywc 4.01 + wc1s 6.87 + wc1 5.32 + wc2 4.95 + wc3 4.12 + wc4 4.12 + wc5 5.05 + +[[Makefile and config.h moved to separate files -VP]] diff --git a/MISC/Borland/config.h b/MISC/Borland/config.h new file mode 100644 index 0000000..5e210da --- /dev/null +++ b/MISC/Borland/config.h @@ -0,0 +1,29 @@ +/* $Header: /home/daffy/u0/vern/flex/RCS/conf.in,v 1.2 95/01/09 12:11:51 vern Exp $ */ +/* ------------------------------------------------ */ +/* version of config.h for Borland C/C++ v4.02 */ +/* flex version 2.5.0.6 (beta) */ +/* ------------------------------------------------ */ + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to `unsigned' if <sys/types.h> doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you have the <malloc.h> header file. */ +#define HAVE_MALLOC_H 1 + +/* Define if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if platform-specific command line handling is necessary. */ +#undef NEED_ARGV_FIXUP |