Changed copyright notice, made installation less dependent on ACK
authorceriel <none@none>
Sat, 23 Nov 1991 10:41:43 +0000 (10:41 +0000)
committerceriel <none@none>
Sat, 23 Nov 1991 10:41:43 +0000 (10:41 +0000)
25 files changed:
util/LLgen/.distr
util/LLgen/COPYING [new file with mode: 0644]
util/LLgen/LLgen.1
util/LLgen/Makefile
util/LLgen/proto.make
util/LLgen/src/LLgen.g
util/LLgen/src/Makefile
util/LLgen/src/alloc.c
util/LLgen/src/cclass.c
util/LLgen/src/cclass.h
util/LLgen/src/check.c
util/LLgen/src/compute.c
util/LLgen/src/extern.h
util/LLgen/src/gencode.c
util/LLgen/src/global.c
util/LLgen/src/io.h
util/LLgen/src/machdep.c
util/LLgen/src/main.c
util/LLgen/src/name.c
util/LLgen/src/proto.make
util/LLgen/src/reach.c
util/LLgen/src/sets.c
util/LLgen/src/sets.h
util/LLgen/src/tokens.g
util/LLgen/src/types.h

index 0717e0b..6b0b1d2 100644 (file)
@@ -1,4 +1,5 @@
 READ_ME
+COPYING
 lib
 src
 Makefile
diff --git a/util/LLgen/COPYING b/util/LLgen/COPYING
new file mode 100644 (file)
index 0000000..cefd370
--- /dev/null
@@ -0,0 +1,18 @@
+Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+All rights reserved.
+
+Permission to use and copy this software and its documentation for research
+and educational use only is hereby granted, provided that the above copyright
+notice and this permission notice appear in all copies.  No commercial use of
+any kind is permitted without permission in writing from the copyright owner.
+
+One way of obtaining such a permission is to obtain the Amsterdam Compiler
+Kit.  LLgen is part of it.  The Amsterdam Compiler Kit is available from
+two companies:
+
+Transmediair Products & Support B.V.            Unipress Software
+Melkweg 3                                       2025 Lincoln Highway
+3721 RG  Bilthoven                              Edison, NJ 08817
+The Netherlands                                 U.S.A.
+tel: +31 30 281820                              tel: +1 908 287 2100
+fax: +31 30 292294                              fax: +1 908 287 4929
index abf7d99..91b95c1 100644 (file)
@@ -82,9 +82,9 @@ so that the compiler can generate a jump table for it. This will only be
 done for switches that have density between
 \fIlow_percentage\fP and \fIhigh_percentage\fP, as explained below.
 Usually, compilers generate a jumptable when the density of the switch
