summaryrefslogtreecommitdiff
path: root/MISC/Borland.old
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2003-12-03 10:38:02 +0000
committerManoj Srivastava <srivasta@debian.org>2003-12-03 10:38:02 +0000
commitedc848712307fe5c881364e12e520e9fe58d9969 (patch)
tree1c055587d094d006b61c425136149350f326f106 /MISC/Borland.old
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.old')
-rw-r--r--MISC/Borland.old/Borland-2.4419
-rw-r--r--MISC/Borland.old/Turbo-C179
2 files changed, 598 insertions, 0 deletions
diff --git a/MISC/Borland.old/Borland-2.4 b/MISC/Borland.old/Borland-2.4
new file mode 100644
index 0000000..5602a14
--- /dev/null
+++ b/MISC/Borland.old/Borland-2.4
@@ -0,0 +1,419 @@
+Received: from 128.140.1.1 by ee.lbl.gov for <vern@ee.lbl.gov> (8.6.9/1.43r)
+ id HAA01193; Thu, 29 Sep 1994 07:26:54 -0700
+Received: from larry-le0.cc.emory.edu by
+ emoryu1.cc.emory.edu (5.65/Emory_cc.4.0.1) via SMTP
+ id AA07292 ; Thu, 29 Sep 94 10:26:41 -0400
+From: tkane01@unix.cc.emory.edu (Terrence O Kane)
+Received: by larry.cc.emory.edu (5.0) id AA11757; Thu, 29 Sep 1994 10:26:43 +0500
+Message-Id: <9409291426.AA11757@larry.cc.emory.edu>
+Subject: patches and makefile for Borland C 4.02, flex 2.4.7
+To: vern@ee.lbl.gov
+Date: Thu, 29 Sep 1994 10:26:42 -0400 (EDT)
+X-Mailer: ELM [version 2.4 PL23]
+Mime-Version: 1.0
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Content-Length: 9900
+
+Enclosed are unified diffs and a makefile for Borland 4.02
+
+The changes in the enclosed are 1) make the size parameters for memory
+allocation "size_t", 2) change an include file when the lexer is
+compiled within 'extern "C" {...}' in a C++ file, and 3) include pragmas
+in the header suitable for BCC 4.02 to hush on warnings.
+
+The latter is done because of the limit on command line size. A tradeoff
+exists between putting pragmas in the header, or #defines in the header -
+I put in the pragmas since they're suppoed to be ignored unless
+understood - *and* they're enclosed in BCC specific ifdefs, anyway.
+
+All changes are enclosed in "#ifdef __BORLANDC__".
+
+
+
+
+
+--- misc.c Tue Jan 04 14:33:10 1994
++++ ../misc.c Wed Sep 28 18:44:32 1994
+@@ -55,15 +55,19 @@
+ action_index += len;
+ }
+
+
+ /* allocate_array - allocate memory for an integer array of the given size */
+
+ void *allocate_array( size, element_size )
++#ifndef __BORLANDC__
+ int size, element_size;
++#else /* __BORLANDC__ */
++size_t size, element_size;
++#endif /* __BORLANDC__ */
+ {
+ register void *mem;
+
+ /* On 16-bit int machines (e.g., 80286) we might be trying to
+ * allocate more than a signed int can hold, and that won't
+ * work. Cheap test:
+ */
+@@ -634,15 +638,19 @@
+ }
+
+
+ /* reallocate_array - increase the size of a dynamic array */
+
+ void *reallocate_array( array, size, element_size )
+ void *array;
++#ifndef __BORLANDC__
+ int size, element_size;
++#else /* __BORLANDC__ */
++size_t size, element_size;
++#endif /* __BORLANDC__ */
+ {
+ register void *new_array;
+
+ /* Same worry as in allocate_array(): */
+ if ( size * element_size <= 0 )
+ flexfatal(
+ "attempt to increase array size by less than 1 byte" );
+@@ -739,15 +747,19 @@
+ }
+
+
+ /* The following is only needed when building flex's parser using certain
+ * broken versions of bison.
+ */
+ void *yy_flex_xmalloc( size )
++#ifndef __BORLANDC__
+ int size;
++#else /* __BORLANDC__ */
++size_t size;
++#endif /* __BORLANDC__ */
+ {
+ void *result = flex_alloc( size );
+
+ if ( ! result )
+ flexfatal( "memory allocation failed in yy_flex_xmalloc()" );
+
+ return result;
+
+
+
+
+
+--- skel.c Wed Aug 03 11:38:32 1994
++++ ../skel.c Wed Sep 28 18:50:58 1994
+@@ -26,15 +26,19 @@
+ "",
+ "#ifdef __cplusplus",
+ "",
+ "#include <stdlib.h>",
+ "%+",
+ "class istream;",
+ "%*",
++ "#ifndef __BORLANDC__",
+ "#include <unistd.h>",
++ "#else /* __BORLANDC__ */",
++ "#include <io.h>",
++ "#endif /* __BORLANDC__ */",
+ "",
+ "/* Use prototypes in function declarations. */",
+ "#define YY_USE_PROTOS",
+ "",
+ "/* The \"const\" storage-class-modifier is valid. */",
+ "#define YY_USE_CONST",
+ "",
+@@ -240,16 +244,21 @@
+ "static int yy_start_stack_depth = 0;",
+ "static int *yy_start_stack = 0;",
+ "static void yy_push_state YY_PROTO(( int new_state ));",
+ "static void yy_pop_state YY_PROTO(( void ));",
+ "static int yy_top_state YY_PROTO(( void ));",
+ "%*",
+ "",
++ "#ifndef __BORLANDC__",
+ "static void *yy_flex_alloc YY_PROTO(( unsigned int ));",
+ "static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));",
++ "#else /* __BORLANDC__ */",
++ "static void *yy_flex_alloc YY_PROTO(( size_t ));",
++ "static void *yy_flex_realloc YY_PROTO(( void *, size_t ));",
++ "#endif /* __BORLANDC__ */",
+ "static void yy_flex_free YY_PROTO(( void * ));",
+ "",
+ "#define yy_new_buffer yy_create_buffer",
+ "",
+ "%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here",
+ "",
+ "#ifndef yytext_ptr",
+
+
+
+
+
+--- initscan.c Wed Aug 03 11:42:46 1994
++++ ../initscan.c Wed Sep 28 18:51:34 1994
+@@ -16,15 +16,19 @@
+ #endif
+ #endif
+
+
+ #ifdef __cplusplus
+
+ #include <stdlib.h>
++#ifndef __BORLANDC__
+ #include <unistd.h>
++#else /* __BORLANDC__ */
++#include <io.h>
++#endif /* __BORLANDC__ */
+
+ /* Use prototypes in function declarations. */
+ #define YY_USE_PROTOS
+
+ /* The "const" storage-class-modifier is valid. */
+ #define YY_USE_CONST
+
+@@ -220,16 +224,21 @@
+ static int yy_start_stack_ptr = 0;
+ static int yy_start_stack_depth = 0;
+ static int *yy_start_stack = 0;
+ static void yy_push_state YY_PROTO(( int new_state ));
+ static void yy_pop_state YY_PROTO(( void ));
+ static int yy_top_state YY_PROTO(( void ));
+
++#ifndef __BORLANDC__
+ static void *yy_flex_alloc YY_PROTO(( unsigned int ));
+ static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
++#else /* __BORLANDC__ */
++static void *yy_flex_alloc YY_PROTO(( size_t ));
++static void *yy_flex_realloc YY_PROTO(( void *, size_t ));
++#endif /* __BORLANDC__ */
+ static void yy_flex_free YY_PROTO(( void * ));
+
+ #define yy_new_buffer yy_create_buffer
+
+ #define INITIAL 0
+ #define SECT2 1
+ #define SECT2PROLOG 2
+
+
+
+
+
+--- flexdef.h Tue Jan 04 14:33:14 1994
++++ ../flexdef.h Wed Sep 28 18:53:44 1994
+@@ -27,14 +27,25 @@
+ */
+
+ /* @(#) $Header: flexdef.h,v 1.2 94/01/04 14:33:14 vern Exp $ (LBL) */
+
+ #include <stdio.h>
+ #include <ctype.h>
+
++#ifdef __BORLANDC__
++#include <malloc.h>
++
++#pragma warn -pro
++#pragma warn -rch
++#pragma warn -use
++#pragma warn -aus
++#pragma warn -par
++#pragma warn -pia
++
++#endif /* __BORLANDC__ */
+ #if HAVE_STRING_H
+ #include <string.h>
+ #else
+ #include <strings.h>
+ #endif
+
+ #if __STDC__
+@@ -607,19 +618,29 @@
+ */
+
+ extern char nmstr[MAXLINE];
+ extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
+ extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
+ extern int num_backing_up, bol_needed;
+
++#ifndef __BORLANDC__
+ void *allocate_array PROTO((int, int));
+ void *reallocate_array PROTO((void*, int, int));
++#else /* __BORLANDC__ */
++void *allocate_array PROTO((size_t, size_t));
++void *reallocate_array PROTO((void*, size_t, size_t));
++#endif /* __BORLANDC__ */
+
++#ifndef __BORLANDC__
+ void *flex_alloc PROTO((unsigned int));
+ void *flex_realloc PROTO((void*, unsigned int));
++#else /* __BORLANDC__ */
++void *flex_alloc PROTO((size_t));
++void *flex_realloc PROTO((void*, size_t));
++#endif /* __BORLANDC__ */
+ void flex_free PROTO((void*));
+
+ #define allocate_integer_array(size) \
+ (int *) allocate_array( size, sizeof( int ) )
+
+ #define reallocate_integer_array(array,size) \
+ (int *) reallocate_array( (void *) array, size, sizeof( int ) )
+@@ -772,15 +793,19 @@
+ /* Write out one section of the skeleton file. */
+ extern void skelout PROTO((void));
+
+ /* Output a yy_trans_info structure. */
+ extern void transition_struct_out PROTO((int, int));
+
+ /* Only needed when using certain broken versions of bison to build parse.c. */
++#ifndef __BORLANDC__
+ extern void *yy_flex_xmalloc PROTO(( int ));
++#else /* __BORLANDC__ */
++extern void *yy_flex_xmalloc PROTO(( size_t ));
++#endif /* __BORLANDC__ */
+
+ /* Set a region of memory to 0. */
+ extern void zero_out PROTO((char *, int));
+
+
+ /* from file nfa.c */
+
+
+
+
+
+###############################################################################
+# Makefile for flex 2.4.7 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.
+#
+# Copy initscan.c to scan.c to make your first executable. 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: flex.exe
+
+###############################################################################
+#
+# 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 = -DSHORT_FILE_NAMES=1 -DHAVE_STRING_H=1
+
+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
+#
+
+SRC = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
+ scan.c sym.c tblcmp.c yylex.c skel.c
+
+OBJS = $(SRC:.c=.obj)
+
+objects: $(OBJS)
+ @echo $(OBJS)
+
+###############################################################################
+#
+# Executable
+#
+
+flex.exe: $(OBJS)
+ tlink $(LINKFLAGS) @&&!
+$(LOADER) $**
+$&.exe
+$&.map
+$(LIBS)
+!
+
+#
+###############################################################################
+#
+# Lex files
+#
+
+FLEX = .\flex
+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
+
+#
+# end Makefile
+#
+###############################################################################
+
diff --git a/MISC/Borland.old/Turbo-C b/MISC/Borland.old/Turbo-C
new file mode 100644
index 0000000..bfe8a92
--- /dev/null
+++ b/MISC/Borland.old/Turbo-C
@@ -0,0 +1,179 @@
+Received: from 128.84.254.220 by ee.lbl.gov for <vern@ee.lbl.gov> (8.6.8.1/1.43r)
+ id PAA27266; Mon, 18 Apr 1994 15:08:26 -0700
+Received: from CLOYD.CS.CORNELL.EDU by thialfi.cs.cornell.edu (5.67/I-1.99E)
+ id AA28742; Mon, 18 Apr 94 18:08:14 -0400
+Received: from iraun1.ira.uka.de by cloyd.cs.cornell.edu (5.67/I-1.99D)
+ id AA19613; Mon, 18 Apr 94 18:08:19 -0400
+Received: from t500i2.telematik.informatik. (actually t500i2.telematik.informatik.uni-karlsruhe.de)
+ by iraun1.ira.uka.de with SMTP (PP); Tue, 19 Apr 1994 00:07:55 +0200
+Received: by t500i2.telematik.informatik.uni-karlsruhe.de (5.57/Ultrix3.0-C)
+ id AA10269; Tue, 19 Apr 94 00:09:14 +0200
+From: beigl@t500i2.telematik.informatik.uni-karlsruhe.de (Michael Beigl)
+Message-Id: <9404182209.AA10269@t500i2.telematik.informatik.uni-karlsruhe.de>
+Subject: Makefile-TurboC
+To: vern@cs.cornell.edu
+Date: Tue, 19 Apr 1994 00:09:13 +0200 (MET DST)
+X-Mailer: ELM [version 2.4 PL22]
+Mime-Version: 1.0
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Content-Length: 2739
+
+Hello
+
+Here are some additional adjustments to my Makefile. I was using "pure" DOS
+and an old Turbo C++ 1.0 version, so I had some problems with systemtools
+like mv etc. and problems with variables in my Makefile.
+
+Now follows my Makefile
+############################################################################
+# make file for "flex" tool
+
+# @(#) $Header: Makefile,v 2.3 89/06/20 17:27:12 vern Exp $ (LBL)
+
+# Porting considerations:
+#
+# For BSD machines:
+# CFLAGS =
+# LDFLAGS = -s
+# LINK = $(CC) $(CFLAGS) -o flex $(LDFLAGS) $(FLEXOBJS)
+# SKELETON_DIR = .
+# SKELETON_FILE = flex.skel
+# SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_DIR)/$(SKELETON_FILE)\"
+# O = o
+# YTAB = y.tab
+# FLEX = ./flex
+#
+# For System V Unix or Vax/VMS machines, merely add:
+# CFLAGS = -DSYS_V
+#
+# For MS-DOS, Turbo C:
+CC = tcc
+# -2+ 286 Options
+CFLAGS = -DSYS_V -DMS_DOS -O -G -Z -ml -v -2
+# /3 enable 32 bit processing
+# /ye expanded memory swapping
+# /yx extended memory swapping
+LINK = tlink @flex.lnk/c/x/v/3/ye
+SKELETON_DIR = .
+SKELETON_FILE = flex.skl
+SKELFLAGS = -DDEFAULT_SKELETON_FILE="$(SKELETON_DIR)/$(SKELETON_FILE)"
+O = obj
+EXE = .exe
+YTAB = y_tab
+FLEX = flex
+YACC = /yacc/byacc
+
+#
+# the first time around use "make first_flex"
+#
+
+FLEX_FLAGS =
+
+FLEXOBJS = \
+ ccl.$O \
+ dfa.$O \
+ ecs.$O \
+ gen.$O \
+ main.$O \
+ misc.$O \
+ nfa.$O \
+ parse.$O \
+ scan.$O \
+ sym.$O \
+ tblcmp.$O \
+ yylex.$O
+
+FLEX_C_SOURCES = \
+ ccl.c \
+ dfa.c \
+ ecs.c \
+ gen.c \
+ main.c \
+ misc.c \
+ nfa.c \
+ parse.c \
+ scan.c \
+ sym.c \
+ tblcmp.c \
+ yylex.c
+
+FLEX_C_SOURCES_1 = \
+ ccl.c \
+ dfa.c \
+ ecs.c \
+ gen.c \
+ main.c \
+ misc.c
+
+FLEX_C_SOURCES_2 = \
+ nfa.c \
+ parse.c \
+ scan.c \
+ sym.c \
+ tblcmp.c \
+ yylex.c
+
+flex.exe: $(FLEXOBJS)
+ $(LINK)
+
+
+flex: $(FLEX_C_SOURCES)
+ $(CC) $(CFLAGS) -c $(SKELFLAGS) $(FLEX_C_SOURCES_1)
+ $(CC) $(CFLAGS) -c $(SKELFLAGS) $(FLEX_C_SOURCES_2)
+ $(LINK)
+
+
+first_flex:
+ copy initscan.c scan.c
+ $(MAKE) flex
+
+parse.h parse.c: parse.y
+ $(YACC) -d parse.y
+ @rename $(YTAB).c parse.c
+ @rename $(YTAB).h parse.h
+
+scan.c: scan.l
+ $(FLEX) -ist $(FLEX_FLAGS) scan.l >scan.c
+
+scan.$O: scan.c parse.h
+
+main.$O: main.c
+ $(CC) $(CFLAGS) -c $(SKELFLAGS) main.c
+
+flex.man: flex.1
+ nroff -man flex.1 >flex.man
+
+lint: $(FLEX_C_SOURCES)
+ lint $(FLEX_C_SOURCES) > flex.lint
+
+distrib:
+ rename scan.c initscan.c
+ attrib +R -A -H -S initscan.c
+ $(MAKE) clean
+
+clean:
+ del *.obj
+ del *.lint
+ del core
+ del errs
+ del flex.exe
+ del parse.c
+ del parse.h
+ del flex.man
+ del tags
+
+tags:
+ ctags $(FLEX_C_SOURCES)
+
+vms: flex.man
+ $(MAKE) distrib
+
+test:
+ $(FLEX) -ist $(FLEX_FLAGS) scan.l | diff scan.c -
+
+############################################################################
+
+I think this Makefile will help some other simple DOS user
+
+ M. Beigl