]> pd.if.org Git - pccts/commitdiff
auto commit for import
authorTerence Parr <>
Fri, 6 Oct 1995 00:39:44 +0000 (19:39 -0500)
committerNathan Wagner <nw@hydaspes.if.org>
Sun, 26 Feb 2017 02:16:52 +0000 (20:16 -0600)
NOTES.BCC [new file with mode: 0755]
NOTES.MSVC [new file with mode: 0755]
NOTES.OS2 [new file with mode: 0755]
NOTES.watcom [new file with mode: 0755]
README [new file with mode: 0755]
SERVICES [new file with mode: 0755]
unbag.c [new file with mode: 0755]

diff --git a/NOTES.BCC b/NOTES.BCC
new file mode 100755 (executable)
index 0000000..8316ce5
--- /dev/null
+++ b/NOTES.BCC
@@ -0,0 +1,184 @@
+March 95
+Version 1.32 of pccts
+At the moment this file is available via anonymous FTP at
+        Node: marvin.ecn.purdue.edu
+        File: pub/pccts/1.32/NOTES.BCC
+Mail corrections or additions to David Seidel <71333.1575@compuserve.com>
+===============================================================================
+Notes on Building PCCTS 1.32 with Borland C++
+David Seidel, Innovative Data Concepts Incorporated
+CompuServe: 71333,1575
+Internet:   71333.1575@compuserve.com
+            dseidel@delphi.com
+I have gotten ANTLR and DLG to succesfully build with BCC 4.0, but have found
+from experience that ANTLR, in particular, is likely to run out of memory
+with grammars over a certain size, or with larger values for the -k and -ck
+options.  Now that BCC 4.02 and the new Borland Power Pack for DOS is now
+available, I feel that there is no excuse not to build these tools as
+32-bit executables, as they ought to be.
+For people without the Power Pack, the makefiles below should be fairly easily
+modified to build 16-bit real-mode executables, but I don't really recommend
+it.  As an alternative, you might consider the highly regarded DJGPP compiler
+(a DOS port of the Gnu GCC compiler, with a DOS extender included).  Hopefully
+some other PCCTS who has DJGPP can provode whatever advice is necessary.  The
+Watcom compiler is also an excellent possibility (albeit a commercial one),
+and I hope to make available Watcom makefiles in the near future.
+Here are the makefiles I am using.  Both makefiles use a compiler configuration
+file that contains compiler switches such as optimization settings.  I call
+this file bor32.cfg and keep a copy in both the ANTLR and DLG subdirectories.
+==== File: bor32.cfg (cut here) ===============================================
+-w-
+-RT-
+-x-
+-N-
+-k-
+-d
+-O2-e-l
+-Z
+-D__STDC__=1
+==== End of file bor32.cfg (cut here) =========================================
+==== File: antlr\bor32.mak (cut here) =========================================
+#
+#  ANTLR 1.32 Makefile for Borland C++ 4.02 with DPMI 32-bit DOS extender by
+#  David Seidel
+#  Innovative Data Concepts Incorporated
+#  71333.1575@compuserve.com (or) dseidel@delphi.com
+#
+#  Notes:   1. Compiler switches (optimization etc.) are contained in the
+#              file bor32.cfg.
+#           2. This makefile requires Borland C++ 4.02 or greater with
+#              the DOS Power Pack add-on package.
+#           3. Change the BCCDIR macro below to the topmost directory in
+#              which BCC is installed on your system.
+#
+BCCDIR   =  d:\bc4
+CC       =  bcc32
+SET      =  ..\support\set
+PCCTS_H  =  ..\h
+ANTLR    =  ..\bin\antlr
+DLG      =  ..\bin\dlg
+CFLAGS   =  -I$(BCCDIR)\include -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN \
+ +bor32.cfg
+LIBS     =  dpmi32 cw32
+OBJ_EXT  =  obj
+OBJS     =  antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj fset.obj \
+ gen.obj globals.obj hash.obj lex.obj main.obj misc.obj pred.obj dialog.obj \
+ set.obj
+.c.obj:
+      $(CC) -c $(CFLAGS) {$&.c }
+antlr.exe: $(OBJS)
+   tlink32 @&&|
+-Tpe -ax -c -s -L$(BCCDIR)\lib +
+$(BCCDIR)\lib\c0x32 $**
+$@
+$(LIBS)
+;
+|
+   copy *.exe ..\bin
+# *********** Target list of PC machines ***********
+#
+# Don't worry about the ambiguity messages coming from antlr
+# for making antlr.c etc...  [should be 10 of them, I think]
+#
+# leave this commented out for initial build!
+#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
+#   $(ANTLR) antlr.g
+antlr.$(OBJ_EXT): antlr.c mode.h tokens.h
+scan.$(OBJ_EXT): scan.c mode.h tokens.h
+# leave this commented out for initial build!
+#scan.c mode.h: parser.dlg
+#   $(DLG) -C2 parser.dlg scan.c
+set.$(OBJ_EXT): $(SET)\set.c
+   $(CC) -c $(CFLAGS) $(SET)\set.c
+==== End of file antlr\bor32.mak (cut here) ===================================
+==== File: dlg\bor32.mak (cut here) ===========================================
+#
+#  DLG 1.32 Makefile for Borland C++ 4.02 with DPMI 32-bit DOS extender by
+#  David Seidel
+#  Innovative Data Concepts Incorporated
+#  71333.1575@compuserve.com (or) dseidel@delphi.com
+#
+#  Notes:   1. Compiler switches (optimization etc.) are contained in the
+#              file bor32.cfg.
+#           2. This makefile requires Borland C++ 4.02 or greater with
+#              the DOS Power Pack add-on package.
+#           3. Change the BCCDIR macro below to the topmost directory in
+#              which BCC is installed on your system.
+#
+BCCDIR   =  d:\bc4
+CC       =  bcc32
+SET      =  ..\support\set
+PCCTS_H  =  ..\h
+ANTLR    =  ..\bin\antlr
+DLG      =  ..\bin\dlg
+CFLAGS   =  -I$(BCCDIR)\include -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN \
+ +bor32.cfg
+LIBS     =  dpmi32 cw32
+OBJ_EXT  =  obj
+OBJS     =  dlg_p.obj dlg_a.obj main.obj err.obj support.obj \
+ output.obj relabel.obj automata.obj set.obj
+.c.obj:
+      $(CC) -c $(CFLAGS) {$&.c }
+dlg.exe : $(OBJS)
+   tlink32 @&&|
+-Tpe -ax -c -s -L$(BCCDIR)\lib +
+c0x32 $**
+$@
+$(LIBS)
+;
+|
+   copy *.exe ..\bin
+dlg_p.obj:  dlg_p.c
+dlg_a.obj:  dlg_a.c
+main.obj:   main.c
+err.obj:    err.c
+support.obj:   support.c
+output.obj: output.c
+relabel.obj:   relabel.c
+automata.obj:  automata.c
+set.$(OBJ_EXT): $(SET)\set.c
+   $(CC) -c $(CFLAGS) $(SET)\set.c
+==== End of file dlg\bor32.mak (cut here) =====================================
+
+
+
diff --git a/NOTES.MSVC b/NOTES.MSVC
new file mode 100755 (executable)
index 0000000..ad0dd1e
--- /dev/null
@@ -0,0 +1,854 @@
+                        Microsoft Visual C Stuff\r
+\r
+[Modified by Terence Parr (September 1995) to change .C to .cpp\r]
+\r
+[This file contains notes on MSVC for Windows NT console execs by Dave\r
+ Seidel and an explanation of flags etc.. by John Hall; good luck,\r
+ Terence]\r
+\r
+Date: Sat, 31 Dec 1994 11:40:36 -0500 (EST)\r
+From: David Seidel <75342.2034@compuserve.com>\r
+\r
+I've succesfully build 1.31b3 with djgpp for DOS and MSVC 2.0 for Windows \r
+NT.  The only (minor) problem I had was that GNU make (version 3.71, in the \r
+djgpp port) complained about "multiple targets" in both the antlr and dlg \r
+makefiles.  I got around the error by, in each makefile, commenting out the \r
+$(SRC) dependency, for example:\r
+\r
+   antlr: $(OBJ) #$(SRC)\r
+\r
+I don't know why this is happenning, since you haven't changed that part of \r
+the makefile at all, and I think this used to work ok...\r
+\r
+Here are the makefiles I built from within the MSVC 2.0 environment for antlr \r
+and dlg and Windows NT console executables.  Please feel free to pass them \r
+on.  Of course, as soon as 1.31 "goes gold", I will send you nice new \r
+binaries.  I'm not going to bother to keep doing both Borland and djgpp for \r
+DOS however.  Instead, I'll just keep the djgpp version up to date and also \r
+provide WinNT binaries.\r
+\r
+Dave\r
+\r
+------ File antlr.mak: --------------\r
+\r
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+!IF "$(CFG)" == ""\r
+CFG=Win32 Debug\r
+!MESSAGE No configuration specified.  Defaulting to Win32 Debug.\r
+!ENDIF \r
+\r
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"\r
+!MESSAGE Invalid configuration "$(CFG)" specified.\r
+!MESSAGE You can specify a configuration when running NMAKE on this makefile\r
+!MESSAGE by defining the macro CFG on the command line.  For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "ANTLR.MAK" CFG="Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+!ERROR An invalid configuration is specified.\r
+!ENDIF \r
+\r
+################################################################################\r
+# Begin Project\r
+# PROP Target_Last_Scanned "Win32 Release"\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "WinRel"\r
+# PROP BASE Intermediate_Dir "WinRel"\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "WinRel"\r
+# PROP Intermediate_Dir "WinRel"\r
+OUTDIR=.\WinRel\r
+INTDIR=.\WinRel\r
+\r
+ALL : $(OUTDIR)/ANTLR.exe $(OUTDIR)/ANTLR.bsc\r
+\r
+$(OUTDIR) : \r
+    if not exist $(OUTDIR)/nul mkdir $(OUTDIR)\r
+\r
+# ADD BASE CPP /nologo /W3 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c\r
+# ADD CPP /nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /c\r
+# SUBTRACT CPP /Fr\r
+CPP_PROJ=/nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D\\r
+ "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /Fp$(OUTDIR)/"ANTLR.pch"\\r
+ /Fo$(INTDIR)/ /c \r
+CPP_OBJS=.\WinRel/\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+BSC32_SBRS= \\r
+       \r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"ANTLR.bsc" \r
+\r
+$(OUTDIR)/ANTLR.bsc : $(OUTDIR)  $(BSC32_SBRS)\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386\r
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\\r
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\\r
+ odbccp32.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no\\r
+ /PDB:$(OUTDIR)/"ANTLR.pdb" /MACHINE:I386 /OUT:$(OUTDIR)/"ANTLR.exe" \r
+DEF_FILE=\r
+LINK32_OBJS= \\r
+       $(INTDIR)/HASH.OBJ \\r
+       $(INTDIR)/MISC.OBJ \\r
+       $(INTDIR)/BUILD.OBJ \\r
+       $(INTDIR)/ANTLR.OBJ \\r
+       $(INTDIR)/GLOBALS.OBJ \\r
+       $(INTDIR)/PRED.OBJ \\r
+       $(INTDIR)/FSET.OBJ \\r
+       $(INTDIR)/FSET2.OBJ \\r
+       $(INTDIR)/GEN.OBJ \\r
+       $(INTDIR)/MAIN.OBJ \\r
+       $(INTDIR)/SCAN.OBJ \\r
+       $(INTDIR)/LEX.OBJ \\r
+       $(INTDIR)/ERR.OBJ \\r
+       $(INTDIR)/BITS.OBJ \\r
+       $(INTDIR)/SET.OBJ\r
+\r
+$(OUTDIR)/ANTLR.exe : $(OUTDIR)  $(DEF_FILE) $(LINK32_OBJS)\r
+    $(LINK32) @<<\r
+  $(LINK32_FLAGS) $(LINK32_OBJS)\r
+<<\r
+\r
+!ELSEIF  "$(CFG)" == "Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "WinDebug"\r
+# PROP BASE Intermediate_Dir "WinDebug"\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "WinDebug"\r
+# PROP Intermediate_Dir "WinDebug"\r
+OUTDIR=.\WinDebug\r
+INTDIR=.\WinDebug\r
+\r
+ALL : $(OUTDIR)/ANTLR.exe $(OUTDIR)/ANTLR.bsc\r
+\r
+$(OUTDIR) : \r
+    if not exist $(OUTDIR)/nul mkdir $(OUTDIR)\r
+\r
+# ADD BASE CPP /nologo /W3 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c\r
+# ADD CPP /nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /c\r
+# SUBTRACT CPP /Gf /Fr\r
+CPP_PROJ=/nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32"\\r
+ /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /Fp$(OUTDIR)/"ANTLR.pch"\\r
+ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"ANTLR.pdb" /c \r
+CPP_OBJS=.\WinDebug/\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+BSC32_SBRS= \\r
+       \r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"ANTLR.bsc" \r
+\r
+$(OUTDIR)/ANTLR.bsc : $(OUTDIR)  $(BSC32_SBRS)\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386\r
+# SUBTRACT LINK32 /MAP\r
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\\r
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\\r
+ odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386\\r
+ /OUT:$(OUTDIR)/"ANTLR.exe" \r
+DEF_FILE=\r
+LINK32_OBJS= \\r
+       $(INTDIR)/HASH.OBJ \\r
+       $(INTDIR)/MISC.OBJ \\r
+       $(INTDIR)/BUILD.OBJ \\r
+       $(INTDIR)/ANTLR.OBJ \\r
+       $(INTDIR)/GLOBALS.OBJ \\r
+       $(INTDIR)/PRED.OBJ \\r
+       $(INTDIR)/FSET.OBJ \\r
+       $(INTDIR)/FSET2.OBJ \\r
+       $(INTDIR)/GEN.OBJ \\r
+       $(INTDIR)/MAIN.OBJ \\r
+       $(INTDIR)/SCAN.OBJ \\r
+       $(INTDIR)/LEX.OBJ \\r
+       $(INTDIR)/ERR.OBJ \\r
+       $(INTDIR)/BITS.OBJ \\r
+       $(INTDIR)/SET.OBJ\r
+\r
+$(OUTDIR)/ANTLR.exe : $(OUTDIR)  $(DEF_FILE) $(LINK32_OBJS)\r
+    $(LINK32) @<<\r
+  $(LINK32_FLAGS) $(LINK32_OBJS)\r
+<<\r
+\r
+!ENDIF \r
+\r
+.c{$(CPP_OBJS)}.obj:\r
+   $(CPP) $(CPP_PROJ) $<  \r
+\r
+.cpp{$(CPP_OBJS)}.obj:\r
+   $(CPP) $(CPP_PROJ) $<  \r
+\r
+.cxx{$(CPP_OBJS)}.obj:\r
+   $(CPP) $(CPP_PROJ) $<  \r
+\r
+################################################################################\r
+# Begin Group "Source Files"\r
+\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\HASH.C\r
+DEP_HASH_=\\r
+       .\HASH.H\r
+\r
+$(INTDIR)/HASH.OBJ :  $(SOURCE)  $(DEP_HASH_) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\MISC.C\r
+DEP_MISC_=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/MISC.OBJ :  $(SOURCE)  $(DEP_MISC_) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\BUILD.C\r
+DEP_BUILD=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/BUILD.OBJ :  $(SOURCE)  $(DEP_BUILD) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\ANTLR.C\r
+DEP_ANTLR=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\ANTLR.H\\r
+       .\TOKENS.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       .\MODE.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/ANTLR.OBJ :  $(SOURCE)  $(DEP_ANTLR) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\GLOBALS.C\r
+DEP_GLOBA=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/GLOBALS.OBJ :  $(SOURCE)  $(DEP_GLOBA) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\PRED.C\r
+DEP_PRED_=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/PRED.OBJ :  $(SOURCE)  $(DEP_PRED_) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\FSET.C\r
+DEP_FSET_=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/FSET.OBJ :  $(SOURCE)  $(DEP_FSET_) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\FSET2.C\r
+DEP_FSET2=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/FSET2.OBJ :  $(SOURCE)  $(DEP_FSET2) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\GEN.C\r
+DEP_GEN_C=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/GEN.OBJ :  $(SOURCE)  $(DEP_GEN_C) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\MAIN.C\r
+DEP_MAIN_=\\r
+       .\STDPCCTS.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\ANTLR.H\\r
+       .\TOKENS.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       .\MODE.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/MAIN.OBJ :  $(SOURCE)  $(DEP_MAIN_) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\SCAN.C\r
+DEP_SCAN_=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\ANTLR.H\\r
+       .\TOKENS.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       .\MODE.H\\r
+       \PCCTS\H\DLGAUTO.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/SCAN.OBJ :  $(SOURCE)  $(DEP_SCAN_) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\LEX.C\r
+DEP_LEX_C=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/LEX.OBJ :  $(SOURCE)  $(DEP_LEX_C) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\ERR.C\r
+DEP_ERR_C=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\ANTLR.H\\r
+       .\TOKENS.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\ERR.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/ERR.OBJ :  $(SOURCE)  $(DEP_ERR_C) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\BITS.C\r
+DEP_BITS_=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       .\SYN.H\\r
+       .\HASH.H\\r
+       .\GENERIC.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\CONFIG.H\\r
+       .\PROTO.H\r
+\r
+$(INTDIR)/BITS.OBJ :  $(SOURCE)  $(DEP_BITS_) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=\PCCTS\SUPPORT\SET\SET.C\r
+DEP_SET_C=\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/SET.OBJ :  $(SOURCE)  $(DEP_SET_C) $(INTDIR)\r
+   $(CPP) $(CPP_PROJ)  $(SOURCE) \r
+\r
+# End Source File\r
+# End Group\r
+# End Project\r
+################################################################################\r
+------ File dlg.mak: ----------------\r
+\r
+# Microsoft Visual C++ Generated NMAKE File, Format Version 2.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+!IF "$(CFG)" == ""\r
+CFG=Win32 Debug\r
+!MESSAGE No configuration specified.  Defaulting to Win32 Debug.\r
+!ENDIF \r
+\r
+!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"\r
+!MESSAGE Invalid configuration "$(CFG)" specified.\r
+!MESSAGE You can specify a configuration when running NMAKE on this makefile\r
+!MESSAGE by defining the macro CFG on the command line.  For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "DLG.MAK" CFG="Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+!ERROR An invalid configuration is specified.\r
+!ENDIF \r
+\r
+################################################################################\r
+# Begin Project\r
+# PROP Target_Last_Scanned "Win32 Debug"\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "WinRel"\r
+# PROP BASE Intermediate_Dir "WinRel"\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "WinRel"\r
+# PROP Intermediate_Dir "WinRel"\r
+OUTDIR=.\WinRel\r
+INTDIR=.\WinRel\r
+\r
+ALL : $(OUTDIR)/DLG.exe $(OUTDIR)/DLG.bsc\r
+\r
+$(OUTDIR) : \r
+    if not exist $(OUTDIR)/nul mkdir $(OUTDIR)\r
+\r
+# ADD BASE CPP /nologo /W3 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c\r
+# ADD CPP /nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /c\r
+# SUBTRACT CPP /Fr\r
+CPP_PROJ=/nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D\\r
+ "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /Fp$(OUTDIR)/"DLG.pch"\\r
+ /Fo$(INTDIR)/ /c \r
+CPP_OBJS=.\WinRel/\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+BSC32_SBRS= \\r
+       \r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"DLG.bsc" \r
+\r
+$(OUTDIR)/DLG.bsc : $(OUTDIR)  $(BSC32_SBRS)\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386\r
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\\r
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\\r
+ odbccp32.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no\\r
+ /PDB:$(OUTDIR)/"DLG.pdb" /MACHINE:I386 /OUT:$(OUTDIR)/"DLG.exe" \r
+DEF_FILE=\r
+LINK32_OBJS= \\r
+       $(INTDIR)/SET.OBJ \\r
+       $(INTDIR)/AUTOMATA.OBJ \\r
+       $(INTDIR)/SUPPORT.OBJ \\r
+       $(INTDIR)/DLG_P.OBJ \\r
+       $(INTDIR)/ERR.OBJ \\r
+       $(INTDIR)/MAIN.OBJ \\r
+       $(INTDIR)/DLG_A.OBJ \\r
+       $(INTDIR)/RELABEL.OBJ \\r
+       $(INTDIR)/OUTPUT.OBJ\r
+\r
+$(OUTDIR)/DLG.exe : $(OUTDIR)  $(DEF_FILE) $(LINK32_OBJS)\r
+    $(LINK32) @<<\r
+  $(LINK32_FLAGS) $(LINK32_OBJS)\r
+<<\r
+\r
+!ELSEIF  "$(CFG)" == "Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "WinDebug"\r
+# PROP BASE Intermediate_Dir "WinDebug"\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "WinDebug"\r
+# PROP Intermediate_Dir "WinDebug"\r
+OUTDIR=.\WinDebug\r
+INTDIR=.\WinDebug\r
+\r
+ALL : $(OUTDIR)/DLG.exe $(OUTDIR)/DLG.bsc\r
+\r
+$(OUTDIR) : \r
+    if not exist $(OUTDIR)/nul mkdir $(OUTDIR)\r
+\r
+# ADD BASE CPP /nologo /W3 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c\r
+# ADD CPP /nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /c\r
+# SUBTRACT CPP /Fr\r
+CPP_PROJ=/nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32"\\r
+ /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /Fp$(OUTDIR)/"DLG.pch"\\r
+ /Fo$(INTDIR)/ /Fd$(OUTDIR)/"DLG.pdb" /c \r
+CPP_OBJS=.\WinDebug/\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+BSC32_SBRS= \\r
+       \r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+BSC32_FLAGS=/nologo /o$(OUTDIR)/"DLG.bsc" \r
+\r
+$(OUTDIR)/DLG.bsc : $(OUTDIR)  $(BSC32_SBRS)\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386\r
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\\r
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\\r
+ odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386\\r
+ /OUT:$(OUTDIR)/"DLG.exe" \r
+DEF_FILE=\r
+LINK32_OBJS= \\r
+       $(INTDIR)/SET.OBJ \\r
+       $(INTDIR)/AUTOMATA.OBJ \\r
+       $(INTDIR)/SUPPORT.OBJ \\r
+       $(INTDIR)/DLG_P.OBJ \\r
+       $(INTDIR)/ERR.OBJ \\r
+       $(INTDIR)/MAIN.OBJ \\r
+       $(INTDIR)/DLG_A.OBJ \\r
+       $(INTDIR)/RELABEL.OBJ \\r
+       $(INTDIR)/OUTPUT.OBJ\r
+\r
+$(OUTDIR)/DLG.exe : $(OUTDIR)  $(DEF_FILE) $(LINK32_OBJS)\r
+    $(LINK32) @<<\r
+  $(LINK32_FLAGS) $(LINK32_OBJS)\r
+<<\r
+\r
+!ENDIF \r
+\r
+.c{$(CPP_OBJS)}.obj:\r
+   $(CPP) $(CPP_PROJ) $<  \r
+\r
+.cpp{$(CPP_OBJS)}.obj:\r
+   $(CPP) $(CPP_PROJ) $<  \r
+\r
+.cxx{$(CPP_OBJS)}.obj:\r
+   $(CPP) $(CPP_PROJ) $<  \r
+\r
+################################################################################\r
+# Begin Group "Source Files"\r
+\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=\PCCTS\SUPPORT\SET\SET.C\r
+\r
+$(INTDIR)/SET.OBJ :  $(SOURCE)  $(INTDIR)\r
+   $(CPP) $(CPP_PROJ)  $(SOURCE) \r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\AUTOMATA.C\r
+DEP_AUTOM=\\r
+       .\DLG.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/AUTOMATA.OBJ :  $(SOURCE)  $(DEP_AUTOM) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\SUPPORT.C\r
+DEP_SUPPO=\\r
+       .\DLG.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/SUPPORT.OBJ :  $(SOURCE)  $(DEP_SUPPO) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\DLG_P.C\r
+DEP_DLG_P=\\r
+       .\DLG.H\\r
+       \PCCTS\H\ANTLR.H\\r
+       .\TOKENS.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       .\MODE.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/DLG_P.OBJ :  $(SOURCE)  $(DEP_DLG_P) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\ERR.C\r
+DEP_ERR_C=\\r
+       .\DLG.H\\r
+       \PCCTS\H\ANTLR.H\\r
+       .\TOKENS.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       \PCCTS\H\ERR.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/ERR.OBJ :  $(SOURCE)  $(DEP_ERR_C) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\MAIN.C\r
+DEP_MAIN_=\\r
+       .\STDPCCTS.H\\r
+       .\DLG.H\\r
+       \PCCTS\H\ANTLR.H\\r
+       .\TOKENS.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       .\MODE.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/MAIN.OBJ :  $(SOURCE)  $(DEP_MAIN_) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\DLG_A.C\r
+DEP_DLG_A=\\r
+       .\DLG.H\\r
+       \PCCTS\H\ANTLR.H\\r
+       .\TOKENS.H\\r
+       \PCCTS\H\DLGDEF.H\\r
+       .\MODE.H\\r
+       \PCCTS\H\DLGAUTO.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/DLG_A.OBJ :  $(SOURCE)  $(DEP_DLG_A) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\RELABEL.C\r
+DEP_RELAB=\\r
+       .\DLG.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/RELABEL.OBJ :  $(SOURCE)  $(DEP_RELAB) $(INTDIR)\r
+\r
+# End Source File\r
+################################################################################\r
+# Begin Source File\r
+\r
+SOURCE=.\OUTPUT.C\r
+DEP_OUTPU=\\r
+       .\DLG.H\\r
+       \PCCTS\SUPPORT\SET\SET.H\\r
+       \PCCTS\H\CONFIG.H\r
+\r
+$(INTDIR)/OUTPUT.OBJ :  $(SOURCE)  $(DEP_OUTPU) $(INTDIR)\r
+\r
+# End Source File\r
+# End Group\r
+# End Project\r
+################################################################################\r
+-------------------------------------\r
+\r
+         How to port PCCTS 1.10 (and 1.32 hopefully) to Visual C++\r
+\r
+                                   By\r
+\r
+                       John Hall <jhall@ivy.wpi.edu>\r
+\r
+Here is how to compile an ANTLR grammar in Visual C++.  These steps\r
+describe how to have your ANTLR grammar parse the input file the user\r
+selects when they choose File Open in your Windows application.  (Even\r
+if you aren't using Visual C++, the steps should be portable enough to\r
+other compilers.)\r
+\r
+ * Make sure that ANTLR and DLG generate ANSI code (use the -ga\r
+   switch).\r
+\r
+ * Set the following compiler flags in Visual C++ (these are in the\r
+   Memory Model category of the compiler options in the Project\r
+   Options menu):\r
+\r
+   FLAG MEANING\r
+   ==== ==============================================================\r
+   /AL Large memory model (multiple data segments; data items must be\r
+       smaller than 64K).\r
+\r
+   /Gtn        Allocates all items whose size is greater than or equal to n\r
+       in a new data segment.  (I let n be 256: /Gt256.)\r
+\r
+   /Gx-        All references to data items are done with far addressing in\r
+       case they are placed in a far segment.\r
+\r
+ * Add the following member variable to the attributes section of your\r
+   derived CDocument class (you will need to make sure you also\r
+   include stdio.h):\r
+\r
+   FILE *fp;\r
+\r
+ * Add the following method to your derived CDocument class:\r
+\r
+   BOOL CAppDoc::OnOpenDocument(const char* pszPathName)\r
+   {\r
+       // Call CDocument's OnOpenDocument to do housekeeping for us\r
+       // DON'T add anything to the loading section of Serialize\r
+       if (!CDocument::OnOpenDocument(pszPathName))\r
+           return FALSE;\r
+   \r
+       // Open input file\r
+       if ((fp = fopen(pszPathName, "r")) == NULL)\r
+           return FALSE;\r
+   \r
+       // Parse input file\r
+       ANTLR(start(), fp);\r
+   \r
+       // Close input file\r
+       fclose(fp);\r
+       return TRUE;\r
+   }\r
+\r
+   (Note: additional code may be necessary, depending on your parser.\r
+   For example, if your parser uses PCCTS's symbol table library, you\r
+   will need to insert calls to zzs_init and zzs_done.)\r
+\r
+ * Compile the generated C files as C++ files.  (I renamed the files\r
+   to have a .CPP extension to fool Visual C++ into thinking they were\r
+   C++ files.  One might also use the /Tp switch, but that switch\r
+   requires you separately include the filename.)  [I used this step\r
+   as an easy out for all the external linking errors I was getting\r
+   that I couldn't fix by declaring things extern "C".]\r
+\r
+ * Make sure the __STDC__ portion of the generated files gets\r
+   compiled.  (Either define __STDC__ yourself or else change all\r
+   occurrences of __STDC__ to __cplusplus in the generated files.  You\r
+   can define __STDC__ in the Preprocessor category of the compiler\r
+   options.)\r
+\r
+That last step is important for Visual C++, but may not apply to other\r
+compilers.  For C++ compilers, whether __STDC__ is defined is\r
+implementation dependent (ARM, page 379).  Apparently, Visual C++ does\r
+not to define it; it also does not support "old style" C function\r
+definitions (which is okay, according to page 404 of the ARM).  Those\r
+two things together caused problems when trying to port the code.\r
+When it saw this:\r
+\r
+#ifdef __STDC__\r
+void\r
+globals(AST **_root)\r
+#else\r
+globals(_root)\r
+AST **_root;\r
+#endif\r
+\r
+it skipped the __STDC__ section and tried to process the "old style"\r
+function definition, where it choked.\r
+\r
+When you finally get your parser to compile and link without error,\r
+you may get General Protection Fault errors at run time.  The problem\r
+I had was that a NULL was passed to a variable argument function\r
+without an explicit cast.  The function grabbed a pointer (32-bits)\r
+off the stack using va_arg, but the NULL was passed silently as the\r
+integer 0 (16 bits), making the resulting pointer was invalid.  (This\r
+was in PCCTS's sample C parser.)\r
+\r
+There is one other thing I might suggest to help you avoid a run-time\r
+error.  Make sure you redefine the default error reporting function,\r
+zzsyn.  To do this, put "#define USER_ZZSYN" in your #header section\r
+and put your own zzsyn somewhere.  You can then pop up a MessageBox or\r
+print the error to some output window.\r
\r
diff --git a/NOTES.OS2 b/NOTES.OS2
new file mode 100755 (executable)
index 0000000..df81b42
--- /dev/null
+++ b/NOTES.OS2
@@ -0,0 +1,296 @@
+14 April 94
+Version 1.20 of pccts
+
+At the moment this help file is available via anonymous FTP at
+
+        Node: marvin.ecn.purdue.edu
+        File: pub/pccts/1.20/NOTES.OS2
+
+Mail corrections or additions to Steve Robenalt <steve@molly.dny.rockwell.com>
+===============================================================================
+Notes on building PCCTS under OS/2 2.X with the C Set compilers.
+
+The supplied makefiles can be used to build PCCTS under OS/2 with minimal
+trouble. First you need to edit the makefiles such that the Unix specific
+defaults are commented out, then uncomment the lines which are specific
+to OS/2 and C Set/2 compilers as originally set up by Ed Harfmann. Note
+also that you need to use the target list which reflects the appropriate
+naming conventions. Some of the lines now need to be changed to reflect
+differences in conventions between the operating systems: 1) change forward
+slashes in directories to backslashes, 2) change command line parameters
+from -option to /option (note that this applies to C Set, not ANTLR and DLG
+options), and 3) change rm to del for clean and scrub targets.
+
+To build ANTLR for the first time:
+
+note: I tried various combinations of "touch"ing files to try to prevent nmake
+      from using ANTLR to rebuild itself, and was unsuccessful.
+
+In the section labelled "Target list of PC machines", comment out the
+scan.c and antlr.c dependencies. This prevents nmake from trying to invoke
+ANTLR to build itself. After you have built ANTLR successfully for the first
+time, you can uncomment these lines and it will build itself normally. (If you
+had a working 1.10 installation before, you can also use the older binaries
+when building the new ones.)
+
+An example of the resulting makefile, with all the extra baggage for Unix, DOS,
+and OS/2 1.X is shown here:
+
+----- cut here -----
+
+#
+# Makefile for ANTLR 1.20
+#
+# SOFTWARE RIGHTS
+#
+# We reserve no LEGAL rights to the Purdue Compiler Construction Tool
+# Set (PCCTS) -- PCCTS is in the public domain.  An individual or
+# company may do whatever they wish with source code distributed with
+# PCCTS or the code generated by PCCTS, including the incorporation of
+# PCCTS, or its output, into commerical software.
+# 
+# We encourage users to develop software with PCCTS.  However, we do ask
+# that credit is given to us for developing PCCTS.  By "credit",
+# we mean that if you incorporate our source code into one of your
+# programs (commercial product, research project, or otherwise) that you
+# acknowledge this fact somewhere in the documentation, research report,
+# etc...  If you like PCCTS and have developed a nice tool with the
+# output, please mention that you developed it using PCCTS.  In
+# addition, we ask that this header remain intact in our source code.
+# As long as these guidelines are kept, we expect to continue enhancing
+# this system and expect to make other tools available as they are
+# completed.
+#
+# ANTLR 1.20
+# Terence Parr
+# Purdue University
+# With AHPCRC, University of Minnesota
+# 1989-1994
+#
+# Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by
+# Ed Harfmann
+# Micro Data Base Systems
+# Lafayette, Indiana
+# - With updates by Steve Robenalt 4/94
+#
+SET=..\support\set
+PCCTS_H=..\h
+
+#
+# C-Set/2 for OS/2
+#
+CC=icc
+CFLAGS= /I. /I$(SET) /I$(PCCTS_H) /Sa /W3 /DUSER_ZZSYN
+OUT_OBJ = /Fo
+LIBS=
+ANTLR=..\bin\antlr
+DLG=..\bin\dlg
+OBJ_EXT = obj
+
+antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
+        fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
+        misc.obj set.obj pred.obj dialog.obj
+        link386 @<<
+$** /NOI
+$@ /STACK:32768
+
+$(LIBS: = +^
+)
+$(DEF_FILE) $(LFLAGS) ;
+<<
+        copy *.exe ..\bin
+
+#
+# *********** Target list of PC machines ***********
+#
+# Don't worry about the ambiguity messages coming from antlr
+# for making antlr.c etc...  [should be 10 of them, I think]
+#
+#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
+#      $(ANTLR) antlr.g
+
+antlr.$(OBJ_EXT): antlr.c mode.h tokens.h
+
+scan.$(OBJ_EXT): scan.c mode.h tokens.h
+
+#scan.c mode.h: parser.dlg
+#      $(DLG) -C2 parser.dlg scan.c
+
+set.$(OBJ_EXT): $(SET)\set.c
+       $(CC) $(CFLAGS) /C $(OUT_OBJ)set.$(OBJ_EXT) $(SET)\set.c
+
+#
+# what files does PCCTS generate (both ANTLR and DLG)
+#
+
+PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h
+
+SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \
+       hash.c lex.c main.c misc.c $(SET)\set.c pred.c dialog.c
+
+#
+# ****** These next targets are common to UNIX and PC world ********
+#
+
+#clean up all the intermediate files
+clean:
+       del *.$(OBJ_EXT) 
+
+#remove everything in clean plus the PCCTS files generated
+scrub:
+       del $(PCCTS_GEN) *.$(OBJ_EXT) 
+
+----- cut here -----
+
+To build DLG for the first time:
+
+Follow the same steps as were used to build ANTLR, changing the slashes and
+commands, targets, and extensions for OS/2. Comment out the dependencies for
+dlg_p.c and dlg_a.c to prevent nmake from trying to invoke ANTLR and DLG to
+build DLG (unless you have 1.10 binaries).
+
+An example of the resulting makefile, with all the extra baggage for Unix, DOS,
+and OS/2 1.X is shown here:
+
+----- cut here -----
+
+#
+# Makefile for DLG 1.20
+# Terence Parr
+# Purdue University
+# 1989-1993
+#
+# Ported to IBM C-Set/2 and Microsoft 6.0 by
+# Ed Harfmann
+# Micro Data Base Systems
+# Lafayette, Indiana
+# - With updates by Steve Robenalt 4/94
+#
+SET=..\support\set
+PCCTS_H=..\h
+
+#
+# C-Set/2 for OS/2
+#
+CC=icc
+CFLAGS= /I. /I$(SET) /I$(PCCTS_H) /Sa /W3
+OUT_OBJ = /Fo
+LIBS=
+ANTLR=..\bin\antlr
+DLG=..\bin\dlg
+OBJ_EXT=obj
+
+dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
+        output.obj relabel.obj automata.obj
+        link386 @<<
+$** /NOI
+$@ /STACK:32768
+
+$(LIBS: = +^
+)
+$(DEF_FILE) $(LFLAGS) ;
+<<
+        copy *.exe ..\bin
+
+SRC = dlg_p.c dlg_a.c main.c err.c $(SET)\set.c support.c output.c \
+        relabel.c automata.c
+
+#dlg_p.c parser.dlg err.c tokens.h : dlg_p.g
+#      $(ANTLR) dlg_p.g
+
+#dlg_a.c mode.h : parser.dlg
+#      $(DLG) -C2 parser.dlg dlg_a.c
+
+dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h
+       $(CC) $(CFLAGS) /c dlg_p.c
+
+dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h
+       $(CC) $(CFLAGS) /c dlg_a.c
+
+main.$(OBJ_EXT) : main.c dlg.h
+       $(CC) $(CFLAGS) /c main.c
+
+set.$(OBJ_EXT) : $(SET)\set.c
+       $(CC) /c $(CFLAGS) $(SET)\set.c
+
+lint:
+       lint *.c
+
+#clean up all the intermediate files
+clean:
+       del *.$(OBJ_EXT) 
+
+----- cut here -----
+
+Once you have built ANTLR and DLG successfully, you will also want to build
+the genmk utility, located at ~\pccts\support\genmk. The makefile in this 
+directory is relatively simple to modify, so I won't repeat it here.
+
+At this point, you can test the executables by building one of the sample
+programs, such as the Pascal or C example under ~pccts\lang. The prototype
+makefile which is in these directories will work fine as a base, with OS/2
+specific modifications as noted above. Note that the /Sa flag defines the
+ANSI C mode of the compiler which is not the default. The default mode
+does not define __STDC__ and will lead to lots of errors.
+
+A sample pascal makefile is shown below:
+
+----- cut here -----
+
+GRM =pascal.g
+LEX_FILE =pscan.dlg
+GSRC=pascal.c err.c pscan.c ttree.c adebug.c
+GOBJ=pascal.obj err.obj pscan.obj ttree.obj adebug.obj
+
+PCCTS_GEN= pascal.c err.c $(LEX_FILE) pscan.c mode.h tokens.h
+
+SRC =$(GSRC) pmain.c sym.c
+OBJ =$(GOBJ) pmain.obj sym.obj
+INCL = ..\..\h
+SYM = ..\..\support\sym
+ANTLR = ..\..\bin\antlr
+DLG = ..\..\bin\dlg
+
+CFLAGS=/I. /I$(INCL) /Sa
+AFLAGS= -fl $(LEX_FILE) -gh
+
+pascal.exe : $(OBJ)
+       $(CC) $(CFLAGS) /Fopascal.exe $(OBJ)
+
+pascal.c $(LEX_FILE) : $(GRM)
+       $(ANTLR) $(AFLAGS) $(GRM)
+
+mode.h pscan.c : $(LEX_FILE)
+       $(DLG) -C2 $(LEX_FILE) pscan.c
+
+pmain.obj : pmain.c pascal.h
+
+pascal.obj : pascal.c mode.h tokens.h
+
+sym.obj : $(SYM)\sym.c
+       icc /c /Fo sym.obj $(CFLAGS) $(SYM)\sym.c
+
+err.obj : err.c
+
+clean:
+       del $(PCCTS_GEN) *.obj
+
+
+----- cut here -----
+
+The C example can be built in much the same way.
+
+If you have problems compiling anything, I would appreciate hearing about
+it. I was able to get everything built and working without changing any
+of the supplied or generated C code, so if you find that you need to make
+changes to any code, I've probably written something up incorrectly.
+
+Please post comments to the mailing list for PCCTS at:
+
+       pccts-users@ahpcrc.umn.edu
+
+since I am most likely to see them there.
+
+- Steve Robenalt
+
+
diff --git a/NOTES.watcom b/NOTES.watcom
new file mode 100755 (executable)
index 0000000..1120dca
--- /dev/null
@@ -0,0 +1,114 @@
+From Tom Zougas, zougas@civ.utoronto.ca
+
+These are the changes I had to make to get ANTLR to compile under Watcom C
+10.0 32-bit mode. I'm including the makefiles for antlr and dlg:
+
+[Warning from T. Parr: I think that I may have expanded the tabs by
+ mistake in this file.  You might have to convert them back to
+ tabs to have this file work correctly.]
+
+antlr.mak:
+-----------------------------------------------------------------------
+
+SET=..\support\set
+PCCTS_H=..\h
+
+#
+#   Watcom
+#
+CC=wcl386
+ANTLR=..\bin\antlr
+DLG=..\bin\dlg
+CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC
+OUT_OBJ = -o
+OBJ_EXT = obj
+LINK = wcl386
+
+.c.obj :
+        $(CC) -c $[* $(CFLAGS)
+
+antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj &
+        fset.obj gen.obj globals.obj hash.obj lex.obj main.obj &
+        misc.obj set.obj pred.obj
+        $(LINK) -fe=antlr.exe *.obj -k14336
+        copy *.exe ..\bin
+
+# *********** Target list of PC machines ***********
+#
+# Don't worry about the ambiguity messages coming from antlr
+# for making antlr.c etc...  [should be 10 of them, I think]
+#
+antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
+        $(ANTLR) antlr.g
+
+antlr.$(OBJ_EXT): antlr.c mode.h tokens.h
+
+scan.$(OBJ_EXT): scan.c mode.h tokens.h
+
+scan.c mode.h: parser.dlg
+        $(DLG) -C2 parser.dlg scan.c
+
+set.$(OBJ_EXT): $(SET)\set.c
+        $(CC) $(CFLAGS) -c set.$(OBJ_EXT) $(SET)\set.c
+
+#
+# ****** These next targets are common to UNIX and PC world ********
+#
+
+#clean up all the intermediate files
+clean:
+        del *.obj
+
+#remove everything in clean plus the PCCTS files generated
+scrub:
+        del $(PCCTS_GEN) 
+        del *.$(OBJ_EXT)
+---------------------------------------------------------------------
+dlg.mak:
+---------------------------------------------------------------------
+SET=..\support\set
+PCCTS_H=..\h
+
+#
+#   Watcom
+#
+CC=wcl386
+ANTLR=..\bin\antlr
+DLG=..\bin\dlg
+CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC
+LIBS=
+OBJ_EXT = obj
+LINK = wcl386
+
+.c.obj :
+        $(CC) -c $[* $(CFLAGS)
+
+dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj &
+        output.obj relabel.obj automata.obj
+        $(LINK) -fe=dlg.exe *.obj -k14336
+        copy *.exe ..\bin
+
+SRC = dlg_p.c dlg_a.c main.c err.c $(SET)\set.c support.c output.c &
+        relabel.c automata.c
+
+dlg_p.c parser.dlg err.c tokens.h : dlg_p.g
+        $(ANTLR) dlg_p.g
+
+dlg_a.c mode.h : parser.dlg
+        $(DLG) -C2 parser.dlg dlg_a.c
+
+dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h
+        $(CC) $(CFLAGS) -c dlg_p.c
+
+dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h
+        $(CC) $(CFLAGS) -c dlg_a.c
+
+main.$(OBJ_EXT) : main.c dlg.h
+        $(CC) $(CFLAGS) -c main.c
+
+set.$(OBJ_EXT) : $(SET)\set.c
+        $(CC) -c $(CFLAGS) $(SET)\set.c
+
+#clean up all the intermediate files
+clean:
+        del *.$(OBJ_EXT)
diff --git a/README b/README
new file mode 100755 (executable)
index 0000000..45b8bda
--- /dev/null
+++ b/README
@@ -0,0 +1,209 @@
+
+                           Welcome to PCCTS 1.33
+
+                              October 5, 1995
+
+
+                          Parr Research Corporation
+                                    with
+                  Purdue University Electrical Engineering
+                                    and
+                       University of Minnesota, AHPCRC
+
+                                Terence Parr
+                                Russell Quong
+                                 Will Cohen
+                                 Hank Dietz
+
+[The "NOTES for new users" by Tom Moog is available now via web
+ browser at http:www.mcs.net/~tmoog and via anonymous ftp at
+ ftp.mcs.net/mcsnet.users/tmoog.]
+
+[We've removed PCCTS.FUTURE from the distribution and added file SERVICES,
+ which describes the services of Parr Research Corporation.]
+
+
+                                INSTALLATION
+
+     This document describes the installation of PCCTS 1.33 on UNIX
+and non-UNIX machines.  The UNIX installation is trivial while the
+non-UNIX folks have a bit more work to do as an install script
+explicitly for there machine will not exist--they will have to
+interpret the install script.
+
+     PCCTS 1.33 includes a number of different programs and examples
+in the software release package -- most of which like to live in their
+own directories.  The install script will build a standard hierarchy.
+Or, if you get the tar file off the ftp site, the hierarchy will be
+constructed automatically by tar.
+
+     The PCCTS executables (antlr, dlg) may be placed anywhere the user
+wishes but the install script places them in the bin directory created
+during installation.
+
+1.0.  UNIX USERS
+
+This section is for UNIX users and describes the most convenient
+installation procedure.
+
+1.1.  FORMAT: pccts.tar
+
+To begin installation, place the pccts.tar file into the directory
+where you want to place a pccts subdirectory.  Untar the file with
+
+     tar xvf pccts.tar
+
+and cd into it.  To install PCCTS, simply type
+     make
+
+which will build the standard PCCTS directory hierarchy (under the
+directory where you ran the install script) and build executable
+versions of antlr and dlg.
+
+1.2.  FORMAT: pccts.bag
+
+     To begin installation, the user should create a directory (usually
+called pccts) where the PCCTS source subtree is to be created.  Place
+the pccts.bag file and the install script into this directory and cd
+into it.  To install PCCTS, simply type
+     sh install
+
+which will build the standard PCCTS directory hierarchy (under the
+directory where you ran the install script), "unbag" all of the files
+and build executable versions of antlr and dlg.
+
+If you do not have the 'sh' shell, you'll need the install.unbag.reqd
+file.
+
+NOTE: If you are using the later SGI C++ compilers, use -woff 3262 to
+get rid of a bunch of noise by the compiler (warnings).
+
+
+2.0.  NON-UNIX USERS
+
+     ANTLR was written using portable (we hope), vanilla K&R-style C,
+ANSI C, and C++.  It has been successfully ported to a variety of
+environments.  We do not provide an installation script explicitly for
+non-Unix users.  You must interpret the install script and perform the
+analogous operations on your machine.  There is an install script,
+install.mpw, for Macintosh programmers.
+
+IMPORTANT NOTE:  For PC users:  You must create the parser.dlg and
+                "touch" scan.c in antlr and dlg directories or the
+                makefiles will try to execute antlr and dlg, which
+                don't exist yet.  The first time, you want only to
+                compile the C files in order to obtain an executable
+                for antlr and dlg.  From this point, a change in
+                antlr.g or dlg_p.g will force antlr/dlg to regenerate
+                themselves.
+
+                You must define symbol PC if you want things to work
+                out right for use on a DOS, OS/2, Windows machine.
+                This affects the config.h file, which you can change
+                as you wish.
+
+     For Mac programmers using MPW (Macintosh Programmer's Workshop),
+define symbol MPW to get the correct config.h stuff included.
+
+3.0.  EMAIL VERSION RECIPIENTS
+
+     If you received PCCTS via email response from
+pccts@ecn.purdue.edu you have one additional installation step to
+perform over the ftp folks (and pccts.tar is unavailable).  You will
+have received a number of bite-size chunks of pccts which are small
+enough to be emailed (~1500 lines each).  You must reconstruct the
+PCCTS files before you can begin installation.  In order to rebuild an
+original file, you must have "one.c" which will take the chunks and
+pack them together.  If you are a non-UNIX type, you must have the
+"unbag.c" file which unbags the bags created by our mail archiver.
+UNIX folks use the shell to unbag as they would for shar files (this
+will be done automatically by the install script).
+
+     To install PCCTS, place all PCCTS mail messages into a pccts
+directory, remove the mail headers from one.c.  Then compile one.c
+with:
+
+     cc -o one one.c
+
+and then type:
+
+     ./one f1 f2 ... fn
+
+where f1..fn are the parts of PCCTS source sent as chunks (i.e. these
+files will be all the files you received NOT including one.c, unbag.c,
+README, install and the request acknowledge banner).  There is no need
+to remove mail headers from the chunk files and they may appear in any
+order.  The subject line of the mail will identify it as a chunk and a
+chunk of what file.  The "one" program should be used to put pccts.bag
+back together.  You are now in a position to begin normal PCCTS
+installation.  All files you receive should go into a pccts directory.
+
+     Note that all files which arrive in "chunks" must be put back
+together using "one".  Beware that you do not mix chunks from more
+than one original file.  For instance, do not specify all chunks that
+you collect from the PCCTS mailbot on the "one" command line unless
+you have requested only one original file that was split into multiple
+files.  Each chunk knows which original file it is a part of, where it
+goes in that file and how many total chunks are required to rebuild
+that original.
+
+4.0.  WORD SIZE AND PC USERS
+
+     The config.h file now sets up the word size for your compiler
+automatically.
+
+
+                                TUTORIAL
+
+     The advanced tutorial should be placed in a directory at the
+same level as antlr, dlg, support etc...  Do a
+
+     sh advtut.bag
+
+to unbag (or use the unbag program) and then type
+
+     make -s all
+
+which will create executables called tut1-tut4.  Naturally, if you got
+the tutorials from the ftp site, the tar format of the tutorials can
+be obtained for easier installation.
+
+Unfortunately, the tutorials have changed little since the 1.06
+release.  With luck, these will be enhanced and an AST tutorial will
+appear.
+
+                         MACHINE COMPATIBILITY
+
+PCCTS is known to compile "out of the box" on the following machines
+and/or operating systems:  [didn't have time to retest on all these
+machines, but seems to be highly portable still].
+
+o  DECSTATION 5000
+
+o  SGI; use "-woff 3262" in your CFLAGS make variable
+
+o  Sun SparcStation (cc, gcc, g++, Cfront, acc)
+
+o  VAX C under VMS
+
+o  Linux SLS 0.99, gcc/g++
+
+o  386 PC, NetBSD 0.9, gcc 2.4.5
+
+o  HP 9000/755, HP-UX 9.01, HP cc
+
+o  486 PC, OS/2 2.1 (w/long filenames), IBM C Set++ 2.1
+
+o  NeXTStep 3.2 running g++/gcc 2.6.3 (pentium-90)
+
+
+                           INCOMPATIBILITIES
+
+Please see the release notes.
+
+
+                                CREDITS
+
+Please see the history.ps or history.txt.
diff --git a/SERVICES b/SERVICES
new file mode 100755 (executable)
index 0000000..63511ab
--- /dev/null
+++ b/SERVICES
@@ -0,0 +1,86 @@
+October 2, 1995
+
+                        Services Provided
+
+                                By
+
+                      Parr Research Corporation
+                       parrt@parr-research.com
+                  http://www.parr-research.com/~parrt/prc
+
+ ``Thorough Research, Business Integrity, and really cool software tools''
+
+Programming language and data translation can be difficult and
+frustrating tasks.  Parr Research Corporation, the primary developer
+and distributor of the public domain language toolkit PCCTS (ANTLR,
+DLG, SORCERER), has extensive experience and expertise that can be
+applied to your projects to successfully:
+
+o      Reduce translator design and development time
+
+       We help you avoid unnecessary delays in your overall project
+       due to difficult translation tasks.
+
+o      Reduce development cost
+
+       Odds are that we have seen something similar to your project
+       and can produce an excellent and quick solution.
+
+o      Reduce risk
+
+       We resolve crucial technical questions or development problems
+       that hamper your efforts on time-critical projects.
+
+Parr Research accomplishes these goals by providing the following
+services:
+
+o      Design consultations (fixed price or per hour)
+
+       Parr Research designs ``front-end''s and translators.
+
+o      Development (fixed price or per hour)
+
+o      Retainers / Maintenance / Support agreements
+
+       PCCTS and translator-implementation questions answered
+       Special modifications to PCCTS
+       Bug fixes
+       Maintenance agreements are insurance policies against
+               unforeseen development problems
+
+o      Installation support
+
+o      Tutorials
+
+       ANTLR/DLG
+       SORCERER, intermediate-representations
+       Translation techniques
+       On-site or off-site tutorials
+
+Parr Research Corporation has a proven record of superior service with
+research labs and corporations such as the Army Research Lab, Tandem,
+NeXT, Berkeley Systems, Computing Devices International, and Pencom.
+In addition, we have informal relationships with Apple, Sun Labs,
+Intel, and Motorola as well as numerous academic institutions.
+
+To discuss how Parr Research can save your project time and money
+please contact:
+
+Terence Parr, Ph.D.
+Parr Research Corporation
+1535 Francisco Street Suite 9
+San Francisco, California 94123
+(415) 346 1070
+parrt@parr-research.com
+
+
+For a summary of the ANTLR parser generator as published in the July
+issue of Software Practice and Experience see:
+
+       ftp://ftp.parr-research.com/pub/pccts/papers/antlr.ps
+
+A pre-release version of the upcoming book by Terence Parr entitled
+``Language Translation Using PCCTS and C++ (A Reference Guide)'' is
+available at 
+
+       ftp://ftp.parr-research.com/pub/pccts/Book/reference.ps
diff --git a/unbag.c b/unbag.c
new file mode 100755 (executable)
index 0000000..cfaf208
--- /dev/null
+++ b/unbag.c
@@ -0,0 +1,93 @@
+/*
+ * unbag
+ *
+ * This program "unbags" files "bagged" by bag.  Can be used for non-UNIX
+ * folks that need to unbag stuff.
+ */
+#include <stdio.h>
+
+static int line=0;
+
+main(argc, argv)
+int argc;
+char **argv;
+{
+       FILE *f;
+
+       if ( argc <= 1 )
+       {
+               fprintf(stderr, "unbag: missing bagfile name\n");
+               exit(-1);
+       }
+       f = fopen(argv[1], "r");
+       if ( f == NULL )
+       {
+               fprintf(stderr, "unbag: cannot open %s\n", argv[1]);
+               exit(-1);
+       }
+
+       unbag( f );
+
+       fclose( f );
+}
+
+unbag(f)
+FILE *f;
+{
+       FILE *output;
+       static char text[2048];
+       char *nm, *p;
+
+       while ( fgets(text, 2048, f) != NULL )
+       {
+               line++;
+               if ( strncmp(text, "cat << \\EOF_", strlen("cat << \\EOF_"))!= 0 )
+               {
+                       fprintf(stderr, "unbag: line %d: bad file format (missing BEGIN)\n", line);
+                       fprintf(stderr, "unbag: text was '%s'\n", text);
+                       exit(-1);
+               }
+               nm = &text[strlen("cat << \\EOF_")];
+               for (p=nm; *p!=' '; p++) {;}    /* find end of filename */
+               *p = '\0';
+               output = fopen(nm, "w");
+               if ( output == NULL )
+               {
+                       fprintf(stderr, "unbag: cannot open ouput file %s\n", nm);
+                       exit(-1);
+               }
+               extract(f, output, nm);
+               fclose(output);
+       }
+}
+
+/* Cat a f to f2 (lines <= 2047 characters) stopping after reading 'stop' */
+extract(f, f2, stop)
+FILE *f, *f2;
+char *stop;
+{
+       static char text[2048];
+       char *p;
+
+       while ( fgets(text, 2048, f)!=NULL )
+       {
+               line++;
+               text[strlen(text)-1] = '\0';    /* rm \n */
+               if ( strncmp(text, "EOF_", strlen("EOF_")) == 0 )
+                       if ( strcmp(&text[strlen("EOF_")], stop) == 0 ) return;
+               if ( text[0] != '>' )
+               {
+                       fprintf(stderr,"unbag: line %d: bad file format: %s\n", line, stop);
+                       exit(-1);
+               }
+               fprintf(f2, "%s\n", &text[1]);
+/*
+               for (p=&text[1]; *p!='\0'; p++)
+               {
+                       if ( *p=='\\' ) p++;
+                       putc(*p, f2);
+               }
+               putc('\n', f2);
+*/
+       }
+}