-is above a certain threshold. If you want jump tables in more cases,
-set \fIhigh_percentage\fP to this threshold, and \fIlow_percentage\fP to
-a minimum threshold. There is a time-space trade-off here.
+is above a certain threshold. When jump tables are to be used more often,
+\fIhigh_percentage\fP must be set to this threshold, and \fIlow_percentage\fP
+must be set to a minimum threshold. There is a time-space trade-off here.
 .I num
 is the minimum number of cases in a switch for the \fB\-j\fP option to be
 effective. The default value (if
index c9b4162..1be2edd 100644 (file)
@@ -1,17 +1,16 @@
 # $Header$
-EMHOME=../..
-INSTALLDIR=$(EMHOME)/bin
-LIBDIR=$(EMHOME)/lib/LLgen
-MANDIR=$(EMHOME)/man
+INSTALLDIR=/usr/local/bin
+LIBDIR=/usr/local/lib/LLgen
+MANDIR=/usr/local/man/man1
 
 all:
-       cd src; make
+       cd src; make LIBDIR=$(LIBDIR)
 
 clean:
        -cd src; make clean
 
 install:
-       cd src; make
+       cd src; make LIBDIR=$(LIBDIR)
        rm -f $(INSTALLDIR)/LLgen $(LIBDIR)/rec $(LIBDIR)/incl $(MANDIR)/LLgen.1
        cp src/LLgen $(INSTALLDIR)/LLgen
        cp lib/rec $(LIBDIR)/rec
@@ -19,7 +18,7 @@ install:
        cp LLgen.1 $(MANDIR)/LLgen.1
 
 firstinstall:
-       cd src; make first
+       cd src; make LIBDIR=$(LIBDIR) first
        rm -f $(INSTALLDIR)/LLgen $(LIBDIR)/rec $(LIBDIR)/incl $(MANDIR)/LLgen.1
        cp src/LLgen $(INSTALLDIR)/LLgen
        -mkdir $(LIBDIR)
@@ -28,7 +27,7 @@ firstinstall:
        cp LLgen.1 $(MANDIR)/LLgen.1
 
 cmp:
-       cd src; make
+       cd src; make LIBDIR=$(LIBDIR)
        -cmp src/LLgen $(INSTALLDIR)/LLgen
        -cmp lib/rec $(LIBDIR)/rec
        -cmp lib/incl $(LIBDIR)/incl
index f46f5d0..6a48444 100644 (file)
@@ -6,13 +6,13 @@ INSTALLDIR=$(TARGET_HOME)/bin
 LIBDIR=$(TARGET_HOME)/lib/LLgen
 
 all:
-       cd src; make
+       cd src; make LIBDIR=$(LIBDIR)
 
 clean:
        -cd src; make clean
 
 install:
-       cd src; make
+       cd src; make LIBDIR=$(LIBDIR)
        cp src/LLgen $(INSTALLDIR)/LLgen
        if [ $(DO_MACHINE_INDEP) = y ] ; \
        then    cp $(SRC_HOME)/util/LLgen/lib/rec $(LIBDIR)/rec ; \
@@ -21,7 +21,7 @@ install:
        fi
 
 firstinstall:
-       cd src; make first
+       cd src; make LIBDIR=$(LIBDIR) first
        cp src/LLgen $(INSTALLDIR)/LLgen
        if [ $(DO_MACHINE_INDEP) = y ] ; \
        then    if [ -d $(LIBDIR) ] ; then : ; else mkdir $(LIBDIR) ; fi ; \
@@ -31,7 +31,7 @@ firstinstall:
        fi
 
 cmp:
-       cd src; make
+       cd src; make LIBDIR=$(LIBDIR)
        -cmp src/LLgen $(INSTALLDIR)/LLgen
        -cmp $(SRC_HOME)/util/LLgen/lib/rec $(LIBDIR)/rec
        -cmp $(SRC_HOME)/util/LLgen/lib/incl $(LIBDIR)/incl
index d49df70..07c392a 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index ac039d7..98f4b20 100644 (file)
@@ -1,25 +1,27 @@
 # $Header$
-EMHOME=../../..
 PROF=
 LLOPT= # -vvv -x
-INCLUDES = -I$(EMHOME)/h
-CFLAGS=-O -DNDEBUG $(INCLUDES) $(PROF)
+INCLUDES =
+DEFINES = -DNDEBUG
+CFLAGS=-O $(DEFINES) $(INCLUDES) $(PROF)
 LDFLAGS=
 OBJECTS = main.o gencode.o compute.o LLgen.o tokens.o check.o reach.o global.o name.o sets.o Lpars.o alloc.o machdep.o cclass.o
 CFILES = main.c gencode.c compute.c LLgen.c tokens.c check.c reach.c global.c name.c sets.c Lpars.c alloc.c machdep.c cclass.c
-FILES =types.h tunable.h extern.h io.h sets.h tokens.g LLgen.g main.c name.c compute.c sets.c gencode.c global.c check.c reach.c alloc.c machdep.c Makefile cclass.c
+FILES =types.h extern.h io.h sets.h tokens.g LLgen.g main.c name.c compute.c sets.c gencode.c global.c check.c reach.c alloc.c machdep.c Makefile cclass.c
 GFILES = tokens.g LLgen.g
-LINT = lint -b -DNDEBUG -DNORCSID
+LINT = lint -b $(DEFINES) -DNORCSID
+
+LIBDIRSTR = \"$(LIBDIR)\"
 
 all:           parser
-               @make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "PROF=$(PROF)"
+               @make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "PROF=$(PROF)" "LIBDIR=$(LIBDIR)"
 
 parser:                $(GFILES)
                LLgen $(LLOPT) $(GFILES)
                @touch parser
 
 first:         firstparser
-               @make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "PROF=$(PROF)"
+               @make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "PROF=$(PROF)" "LIBDIR=$(LIBDIR)"
 
 firstparser:
                cp LLgen.c.dist LLgen.c
@@ -29,7 +31,7 @@ firstparser:
                @touch parser
 
 LLgen:         $(OBJECTS)
-               $(CC) $(PROF) $(LDFLAGS) $(OBJECTS) $(EMHOME)/modules/lib/libsystem.a -o LLgen
+               $(CC) $(PROF) $(LDFLAGS) $(OBJECTS) -o LLgen
                @size LLgen
 
 pr : 
@@ -49,6 +51,9 @@ distr:
                cp LLgen.c LLgen.c.dist
                cp tokens.c tokens.c.dist
 
+machdep.o:     machdep.c
+               $(CC) -c $(CFLAGS) -DLIBDIR=$(LIBDIRSTR) machdep.c
+
 # The next lines are generated automatically
 # AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
 LLgen.o:       Lpars.h
@@ -76,7 +81,6 @@ gencode.o:    types.h
 global.o:      extern.h
 global.o:      io.h
 global.o:      types.h
-machdep.o:     $(EMHOME)/h/em_path.h
 machdep.o:     types.h
 main.o:        extern.h
 main.o:        io.h
index cbd3a44..74acf4e 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -19,7 +17,6 @@
 
 # include "types.h"
 # include "extern.h"
-# include <local.h>
 
 # ifndef NORCSID
 static string rcsid = "$Header$";
@@ -68,19 +65,20 @@ new_mem(p) register p_info p; {
 
        if (p->i_max >= p->i_top) {     /* No more free elements */
                sz = p->i_size;
-#if BIGMACHINE
-               /*
-                  Do not worry about size. Just double it.
-                */
-               p->i_size += p->i_size;
-               if (! p->i_size)
+               if (sizeof(char *) > 2) {
+                       /*
+                          Do not worry about size. Just double it.
+                        */
+                       p->i_size += p->i_size;
+                       if (! p->i_size)
+                               p->i_size += p->i_incr * p->i_esize;
+                       }
+               else {
+                       /*
+                          Worry about size, so only increment in chunks of i_incr.
+                        */
                        p->i_size += p->i_incr * p->i_esize;
-#else
-               /*
-                  Worry about size, so only increment in chunks of i_incr.
-                */
-               p->i_size += p->i_incr * p->i_esize;
-#endif
+               }
                p->i_ptr = !p->i_ptr ? 
                        alloc(p->i_size) :
                        ralloc(p->i_ptr, p->i_size);
index 3053b63..c79a821 100644 (file)
@@ -1,8 +1,9 @@
-/* $Header$ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
+
+/* $Header$ */
+
 #include "cclass.h"
 char c_class[] = {
        0,      /* 00 */
index d322446..66df7a6 100644 (file)
@@ -1,8 +1,9 @@
-/* $Header$ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
+
+/* $Header$ */
+
 extern char c_class[];
 
 #define ISLET 1
index 695a87c..6119775 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index 4e917ab..272dfcb 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index 285f773..8bcf9c6 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
  */
 
 /*
- * extern.h $Header$
+ * $Header$
  * Miscellanious constants and
  * some variables that are visible in more than one file
  */
 
-# define LTEXTSZ       51      /* Size of longest token */
+# define LTEXTSZ       256     /* Size of longest token */
 
 /*
  * options for the identifier search routine
index 149aeaa..9ed83cc 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index 9696ecf..ac05236 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index 6e2686d..5d0a900 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -13,7 +11,7 @@
  */
 
 /*
- * io.h $Header$
+ * $Header$
  * Some important file names and variables
  */
 
index fc1980e..f1680ff 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -17,8 +15,6 @@
  * Machine dependant things
  */
 
-
-# include <em_path.h>
 # include "types.h"
 
 # ifndef NORCSID
@@ -33,17 +29,27 @@ extern string       libpath();
 UNLINK(x) string x; {
        /* Must remove the file "x" */
 
+#ifdef USE_SYS
        sys_remove(x);  /* systemcall to remove file */
+#else
+       unlink(x);
+#endif
 }
 
 RENAME(x,y) string x,y; {
        /* Must move the file "x" to the file "y" */
 
+#ifdef USE_SYS
        if(! sys_rename(x,y)) fatal(1,"Cannot rename to %s",y);
+#else
+       unlink(y);
+       if (link(x,y) != 0) fatal(1,"Cannot rename to %s",y);
+       unlink(x);
+#endif
 }
 
 /* to make it easier to patch ... */
-char emdir[64] = EM_DIR;
+char libdir[256] = LIBDIR;
 
 string
 libpath(s) string s; {
@@ -53,12 +59,11 @@ libpath(s) string s; {
        register length;
        p_mem alloc();
        string strcpy(), strcat();
-       static string subdir = "/lib/LLgen/";
 
-       length = strlen(emdir) + strlen(subdir) + strlen(s) + 1;
+       length = strlen(libdir) + strlen(s) + 2;
        p = (string) alloc((unsigned) length);
-       strcpy(p,emdir);
-       strcat(p,subdir);
+       strcpy(p,libdir);
+       strcat(p,"/");
        strcat(p,s);
        return p;
 }
index 82c29b6..584842c 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index c9b7164..08c93dc 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index f41be4f..4bc9aba 100644 (file)
@@ -3,8 +3,11 @@
 #PARAMS                do not remove this line
 
 SRC_DIR = $(SRC_HOME)/util/LLgen/src
-INCLUDES = -I$(TARGET_HOME)/h -I$(TARGET_HOME)/config -I$(SRC_DIR) -I.
-CFLAGS = -DNDEBUG $(INCLUDES) $(COPTIONS)
+LIBDIR = $(TARGET_HOME)/lib/LLgen
+INCLUDES = -I$(SRC_DIR) -I.
+LIBDIRSTR = \"$(LIBDIR)\"
+DEFINES = -DNDEBUG
+CFLAGS = $(DEFINES) $(INCLUDES) $(COPTIONS)
 LDFLAGS=$(LDOPTIONS)
 
 LLOPT= # -vvv -x
@@ -18,19 +21,19 @@ CSRC = $(SRC_DIR)/main.c $(SRC_DIR)/gencode.c $(SRC_DIR)/compute.c \
        $(SRC_DIR)/machdep.c $(SRC_DIR)/cclass.c
 CFILES = LLgen.c tokens.c Lpars.c $(CSRC)
 GFILES = $(SRC_DIR)/tokens.g $(SRC_DIR)/LLgen.g
-FILES = $(SRC_DIR)/types.h $(SRC_DIR)/tunable.h $(SRC_DIR)/extern.h \
+FILES = $(SRC_DIR)/types.h $(SRC_DIR)/extern.h \
        $(SRC_DIR)/io.h $(SRC_DIR)/sets.h \
        $(GFILES) $(CSRC) $(SRC_DIR)/proto.make
 
 all:           parser
-               @make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)"
+               @make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "LIBDIR=$(LIBDIR)"
 
 parser:                $(GFILES)
                LLgen $(LLOPT) $(GFILES)
                @touch parser
 
 first:         firstparser
-               @make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)"
+               @make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "LIBDIR=$(LIBDIR)"
 
 firstparser:
                cp $(SRC_DIR)/LLgen.c.dist LLgen.c
@@ -109,7 +112,7 @@ global.$(SUF):      $(SRC_DIR)/io.h
 global.$(SUF): $(SRC_DIR)/types.h
 
 machdep.$(SUF):        $(SRC_DIR)/machdep.c
-               $(CC) -c $(CFLAGS) $(SRC_DIR)/machdep.c
+               $(CC) -c $(CFLAGS) -DUSE_SYS -DLIBDIR=$(LIBDIRSTR) $(SRC_DIR)/machdep.c
 machdep.$(SUF):        $(SRC_DIR)/types.h
 
 main.$(SUF):   $(SRC_DIR)/main.c
index aafcc97..6bce48c 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index 4bdac73..00caddc 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index 4626fd7..89c2449 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -13,7 +11,7 @@
  */
 
 /*
- * sets.h $Header$
+ * $Header$
  * Some macros that deal with bitsets and their size
  */
 
index c292969..6e6b4b9 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
index a3c2c5a..931765f 100644 (file)
@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -13,7 +11,7 @@
  */
 
 /*
- * types.h $Header$
+ * $Header$
  * Type and structure definitions
  */