From c862aaeb52981b9c63800a6cfb5c9ceca2a41b81 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 4 Mar 2003 13:31:11 -0500 Subject: [PATCH] Ready to ship 0.22. --- Makefile => Makefile.in | 19 ++--- READ.ME => README | 0 src/abcess.h => abcess.h | 0 src/arrgghh.c => arrgghh.c | 1 + src/cesspool.c => cesspool.c | 1 + doc/READ.ME | 2 +- src/feh.c => feh.c | 0 src/feh.h => feh.h | 0 src/fiddle.c => fiddle.c | 0 src/fiddle.h => fiddle.h | 0 src/ick-wrap.c => ick-wrap.c | 0 src/ick.h => ick.h | 0 src/ick.y => ick.y | 1 + intercal.lsm | 19 ----- intercal.spec | 37 ++++++++++ src/lexer.l => lexer.l | 0 src/lose.c => lose.c | 0 src/lose.h => lose.h | 2 +- src/numerals.c => numerals.c | 0 src/perpetrate.c => perpetrate.c | 0 pit/CATALOG | 12 ++-- pit/Makefile | 2 +- pit/tests/knuth.i | 20 ++++++ pit/tests/testi18n.i | 9 +++ src/sizes.h => sizes.h | 0 specgen.sh | 46 ++++++++++++ src/Makefile | 91 ------------------------ src/pit/CATALOG | 117 ------------------------------- 28 files changed, 134 insertions(+), 245 deletions(-) rename Makefile => Makefile.in (83%) rename READ.ME => README (100%) rename src/abcess.h => abcess.h (100%) rename src/arrgghh.c => arrgghh.c (99%) rename src/cesspool.c => cesspool.c (99%) rename src/feh.c => feh.c (100%) rename src/feh.h => feh.h (100%) rename src/fiddle.c => fiddle.c (100%) rename src/fiddle.h => fiddle.h (100%) rename src/ick-wrap.c => ick-wrap.c (100%) rename src/ick.h => ick.h (100%) rename src/ick.y => ick.y (99%) delete mode 100644 intercal.lsm create mode 100644 intercal.spec rename src/lexer.l => lexer.l (100%) rename src/lose.c => lose.c (100%) rename src/lose.h => lose.h (98%) rename src/numerals.c => numerals.c (100%) rename src/perpetrate.c => perpetrate.c (100%) create mode 100644 pit/tests/knuth.i create mode 100644 pit/tests/testi18n.i rename src/sizes.h => sizes.h (100%) create mode 100755 specgen.sh delete mode 100644 src/Makefile delete mode 100644 src/pit/CATALOG diff --git a/Makefile b/Makefile.in similarity index 83% rename from Makefile rename to Makefile.in index 8b66d46..640161f 100644 --- a/Makefile +++ b/Makefile.in @@ -34,11 +34,11 @@ YACCFLAGS = -d # -t LOADLIBS = @LIBS@ @INTLLIBS@ @LEXLIB@ CSOURCES = ick.y lexer.l feh.c lose.c fiddle.c perpetrate.c -ISOURCES = cesspool.c arrgghh.c ick-wrap.c +ISOURCES = cesspool.c arrgghh.c ick-wrap.c numerals.c HEADERS = ick.h lose.h sizes.h abcess.h fiddle.h feh.h -BUILD = Makefile.in Makefile configure.ac config.h.in specgen.sh intercal.spec +BUILD = Makefile.in Makefile configure.ac configure config.h.in specgen.sh intercal.spec install.sh MISC = intercal.el -DOCS = BUGS COPYING NEWS READ.ME +DOCS = BUGS COPYING NEWS README SOURCES = $(CSOURCES) $(ISOURCES) $(HEADERS) $(BUILD) $(MISC) $(DOCS) pit doc all: ick libick.a @@ -77,7 +77,7 @@ install: all -mkdir -p $(incdir) cp lose.h abcess.h fiddle.h $(incdir) -mkdir $(datadir) - (cp -r pit $(datadir)/pit) + (cp -r pit $(datadir)) cp ick-wrap.c $(datadir) uninstall: @@ -98,17 +98,18 @@ intercal-@PACKAGE_VERSION@.tar.gz: $(SOURCES) (cd ..; tar -czvf intercal/intercal-@PACKAGE_VERSION@.tar.gz `cat intercal/MANIFEST`) @(cd ..; rm intercal-@PACKAGE_VERSION@) +VERS=@PACKAGE_VERSION@ RPMROOT=/usr/src/redhat RPM = rpmbuild RPMFLAGS = -ba rpm: dist - cp intercal-@PACKAGE_VERSION@.tar.gz $(RPMROOT)/SOURCES; + cp intercal-$(VERS).tar.gz $(RPMROOT)/SOURCES; cp intercal.spec $(RPMROOT)/SPECS - cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) intercal.spec - cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/intercal-@PACKAGE_VERSION@*.rpm . - cp $(RPMROOT)/SRPMS/intercal-@PACKAGE_VERSION@*.src.rpm . + -cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) intercal.spec + cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/intercal-$(VERS)*.rpm . + cp $(RPMROOT)/SRPMS/intercal-$(VERS)*.src.rpm . clean: rm -f yacc.* y.tab.* y.output *~ *.[oa] lexer.c ick.c lextest ick - rm -f intercal-@PACKAGE_VERSION@.shar intercal-@PACKAGE_VERSION@.tar intercal-@PACKAGE_VERSION@.tar.gz intercal.spec + rm -f intercal-@PACKAGE_VERSION@.tar.gz intercal.spec diff --git a/READ.ME b/README similarity index 100% rename from READ.ME rename to README diff --git a/src/abcess.h b/abcess.h similarity index 100% rename from src/abcess.h rename to abcess.h diff --git a/src/arrgghh.c b/arrgghh.c similarity index 99% rename from src/arrgghh.c rename to arrgghh.c index 98cc290..3146bf8 100644 --- a/src/arrgghh.c +++ b/arrgghh.c @@ -25,6 +25,7 @@ LICENSE TERMS #include #include #include +#include #include "abcess.h" #include "lose.h" diff --git a/src/cesspool.c b/cesspool.c similarity index 99% rename from src/cesspool.c rename to cesspool.c index 33355aa..aebea9a 100644 --- a/src/cesspool.c +++ b/cesspool.c @@ -24,6 +24,7 @@ LICENSE TERMS /* LINTLIBRARY */ #include #include +#include #ifdef _POSIX_SOURCE #include diff --git a/doc/READ.ME b/doc/READ.ME index 25ac8ed..fd507bf 100644 --- a/doc/READ.ME +++ b/doc/READ.ME @@ -29,7 +29,7 @@ different places, (b) the circuit diagrams present in the paper version but absent in the ASCII transcription are instead poorly approximated with ASCII boxology, (c) every "butchered Roman numeral" is preceded and followed by a line break, (d) the hanging-indent list -of Princeton compiler options is has all marks above each description, +of Princeton compiler options has all marks above each description, rather than to its left. The aim of these changes was to reduce to one the number of manual masters that diff --git a/src/feh.c b/feh.c similarity index 100% rename from src/feh.c rename to feh.c diff --git a/src/feh.h b/feh.h similarity index 100% rename from src/feh.h rename to feh.h diff --git a/src/fiddle.c b/fiddle.c similarity index 100% rename from src/fiddle.c rename to fiddle.c diff --git a/src/fiddle.h b/fiddle.h similarity index 100% rename from src/fiddle.h rename to fiddle.h diff --git a/src/ick-wrap.c b/ick-wrap.c similarity index 100% rename from src/ick-wrap.c rename to ick-wrap.c diff --git a/src/ick.h b/ick.h similarity index 100% rename from src/ick.h rename to ick.h diff --git a/src/ick.y b/ick.y similarity index 99% rename from src/ick.y rename to ick.y index 100ed85..707c0a1 100644 --- a/src/ick.y +++ b/ick.y @@ -242,6 +242,7 @@ varlist : variable {rlist = np = $1;} initem : scalar | subscr | array; inlist : initem INTERSECTION inlist {$$=cons(INTERSECTION,$1,$3);} | initem {$$=cons(INTERSECTION,$1,0);} + ; /* scalars, subscript exprs & constants are permitted in READ OUT lists */ /* new: arrays are also permitted to allow for bitwise I/0 */ diff --git a/intercal.lsm b/intercal.lsm deleted file mode 100644 index 25d84ce..0000000 --- a/intercal.lsm +++ /dev/null @@ -1,19 +0,0 @@ -Begin3 -Title: intercal -Version: 0.21 -Entered-date: 30JUL2002 -Description: An implementation of the language INTERCAL, legendary for - its perversity and horribleness (this version adds COME FROM - for extra flavor). Comes with language manual and examples - including possibly the entire extant body of INTERCAL code. - Now supports i18n and l14n (to Ancient Roman locale only) -Keywords: language, compiler, retrocomputing, geek humor -Author: esr@thyrsus.com (Eric S. Raymond) -Maintained-by: esr@thyrsus.com (Eric S. Raymond) -Primary-site: http://www.tuxedo.org/~esr/intercal/ - 167K intercal-0.21.tar.gz -Platforms: All -Copying-policy: GPL -End - - diff --git a/intercal.spec b/intercal.spec new file mode 100644 index 0000000..2355474 --- /dev/null +++ b/intercal.spec @@ -0,0 +1,37 @@ +Name: intercal +Version: 0.22 +Release: 1 +URL: http://www.catb.org/~esr/intercal/ +Source: intercal-0.22.tar.gz +License: GPL +Group: Development/Languages +Summary: the language that kills the weak and drives mad the strong + +%description +An implementation of the language INTERCAL, legendary for +its perversity and horribleness (this version adds COME FROM +for extra flavor). Comes with language manual and examples +including possibly the entire extant body of INTERCAL code. +Now supports i18n and l14n (to Ancient Roman locale only) +Now with fix patch by Donald Knuth. + +%prep +%setup -q + +%build +configure --prefix=/usr +make + +%install +rm -fr /usr/share/intercal-0.22/* +make install + +%files +/usr/bin/ick +/usr/lib/libick.a +/usr/include/intercal-0.22/lose.h +/usr/include/intercal-0.22/abcess.h +/usr/include/intercal-0.22/fiddle.h +/usr/share/intercal-0.22/ick-wrap.c +/usr/share/intercal-0.22/ +%doc README BUGS NEWS diff --git a/src/lexer.l b/lexer.l similarity index 100% rename from src/lexer.l rename to lexer.l diff --git a/src/lose.c b/lose.c similarity index 100% rename from src/lose.c rename to lose.c diff --git a/src/lose.h b/lose.h similarity index 98% rename from src/lose.h rename to lose.h index 3c24648..76bad13 100644 --- a/src/lose.h +++ b/lose.h @@ -8,7 +8,7 @@ * ESR's "THE NEXT STACK HAS RUPTURED!..." has been retained on the grounds * that it is more obscure and much funnier. For context, find a copy of * Joe Haldeman's SF short story "A !Tangled Web", first published in - * Analog magazine sometime in 1983 and later anthologized in the author's + * Analog magazine in September 1981 and later anthologized in the author's * "Infinite Dreams" (Ace 1985). */ /* An undecodable statement has been encountered in the course of execution. */ diff --git a/src/numerals.c b/numerals.c similarity index 100% rename from src/numerals.c rename to numerals.c diff --git a/src/perpetrate.c b/perpetrate.c similarity index 100% rename from src/perpetrate.c rename to perpetrate.c diff --git a/pit/CATALOG b/pit/CATALOG index 20d55b8..bc42d9f 100644 --- a/pit/CATALOG +++ b/pit/CATALOG @@ -1,9 +1,6 @@ -This is the directory of programs written in INTERCAL. It is named -pit because src was already taken---that's where source code for the -compiler lives---and pit seemed an appropriate place to throw -INTERCAL programs anyway. Most of these are no doubt full of bugs. -Don't complain, you're lucky if anything written in INTERCAL works -at all. +This is the directory of programs written in INTERCAL. Most of these +are no doubt full of bugs. Don't complain, you're lucky if anything +written in INTERCAL works at all. The subdirectory lib contains code fragments that are not complete programs. @@ -91,6 +88,9 @@ By Brian Raiter The subdirectory tests contains some programs written only to test the compiler. +by Donald Knuth + knuth.i Demonstrates Don Knuth's patch for handling multiline comments + by David Moews test1.i Prints DO THIS TEST HAS BEEN SUCCESSFULLY COMPLETED test2.i Reads in two numbers and multiplies their product diff --git a/pit/Makefile b/pit/Makefile index 3b7e184..3658fba 100644 --- a/pit/Makefile +++ b/pit/Makefile @@ -2,7 +2,7 @@ # Torture-tester for the INTERCAL compiler # -ICK = ../src/ick -b +ICK = ../ick -b SOURCES = \ ./sample.i \ diff --git a/pit/tests/knuth.i b/pit/tests/knuth.i new file mode 100644 index 0000000..738e3d0 --- /dev/null +++ b/pit/tests/knuth.i @@ -0,0 +1,20 @@ + PLEASE ABSTAIN FROM (1) +(1) DON KNUTH'S IMPLEMENTATION OF TPK IN INTERCAL + (C) MARCH 2003 + REFERENCE --- THE EARLY HISTORY OF PROGRAMMING + LANGUAGES, BY D E KNUTH AND L TRABB PARDO + + NOTA BENE: THE INPUT AND OUTPUT DATA ARE SCALED + DECIMAL NUMBERS WITH SIX DIGITS TO THE RIGHT OF + THE DECIMAL POINT; THUS AN INPUT OF + THREE ONE FOUR ONE FIVE NINE THREE + DENOTES 3.141593, AND THAT VALUE WOULD BE OUTPUT AS + ______ + MMMCXLMDXCIII + + VARIABLE NAMES AND SUBROUTINE NAMES USE THE CLASSIC + 5-BIT TELEPRINTER CODE IN LETTER-SHIFT MODE, NAMELY + / E @ A : S I U 1/4 D R J N F C K T Z L W H Y P Q O B G " M X V $ + (WHICH ALAN TURING ADVISED EVERY PROGRAMMER TO LEARN) + + DO GIVE UP diff --git a/pit/tests/testi18n.i b/pit/tests/testi18n.i new file mode 100644 index 0000000..2106dce --- /dev/null +++ b/pit/tests/testi18n.i @@ -0,0 +1,9 @@ + PLEASE .1 <- #1$#0 + DO .2 <- #1¢#0 + DO .3 <- #1£#0 + DO .4 <- #1¤#0 + PLEASE READ OUT .1 + DO READ OUT .2 + DO READ OUT .3 + DO READ OUT .4 + PLEASE GIVE UP diff --git a/src/sizes.h b/sizes.h similarity index 100% rename from src/sizes.h rename to sizes.h diff --git a/specgen.sh b/specgen.sh new file mode 100755 index 0000000..86694ef --- /dev/null +++ b/specgen.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +version=$1 + +cat < support; -# otherwise, the ANSI-compliant library will be used. - -# POSIX = -POSIX = -D_POSIX_SOURCE - -CFLAGS = -I. $(DEBUG) -DICKINCLUDEDIR=\"$(INCDIR)\" \ - -DICKLIBDIR=\"$(LIBDIR)\" -DYYDEBUG $(POSIX) -LDFLAGS = - -CC = gcc -Wall -W - -# You can use lex or flex -#LEX = lex -LEX = flex - -# You should use bison, because some yaccs won't work correctly -YACC = bison -y - -CSOURCES = ick.y lexer.l feh.c lose.c fiddle.c perpetrate.c -ISOURCES = cesspool.c arrgghh.c ick-wrap.c -HEADERS = ick.h lose.h sizes.h abcess.h fiddle.h feh.h -SOURCES = $(CSOURCES) $(ISOURCES) $(HEADERS) - -all: ick libick.a - -ick: ick.o lexer.o feh.o lose.o fiddle.o perpetrate.o - $(CC) perpetrate.o ick.o lexer.o feh.o lose.o fiddle.o $(LDFLAGS) -o ick - -y.tab.h ick.c: ick.y ick.h sizes.h feh.h lose.h - $(YACC) -d $(YDEBUG) ick.y - mv y.tab.c ick.c - -lexer.c: lexer.l ick.h lose.h - $(LEX) $(LFLAGS) lexer.l - mv lex.yy.c lexer.c - -# Uncomment the following if using a stock lex -# LEXLIBS = -ll -lextest: y.tab.h lexer.c ick.h lose.o - $(CC) -DMAIN lexer.c lose.o $(LEXLIBS) -o lextest - -ick.o: ick.c ick.h feh.h lose.h sizes.h -lexer.o: lexer.c y.tab.h ick.h lose.h -feh.o: feh.c feh.h y.tab.h ick.h fiddle.h lose.h sizes.h -perpetrate.o: perpetrate.c y.tab.h ick.h lose.h sizes.h -cesspool.o: cesspool.c numerals.c abcess.h lose.h sizes.h -lose.o: lose.h -fiddle.o: fiddle.h sizes.h - -libick.a: cesspool.o lose.o fiddle.o arrgghh.o - ar cr libick.a cesspool.o lose.o fiddle.o arrgghh.o - -ranlib libick.a - -install: all - cp ick $(BINDIR) - -mkdir $(INCDIR) - cp lose.h abcess.h fiddle.h ick-wrap.c $(INCDIR) - -mkdir $(SHAREDIR) - (cd ../pit; cp *.i *.3i t_tet *.fft glider gun blinkers $(SHAREDIR)) - -mkdir $(LIBDIR) - cp libick.a $(LIBDIR) - (cd ../pit/lib; cp *.*i $(LIBDIR)) - -clean: - rm -f yacc.* y.tab.* y.output *~ *.[oa] lexer.c ick.c lextest ick - -TAGS: $(SOURCES) - etags $(SOURCES) diff --git a/src/pit/CATALOG b/src/pit/CATALOG deleted file mode 100644 index bc42d9f..0000000 --- a/src/pit/CATALOG +++ /dev/null @@ -1,117 +0,0 @@ -This is the directory of programs written in INTERCAL. Most of these -are no doubt full of bugs. Don't complain, you're lucky if anything -written in INTERCAL works at all. - -The subdirectory lib contains code fragments that are not complete -programs. - -Contents: - -from original manual: - sample.i Returns absolute value of a 16-bit 2s-complement number - lib/syslib.i Standard library, with bugs fixed - lib/syslib-orig.i Standard library (original buggy version) - -by Jon Blow - sink.i Simple test program - random.i Random number program - lib/plus.i Increment .1 - -by Hans Olsson - lib/1910.doc Listing of a random number routine. Hans said he wrote this - because he couldn't find (1910) in the system library, but - it's there in our lib/syslib.i. We keep this around as an - example. (What? Throw away INTERCAL code? Perish the thought!) - -by Louis Howell - life.i Conway's game of Life, standard INTERCAL version - life2.i This version uses COME FROM and character output - blinkers - t_tet - glider - gun Input files for both Life programs - bubble.i Bubble sort - icat.i Sends input to output - lib/lib2.i New library routines: decrement, decrement and branch on 0, - add bit, 16-bit division with remainder, exponentiation - pi.i Calculate pi - primes.i Find prime numbers - pow.i Prints a list of nth powers using old exponentiation routine - lib/syslib.i Corrected version of system library - iching1.i Generates I Ching hexagrams - iching2.i This version uses a lookup table to find the sequence number - iching.doc Description of the two I Ching programs - change.i Count up different ways to make change - change.doc Description of change.i - -by Matt Dimeo - beer.i Print out the lyrics to "99 Bottles of Beer On The Wall" - -by Stinglai Ka'abi : - random2.i Another random-number generator - -by Jacob Mandelson - rot13.i Prints ROT-13 of its input - -by Jan-Pieter Cornet - hail_mary.3i Print 1,000,000 Hail Marys - count.3i Count from 1 to 10 in TriINTERCAL - iogerunds.i Demonstrate gerund abstention - -by Clemens Meier - rot13b.i Another ROT-13 program - -By Brian Raiter - lib/numio.i I/O routines - lib/numio.doc Description of the I/O routines - lib/syslib.3i - lib/syslib.4i - lib/syslib.5i - lib/syslib.6i Translations of the standard library to - lib/syslib.7i C-INTERCAL's other bases. - lib/syslib3-7.doc Documentation for same - hello.i The traditional hello world program - ins.i Intersections & Splats, a Mastermind-style game - ins.doc Documentation for I&S - yapp.i Prints an INTERCAL program that prints - yapp.doc Description of yapp.i - quine.i Prints itself - lib/floatlib.i Floating-point routines - lib/floatlib.doc Documentation for the floating-point routines - flonck.i An RPN calculator - flonck.doc Documentation for flonck.i - fft.i Fast Fourier Transform - fft.doc Description of fft.i - delta.fft - tophat.fft Sample input for FFT - -The subdirectory tests contains some programs written only to test the -compiler. - -by Donald Knuth - knuth.i Demonstrates Don Knuth's patch for handling multiline comments - -by David Moews - test1.i Prints DO THIS TEST HAS BEEN SUCCESSFULLY COMPLETED - test2.i Reads in two numbers and multiplies their product - -David Moews wrote of the latter (test2.i): - -The following program reads in two numbers and then prints their product. -It consists of a trivial calling program followed by a cleaned-up version -of a portion of the INTERCAL subroutine library. (Only a portion of -the INTERCAL subroutine library is present in the posted manual, and -that portion is full of typos.) - -The programs test16bit.i, testarray.i, testcf.i, testlib2.i, mult.i, -limits.{i,3i}, testops.{3i,5i}, testsplat.i, were all written by Louis -Howell. Of these, testcf.i might be considered an interesting -puzzle---try to figure out what it's doing. The others are pretty -boring, but are included as diagnostics and because so few other -example programs exist. Not all of these even produce interesting -diagnostic output; it may be necessary to look at the degenerated C -code to determine if the compiler is doing the right thing. - - -End of file CATALOG -------------------- -- 2.43.0