there's not much we can do about it as things stand.
4) (AIS) Reverse assignments (those with the expression on the left)
- are very unlikely to work in bases other than 2.
+ are very unlikely to work in bases other than 2. (The current code
+ calculates what the answer would be in base 2 and throws an error
+ if it isn't correct for the current base.)
5) (AIS) Some of the newer features in intercal.el are not yet fully
implemented and have a tendency to print 'Unimplemented' rather
than doing anything useful.
+6) (AIS) The external call system only works with gcc (due to its need
+ to pass command-line arguments like -x and -E to it), and fails
+ when mixed with come-from-gerund and next-from-gerund.
+
TO DO
1. (ESR) Add more optimization templates, esp. idioms for +, -, *, /.
--- /dev/null
+# Generated automatically from Makefile.in by configure.
+#
+# Productions for the INTERCAL distribution
+#
+VERSION=0.28
+
+# Common prefix for machine-independent installed files.
+prefix = /usr/local
+# Common prefix for machine-dependent installed files.
+exec_prefix = ${prefix}
+
+# Debian doesn't like versioned subdirs; give them a way to unversion
+# the subdir.
+
+ick_specific_subdir = ick-0.28
+
+# Modern versions of autoconf use an overridable datarootdir, and this
+# doesn't do any harm with older versions.
+datarootdir = @datarootdir@
+# Directory in which to install binaries.
+bindir = ${exec_prefix}/bin
+# Directory in which to install libraries.
+libdir = ${exec_prefix}/lib
+# Directory to install data files.
+datadir = ${prefix}/share/$(ick_specific_subdir)
+# Directory to install the include files in.
+incdir = ${prefix}/include/$(ick_specific_subdir)
+# Directory to install Info files in.
+infodir = ${prefix}/info
+# Directory to install manpages in.
+mandir = ${prefix}/man
+# Directory file for Info installation.
+infodirfile = /usr/share/info/dir
+
+# This can be overridden from the command line
+DESTDIR=
+
+CC = gcc
+CFLAGS = -g -O2 -DICKINCLUDEDIR=\"$(incdir)\" -DICKDATADIR=\"$(datadir)\" -DICKBINDIR=\"$(bindir)\" -DICKLIBDIR=\"$(libdir)\" -DYYDEBUG -O2 -W -Wall -I./src -I./temp
+LDFLAGS =
+LEX = flex
+LEXFLAGS=
+YACC = bison -y
+YACCFLAGS =
+
+LOADLIBS = -lfl
+
+CSOURCES = src/parser.y src/lexer.l src/feh2.c src/dekludge.c src/ick_lose.c src/fiddle.c src/perpet.c src/unravel.c src/uncommon.c src/convickt.c src/clc-cset.c src/bin2c.c
+ISOURCES = src/cesspool.c src/arrgghh.c src/ick-wrap.c src/pickwrap.c src/numerals.c
+YSOURCES = src/yuk.c
+HEADERS = src/ick.h src/ick_lose.h src/sizes.h src/abcess.h src/fiddle.h src/feh.h src/yuk.h src/uncommon.h src/ick_ec.h
+BUILD = Makefile.in config.in config.sh src/configh.in ickspec.in ickspec src/cooptsh.in
+MISC = etc/intercal.el src/ctrlmfix.sh src/ctrlmfix.bat src/*.bin
+DOCS = BUGS.txt COPYING.txt NEWS.txt README.txt
+SOURCES = $(CSOURCES) $(ISOURCES) $(YSOURCES) $(HEADERS) $(BUILD) $(MISC) $(DOCS) pit doc
+
+all: bin/ick bin/convickt lib/libick.a lib/libickmt.a lib/libyuk.a lib/libickec.a ial
+
+ial: include/ick_ec.h include/fiddle.h include/abcess.h include/ick_lose.h include/yuk.h include/syslib.i include/syslib.3i include/syslib.4i include/syslib.5i include/syslib.6i include/syslib.7i lib/ick-wrap.c lib/pickwrap.c lib/coopt.sh lib/COPYING.txt include/atari.bin include/baudot.bin include/ebcdic.bin include/latin1.bin
+
+include/ick_ec.h: src/ick_ec.h
+ -cp src/ick_ec.h include/ick_ec.h
+include/fiddle.h: src/fiddle.h
+ -cp src/fiddle.h include/fiddle.h
+include/abcess.h:src/abcess.h
+ -cp src/abcess.h include/abcess.h
+include/ick_lose.h:src/ick_lose.h
+ -cp src/ick_lose.h include/ick_lose.h
+include/yuk.h:src/yuk.h
+ -cp src/yuk.h include/yuk.h
+
+include/syslib.i: pit/lib/syslib.i
+ -cp pit/lib/syslib.i include/syslib.i
+include/syslib.3i: pit/lib/syslib.3i
+ -cp pit/lib/syslib.3i include/syslib.3i
+include/syslib.4i: pit/lib/syslib.4i
+ -cp pit/lib/syslib.4i include/syslib.4i
+include/syslib.5i: pit/lib/syslib.5i
+ -cp pit/lib/syslib.5i include/syslib.5i
+include/syslib.6i: pit/lib/syslib.6i
+ -cp pit/lib/syslib.6i include/syslib.6i
+include/syslib.7i: pit/lib/syslib.7i
+ -cp pit/lib/syslib.7i include/syslib.7i
+
+lib/ick-wrap.c:src/ick-wrap.c
+ -cp src/ick-wrap.c lib/ick-wrap.c
+
+lib/pickwrap.c:src/pickwrap.c
+ -cp src/pickwrap.c lib/pickwrap.c
+
+lib/coopt.sh:temp/coopt.sh
+ -cp temp/coopt.sh lib/coopt.sh
+
+lib/COPYING.txt:COPYING.txt
+ -cp COPYING.txt lib/COPYING.txt
+
+include/atari.bin:src/atari.bin
+ -cp src/atari.bin include/atari.bin
+include/baudot.bin:src/baudot.bin
+ -cp src/baudot.bin include/baudot.bin
+include/ebcdic.bin:src/ebcdic.bin
+ -cp src/ebcdic.bin include/ebcdic.bin
+include/latin1.bin:src/latin1.bin
+ -cp src/latin1.bin include/latin1.bin
+
+bin/ick: temp/parser.o temp/lexer.o temp/feh2.o temp/dekludge.o temp/idiotism.o temp/ick_lose.o temp/fiddle.o temp/perpet.o temp/uncommon.o
+ $(CC) temp/perpet.o temp/parser.o temp/lexer.o temp/feh2.o temp/dekludge.o temp/idiotism.o temp/ick_lose.o temp/fiddle.o temp/uncommon.o $(LDFLAGS) -o bin/ick
+
+bin/convickt: temp/convickt.o temp/clc-cset.o temp/uncommon.o
+ $(CC) temp/convickt.o temp/clc-cset.o temp/uncommon.o $(LDFLAGS) -o bin/convickt
+
+temp/oil.c: src/oil.y temp/config.h
+ $(YACC) $(YACCFLAGS) src/oil.y
+ -rm -f temp/oil.c
+ mv y.tab.c temp/oil.c
+
+temp/parser.h temp/parser.c: src/parser.y src/ick.h src/sizes.h src/feh.h src/ick_lose.h temp/config.h
+ $(YACC) -d $(YACCFLAGS) src/parser.y
+ -rm -f temp/parser.c
+ mv y.tab.c temp/parser.c
+ -rm -f temp/parser.h
+ mv y.tab.h temp/parser.h
+
+temp/lexer.c: src/lexer.l src/ick.h src/ick_lose.h temp/config.h
+ $(LEX) $(LEXFLAGS) src/lexer.l
+ -rm -f temp/lexer.c
+ mv lex.yy.c temp/lexer.c
+
+bin/lextest: temp/parser.h src/lexer.c src/ick.h temp/ick_lose.o
+ $(CC) -DMAIN src/lexer.c src/ick_lose.o -lfl -o bin/lextest
+
+temp/oil: temp/oil.c temp/config.h
+ $(CC) $(CFLAGS) -o temp/oil temp/oil.c
+temp/bin2c: src/bin2c.c
+ $(CC) $(CFLAGS) -o temp/bin2c src/bin2c.c
+temp/parser.o: temp/parser.c src/ick.h src/feh.h src/ick_lose.h src/sizes.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/parser.o temp/parser.c
+temp/lexer.o: temp/lexer.c temp/parser.h src/ick.h src/ick_lose.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/lexer.o temp/lexer.c
+temp/feh2.o: src/feh2.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/ick_lose.h src/sizes.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/feh2.o src/feh2.c
+temp/idiotism.c: src/idiotism.oil temp/oil
+ temp/oil < src/idiotism.oil > temp/idiotism.c
+# There is a situation that some operating systems can get into known as memory
+# overcommit. Linux (talking specifically about the kernel) can reach this
+# situation in its default configuration, where it has been reporting to malloc
+# that memory is available when in fact it isn't, and reaches the situation when
+# the computer is actually completely out of memory but programs on it believe
+# that they aren't. For some reason, using the default options, gcc can somehow
+# cause memory overcommit when acting on a file as big as idiotism.c. The
+# solution here, therefore, is to put two protections to prevent this happening;
+# first, turn off optimisation specifically for that file, and second, put an
+# artificial memory limit on the compilation so that no more than 128 megabytes
+# can be allocated, using the ulimit feature on bash. As memory overcommit can
+# make a system unusable, and as it can be preceded by 'thrashing' (hugely
+# rapid swaps to disk in an attempt to get more memory) that can also make a
+# system unusable, steps to avoid this are necessary.
+temp/idiotism.o: temp/idiotism.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/ick_lose.h src/sizes.h temp/config.h
+ bash -c 'ulimit -Sv 131072 && ulimit -Sd 131072 && $(CC) $(CFLAGS) -c -o temp/idiotism.o -O0 temp/idiotism.c'
+temp/dekludge.o: src/dekludge.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/ick_lose.h src/sizes.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/dekludge.o src/dekludge.c
+temp/perpet.o: src/perpet.c temp/parser.h src/ick.h src/ick_lose.h src/sizes.h src/uncommon.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/perpet.o src/perpet.c
+temp/cesspool.o: src/cesspool.c src/abcess.h src/ick_lose.h src/sizes.h
+ $(CC) $(CFLAGS) -c -o temp/cesspool.o src/cesspool.c
+temp/numerals.o: src/numerals.c src/abcess.h src/ick_lose.h src/sizes.h
+ $(CC) $(CFLAGS) -c -o temp/numerals.o src/numerals.c
+temp/unravel.o: src/unravel.c src/abcess.h src/ick_lose.h src/sizes.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/unravel.o src/unravel.c
+temp/ick_lose.o: src/ick_lose.c src/ick_lose.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/ick_lose.o src/ick_lose.c
+temp/fiddle.o: src/fiddle.c src/fiddle.h src/sizes.h
+ $(CC) $(CFLAGS) -c -o temp/fiddle.o src/fiddle.c
+temp/arrgghh.o: src/arrgghh.c
+ $(CC) $(CFLAGS) -c -o temp/arrgghh.o src/arrgghh.c
+temp/uncommon.o: src/uncommon.c src/uncommon.h
+ $(CC) $(CFLAGS) -c -o temp/uncommon.o src/uncommon.c
+temp/ick_ec.o: src/ick_ec.c src/ick_ec.h src/abcess.h
+ $(CC) $(CFLAGS) -c -o temp/ick_ec.o src/ick_ec.c
+temp/yuk.o: src/yuk.c src/yuk.h src/ick_lose.h src/sizes.h src/abcess.h src/uncommon.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/yuk.o src/yuk.c
+temp/clc-cset.o: src/clc-cset.c src/uncommon.h
+ $(CC) $(CFLAGS) -c -o temp/clc-cset.o src/clc-cset.c
+temp/convickt.o: src/convickt.c
+ $(CC) $(CFLAGS) -c -o temp/convickt.o src/convickt.c
+
+temp/cset-a.c: temp/bin2c src/atari.bin
+ temp/bin2c ick_clc_cset_atari < src/atari.bin > temp/cset-a.c
+temp/cset-b.c: temp/bin2c src/baudot.bin
+ temp/bin2c ick_clc_cset_baudot < src/baudot.bin > temp/cset-b.c
+temp/cset-e.c: temp/bin2c src/ebcdic.bin
+ temp/bin2c ick_clc_cset_ebcdic < src/ebcdic.bin > temp/cset-e.c
+temp/cset-l.c: temp/bin2c src/latin1.bin
+ temp/bin2c ick_clc_cset_latin1 < src/latin1.bin > temp/cset-l.c
+temp/cset-a.o: temp/cset-a.c
+ $(CC) $(CFLAGS) -c -o temp/cset-a.o temp/cset-a.c
+temp/cset-b.o: temp/cset-b.c
+ $(CC) $(CFLAGS) -c -o temp/cset-b.o temp/cset-b.c
+temp/cset-e.o: temp/cset-e.c
+ $(CC) $(CFLAGS) -c -o temp/cset-e.o temp/cset-e.c
+temp/cset-l.o: temp/cset-l.c
+ $(CC) $(CFLAGS) -c -o temp/cset-l.o temp/cset-l.c
+
+lib/libick.a: temp/cesspool.o temp/numerals.o temp/ick_lose.o temp/fiddle.o temp/arrgghh.o temp/clc-cset.o temp/cset-a.o temp/cset-b.o temp/cset-e.o temp/cset-l.o temp/uncommon.o
+ ar cr lib/libick.a temp/cesspool.o temp/numerals.o temp/ick_lose.o temp/fiddle.o temp/arrgghh.o temp/clc-cset.o temp/cset-a.o temp/cset-b.o temp/cset-e.o temp/cset-l.o temp/uncommon.o
+ ranlib lib/libick.a
+
+lib/libickmt.a: temp/cesspool.o temp/numerals.o temp/unravel.o temp/ick_lose.o temp/fiddle.o temp/arrgghh.o temp/clc-cset.o temp/cset-a.o temp/cset-b.o temp/cset-e.o temp/cset-l.o temp/uncommon.o
+ ar cr lib/libickmt.a temp/cesspool.o temp/numerals.o temp/unravel.o temp/ick_lose.o temp/fiddle.o temp/arrgghh.o temp/clc-cset.o temp/cset-a.o temp/cset-b.o temp/cset-e.o temp/cset-l.o temp/uncommon.o
+ ranlib lib/libickmt.a
+
+lib/libickec.a: temp/cesspool.o temp/numerals.o temp/ick_ec.o temp/ick_lose.o temp/fiddle.o temp/arrgghh.o temp/clc-cset.o temp/cset-a.o temp/cset-b.o temp/cset-e.o temp/cset-l.o temp/uncommon.o
+ ar cr lib/libickec.a temp/cesspool.o temp/numerals.o temp/ick_ec.o temp/ick_lose.o temp/fiddle.o temp/arrgghh.o temp/clc-cset.o temp/cset-a.o temp/cset-b.o temp/cset-e.o temp/cset-l.o temp/uncommon.o
+ ranlib lib/libickec.a
+
+lib/libyuk.a: temp/yuk.o
+ ar cr lib/libyuk.a temp/yuk.o
+ ranlib lib/libyuk.a
+
+install-common: all
+ cp bin/ick bin/convickt $(DESTDIR)$(bindir)
+ cp lib/libick.a $(DESTDIR)$(libdir)
+ cp lib/libickmt.a $(DESTDIR)$(libdir)
+ cp lib/libickec.a $(DESTDIR)$(libdir)
+ cp lib/libyuk.a $(DESTDIR)$(libdir)
+ -mkdir -p $(DESTDIR)$(incdir)
+ cp src/ick_lose.h src/abcess.h src/fiddle.h src/yuk.h $(DESTDIR)$(incdir)
+ cp src/ick_ec.h $(DESTDIR)$(incdir)
+ -mkdir -p $(DESTDIR)$(datadir)
+ cp include/*.bin $(DESTDIR)$(datadir)
+ cp src/ick-wrap.c src/pickwrap.c $(DESTDIR)$(datadir)
+ cp include/syslib.i include/syslib.?i $(DESTDIR)$(datadir)
+ cp temp/coopt.sh $(DESTDIR)$(datadir)
+ cp COPYING.txt $(DESTDIR)$(datadir)
+ -mkdir -p $(DESTDIR)$(mandir)/man1
+ cp doc/ick.1 doc/convickt.1 $(DESTDIR)$(mandir)/man1
+ -mkdir -p $(DESTDIR)$(infodir)
+ rm -f $(DESTDIR)$(infodir)/ick.info
+ cp doc/ick.in* $(DESTDIR)$(infodir)
+ mv $(DESTDIR)$(infodir)/ick.inf $(DESTDIR)$(infodir)/ick.info
+# Note that it's necessary to copy the info file to .inf on an 8.3 system
+# and .info otherwise; this is done by copying it to .inf, and then renaming
+# to .info; on an 8.3 system, this leaves the extension as .inf because mv
+# will signal an (unimportant) error. Also, the info directory has to
+# be created first if it doesn't exist because /usr/local/share/info
+# (the default) doesn't exist by default in Debian.
+
+# install, and gzip the docs after installing.
+# The pattern i*[fo] matches ick.info only when uncompressed, even on
+# an 8.3 system. ick.i*gz matches compressed Info files, but some DOS
+# command interpreters buggily also match it to uncompressed Info files
+# even though gz appears nowhere in the filename, so care must be taken
+# only to use that pattern with sh.
+install: install-common
+ sh -c "rm -f $(DESTDIR)$(infodir)/ick.i*gz"
+ -gzip -9 -f $(DESTDIR)$(infodir)/ick.in*
+ -gzip -9 -f $(DESTDIR)$(mandir)/man1/ick.1
+ -gzip -9 -f $(DESTDIR)$(mandir)/man1/convickt.1
+ sh -c "mandb -q"
+ sh -c "(test -f $(DESTDIR)$(infodir)/ick.info.gz && install-info --quiet --dir-file=$(infodirfile) $(DESTDIR)$(infodir)/ick.info.gz) || true"
+ sh -c "(test -f $(DESTDIR)$(infodir)/ick.igz && install-info --quiet --dir-file=$(infodirfile) $(DESTDIR)$(infodir)/ick.igz) || true"
+
+# install without gzipping the docs
+install-nozip: install-common
+ sh -c "mandb -q"
+ sh -c "(test -f $(DESTDIR)$(infodir)/ick.info && install-info --quiet --dir-file=$(infodirfile) $(DESTDIR)$(infodir)/ick.info) || true"
+ sh -c "(test -f $(DESTDIR)$(infodir)/ick.inf && install-info --quiet --dir-file=$(infodirfile) $(DESTDIR)$(infodir)/ick.inf) || true"
+
+
+uninstall:
+ sh -c "install-info --quiet --remove --dir-file=$(infodirfile) ick"
+ rm -f $(DESTDIR)$(bindir)/ick $(DESTDIR)$(libdir)/libick.a
+ rm -f $(DESTDIR)$(bindir)/convickt
+ rm -f $(DESTDIR)$(libdir)/libickmt.a $(DESTDIR)$(libdir)/libyuk.a
+ rm -f ${DESTDIR}${infodir}/ick.i*
+ rm -f $(DESTDIR)$(mandir)/man1/ick.1*
+ rm -f $(DESTDIR)$(mandir)/man1/convickt.1*
+ rm -fr $(DESTDIR)$(incdir) $(DESTDIR)$(datadir)
+ sh -c "mandb -q"
+
+TAGS: $(SOURCES)
+ etags $(SOURCES)
+
+dist: ick-0.28.tgz
+
+ick-0.28.tgz: $(SOURCES)
+ @find $(SOURCES) -type f -print | grep -v RCS | sed s:^:ick-0.28/: >MANIFEST.txt
+ @(cd ..; ln -s intercal ick-0.28)
+ (cd ..; tar -czvf intercal/ick-0.28.tgz `cat intercal/MANIFEST.txt`)
+ @(cd ..; rm ick-0.28)
+
+clean:
+ -cp temp/config.h temp/coopt.sh .
+ -rm -f temp/* bin/* lib/* include/*
+ mv config.h coopt.sh temp
+
+distr:
+ -rm -f temp/*.o temp/parser.h temp/oil
+ -rm -f temp/idiotism.c temp/bin2c temp/cset-?.c
+ -rm -f bin/* lib/* include/*
+
+distclean: distr
+ -rm -f config.status config.cache config.log Makefile
+ -rm -f temp/config.h temp/coopt.sh
LOADLIBS = @LIBS@ @LEXLIB@
-CSOURCES = src/parser.y src/lexer.l src/feh2.c src/dekludge.c src/lose.c src/fiddle.c src/perpet.c src/unravel.c src/uncommon.c src/convickt.c src/clc-cset.c src/bin2c.c
+CSOURCES = src/parser.y src/lexer.l src/feh2.c src/dekludge.c src/ick_lose.c src/fiddle.c src/perpet.c src/unravel.c src/uncommon.c src/convickt.c src/clc-cset.c src/bin2c.c
ISOURCES = src/cesspool.c src/arrgghh.c src/ick-wrap.c src/pickwrap.c src/numerals.c
YSOURCES = src/yuk.c
-HEADERS = src/ick.h src/lose.h src/sizes.h src/abcess.h src/fiddle.h src/feh.h src/yuk.h src/uncommon.h
+HEADERS = src/ick.h src/ick_lose.h src/sizes.h src/abcess.h src/fiddle.h src/feh.h src/yuk.h src/uncommon.h src/ick_ec.h
BUILD = Makefile.in config.in config.sh src/configh.in ickspec.in ickspec src/cooptsh.in
MISC = etc/intercal.el src/ctrlmfix.sh src/ctrlmfix.bat src/*.bin
DOCS = BUGS.txt COPYING.txt NEWS.txt README.txt
SOURCES = $(CSOURCES) $(ISOURCES) $(YSOURCES) $(HEADERS) $(BUILD) $(MISC) $(DOCS) pit doc
-all: bin/ick@EXEEXT@ bin/convickt@EXEEXT@ lib/libick.a lib/libickmt.a lib/libyuk.a ial
+all: bin/ick@EXEEXT@ bin/convickt@EXEEXT@ lib/libick.a lib/libickmt.a lib/libyuk.a lib/libickec.a ial
-ial: include/fiddle.h include/abcess.h include/lose.h include/yuk.h include/syslib.i include/syslib.3i include/syslib.4i include/syslib.5i include/syslib.6i include/syslib.7i lib/ick-wrap.c lib/pickwrap.c lib/coopt.sh lib/COPYING.txt include/atari.bin include/baudot.bin include/ebcdic.bin include/latin1.bin
+ial: include/ick_ec.h include/fiddle.h include/abcess.h include/ick_lose.h include/yuk.h include/syslib.i include/syslib.3i include/syslib.4i include/syslib.5i include/syslib.6i include/syslib.7i lib/ick-wrap.c lib/pickwrap.c lib/coopt.sh lib/COPYING.txt include/atari.bin include/baudot.bin include/ebcdic.bin include/latin1.bin
+include/ick_ec.h: src/ick_ec.h
+ -cp src/ick_ec.h include/ick_ec.h
include/fiddle.h: src/fiddle.h
-cp src/fiddle.h include/fiddle.h
-
include/abcess.h:src/abcess.h
-cp src/abcess.h include/abcess.h
-
-include/lose.h:src/lose.h
- -cp src/lose.h include/lose.h
-
+include/ick_lose.h:src/ick_lose.h
+ -cp src/ick_lose.h include/ick_lose.h
include/yuk.h:src/yuk.h
-cp src/yuk.h include/yuk.h
include/latin1.bin:src/latin1.bin
-cp src/latin1.bin include/latin1.bin
-bin/ick@EXEEXT@: temp/parser.@OBJEXT@ temp/lexer.@OBJEXT@ temp/feh2.@OBJEXT@ temp/dekludge.@OBJEXT@ temp/idiotism.@OBJEXT@ temp/lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/perpet.@OBJEXT@ temp/uncommon.@OBJEXT@
- $(CC) temp/perpet.@OBJEXT@ temp/parser.@OBJEXT@ temp/lexer.@OBJEXT@ temp/feh2.@OBJEXT@ temp/dekludge.@OBJEXT@ temp/idiotism.@OBJEXT@ temp/lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/uncommon.@OBJEXT@ $(LDFLAGS) -o bin/ick@EXEEXT@
+bin/ick@EXEEXT@: temp/parser.@OBJEXT@ temp/lexer.@OBJEXT@ temp/feh2.@OBJEXT@ temp/dekludge.@OBJEXT@ temp/idiotism.@OBJEXT@ temp/ick_lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/perpet.@OBJEXT@ temp/uncommon.@OBJEXT@
+ $(CC) temp/perpet.@OBJEXT@ temp/parser.@OBJEXT@ temp/lexer.@OBJEXT@ temp/feh2.@OBJEXT@ temp/dekludge.@OBJEXT@ temp/idiotism.@OBJEXT@ temp/ick_lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/uncommon.@OBJEXT@ $(LDFLAGS) -o bin/ick@EXEEXT@
bin/convickt@EXEEXT@: temp/convickt.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/uncommon.@OBJEXT@
$(CC) temp/convickt.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/uncommon.@OBJEXT@ $(LDFLAGS) -o bin/convickt@EXEEXT@
-rm -f temp/oil.c
mv y.tab.c temp/oil.c
-temp/parser.h temp/parser.c: src/parser.y src/ick.h src/sizes.h src/feh.h src/lose.h temp/config.h
+temp/parser.h temp/parser.c: src/parser.y src/ick.h src/sizes.h src/feh.h src/ick_lose.h temp/config.h
$(YACC) -d $(YACCFLAGS) src/parser.y
-rm -f temp/parser.c
mv y.tab.c temp/parser.c
-rm -f temp/parser.h
mv y.tab.h temp/parser.h
-temp/lexer.c: src/lexer.l src/ick.h src/lose.h temp/config.h
+temp/lexer.c: src/lexer.l src/ick.h src/ick_lose.h temp/config.h
$(LEX) $(LEXFLAGS) src/lexer.l
-rm -f temp/lexer.c
mv @LEX_OUTPUT_ROOT@.c temp/lexer.c
-bin/lextest: temp/parser.h src/lexer.c src/ick.h temp/lose.@OBJEXT@
- $(CC) -DMAIN src/lexer.c src/lose.@OBJEXT@ @LEXLIB@ -o bin/lextest
+bin/lextest: temp/parser.h src/lexer.c src/ick.h temp/ick_lose.@OBJEXT@
+ $(CC) -DMAIN src/lexer.c src/ick_lose.@OBJEXT@ @LEXLIB@ -o bin/lextest
temp/oil@EXEEXT@: temp/oil.c temp/config.h
$(CC) $(CFLAGS) -o temp/oil@EXEEXT@ temp/oil.c
temp/bin2c@EXEEXT@: src/bin2c.c
$(CC) $(CFLAGS) -o temp/bin2c@EXEEXT@ src/bin2c.c
-temp/parser.@OBJEXT@: temp/parser.c src/ick.h src/feh.h src/lose.h src/sizes.h temp/config.h
+temp/parser.@OBJEXT@: temp/parser.c src/ick.h src/feh.h src/ick_lose.h src/sizes.h temp/config.h
$(CC) $(CFLAGS) -c -o temp/parser.@OBJEXT@ temp/parser.c
-temp/lexer.@OBJEXT@: temp/lexer.c temp/parser.h src/ick.h src/lose.h temp/config.h
+temp/lexer.@OBJEXT@: temp/lexer.c temp/parser.h src/ick.h src/ick_lose.h temp/config.h
$(CC) $(CFLAGS) -c -o temp/lexer.@OBJEXT@ temp/lexer.c
-temp/feh2.@OBJEXT@: src/feh2.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/lose.h src/sizes.h temp/config.h
+temp/feh2.@OBJEXT@: src/feh2.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/ick_lose.h src/sizes.h temp/config.h
$(CC) $(CFLAGS) -c -o temp/feh2.@OBJEXT@ src/feh2.c
temp/idiotism.c: src/idiotism.oil temp/oil@EXEEXT@
temp/oil@EXEEXT@ < src/idiotism.oil > temp/idiotism.c
-temp/idiotism.@OBJEXT@: temp/idiotism.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/lose.h src/sizes.h temp/config.h
- $(CC) $(CFLAGS) -c -o temp/idiotism.@OBJEXT@ temp/idiotism.c
-temp/dekludge.@OBJEXT@: src/dekludge.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/lose.h src/sizes.h temp/config.h
+# There is a situation that some operating systems can get into known as memory
+# overcommit. Linux (talking specifically about the kernel) can reach this
+# situation in its default configuration, where it has been reporting to malloc
+# that memory is available when in fact it isn't, and reaches the situation when
+# the computer is actually completely out of memory but programs on it believe
+# that they aren't. For some reason, using the default options, gcc can somehow
+# cause memory overcommit when acting on a file as big as idiotism.c. The
+# solution here, therefore, is to put two protections to prevent this happening;
+# first, turn off optimisation specifically for that file, and second, put an
+# artificial memory limit on the compilation so that no more than 128 megabytes
+# can be allocated, using the ulimit feature on bash. As memory overcommit can
+# make a system unusable, and as it can be preceded by 'thrashing' (hugely
+# rapid swaps to disk in an attempt to get more memory) that can also make a
+# system unusable, steps to avoid this are necessary.
+temp/idiotism.@OBJEXT@: temp/idiotism.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/ick_lose.h src/sizes.h temp/config.h
+ bash -c 'ulimit -Sv 131072 && ulimit -Sd 131072 && $(CC) $(CFLAGS) -c -o temp/idiotism.@OBJEXT@ -O0 temp/idiotism.c'
+temp/dekludge.@OBJEXT@: src/dekludge.c src/feh.h temp/parser.h src/ick.h src/fiddle.h src/ick_lose.h src/sizes.h temp/config.h
$(CC) $(CFLAGS) -c -o temp/dekludge.@OBJEXT@ src/dekludge.c
-temp/perpet.@OBJEXT@: src/perpet.c temp/parser.h src/ick.h src/lose.h src/sizes.h src/uncommon.h temp/config.h
+temp/perpet.@OBJEXT@: src/perpet.c temp/parser.h src/ick.h src/ick_lose.h src/sizes.h src/uncommon.h temp/config.h
$(CC) $(CFLAGS) -c -o temp/perpet.@OBJEXT@ src/perpet.c
-temp/cesspool.@OBJEXT@: src/cesspool.c src/abcess.h src/lose.h src/sizes.h
+temp/cesspool.@OBJEXT@: src/cesspool.c src/abcess.h src/ick_lose.h src/sizes.h
$(CC) $(CFLAGS) -c -o temp/cesspool.@OBJEXT@ src/cesspool.c
-temp/numerals.@OBJEXT@: src/numerals.c src/abcess.h src/lose.h src/sizes.h
+temp/numerals.@OBJEXT@: src/numerals.c src/abcess.h src/ick_lose.h src/sizes.h
$(CC) $(CFLAGS) -c -o temp/numerals.@OBJEXT@ src/numerals.c
-temp/unravel.@OBJEXT@: src/unravel.c src/abcess.h src/lose.h src/sizes.h temp/config.h
+temp/unravel.@OBJEXT@: src/unravel.c src/abcess.h src/ick_lose.h src/sizes.h temp/config.h
$(CC) $(CFLAGS) -c -o temp/unravel.@OBJEXT@ src/unravel.c
-temp/lose.@OBJEXT@: src/lose.c src/lose.h temp/config.h
- $(CC) $(CFLAGS) -c -o temp/lose.@OBJEXT@ src/lose.c
+temp/ick_lose.@OBJEXT@: src/ick_lose.c src/ick_lose.h temp/config.h
+ $(CC) $(CFLAGS) -c -o temp/ick_lose.@OBJEXT@ src/ick_lose.c
temp/fiddle.@OBJEXT@: src/fiddle.c src/fiddle.h src/sizes.h
$(CC) $(CFLAGS) -c -o temp/fiddle.@OBJEXT@ src/fiddle.c
temp/arrgghh.@OBJEXT@: src/arrgghh.c
$(CC) $(CFLAGS) -c -o temp/arrgghh.@OBJEXT@ src/arrgghh.c
temp/uncommon.@OBJEXT@: src/uncommon.c src/uncommon.h
$(CC) $(CFLAGS) -c -o temp/uncommon.@OBJEXT@ src/uncommon.c
-temp/yuk.@OBJEXT@: src/yuk.c src/yuk.h src/lose.h src/sizes.h src/abcess.h src/uncommon.h temp/config.h
+temp/ick_ec.@OBJEXT@: src/ick_ec.c src/ick_ec.h src/abcess.h
+ $(CC) $(CFLAGS) -c -o temp/ick_ec.@OBJEXT@ src/ick_ec.c
+temp/yuk.@OBJEXT@: src/yuk.c src/yuk.h src/ick_lose.h src/sizes.h src/abcess.h src/uncommon.h temp/config.h
$(CC) $(CFLAGS) -c -o temp/yuk.@OBJEXT@ src/yuk.c
temp/clc-cset.@OBJEXT@: src/clc-cset.c src/uncommon.h
$(CC) $(CFLAGS) -c -o temp/clc-cset.@OBJEXT@ src/clc-cset.c
$(CC) $(CFLAGS) -c -o temp/convickt.@OBJEXT@ src/convickt.c
temp/cset-a.c: temp/bin2c@EXEEXT@ src/atari.bin
- temp/bin2c@EXEEXT@ clc_cset_atari < src/atari.bin > temp/cset-a.c
+ temp/bin2c@EXEEXT@ ick_clc_cset_atari < src/atari.bin > temp/cset-a.c
temp/cset-b.c: temp/bin2c@EXEEXT@ src/baudot.bin
- temp/bin2c@EXEEXT@ clc_cset_baudot < src/baudot.bin > temp/cset-b.c
+ temp/bin2c@EXEEXT@ ick_clc_cset_baudot < src/baudot.bin > temp/cset-b.c
temp/cset-e.c: temp/bin2c@EXEEXT@ src/ebcdic.bin
- temp/bin2c@EXEEXT@ clc_cset_ebcdic < src/ebcdic.bin > temp/cset-e.c
+ temp/bin2c@EXEEXT@ ick_clc_cset_ebcdic < src/ebcdic.bin > temp/cset-e.c
temp/cset-l.c: temp/bin2c@EXEEXT@ src/latin1.bin
- temp/bin2c@EXEEXT@ clc_cset_latin1 < src/latin1.bin > temp/cset-l.c
+ temp/bin2c@EXEEXT@ ick_clc_cset_latin1 < src/latin1.bin > temp/cset-l.c
temp/cset-a.@OBJEXT@: temp/cset-a.c
$(CC) $(CFLAGS) -c -o temp/cset-a.@OBJEXT@ temp/cset-a.c
temp/cset-b.@OBJEXT@: temp/cset-b.c
temp/cset-l.@OBJEXT@: temp/cset-l.c
$(CC) $(CFLAGS) -c -o temp/cset-l.@OBJEXT@ temp/cset-l.c
-lib/libick.a: temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
- ar cr lib/libick.a temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
+lib/libick.a: temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/ick_lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
+ ar cr lib/libick.a temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/ick_lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
@RANLIB@ lib/libick.a
-lib/libickmt.a: temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/unravel.@OBJEXT@ temp/lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
- ar cr lib/libickmt.a temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/unravel.@OBJEXT@ temp/lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
+lib/libickmt.a: temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/unravel.@OBJEXT@ temp/ick_lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
+ ar cr lib/libickmt.a temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/unravel.@OBJEXT@ temp/ick_lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
@RANLIB@ lib/libickmt.a
+lib/libickec.a: temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/ick_ec.@OBJEXT@ temp/ick_lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
+ ar cr lib/libickec.a temp/cesspool.@OBJEXT@ temp/numerals.@OBJEXT@ temp/ick_ec.@OBJEXT@ temp/ick_lose.@OBJEXT@ temp/fiddle.@OBJEXT@ temp/arrgghh.@OBJEXT@ temp/clc-cset.@OBJEXT@ temp/cset-a.@OBJEXT@ temp/cset-b.@OBJEXT@ temp/cset-e.@OBJEXT@ temp/cset-l.@OBJEXT@ temp/uncommon.@OBJEXT@
+ @RANLIB@ lib/libickec.a
+
lib/libyuk.a: temp/yuk.@OBJEXT@
ar cr lib/libyuk.a temp/yuk.@OBJEXT@
@RANLIB@ lib/libyuk.a
cp bin/ick@EXEEXT@ bin/convickt@EXEEXT@ $(DESTDIR)$(bindir)
cp lib/libick.a $(DESTDIR)$(libdir)
cp lib/libickmt.a $(DESTDIR)$(libdir)
+ cp lib/libickec.a $(DESTDIR)$(libdir)
cp lib/libyuk.a $(DESTDIR)$(libdir)
-mkdir -p $(DESTDIR)$(incdir)
- cp src/lose.h src/abcess.h src/fiddle.h src/yuk.h $(DESTDIR)$(incdir)
+ cp src/ick_lose.h src/abcess.h src/fiddle.h src/yuk.h $(DESTDIR)$(incdir)
+ cp src/ick_ec.h $(DESTDIR)$(incdir)
-mkdir -p $(DESTDIR)$(datadir)
cp include/*.bin $(DESTDIR)$(datadir)
cp src/ick-wrap.c src/pickwrap.c $(DESTDIR)$(datadir)
# install, and gzip the docs after installing.
# The pattern i*[fo] matches ick.info only when uncompressed, even on
-# an 8.3 system.
+# an 8.3 system. ick.i*gz matches compressed Info files, but some DOS
+# command interpreters buggily also match it to uncompressed Info files
+# even though gz appears nowhere in the filename, so care must be taken
+# only to use that pattern with sh.
install: install-common
+ sh -c "rm -f $(DESTDIR)$(infodir)/ick.i*gz"
-gzip -9 -f $(DESTDIR)$(infodir)/ick.in*
-gzip -9 -f $(DESTDIR)$(mandir)/man1/ick.1
-gzip -9 -f $(DESTDIR)$(mandir)/man1/convickt.1
NEW IN THIS RELEASE
+ Release 0.28 (by Alex Smith)
+
+Patches, suggestions and bugs found by Joris Huizer
+
+1. Fixed a typo in the [noopxor] optimiser idiom.
+
+2. Fixed a typo that caused the flow optimiser to optimise some errors into
+ non-erroring code.
+
+3. Fixed the [lshift16] optimiser idiom; previously it was giving incorrect
+ values in some cases where the bits being selected from the original
+ number weren't contiguous.
+
+4. There is now no longer a segfault when the unusual option combination -f
+ (without specifying -O) is used.
+
+5. It is again possible to recompile more than one source file at a time.
+
+6. The flow optimiser now recognises that comments can be reinstated in
+ programs where they can be reinstated.
+
+Changes by Alex Smith
+
+7. Fixed some typos in the documentation.
+
+8. Applying an infix unary operator to a constant (as in ) now returns
+ the correct value; previously it returned the unary operator applied to a
+ sequence number that was 0 for the first unique constant that was the
+ argument of a unary operator, 1 for the second unique constant, and so
+ on. (This was a bug in the parser.)
+
+9. Added doc/THEORY.txt back in. (It seems that it went missing some time
+ between 1.26 and 0.27.) Updated it to describe the current compiler.
+
+10. Turned off optimsation of the optimiser, and also placed a 128MB limit on
+ the data segment and virtual memory it was allowed to use. This is to
+ prevent Linux thrashing and/or invoking the dreaded oom-killer when
+ recompiling idiotism.c. (This happened only rarely, but it happened to me
+ twice, each time making my computer unusable for about half an hour.
+ Therefore, a fix to prevent the situation happening again was added,
+ assuming your computer has at least 128MB free memory and disk space.) As
+ a bonus, the build process is now considerably faster, because the
+ optimisation of the optimiser was the slowest step of the process.
+
+11. Internally, all symbols that are visible globally are now name-mangled (by
+ using the prefix ick_). This allows other files to be linked with files
+ compiled from INTERCAL without namespace collisions. This does not include
+ symbols that are only useful in multithreading (as INTERCAL's
+ multithreading model is incompatible with other programs), only for the
+ debugger (because linking yuk into a program causes all sorts of chaos if
+ non-INTERCAL programs are involved), or only used by the compiler (which
+ hopefully should never be linked to another program that isn't
+ specifically designed to be linked to it).
+
+12. Thoroughly delinted the code, using Splint; the code is now annotated to
+ show Splint what is being done where (and all the non-obvious annotations
+ are explained so that humans can figure out what is going on as well);
+ over 800 warnings have been fixed, including some which identified bugs in
+ the original program (many of which were to do with edge cases involving
+ unusually long strings, and some of which were buffer overflows). All
+ comments from /*@ to @*/ are mine, and are annotations for Splint.
+
+13. Implemented external calls, which allow multiple INTERCAL programs to be
+ linked to each other, and/or to C programs, via the -e option and NEXT /
+ COME FROM / NEXT FROM / FORGET / RESUME statements. See the manual for
+ more details.
+
+Changes from elsewhere
+
+14. Added yet another nontrivial INTERCAL program to the pit; interfunge.i
+ (written by Jeffrey Lee) is a Befunge-93 interpreter written in INTERCAL.
+ (It appears to conform to the standard (I actually ran it against a
+ testsuite, and it passed); its only pecularities, apart from the language
+ in which it's written, appear to be the need for a blank line at the end
+ of the program, but no blank lines earlier (because INTERCAL can't sense
+ EOF, although there are plans to change that), the restriction to 80x25 is
+ enforced (this seems to be an implied requirement in the standard, but
+ most Befunge-93 interpreters don't enforce it), and numeric output is in
+ Roman numerals (what did you expect?).)
+
Release 0.27 (by Alex Smith)
1. Joris Huizer pointed out that the manual nowhere says that a GIVE UP line
This implementation was created by Eric S. Raymond <esr@snark.thyrsus.com>
during a fit of lunacy from which he has since mostly recovered. It has been
considerably hacked upon and improved by Steve Swales, Michael Ernst, Louis
-Howell, Brian Raiter, Alex Smith, and others. For detailed credits see NEWS.
+Howell, Brian Raiter, Alex Smith, Joris Huizer and others. For detailed
+credits see NEWS.
FILES
src/fiddle.[ch] -- the INTERCAL operators
src/ick-wrap.c -- the driver for generated C-from-INTERCAL code
src/ick.h -- compilation types and defines
+src/ick_ec.[ch] -- external call support for INTERCAL
+src/ick_lose.[ch] -- INTERCAL compile- and run-time error handling
src/idiotism.oil -- list of INTERCAL idioms to optimize
src/lexer.l -- the lexical analyzer specification (in LEX)
-src/lose.[ch] -- INTERCAL compile- and run-time error handling
src/numerals.c -- numerals table for INTERCAL input
src/oil.y -- compiler to translate idiotism.oil into C
+src/oil.h -- name mangling for OIL files
src/parser.y -- the grammar specification (in YACC)
src/perpet.c -- main routine for compiler
src/pick1.h -- template for compiler-dependent PIC C headers
version wasn't the most recent. Looking through the alt.lang.intercal archives
is usually the best way to find out what the latest version of C-INTERCAL (and
you'll find out how to get its rival too, for that matter) is nowadays; they
-tend to pop up in various unusual places, so giving a URL might be
-misleading. Note also that contact details, and even who to contact, often end
-up out of date; the newsgroup is also a good way to find out who to contact.)
+tend to pop up in various unusual places, so giving a URL might be misleading.
+Note also that contact details, and even who to contact, often end up out of
+date; the newsgroup is also a good way to find out who to contact.
+
+As of when I wrote this, the current homepage for C-INTERCAL and CLC-INTERCAL
+is http://intercal.freeshell.org.)
There is, in addition, an occasionally active USENET newsgroup devoted to the
language: alt.lang.intercal.
DJGPP-specific output; and if you're running DJGPP under bash under Windows
XP, you may need to either set your default command interpreter for batch
files to cmd rather than command.com (by setting your SHELL environment
-variable, or use some better workaround that I don't know about. (command.com
+variable), or use some better workaround that I don't know about. (command.com
seems to have problems with the PATH environment variable under Windows XP
when running under bash.) Also try to make sure that you use the .sh versions
of the makeick.* scripts when running under bash or a similar ported shell,
Some distributions of DJGPP have a bug where they complain that they can't find
'm4.exe' (or maybe my PATH is still wrong...). You can solve this problem by
-copying m4.exe into the \temp subdirectory before running makeick.bat.
+copying m4.exe into the temp\ subdirectory before running makeick.bat.
(P.S. It was my PATH that was wrong. Still, if you made the same mistake as me,
you may want to try the same fix.)
--- /dev/null
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+ac_cv_c_const=${ac_cv_c_const=yes}
+ac_cv_cygwin=${ac_cv_cygwin=no}
+ac_cv_exeext=${ac_cv_exeext=no}
+ac_cv_func_asprintf=${ac_cv_func_asprintf=yes}
+ac_cv_func_gethrtime=${ac_cv_func_gethrtime=no}
+ac_cv_func_gettimeofday=${ac_cv_func_gettimeofday=yes}
+ac_cv_func_snprintf=${ac_cv_func_snprintf=yes}
+ac_cv_func_strdup=${ac_cv_func_strdup=yes}
+ac_cv_func_strtol=${ac_cv_func_strtol=yes}
+ac_cv_func_strtoul=${ac_cv_func_strtoul=yes}
+ac_cv_header_stdc=${ac_cv_header_stdc=yes}
+ac_cv_header_sys_time_h=${ac_cv_header_sys_time_h=yes}
+ac_cv_header_time=${ac_cv_header_time=yes}
+ac_cv_header_unistd_h=${ac_cv_header_unistd_h=yes}
+ac_cv_lib_fl_yywrap=${ac_cv_lib_fl_yywrap=yes}
+ac_cv_mingw32=${ac_cv_mingw32=no}
+ac_cv_objext=${ac_cv_objext=o}
+ac_cv_prog_CC=${ac_cv_prog_CC=gcc}
+ac_cv_prog_CPP=${ac_cv_prog_CPP='gcc -E'}
+ac_cv_prog_INSTALLINFO=${ac_cv_prog_INSTALLINFO=install-info}
+ac_cv_prog_LEX=${ac_cv_prog_LEX=flex}
+ac_cv_prog_MANDB=${ac_cv_prog_MANDB=mandb}
+ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=ranlib}
+ac_cv_prog_YACC=${ac_cv_prog_YACC='bison -y'}
+ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no}
+ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes}
+ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes}
+ac_cv_prog_gcc=${ac_cv_prog_gcc=yes}
+ac_cv_prog_lex_root=${ac_cv_prog_lex_root=lex.yy}
+ac_cv_prog_lex_yytext_pointer=${ac_cv_prog_lex_yytext_pointer=yes}
+ac_cv_sizeof__Bool=${ac_cv_sizeof__Bool=1}
+ac_cv_sizeof_long_long_int=${ac_cv_sizeof_long_long_int=8}
+ac_cv_sys_interpreter=${ac_cv_sys_interpreter=yes}
+ac_cv_type_signal=${ac_cv_type_signal=void}
+dnl -*- autoconf -*-
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/abcess.h)
AC_CONFIG_HEADER(temp/config.h:src/configh.in)
dnl Information about this version of INTERCAL.
-PACKAGE_VERSION=0.27
+PACKAGE_VERSION=0.28
dnl Checks for programs.
AC_PROG_YACC
dnl Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(gettimeofday gethrtime strdup strtol strtoul)
+AC_CHECK_FUNCS(gettimeofday gethrtime strdup strtol strtoul snprintf asprintf)
AC_SUBST(PACKAGE_VERSION)
--- /dev/null
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+configure:534: checking for bison
+configure:567: checking for gcc
+configure:680: checking whether the C compiler (gcc ) works
+configure:696: gcc -o conftest conftest.c 1>&5
+configure:722: checking whether the C compiler (gcc ) is a cross-compiler
+configure:727: checking whether we are using GNU C
+configure:755: checking whether gcc accepts -g
+configure:789: checking for ranlib
+configure:821: checking for install-info
+configure:856: checking for mandb
+configure:889: checking the location of the Info dir file
+configure:918: checking how to run the C preprocessor
+configure:998: checking for ANSI C header files
+configure:1105: checking for sys/time.h
+configure:1105: checking for unistd.h
+configure:1143: checking for working const
+configure:1218: checking size of long long int
+configure:1258: checking size of _Bool
+configure:1298: checking whether time.h and sys/time.h may both be included
+configure:1333: checking for Cygwin environment
+configure:1366: checking for mingw32 environment
+configure:1397: checking for executable suffix
+configure:1428: checking for object suffix
+configure:1454: checking for flex
+configure:1488: checking for yywrap in -lfl
+configure:1530: checking lex output file root
+configure:1551: checking whether yytext is a pointer
+configure:1594: checking whether #! works in shell scripts
+configure:1616: checking whether yyrestart() is needed
+configure:1630: gcc -c -g -O2 conftest.c 1>&5
+In file included from configure:1623:
+<stdin>:4: error: conflicting types for 'yyrestart'
+lex.yy.c:1133: error: previous definition of 'yyrestart' was here
+configure: failed program was:
+#line 1622 "configure"
+#include "confdefs.h"
+#include "lex.yy.c"
+
+int main() {
+exit(0);
+; return 0; }
+configure:1658: checking return type of signal handlers
+configure:1701: checking for gettimeofday
+configure:1701: checking for gethrtime
+configure:1701: checking for strdup
+configure:1701: checking for strtol
+configure:1701: checking for strtoul
+configure:1701: checking for snprintf
+configure:1701: checking for asprintf
#! /bin/sh
+
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
-
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- case $as_dir in
- /*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-exec 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
+# Defaults:
+ac_help=
ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="src/abcess.h"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-YACC
-YFLAGS
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-RANLIB
-INSTALLINFO
-MANDB
-INFODIRFILE
-CPP
-GREP
-EGREP
-LEX
-LEX_OUTPUT_ROOT
-LEXLIB
-LIBOBJS
-LTLIBOBJS'
-ac_subst_files=''
- ac_precious_vars='build_alias
-host_alias
-target_alias
-YACC
-YFLAGS
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP'
-
+# Any additions from configure.in:
# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
-cache_file=/dev/null
+build=NONE
+cache_file=./config.cache
exec_prefix=NONE
+host=NONE
no_create=
+nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
silent=
site=
srcdir=
+target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
+datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
ac_prev=
-ac_dashdash=
for ac_option
do
+
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
+ eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
- case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
+ case "$ac_option" in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
+ bindir="$ac_optarg" ;;
-build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
+ ac_prev=build ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
+ build="$ac_optarg" ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
+ cache_file="$ac_optarg" ;;
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
-disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
-enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
+ exec_prefix="$ac_optarg" ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
-host | --host | --hos | --ho)
- ac_prev=host_alias ;;
+ ac_prev=host ;;
-host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
+ host="$ac_optarg" ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
+ includedir="$ac_optarg" ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
+ infodir="$ac_optarg" ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
+ libdir="$ac_optarg" ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
+ libexecdir="$ac_optarg" ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
+ mandir="$ac_optarg" ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
+ | --no-cr | --no-c)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
+ oldincludedir="$ac_optarg" ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
+ prefix="$ac_optarg" ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
+ program_prefix="$ac_optarg" ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
+ program_suffix="$ac_optarg" ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
+ program_transform_name="$ac_optarg" ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
+ sbindir="$ac_optarg" ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
+ sharedstatedir="$ac_optarg" ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
+ site="$ac_optarg" ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
+ srcdir="$ac_optarg" ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
+ sysconfdir="$ac_optarg" ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
+ ac_prev=target ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
+ target="$ac_optarg" ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
-with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
--x)
# Obsolete; use --with-x.
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
+ x_includes="$ac_optarg" ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
+ x_libraries="$ac_optarg" ;;
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
*)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
;;
esac
done
if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi
-# Be sure to have absolute directory names.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
-done
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
fi
+exec 5>./config.log
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
-test "$silent" = yes && exec 6>/dev/null
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=src/abcess.h
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
+ if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
done
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
-Usage: $0 [OPTION]... [VAR=VALUE]...
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-Defaults for the options are specified in brackets.
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-_ACEOF
-fi
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Some influential environment variables:
- YACC The `Yet Another C Compiler' implementation to use. Defaults to
- the first program found out of: `bison -y', `byacc', `yacc'.
- YFLAGS The list of arguments that will be passed by default to $YACC.
- This script will default YFLAGS to the empty string to avoid a
- default value of `-d' given by some make applications.
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.61
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-ac_config_headers="$ac_config_headers temp/config.h:src/configh.in"
-
-
-PACKAGE_VERSION=0.27
+PACKAGE_VERSION=0.28
for ac_prog in 'bison -y' byacc
do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
+# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_YACC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:534: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$YACC"; then
ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_YACC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_YACC="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
fi
fi
-YACC=$ac_cv_prog_YACC
+YACC="$ac_cv_prog_YACC"
if test -n "$YACC"; then
- { echo "$as_me:$LINENO: result: $YACC" >&5
-echo "${ECHO_T}$YACC" >&6; }
+ echo "$ac_t""$YACC" 1>&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$ac_t""no" 1>&6
fi
-
- test -n "$YACC" && break
+test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
+# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:567: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
fi
fi
-CC=$ac_cv_prog_CC
+CC="$ac_cv_prog_CC"
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ echo "$ac_t""$CC" 1>&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$ac_t""no" 1>&6
fi
-
- fi
-fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:597: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
- if test $# != 0; then
+ if test $# -gt 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
fi
fi
fi
fi
-CC=$ac_cv_prog_CC
+CC="$ac_cv_prog_CC"
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ echo "$ac_t""$CC" 1>&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$ac_t""no" 1>&6
fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:648: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
fi
fi
-CC=$ac_cv_prog_CC
+CC="$ac_cv_prog_CC"
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ echo "$ac_t""$CC" 1>&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$ac_t""no" 1>&6
fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
+ ;;
+ esac
fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:680: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 691 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
+ ac_cv_prog_cc_cross=yes
fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
else
- ac_file=''
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:722: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:727: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ ac_cv_prog_gcc=no
fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
+ GCC=
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:755: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
ac_cv_prog_cc_g=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_prog_cc_g=no
fi
+rm -f conftest*
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
+ CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
CFLAGS=
fi
fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:789: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
-RANLIB=$ac_cv_prog_RANLIB
+RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
+ echo "$ac_t""$RANLIB" 1>&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
+ echo "$ac_t""no" 1>&6
fi
for ac_prog in install-info
do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
+# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_INSTALLINFO+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:821: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_INSTALLINFO'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$INSTALLINFO"; then
ac_cv_prog_INSTALLINFO="$INSTALLINFO" # Let the user override the test.
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_INSTALLINFO="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_INSTALLINFO="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
fi
fi
-INSTALLINFO=$ac_cv_prog_INSTALLINFO
+INSTALLINFO="$ac_cv_prog_INSTALLINFO"
if test -n "$INSTALLINFO"; then
- { echo "$as_me:$LINENO: result: $INSTALLINFO" >&5
-echo "${ECHO_T}$INSTALLINFO" >&6; }
+ echo "$ac_t""$INSTALLINFO" 1>&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$ac_t""no" 1>&6
fi
-
- test -n "$INSTALLINFO" && break
+test -n "$INSTALLINFO" && break
done
test -n "$INSTALLINFO" || INSTALLINFO=":"
for ac_prog in mandb
do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
+# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_MANDB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:856: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_MANDB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$MANDB"; then
ac_cv_prog_MANDB="$MANDB" # Let the user override the test.
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_MANDB="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_MANDB="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
fi
fi
-MANDB=$ac_cv_prog_MANDB
+MANDB="$ac_cv_prog_MANDB"
if test -n "$MANDB"; then
- { echo "$as_me:$LINENO: result: $MANDB" >&5
-echo "${ECHO_T}$MANDB" >&6; }
+ echo "$ac_t""$MANDB" 1>&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$ac_t""no" 1>&6
fi
-
- test -n "$MANDB" && break
+test -n "$MANDB" && break
done
test -n "$MANDB" || MANDB=":"
if test ! INSTALLINFO = ":"; then
-{ echo "$as_me:$LINENO: checking the location of the Info dir file" >&5
-echo $ECHO_N "checking the location of the Info dir file... $ECHO_C" >&6; }
+echo $ac_n "checking the location of the Info dir file""... $ac_c" 1>&6
+echo "configure:889: checking the location of the Info dir file" >&5
# Try the following locations in order:
INFODIRFILELOCATIONGUESSES=${infodir}/dir
INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} ${infodir}/dir.gz"
INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /dev/env/DJDIR/info/dir"
INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /dev/env/DJDIR/info/dir.gz"
-INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /usr/share/info/dir"
-INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /usr/share/info/dir.gz"
-INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /usr/local/share/info/dir"
-INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /usr/local/share/info/dir.gz"
-for my_ac_infodirfile in ${INFODIRFILELOCATIONGUESSES}
-do
-INFODIRFILE=${my_ac_infodirfile}
-test -f "$INFODIRFILE" && break
-INFODIRFILE=/dev/null
-done
-if test $INFODIRFILE = /dev/null; then
-{ echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
-{ echo "$as_me:$LINENO: WARNING: Could not find Info directory file, set infodirfile in the Makefile by hand" >&5
-echo "$as_me: WARNING: Could not find Info directory file, set infodirfile in the Makefile by hand" >&2;}
-else
-{ echo "$as_me:$LINENO: result: $INFODIRFILE" >&5
-echo "${ECHO_T}$INFODIRFILE" >&6; }
-fi
-else
-INFODIRFILE=(irrelevant)
-fi
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_GREP_found && break 3
- done
-done
-
+INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /usr/share/info/dir"
+INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /usr/share/info/dir.gz"
+INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /usr/local/share/info/dir"
+INFODIRFILELOCATIONGUESSES="${INFODIRFILELOCATIONGUESSES} /usr/local/share/info/dir.gz"
+for my_ac_infodirfile in ${INFODIRFILELOCATIONGUESSES}
+do
+INFODIRFILE=${my_ac_infodirfile}
+test -f "$INFODIRFILE" && break
+INFODIRFILE=/dev/null
done
-IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
+if test $INFODIRFILE = /dev/null; then
+echo "$ac_t""not found" 1>&6
+echo "configure: warning: Could not find Info directory file, set infodirfile in the Makefile by hand" 1>&2
+else
+echo "$ac_t""$INFODIRFILE" 1>&6
fi
-
else
- ac_cv_path_GREP=$GREP
+INFODIRFILE=(irrelevant)
fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:918: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 933 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
else
- ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_EGREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 950 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 967 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
+rm -f conftest*
fi
-
-else
- ac_cv_path_EGREP=$EGREP
+rm -f conftest*
fi
-
-
- fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:998: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ cat > conftest.$ac_ext <<EOF
+#line 1003 "configure"
+#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
ac_cv_header_stdc=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+cat > conftest.$ac_ext <<EOF
+#line 1028 "configure"
+#include "confdefs.h"
#include <string.h>
-
-_ACEOF
+EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
+ egrep "memchr" >/dev/null 2>&1; then
:
else
+ rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+cat > conftest.$ac_ext <<EOF
+#line 1046 "configure"
+#include "confdefs.h"
#include <stdlib.h>
-
-_ACEOF
+EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
+ egrep "free" >/dev/null 2>&1; then
:
else
+ rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
+if test "$cross_compiling" = yes; then
:
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ cat > conftest.$ac_ext <<EOF
+#line 1067 "configure"
+#include "confdefs.h"
#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:1078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
:
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -fr conftest*
fi
-
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-cat >>confdefs.h <<\_ACEOF
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
+EOF
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in sys/time.h unistd.h
+for ac_hdr in sys/time.h unistd.h
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1105: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1110 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+rm -f conftest*
fi
-
-done
-
-
-{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
-if test "${ac_cv_c_const+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
- typedef int charset[2];
- const charset cs;
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
- ;
- return 0;
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1143: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1148 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:1197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
ac_cv_c_const=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_c_const=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
-
+rm -f conftest*
fi
-{ echo "$as_me:$LINENO: checking for long long int" >&5
-echo $ECHO_N "checking for long long int... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_long_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef long long int ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_long_long_int=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
- ac_cv_type_long_long_int=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
-echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long long int" >&5
-echo $ECHO_N "checking size of long long int... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long_long_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking size of long long int""... $ac_c" 1>&6
+echo "configure:1218: checking size of long long int" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_long_long_int'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+ ac_cv_sizeof_long_long_int=0
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long int ac__type_sizeof_;
-int
-main ()
+ cat > conftest.$ac_ext <<EOF
+#line 1226 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <sys/types.h>
+main()
{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", sizeof(long long int));
+ exit(0);
}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
+EOF
+if { (eval echo configure:1238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_sizeof_long_long_int=`cat conftestval`
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_sizeof_long_long_int=0
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
+rm -fr conftest*
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+echo "$ac_t""$ac_cv_sizeof_long_long_int" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
+EOF
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
+echo $ac_n "checking size of _Bool""... $ac_c" 1>&6
+echo "configure:1258: checking size of _Bool" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof__Bool'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_long_int=$ac_lo;;
-'') if test "$ac_cv_type_long_long_int" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_long_int=0
- fi ;;
-esac
+ if test "$cross_compiling" = yes; then
+ ac_cv_sizeof__Bool=0
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long int ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+ cat > conftest.$ac_ext <<EOF
+#line 1266 "configure"
+#include "confdefs.h"
#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
+#include <sys/types.h>
+main()
{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", sizeof(_Bool));
+ exit(0);
}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_long_long_int=`cat conftest.val`
+EOF
+if { (eval echo configure:1278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_sizeof__Bool=`cat conftestval`
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long_long_int" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_long_int=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_sizeof__Bool=0
fi
-rm -f conftest.val
+rm -fr conftest*
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long_int" >&6; }
+fi
+echo "$ac_t""$ac_cv_sizeof__Bool" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF__BOOL $ac_cv_sizeof__Bool
+EOF
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for _Bool" >&5
-echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; }
-if test "${ac_cv_type__Bool+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:1298: checking whether time.h and sys/time.h may both be included" >&5
+if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef _Bool ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type__Bool=yes
+ cat > conftest.$ac_ext <<EOF
+#line 1303 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+int main() {
+struct tm *tp;
+; return 0; }
+EOF
+if { (eval echo configure:1312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_header_time=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type__Bool=no
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_time=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
-echo "${ECHO_T}$ac_cv_type__Bool" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of _Bool" >&5
-echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof__Bool+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef _Bool ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef _Bool ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+rm -f conftest*
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef _Bool ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef _Bool ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
+echo "$ac_t""$ac_cv_header_time" 1>&6
+if test $ac_cv_header_time = yes; then
+ cat >> confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:1333: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ cat > conftest.$ac_ext <<EOF
+#line 1338 "configure"
+#include "confdefs.h"
- ac_lo= ac_hi=
-fi
+int main() {
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef _Bool ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
+rm -f conftest*
+rm -f conftest*
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof__Bool=$ac_lo;;
-'') if test "$ac_cv_type__Bool" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (_Bool)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof__Bool=0
- fi ;;
-esac
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1366: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef _Bool ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
+ cat > conftest.$ac_ext <<EOF
+#line 1371 "configure"
+#include "confdefs.h"
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof__Bool=`cat conftest.val`
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type__Bool" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (_Bool)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof__Bool=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
fi
-rm -f conftest.val
+rm -f conftest*
+rm -f conftest*
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5
-echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF__BOOL $ac_cv_sizeof__Bool
-_ACEOF
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
-{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
-if test "${ac_cv_header_time+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1397: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_time=yes
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_time=no
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:1407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.$ac_ext | *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define TIME_WITH_SYS_TIME 1
-_ACEOF
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1428: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+ *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+else
+ { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
fi
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
-
-for ac_prog in flex lex
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_LEX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# Extract the first word of "flex", so it can be a program name with args.
+set dummy flex; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1454: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$LEX"; then
ac_cv_prog_LEX="$LEX" # Let the user override the test.
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_LEX="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_LEX="flex"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
fi
fi
-LEX=$ac_cv_prog_LEX
+LEX="$ac_cv_prog_LEX"
if test -n "$LEX"; then
- { echo "$as_me:$LINENO: result: $LEX" >&5
-echo "${ECHO_T}$LEX" >&6; }
+ echo "$ac_t""$LEX" 1>&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$ac_t""no" 1>&6
fi
+if test -z "$LEXLIB"
+then
+ case "$LEX" in
+ flex*) ac_lib=fl ;;
+ *) ac_lib=l ;;
+ esac
+ echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
+echo "configure:1488: checking for yywrap in -l$ac_lib" >&5
+ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-l$ac_lib $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1496 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char yywrap();
+
+int main() {
+yywrap()
+; return 0; }
+EOF
+if { (eval echo configure:1507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
- test -n "$LEX" && break
-done
-test -n "$LEX" || LEX=":"
-
-if test "x$LEX" != "x:"; then
- cat >conftest.l <<_ACEOF
-%%
-a { ECHO; }
-b { REJECT; }
-c { yymore (); }
-d { yyless (1); }
-e { yyless (input () != 0); }
-f { unput (yytext[0]); }
-. { BEGIN INITIAL; }
-%%
-#ifdef YYTEXT_POINTER
-extern char *yytext;
-#endif
-int
-main (void)
-{
- return ! yylex () + ! yywrap ();
-}
-_ACEOF
-{ (ac_try="$LEX conftest.l"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$LEX conftest.l") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ echo "$as_me:$LINENO: checking lex output file root" >&5
-echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; }
-if test "${ac_cv_prog_lex_root+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LEXLIB="-l$ac_lib"
else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+echo $ac_n "checking lex output file root""... $ac_c" 1>&6
+echo "configure:1530: checking lex output file root" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # The minimal lex program is just a single line: %%. But some broken lexes
+# (Solaris, I think it was) want two %% lines, so accommodate them.
+echo '%%
+%%' | $LEX
if test -f lex.yy.c; then
ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
ac_cv_prog_lex_root=lexyy
else
- { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
-echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
- { (exit 1); exit 1; }; }
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
-echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; }
-LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
-
-if test -z "${LEXLIB+set}"; then
- { echo "$as_me:$LINENO: checking lex library" >&5
-echo $ECHO_N "checking lex library... $ECHO_C" >&6; }
-if test "${ac_cv_lib_lex+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_save_LIBS=$LIBS
- ac_cv_lib_lex='none needed'
- for ac_lib in '' -lfl -ll; do
- LIBS="$ac_lib $ac_save_LIBS"
- cat >conftest.$ac_ext <<_ACEOF
-`cat $LEX_OUTPUT_ROOT.c`
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_lex=$ac_lib
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- test "$ac_cv_lib_lex" != 'none needed' && break
- done
- LIBS=$ac_save_LIBS
-
+ { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; }
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
-echo "${ECHO_T}$ac_cv_lib_lex" >&6; }
- test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
fi
+echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
-{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
-echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; }
-if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
+echo "configure:1551: checking whether yytext is a pointer" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
# POSIX says lex can declare yytext either as a pointer or an array; the
-# default is implementation-dependent. Figure out which it is, since
+# default is implementation-dependent. Figure out which it is, since
# not all implementations provide the %pointer and %array declarations.
ac_cv_prog_lex_yytext_pointer=no
-ac_save_LIBS=$LIBS
-LIBS="$LEXLIB $ac_save_LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#define YYTEXT_POINTER 1
+echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
+ac_save_LIBS="$LIBS"
+LIBS="$LIBS $LEXLIB"
+cat > conftest.$ac_ext <<EOF
+#line 1563 "configure"
+#include "confdefs.h"
`cat $LEX_OUTPUT_ROOT.c`
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
ac_cv_prog_lex_yytext_pointer=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_save_LIBS
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+rm -f "${LEX_OUTPUT_ROOT}.c"
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
-echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; }
-if test $ac_cv_prog_lex_yytext_pointer = yes; then
-cat >>confdefs.h <<\_ACEOF
+echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+ cat >> confdefs.h <<\EOF
#define YYTEXT_POINTER 1
-_ACEOF
+EOF
fi
-rm -f conftest.l $LEX_OUTPUT_ROOT.c
-fi
-{ echo "$as_me:$LINENO: checking whether #! works in shell scripts" >&5
-echo $ECHO_N "checking whether #! works in shell scripts... $ECHO_C" >&6; }
-if test "${ac_cv_sys_interpreter+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+# Pull the hash mark out of the macro call to avoid m4 problems.
+ac_msg="whether #! works in shell scripts"
+echo $ac_n "checking $ac_msg""... $ac_c" 1>&6
+echo "configure:1594: checking $ac_msg" >&5
+if eval "test \"`echo '$''{'ac_cv_sys_interpreter'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
echo '#! /bin/cat
exit 69
-' >conftest
+' > conftest
chmod u+x conftest
-(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1)
+(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null)
if test $? -ne 69; then
ac_cv_sys_interpreter=yes
else
fi
rm -f conftest
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sys_interpreter" >&5
-echo "${ECHO_T}$ac_cv_sys_interpreter" >&6; }
-interpval=$ac_cv_sys_interpreter
+
+echo "$ac_t""$ac_cv_sys_interpreter" 1>&6
+interpval="$ac_cv_sys_interpreter"
-{ echo "$as_me:$LINENO: checking whether yyrestart() is needed" >&5
-echo $ECHO_N "checking whether yyrestart() is needed... $ECHO_C" >&6; }
+echo $ac_n "checking whether yyrestart() is needed""... $ac_c" 1>&6
+echo "configure:1616: checking whether yyrestart() is needed" >&5
# Write a lex program that will cause an error if yyrestart exists.
echo '%%
%%
float yyrestart(int, ...);' | $LEX
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+cat > conftest.$ac_ext <<EOF
+#line 1622 "configure"
+#include "confdefs.h"
#include "${LEX_OUTPUT_ROOT}.c"
-int
-main ()
-{
+int main() {
exit(0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >>confdefs.h <<\_ACEOF
+; return 0; }
+EOF
+if { (eval echo configure:1630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat >> confdefs.h <<\EOF
#define NEED_YYRESTART 1
-_ACEOF
+EOF
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+echo "$ac_t""yes" 1>&6
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest*
rm -f ${LEX_OUTPUT_ROOT}.c
if test "$interpval" != "no"; then
-cat >>confdefs.h <<\_ACEOF
+cat >> confdefs.h <<\EOF
#define HAVE_SYS_INTERPRETER 1
-_ACEOF
+EOF
fi
-cat >>confdefs.h <<_ACEOF
+cat >> confdefs.h <<EOF
#define EXEEXT "$EXEEXT"
-_ACEOF
+EOF
-{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
-if test "${ac_cv_type_signal+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:1658: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ cat > conftest.$ac_ext <<EOF
+#line 1663 "configure"
+#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
-int
-main ()
-{
-return *(signal (0, 0)) (0) == 1;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:1680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_type_signal=void
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
ac_cv_type_signal=int
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_signal=void
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest*
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6; }
-cat >>confdefs.h <<_ACEOF
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
#define RETSIGTYPE $ac_cv_type_signal
-_ACEOF
-
-
+EOF
-
-
-
-for ac_func in gettimeofday gethrtime strdup strtol strtoul
+for ac_func in gettimeofday gethrtime strdup strtol strtoul snprintf asprintf
do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1701: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1706 "configure"
+#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
-#undef $ac_func
+int main() {
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
+#else
+$ac_func();
#endif
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
+; return 0; }
+EOF
+if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest*
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
fi
done
-ac_config_files="$ac_config_files Makefile temp/coopt.sh:src/cooptsh.in"
-
-cat >confcache <<\_ACEOF
+trap '' 1 2 15
+cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
+EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
+# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+DEFS=-DHAVE_CONFIG_H
+# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
+# configure, is in ./config.log if it exists.
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
+ac_given_srcdir=$srcdir
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
+trap 'rm -fr `echo "Makefile temp/coopt.sh:src/cooptsh.in temp/config.h:src/configh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@YACC@%$YACC%g
+s%@CC@%$CC%g
+s%@RANLIB@%$RANLIB%g
+s%@INSTALLINFO@%$INSTALLINFO%g
+s%@MANDB@%$MANDB%g
+s%@INFODIRFILE@%$INFODIRFILE%g
+s%@CPP@%$CPP%g
+s%@EXEEXT@%$EXEEXT%g
+s%@OBJEXT@%$OBJEXT%g
+s%@LEX@%$LEX%g
+s%@LEXLIB@%$LEXLIB%g
+s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
+s%@PACKAGE_VERSION@%$PACKAGE_VERSION%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
else
- as_ls_L_option=
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Report bugs to <bug-autoconf@gnu.org>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2006 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1"
- ac_need_defaults=false ;;
-
- esac
- shift
done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
fi
+EOF
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-_ACEOF
+cat >> $CONFIG_STATUS <<EOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "temp/config.h") CONFIG_HEADERS="$CONFIG_HEADERS temp/config.h:src/configh.in" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "temp/coopt.sh") CONFIG_FILES="$CONFIG_FILES temp/coopt.sh:src/cooptsh.in" ;;
-
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
+CONFIG_FILES=\${CONFIG_FILES-"Makefile temp/coopt.sh:src/cooptsh.in"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp=
- trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-YACC!$YACC$ac_delim
-YFLAGS!$YFLAGS$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-RANLIB!$RANLIB$ac_delim
-INSTALLINFO!$INSTALLINFO$ac_delim
-MANDB!$MANDB$ac_delim
-INFODIRFILE!$INFODIRFILE$ac_delim
-CPP!$CPP$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-LEX!$LEX$ac_delim
-LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
-LEXLIB!$LEXLIB$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 58; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ ac_dir_suffix= ac_dots=
fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
-_ACEOF
-
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
-
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$ac_file_inputs $ac_f"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- esac
- ;;
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
esac
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
-
- rm -f "$tmp/stdin"
- case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="temp/config.h:src/configh.in"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
esac
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+rm -f conftest.tail
while :
do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
- if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
- fi
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
else
- echo "/* $configure_input */"
- cat "$ac_result"
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
fi
- rm -f "$tmp/out12"
- ;;
+fi; done
+EOF
+cat >> $CONFIG_STATUS <<EOF
- esac
-
-done # for ac_tag
+EOF
+cat >> $CONFIG_STATUS <<\EOF
-
-{ (exit 0); exit 0; }
-_ACEOF
+exit 0
+EOF
chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
chmod a+x temp/coopt.sh
--- /dev/null
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host dell:
+#
+# ./config.sh
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running ${CONFIG_SHELL-/bin/sh} ./config.sh --no-create --no-recursion"
+ exec ${CONFIG_SHELL-/bin/sh} ./config.sh --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "./config.status generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "$ac_cs_usage"; exit 0 ;;
+ *) echo "$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=.
+
+trap 'rm -fr Makefile temp/coopt.sh temp/config.h conftest*; exit 1' 1 2 15
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
+/^[ ]*VPATH[ ]*=[^:]*$/d
+
+s%@SHELL@%/bin/sh%g
+s%@CFLAGS@%-g -O2%g
+s%@CPPFLAGS@%%g
+s%@CXXFLAGS@%%g
+s%@FFLAGS@%%g
+s%@DEFS@%-DHAVE_CONFIG_H%g
+s%@LDFLAGS@%%g
+s%@LIBS@%%g
+s%@exec_prefix@%${prefix}%g
+s%@prefix@%/usr/local%g
+s%@program_transform_name@%s,x,x,%g
+s%@bindir@%${exec_prefix}/bin%g
+s%@sbindir@%${exec_prefix}/sbin%g
+s%@libexecdir@%${exec_prefix}/libexec%g
+s%@datadir@%${prefix}/share%g
+s%@sysconfdir@%${prefix}/etc%g
+s%@sharedstatedir@%${prefix}/com%g
+s%@localstatedir@%${prefix}/var%g
+s%@libdir@%${exec_prefix}/lib%g
+s%@includedir@%${prefix}/include%g
+s%@oldincludedir@%/usr/include%g
+s%@infodir@%${prefix}/info%g
+s%@mandir@%${prefix}/man%g
+s%@YACC@%bison -y%g
+s%@CC@%gcc%g
+s%@RANLIB@%ranlib%g
+s%@INSTALLINFO@%install-info%g
+s%@MANDB@%mandb%g
+s%@INFODIRFILE@%/usr/share/info/dir%g
+s%@CPP@%gcc -E%g
+s%@EXEEXT@%%g
+s%@OBJEXT@%o%g
+s%@LEX@%flex%g
+s%@LEXLIB@%-lfl%g
+s%@LEX_OUTPUT_ROOT@%lex.yy%g
+s%@PACKAGE_VERSION@%0.28%g
+
+CEOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+
+CONFIG_FILES=${CONFIG_FILES-"Makefile temp/coopt.sh:src/cooptsh.in"}
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+ CONFIG_HEADERS="temp/config.h:src/configh.in"
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+ cat > conftest.frag <<CEOF
+${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD}
+${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD}
+${ac_eA}STDC_HEADERS${ac_eB}STDC_HEADERS${ac_eC}1${ac_eD}
+${ac_dA}HAVE_SYS_TIME_H${ac_dB}HAVE_SYS_TIME_H${ac_dC}1${ac_dD}
+${ac_uA}HAVE_SYS_TIME_H${ac_uB}HAVE_SYS_TIME_H${ac_uC}1${ac_uD}
+${ac_eA}HAVE_SYS_TIME_H${ac_eB}HAVE_SYS_TIME_H${ac_eC}1${ac_eD}
+${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD}
+${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD}
+${ac_eA}HAVE_UNISTD_H${ac_eB}HAVE_UNISTD_H${ac_eC}1${ac_eD}
+${ac_dA}SIZEOF_LONG_LONG_INT${ac_dB}SIZEOF_LONG_LONG_INT${ac_dC}8${ac_dD}
+${ac_uA}SIZEOF_LONG_LONG_INT${ac_uB}SIZEOF_LONG_LONG_INT${ac_uC}8${ac_uD}
+${ac_eA}SIZEOF_LONG_LONG_INT${ac_eB}SIZEOF_LONG_LONG_INT${ac_eC}8${ac_eD}
+CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+
+ cat > conftest.frag <<CEOF
+${ac_dA}SIZEOF__BOOL${ac_dB}SIZEOF__BOOL${ac_dC}1${ac_dD}
+${ac_uA}SIZEOF__BOOL${ac_uB}SIZEOF__BOOL${ac_uC}1${ac_uD}
+${ac_eA}SIZEOF__BOOL${ac_eB}SIZEOF__BOOL${ac_eC}1${ac_eD}
+${ac_dA}TIME_WITH_SYS_TIME${ac_dB}TIME_WITH_SYS_TIME${ac_dC}1${ac_dD}
+${ac_uA}TIME_WITH_SYS_TIME${ac_uB}TIME_WITH_SYS_TIME${ac_uC}1${ac_uD}
+${ac_eA}TIME_WITH_SYS_TIME${ac_eB}TIME_WITH_SYS_TIME${ac_eC}1${ac_eD}
+${ac_dA}YYTEXT_POINTER${ac_dB}YYTEXT_POINTER${ac_dC}1${ac_dD}
+${ac_uA}YYTEXT_POINTER${ac_uB}YYTEXT_POINTER${ac_uC}1${ac_uD}
+${ac_eA}YYTEXT_POINTER${ac_eB}YYTEXT_POINTER${ac_eC}1${ac_eD}
+${ac_dA}NEED_YYRESTART${ac_dB}NEED_YYRESTART${ac_dC}1${ac_dD}
+${ac_uA}NEED_YYRESTART${ac_uB}NEED_YYRESTART${ac_uC}1${ac_uD}
+${ac_eA}NEED_YYRESTART${ac_eB}NEED_YYRESTART${ac_eC}1${ac_eD}
+CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+
+ cat > conftest.frag <<CEOF
+${ac_dA}HAVE_SYS_INTERPRETER${ac_dB}HAVE_SYS_INTERPRETER${ac_dC}1${ac_dD}
+${ac_uA}HAVE_SYS_INTERPRETER${ac_uB}HAVE_SYS_INTERPRETER${ac_uC}1${ac_uD}
+${ac_eA}HAVE_SYS_INTERPRETER${ac_eB}HAVE_SYS_INTERPRETER${ac_eC}1${ac_eD}
+${ac_dA}EXEEXT${ac_dB}EXEEXT${ac_dC}""${ac_dD}
+${ac_uA}EXEEXT${ac_uB}EXEEXT${ac_uC}""${ac_uD}
+${ac_eA}EXEEXT${ac_eB}EXEEXT${ac_eC}""${ac_eD}
+${ac_dA}RETSIGTYPE${ac_dB}RETSIGTYPE${ac_dC}void${ac_dD}
+${ac_uA}RETSIGTYPE${ac_uB}RETSIGTYPE${ac_uC}void${ac_uD}
+${ac_eA}RETSIGTYPE${ac_eB}RETSIGTYPE${ac_eC}void${ac_eD}
+${ac_dA}HAVE_GETTIMEOFDAY${ac_dB}HAVE_GETTIMEOFDAY${ac_dC}1${ac_dD}
+${ac_uA}HAVE_GETTIMEOFDAY${ac_uB}HAVE_GETTIMEOFDAY${ac_uC}1${ac_uD}
+${ac_eA}HAVE_GETTIMEOFDAY${ac_eB}HAVE_GETTIMEOFDAY${ac_eC}1${ac_eD}
+CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+
+ cat > conftest.frag <<CEOF
+${ac_dA}HAVE_STRDUP${ac_dB}HAVE_STRDUP${ac_dC}1${ac_dD}
+${ac_uA}HAVE_STRDUP${ac_uB}HAVE_STRDUP${ac_uC}1${ac_uD}
+${ac_eA}HAVE_STRDUP${ac_eB}HAVE_STRDUP${ac_eC}1${ac_eD}
+${ac_dA}HAVE_STRTOL${ac_dB}HAVE_STRTOL${ac_dC}1${ac_dD}
+${ac_uA}HAVE_STRTOL${ac_uB}HAVE_STRTOL${ac_uC}1${ac_uD}
+${ac_eA}HAVE_STRTOL${ac_eB}HAVE_STRTOL${ac_eC}1${ac_eD}
+${ac_dA}HAVE_STRTOUL${ac_dB}HAVE_STRTOUL${ac_dC}1${ac_dD}
+${ac_uA}HAVE_STRTOUL${ac_uB}HAVE_STRTOUL${ac_uC}1${ac_uD}
+${ac_eA}HAVE_STRTOUL${ac_eB}HAVE_STRTOUL${ac_eC}1${ac_eD}
+${ac_dA}HAVE_SNPRINTF${ac_dB}HAVE_SNPRINTF${ac_dC}1${ac_dD}
+${ac_uA}HAVE_SNPRINTF${ac_uB}HAVE_SNPRINTF${ac_uC}1${ac_uD}
+${ac_eA}HAVE_SNPRINTF${ac_eB}HAVE_SNPRINTF${ac_eC}1${ac_eD}
+CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+
+ cat > conftest.frag <<CEOF
+${ac_dA}HAVE_ASPRINTF${ac_dB}HAVE_ASPRINTF${ac_dC}1${ac_dD}
+${ac_uA}HAVE_ASPRINTF${ac_uB}HAVE_ASPRINTF${ac_uC}1${ac_uD}
+${ac_eA}HAVE_ASPRINTF${ac_eB}HAVE_ASPRINTF${ac_eC}1${ac_eD}
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+
+
+exit 0
\r
\r
\r
-PACKAGE_VERSION=0.27\r
+PACKAGE_VERSION=0.28\r
\r
for ac_prog in 'bison -y' byacc\r
do\r
--- /dev/null
+ INTERCAL IMPLEMENTOR'S NOTES\r
+ by ESR (and AIS where noted)\r
+\r
+The C-INTERCAL compiler has a very conventional implementation using YACC and\r
+LEX (latterly, bison and flex). It generates C, which is then passed to your C\r
+compiler.\r
+\r
+ Lexical issues\r
+\r
+Note that the spectacular ugliness of INTERCAL syntax requires that the lexical\r
+analyzer have two levels. One, embedded in the input() function, handles the\r
+backquote and bang constructs, and stashes the input line away in a buffer for\r
+the splat construct's benefit. The upper level is generated by lex(1) and does\r
+normal tokenizing for YACC.\r
+\r
+In order to splatter erroneous statements correctly, the generated code has to\r
+track both logical and physical lines. That's the reason for the `lineno'\r
+variable in the generated C, it's actually tracking physical lines.\r
+\r
+Numeral tokens for input are defined in a symbol table (numerals.c) that is\r
+directly included in the run-time library module (cesspool.c). This avoids\r
+having to put the the size of the numerals array in an extern. To add new\r
+numeral tokens, simply put them in the numerals initializer.\r
+\r
+AIS: Now computed COME FROM is in the language, the lexer is called forth to do\r
+ a bit of syntax analysis, by distinguishing it from an ordinary COME FROM\r
+ and passing different symbols to the parser. The lexer is also responsible\r
+ for helping the parser to match sparks and ears in complicated array\r
+ situations, by distinguishing possibly closing sparkears from definitely\r
+ opening sparkears.\r
+\r
+ Compilation\r
+\r
+The parser builds an array of tuples, one for each INTERCAL statement. Most\r
+tuples have node trees attached. Once all tuples have been generated, the\r
+compile-time checker and optimizer phases can do consistency checks and\r
+expression-tree rewrites. Finally, the tuples are ground out as C code by the\r
+emit() function.\r
+\r
+Calculations are fully type-checked at compile time; they have to be because\r
+(as I read the manual) the 16- and 32-bit versions of the unary ops do\r
+different things. The only potential problem here is that the typechecker has\r
+to assume that :m ~ :n has the type of :n (32-bit) even though the result might\r
+fit in 16 bits. At run-time everything is calculated in 32 bits. When\r
+INTERCAL-72 was designed 32 bits was expensive; now it's cheap. Really, the\r
+only reason for retaining a 16-bit type at all is for the irritation value of\r
+it (yes, C-INTERCAL *does* enforce the 16-bit limit on constants).\r
+\r
+Labels are mapped to tuple indices (logical line numbers) in the code checker,\r
+just before optimization.\r
+\r
+The optimizer does full recursive folding of all constant expressions at\r
+compile time (evaluating away all the irritating little kluges you have to use\r
+to generate 32-bit constants). It also checks for known INTERCAL idioms for\r
+`test for equality', `test for nonzeroness', and the C logical operators &, |,\r
+^, and ~.\r
+\r
+AIS: The optimizer has now been expanded. See below.\r
+\r
+ Code Generation\r
+\r
+Each line of INTERCAL is translated into a C if()-then; the guard part is used\r
+to implement abstentions and RESUMES, and the arm part translates the `body' of\r
+the corresponding INTERCAL statement.\r
+\r
+The generated C code is plugged into the template file ick-wrap.c inside\r
+main(). It needs to be linked with cesspool.o, fiddle.o and lose.o (these are\r
+in libick.a, with the support for runtime switches, arrgghh.o). Cesspool.o is\r
+the code that implements the storage manager; fiddle.o implements the INTERCAL\r
+operators; and lose.o is the code that generates INTERCAL's error messages.\r
+The routine arrgghh.o parses the runtime command line arguments.\r
+\r
+The abstain[] array in the generated C is used to track line and label\r
+abstentions; if member i is on, the statement on line i is being abstained\r
+from. If gerund abstentions/reinstatements are present in the code, a second\r
+array recording the type of each statement in generated into the runtime, and\r
+used to ensure that these operations are translated into abstention-guard\r
+changes on all appropriate line numbers.\r
+\r
+RESUMES are implemented with a branch to a generated switch statement that\r
+executes a goto to the appropriate label. If there are no RESUMES, no such\r
+switch is generated.\r
+\r
+The compiler places a simple label at the location of each COME FROM in the\r
+program, while all of the machinery for checking for abstention and conditional\r
+execution and actually performing the jump is placed immediately after the code\r
+for the target statement.\r
+\r
+ Credits\r
+\r
+I wrote the first version of this compiler over a weekend using a pre-ANSI C\r
+compiler. It worked, but it wasn't pretty. Louis Howell added the array\r
+support later; he also torture-tested the COME FROM implementation by actually\r
+using it for the life2.i program included in this distribution, and fixed some\r
+bugs. Brian Raiter did a much-needed delinting while porting it for ANSI C,\r
+flex and Linux. He also improved the lexical analyzer's line tracking.\r
+\r
+ Code Generation 2 (by AIS)\r
+\r
+The recent additions to the language have made code generation potentially more\r
+complicated, depending on which switches are on. Each INTERCAL command is still\r
+translated into an if()-then, but with extra guards around it. COME FROM is\r
+still handled the same way, but only in singlethreaded programs with no\r
+computed COME FROMs. For anything more complicated than that, a general COMING\r
+FROM mechanism is invoked. C's most confusing control-flow identifiers, setjmp\r
+and longjmp, are used. When computed COME FROMs are involved, after every\r
+labeled statement, a set of gotos are done to check each in turn. A jmp_buf,\r
+cjb, is used to store the point in the program where the check started. Each\r
+COME FROM leading to that line and computed COME FROM anywhere in the program\r
+is checked, and modifies cjb to aim for its suckpoint if neccesary. In the case\r
+of a multithreaded program, one cjb will be stored in a linked ring of threads,\r
+and the other will be the one in the main program. Extra guards are also added\r
+for ONCE/AGAIN; the position of this guard depends on whether the command is a\r
+NEXT or something else. ONCE/AGAIN are quite legal even in singlethreaded\r
+programs. Computed ABSTAIN is dealt with by allowing the abstain[] array to\r
+hold values other than 0 or 1. Multithreading is supported by a new library,\r
+libickmt.a, to hold the multithread versions of libick.a functions. See\r
+unravel.c for an explanation of the full gory details of the multithread\r
+implementation (it has many comments explaining the implementation at the top).\r
+\r
+ Optimisation (by AIS)\r
+\r
+When I got my C-INTERCAL distribution, it only had a rudimentary\r
+optimiser. Constant folding had already been done, and the following\r
+optimisations. The following is mixed INTERCAL and C, sometimes in the same\r
+statement. It should be clear from context and whether I have used INTERCAL\r
+spark-ears or C brackets which language is which, although in some places I've\r
+mixed them. Note that the optimizer is only run in binary.\r
+\r
+Optimizations available with -O\r
+\r
+Optimisations that had already been done\r
+\r
+Constant folding\r
+'Vx$y'~"#0x55555555" into (x | y)\r
+'?x$y'~"#0x55555555" into (x ^ y)\r
+'&x$y'~"#0x55555555" into (x & y)\r
+(x ^ 0xFFFF) or (x ^ 0xFFFFFFFF) into ~x\r
+\r
+I added:\r
+\r
+[This list has been removed as it got out of date; see src/idiotism.oil for the\r
+new list. Most of the idioms are due to me, a few are by Joris Huizer.]\r
+\r
+Optimizations available with -f (I wrote all these)\r
+\r
+Guard removal (if a line can't be abstained, the if(!abstained[x]) line is\r
+removed when possible)\r
+\r
+Ignorance checks (if a variable can't be ignored and it can't overflow,\r
+assignment is done with C's = rather than a function)\r
+\r
+Recognition of NEXT...NEXT...computed RESUME as an idiom for if() (currently\r
+disabled because the rest of the optimiser can't handle it)\r
+\r
+Optimizations available with -F (I wrote this one)\r
+\r
+This optimization should mean that INTERCAL suddenly becomes the best language\r
+for various benchmark programs. Basically, the file is analysed to try to\r
+determine whether it takes no input and always produces the same output. If\r
+that is the case, the output is simply a shell-script (with executable\r
+permissions set and a #! line) that outputs the correct output! Therefore, the\r
+time required for one run of the program is taken up during compilation, and\r
+whenever the program is executed, it just copies out the predetermined\r
+output. This means (for instance) that primes.i runs in only a fraction of a\r
+second when optimized with -F. Of course, this tends to slow down the compiler\r
+and often produces a large object file, which is why it has a command-line\r
+option of its own.\r
\input texinfo @c -*- texinfo -*-
@c %**start of header
@setfilename ick.info
-@set VERSION 0.27
-@set VERSIONDASH 0-27
+@set VERSION 0.28
+@set VERSIONDASH 0-28
@settitle C-INTERCAL @value{VERSION} Revamped Instruction Manual
@paragraphindent 0
@documentlanguage en
* Multithreading and Backtracking:: Running @ical{} programs in parallel
* Operand Overloading:: Where one expression stands for another
* PIC-INTERCAL:: @ical{} on embedded systems
+* External Calls:: Linking @ical{} with other languages
* Differences to Other Compilers:: @cic{} vs. @clcic{}
Appendices and indices
methods; configure (if possible) and compile it, but instead of
installing it, copy the entire @file{ick-@value{VERSION}} directory to the
CD or USB stick. @ical{} can then be run from there by explicitly giving
-a pathname to @file{bin/ick} or @file{bin/ick.exe}
+a pathname to @file{bin/ick} or @file{bin/ick.exe}.
@node Uninstalling
@section Uninstalling
the number of variables you use by combining some into arrays. This is
a compile-time error.
+@ieanchor E345
+@cindex out of memory
+@quotation
+THAT'S TOO COMPLEX FOR ME TO GRASP
+@end quotation
+
+This is another compile-time error that's unlikely to ever happen;
+this one signifies the compiler itself running out of memory trying to
+compile your program. The only solutions to this are to simplify your
+program, or to make more memory available to the compiler.
+
@ieanchor E404
@cindex @code{GO BACK}, no choicepoint
@cindex @code{GO AHEAD}, no choicepoint
runtime when the program requests that no entries are removed from the
@code{NEXT} stack (which is possible), but that the last entry removed
should be jumped to (which given the circumstances isn't, because no
-entries were removed.)
+entries were removed).
@ieanchor E632
@quotation
There isn't a limit on the length of an input program other than your
computer's memory; if your computer does run out of memory during
-compilation, it causes this error.
+compilation, it causes this error. This error can also be caused if
+too many input files are specified on the command line; if you suspect
+this is the problem, split the compilation into separate compilations
+if you can, or otherwise you may be able to concatenate together your
+input files into larger but fewer files.
@ieanchor E774
@cindex random bug, error message
0.26 and later also right-associate binary operators so as to produce
the same results as @clcic{} rules in this situation, but as nobody has
yet tried to work out what the other implications of @clcic{} rules are
-they are not emulated in @cic{}, except possibly by chance
+they are not emulated in @cic{}, except possibly by chance.
@ianchor Prefix and infix unary operators
@cindex unary operator, prefix
input, and euro if Latin-9 is used as the input) are accepted; from
version 0.20 onwards, in addition to the Latin-1 characters, all the
currency symbols in Unicode are accepted if UTF-8 is used as the input
-format. @cic{} has always used the change character (either the
+format. @clcic{} has always used the change character (either the
Latin-1 version or the version that contains a backspace) for mingle.
In this manual, mingle will be represented as @code{$}, but it's
important to bear in mind that this character is not the most portable
sqiggle character (@code{~}) as the representation of the select
operator, meaning that writing it portably is easy.
-The select operator takes two arguments, which can be of either datatype
-(that is, 16- or 32-bit). It returns a value made by selecting certain
-bits of its first operand indicated by the second operand, and
-right-justifying them. What it does is ignores all the bits of the
-first operand where the second operand has a 0 as the corresponding bit,
-that is, deletes them from a copy of the operand's value; the bits that
-are left are squashed together towards the least-significant end of the
-number, and the result is filled with 0s to make it up to 16 or 32
-bits. (In @icst{} the minimum multiple of 16 bits possible that the
-result fits into is chosen, although if :1 has the value 131061 (in hex,
-1FFFF) the expression @code{#21~:1} produces a 32-bit result because 17
-bits were selected, even though many of the leading bits were zeros; in
-@cic{} the data type of the result is the same as of the right operand
-of the select, so that it can be determined at run time, and so using a
-unary binary logic operator on the result of select when the right
-operand has a 32-bit type is nonportable and not recommended.) As an
-example, @code{#21~:1} produces 21 as its result if :1 has the value
-131061, 10 as its result if :1 has the value 30 (1E in hex; the
-least significant bit of 21 is removed because it corresponds to a 0 in
-:1), and 7 as its result if :1 has the value 21 (because three bits in
-21 are set, and those three bits from 21 are therefore selected by 21).
+The select operator takes two arguments, which can be of either
+datatype (that is, 16- or 32-bit). It returns a value made by
+selecting certain bits of its first operand indicated by the second
+operand, and right-justifying them. What it does is that it ignores
+all the bits of the first operand where the second operand has a 0 as
+the corresponding bit, that is, deletes them from a copy of the
+operand's value; the bits that are left are squashed together towards
+the least-significant end of the number, and the result is filled with
+0s to make it up to 16 or 32 bits. (In @icst{} the minimum multiple
+of 16 bits possible that the result fits into is chosen, although if
+:1 has the value 131061 (in hex, 1FFFF) the expression @code{#21~:1}
+produces a 32-bit result because 17 bits were selected, even though
+many of the leading bits were zeros; in @cic{} the data type of the
+result is the same as of the right operand of the select, so that it
+can be determined at run time, and so using a unary binary logic
+operator on the result of select when the right operand has a 32-bit
+type is nonportable and not recommended.) As an example,
+@code{#21~:1} produces 21 as its result if :1 has the value 131061, 10
+as its result if :1 has the value 30 (1E in hex; the least significant
+bit of 21 is removed because it corresponds to a 0 in :1), and 7 as
+its result if :1 has the value 21 (because three bits in 21 are set,
+and those three bits from 21 are therefore selected by 21).
Select is used for right-shifts, to select every second bit from a
number (either to produce what will eventually become an argument to
effect, because the voltage on sending pins is maintained at the same
level until it is changed), or to ignore the input received.
+@node External Calls
+@chapter External Calls
+@cindex external calls
+@cindex other languages
+@cindex foreign functions
+@cindex calls, external
+
+@cic{} (from version 0.28 onwards) has a feature allowing @ical{} and
+non-@ical{} code to be mixed. This is achieved by causing the
+non-@ical{} programs to participate in the @ical{} line-numbering
+model.
+
+To create a combined program containing @ical{} and non-@ical{} code,
+use @command{ick} as the compiler as normal, but specify both the
+@ical{} and non-@ical{} source files on the command line.
+@command{ick} will invoke other compilers as necessary, possibly after
+modifying the source files accordingly. At present, external calls
+are only supported to and from C.
+
+In each case, it will be the @ical{} program that is invoked first.
+(This means that it is impossible to link together more than one
+@ical{} program, but you probably don't want to, because concatenating
+the programs is likely to have a similar effect.) You can get the
+@ical{} program to @code{NEXT} to the non-@ical{} program immediately,
+or the non-@ical{} program to @code{COME FROM} or @code{NEXT FROM} the
+@ical{} program immediately, to obtain the effect of running the
+non-@ical{} program first.
+
+Note that external calls are incompatible with PIC-INTERCAL and with
+multithreading.
+
+@menu
+* External Calls to C:: How to put @ical{} calls in C.
+@end menu
+
+@node External Calls to C
+@section External Calls to C
+@cindex C
+@cindex other languages, C
+@cindex external calls, to C
+
+Linking C and @ical{} programs is acheived by placing various
+constructs into the C programs that are equivalent to various @ical{}
+constructs. It is possible to simulate a line with a label and a
+dummy command (which serves as a @code{COME FROM} suckpoint and
+@code{NEXT} target), @code{NEXT}, @code{RESUME}, and @code{FORGET},
+and @code{COME FROM} and @code{NEXT FROM}. Onespot and twospot
+variables are accessible from inside the C program, where they can be
+read and written; however, the @ical{} program cannot access any
+variables inside the C program that weren't part of the @ical{}
+program originally.
+
+To prevent various logical impossibilities, there are restrictions on
+where these can be used and what preparation is needed before they are
+used. Also, the semantics are not always exactly what you might
+expect for technical reasons.
+
+It should be observed that the @ical{} link intrudes on the user
+namespace. To prevent possible namespace clashes, no identifiers
+starting with @code{ick_} or @code{ICK_} should be used anywhere in
+the linked C program for any reason, except where specified in this
+manual.
+
+@table @code
+
+@item #include <ick_ec.h>
+@cindex ick_ec.h
+The header file @file{ick_ec.h} must be included using the
+preprocessor in any file which uses any of the @ical{} external call
+functions, variables, or macros. (Note that this file may not
+necessarily exist, or exist in the usual place; @command{ick} will
+deal with making sure the correct header file is included.)
+
+@item ICK_EC_FUNC_START
+@itemx ICK_EC_FUNC_END
+@findex ICK_EC_FUNC_START
+@findex ICK_EC_FUNC_END
+Many of the @ical{} interface macros (@code{ick_linelabel},
+@code{ick_comefrom}, and @code{ick_nextfrom}) make it possible to
+jump from an @ical{} program to a C program. Because C doesn't allow
+jumping into the middle of a function, there has to be some way to
+create a block of code which @emph{can} be jumped into. This is what
+these two macros achieve.
+
+This declaration and definition:
+
+@example
+ICK_EC_FUNC_START(identifier)
+@{
+ /* code goes here */
+@}
+ICK_EC_FUNC_END
+@end example
+
+is equivalent to this:
+
+@example
+void identifier(void)
+@{
+ /* code goes here */
+@}
+@end example
+
+except that it is possible to jump from an @ical{} program into the
+declared and defined program. (If you need to write a prototype for
+the function early, @code{void identifier(void);} is perfectly
+acceptable, but an early prototype is not required unless you call the
+function from earlier within the C code.) Of course, you can
+substitute any identifier that's legal as a function name for
+@code{identifier} (as long as it doesn't start with @code{ick_} or
+@code{ICK_}). The resulting function is a function (for instance, you
+can take its address or call it in the usual ways); the only
+differences are that it can be jumped into from @ical{} code and that
+it is constrained to take no arguments and return no data. (It can
+still access global and @ical{} variables.) If the function is jumped
+into from @ical{} code, but then control flow reaches the end of the
+function, a @code{RESUME #1} is automatically done to give the program
+some way to continue. (There will be the usual error message if the
+@code{NEXT} stack happens to be empty at the time.)
+
+@item ick_linelabel
+@findex ick_linelabel
+@cindex line labels, C
+
+A line label is something that can be @code{NEXT}ed to and @code{COME
+FROM}. Unlike an @ical{} line label, it does not label a statement,
+and therefore attempts to @code{ABSTAIN} or @code{REINSTATE} it may be
+errors, or may be ignored (it's unspecified which, which means that
+either may happen for any or no reason, but exactly one will happen in
+any given case, although the choice might not be consistent).
+
+The macro @code{ick_linelabel(expression);} may appear anywhere a
+compound statement would normally be able to appear. (That is, it
+looks like a function call being used as a standalone expression, but
+in fact the places where it can appear are more limited.) In contrast
+to ordinary line labels, an expression can be used rather than just a
+constant; however, the behaviour is undefined if the expression has
+side-effects. Upon encountering the line label, any @code{COME FROM}s
+or @code{NEXT FROM}s aiming at the line label (including
+@code{ick_comefrom}s and @code{ick_nextfrom}s) will steal control from
+the program; @code{RESUM}ing after a @code{NEXT FROM} will work, but
+suffers from the same caveats as setjmp/longjmp do (any auto variables
+that change their value between the @code{NEXT FROM} and @code{RESUME}
+will have their value clobbered (i.e. their value is no longer
+reliable and should not be accessed)). Note that the @ical{}
+variables are immune to this problem.
+
+It is possible to @code{NEXT} or @code{ick_donext} to a
+@code{ick_linelabel}, which has the same effect as saving the
+@code{NEXT} stack, calling the function containing the
+@code{ick_linelabel} and then immediately doing a C @code{goto} to an
+imaginary label preceding it. Due to this possibility, an
+@code{ick_linelabel} is only allowed within a function defined with
+@code{ICK_EC_FUNC_START}.
+
+
+
+@end table
+
@node Differences to Other Compilers
@chapter Differences to Other Compilers
@cindex INTERCAL compilers
--- /dev/null
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+ <!ENTITY tex "TeX">
+ <!ENTITY latex "LaTeX">
+]>
+<book lang="en">
+ <title>C-INTERCAL 0.28 Revamped Instruction Manual</title>
+<!-- Command line option index. -->
+<!-- Error index -->
+<!-- Commands and language features are in the predefined fnindex. -->
+<!-- Things generally are in the predefined cpindex. -->
+<!-- Combining indices. -->
+<!-- Adding to the main documentation tree. -->
+<!-- Some macros to ease writing and updating. (The VERSION is set above because -->
+<!-- it's needed to set the title.) -->
+<!-- Part headings for unsplit output -->
+<!-- 'Portability' boxes -->
+<!-- Generating items and anchors together is also helpful. -->
+<!-- Some fixes for HTML. -->
+<!-- %**end of header -->
+ <replaceable>This manual is for <abbrev>C-INTERCAL</abbrev>version 0.28. It does not replacethe old groff manual, nor is it designed to be read in conjunction withit; instead, it serves a different purpose, of providing informationuseful to users of <abbrev>C-INTERCAL</abbrev>(unlike the other manual, it is not derivedfrom the original <abbrev>INTERCAL-72</abbrev>manual).Copyright © 2007 Alex Smith.
+ <screen>Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled
+“GNU Free Documentation License.”
+
+</screen> </replaceable>
+ <chapter label="" xreflabel="C-INTERCAL 0.28" id="Top">
+ <para>C-INTERCAL 0.28
+This manual is for <abbrev>C-INTERCAL</abbrev> version 0.28. It does not replace
+the old groff manual, nor is it designed to be read in conjunction with
+it; instead, it serves a different purpose, of providing information
+useful to users of <abbrev>C-INTERCAL</abbrev> (unlike the other manual, it is not derived
+from the original <abbrev>INTERCAL-72</abbrev> manual).</para>
+ <para>Copyright © 2007 Alex Smith.</para>
+ <screen>Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled
+“GNU Free Documentation License.”
+
+</screen>
+ </chapter>
+
+ <chapter label="" xreflabel="About this manual" id="About-this-manual">
+ <para>About this manual</para>
+ <informalfigure>About this manual</informalfigure>
+ <para>This is the Revamped Instruction Manual for <abbrev>C-INTERCAL</abbrev> (this version is
+distributed with <abbrev>C-INTERCAL</abbrev> version 0.28). It is divided into
+four parts.</para>
+ <para>The first part is about the <abbrev>C-INTERCAL</abbrev> compiler <command>ick</command>, and how to
+use it. It covers installing the compiler, using the compiler, what
+error and warning messages are produced by the compiler, and some
+information on how to use the debugger.</para>
+ <para>The second part is about the core <acronym>INTERCAL</acronym> language, invented in 1972,
+and some other commands since then which don't feel like they're
+extensions. (This is a pretty arbitrary distinction, but people who
+write the documentation are entitled to arbitrary distinctions. The
+manual's licensed under a license that lets you change it
+(see ), so if you disagree you can move the commands from
+section to section yourself.) Mostly only commands that are
+implemented in <abbrev>C-INTERCAL</abbrev> are covered here (if you're interested in the
+other commands implemented in other compilers, read <abbrev>CLC-INTERCAL</abbrev>'s
+documentation). However, a comprehensive guide to portability of
+these commands between <abbrev>C-INTERCAL</abbrev> and other <acronym>INTERCAL</acronym> compilers is given.</para>
+ <para>The third part covers the <acronym>INTERCAL</acronym> extensions and dialects that are
+implemented by <abbrev>C-INTERCAL</abbrev>, such as TriINTERCAL and Threaded <acronym>INTERCAL</acronym>.
+Again, extensions and dialects not implemented have been mostly left
+out.</para>
+ <para>The final part contains appendices (which were known as `tonsils' in
+the original <acronym>INTERCAL</acronym> manual), such as character sets used by <acronym>INTERCAL</acronym>,
+programs other than <command>ick</command> in the <abbrev>C-INTERCAL</abbrev> distribution,
+information on how to read and update the list of optimizer idioms
+used by the compiler, and the copyright.</para>
+ </chapter>
+
+ <chapter label="" xreflabel="PART I: THE C-INTERCAL COMPILER">
+ <para>PART I: THE <abbrev>C-INTERCAL</abbrev> COMPILER</para>
+ </chapter>
+
+ <chapter label="1" id="Installation">
+ <para>Installation</para>
+ <informalfigure>installation</informalfigure>
+ <informalfigure><command>ick</command>, installing</informalfigure>
+ <para>The <abbrev>C-INTERCAL</abbrev> distribution is distributed in source code form; this means
+that before using it, you first have to compile it. Don't worry: if you
+have the right software, it's not at all difficult. Most Linux-based
+and UNIX-based computers are likely to have the software needed already;
+the software needed to compile source-distributed packages is also
+readily available for free for other operating systems. The following
+instructions will help you install the distribution in a method
+appropriate for your system.</para>
+ <para>(If you happen to be using Debian or Ubuntu, you can also obtain and
+install binaries with the command ‘<literal>sudo apt-get install
+intercal</literal>’, making the rest of this chapter redundant. If you do this,
+use Debian's bug tracker to report bugs, rather than reporting them
+directly to the maintainers.)</para>
+
+ <sect1 label="1.1" id="Obtaining">
+ <para>Obtaining</para>
+ <informalfigure>obtaining C-INTERCAL</informalfigure>
+ <informalfigure>C-INTERCAL, obtaining a copy</informalfigure>
+ <para><abbrev>C-INTERCAL</abbrev> distributions have been stored in many different places over
+time; it can sometimes be hard to make sure that you are finding the
+most recent version. In order to make sure that you have the most
+recent version, the easiest way is to look at the
+alt.lang.intercal newsgroup; all releases
+of the <abbrev>C-INTERCAL</abbrev> compiler ought to be announced there. (If you are
+interested in what other <acronym>INTERCAL</acronym> compilers are available, it may also be
+worth looking there.) If you don't have access to a newsreader, your
+newsreader doesn't cover that newsgroup, or the distance between
+releases has been too large for your news server to keep the message,
+it's likely that you can find the announcement in an archive on the
+World Wide Web; at the time of writing (2007), the archives of the
+newsgroup are stored by Google Groups,
+and a search for ‘<literal>alt.lang.intercal</literal>’ there should tell you where to
+find a copy.</para>
+ <para>If you're looking for the latest version, note that the number after the
+dot represents the major version number; you want to maximise this in
+favour of the number before the dot, which is the bugfix level within a
+major version. (Major versions are released as version 0.whatever; if a
+new version comes out that fixes bugs but adds no new features, nowadays
+its number will be of the form 1.whatever, with the same major number.
+This has not always been the case, though.)</para>
+ </sect1>
+
+ <sect1 label="1.2" id="Unpacking">
+ <para>Unpacking</para>
+ <informalfigure>C-INTERCAL, unzipping</informalfigure>
+ <informalfigure>C-INTERCAL, unpacking</informalfigure>
+ <informalfigure>unzipping C-INTERCAL</informalfigure>
+ <informalfigure>unpacking C-INTERCAL</informalfigure>
+ <informalfigure>ick-0-28.tgz</informalfigure>
+ <para>The distribution is likely to be a single file with extension
+‘<literal>.tgz</literal>’; this refers to a gzipped tar file. Most computer systems
+can extract files in this format (nowadays even many computers running
+Windows have the appropriate software).</para>
+ <para>It doesn't matter where you extract the distribution file to: it's best
+if you don't put it anywhere special. If you aren't an administrator,
+you should extract the file to somewhere in your home directory (Linux
+or UNIX-like systems) or to your My Documents directory (recent versions
+of Windows; if you're using an older version, then you <emphasis>are</emphasis> an
+administrator, or at least have the same privileges, and can extract it
+anywhere). Some commands that you might use to extract it:</para>
+ <term><indexterm>Generic UNIX/Linux
+ <variablelist>
+ <programlisting>
+gunzip ick-0-28.tgz
+tar xvf ick-0-28.tar
+</programlisting> On most UNIX-based and Linux-based systems, <command>tar</command> will beavailable to unpack the installation files once they've beenuncompressed with <command>gunzip</command>. <command>gunzip</command> is also likely tobe available; if it isn't, you will need to download a copy from theInternet.</variablelist>
+ </indexterm><indexterm>Using GNU tar
+ <variablelist>
+ <programlisting>
+tar xzvf ick-0-28.tgz
+</programlisting>If you are using the GNU version of <command>tar</command> (which is very likelyon Linux), you can combine the two steps into one as shown here.</variablelist>
+ </indexterm><indexterm>Using DJGPP
+ <variablelist>
+ <programlisting>
+djtar -x ick-0-28.tgz
+</programlisting>On a DOS or Windows system, you will have to install DJGPP anyway to beable to compile the distribution (see ), and onceyou've done that you will be able to use DJGPP's decompressing andunpacking utility to extract the files needed to install thedistribution. (You will need to type this at the command line; onWindows 95 and later, try choosing Run... from the start menu thentyping <command>cmd</command> (or <command>command</command> if that fails) in the dialogbox that opens to get a command prompt, which you can exit by typing<command>exit</command>. After typing any command at a command line, press<keycap>RET</keycap> to tell the shell to execute that command.)</variablelist>
+ </indexterm><indexterm>On Windows
+ <variablelist>If you're running a Windows system, you could always try double-clickingon the ick-0-28.tgz file. It's quite possible thatyou'll have a program installed that's capable of decompressing andunpacking it. Unfortunately, I can't guess what program that might be,so I can't give you any instructions for using it.</variablelist>
+ </indexterm>
+ </term>
+ <para>Whatever method you use, you should end up with a directory created
+called <filename>ick-0.28</filename>; this is your main installation
+directory where all the processing done by the installation will be
+carried out. You will need to have that directory as the current
+directory during install (at the command prompt in all the operating
+systems I know, you can set the current directory by typing <command>cd
+ick-0.28</command>).</para>
+ </sect1>
+
+ <sect1 label="1.3" id="Simple-Installation">
+ <para>Simple Installation</para>
+ <informalfigure>installation, simple</informalfigure>
+ <informalfigure>simple installation</informalfigure>
+ <informalfigure>config.sh</informalfigure>
+ <informalfigure>configdj.sh</informalfigure>
+ <informalfigure>make</informalfigure>
+ <informalfigure>make install</informalfigure>
+ <informalfigure>compiling, <command>ick</command> itself</informalfigure>
+ <informalfigure>installation, via autoconf and make</informalfigure>
+ <informalfigure>configuring</informalfigure>
+ <para>There are scripts included in the distribution to automate the process
+of installing, in various ways. The simplest method of installing is to
+use the following routine:</para>
+ <varlistentry numeration="arabic">
+ <variablelist>Configure <abbrev>C-INTERCAL</abbrev>, by typing <command>sh config.sh</command> (or <command>shconfigdj.sh</command> if you're using DJGPP)</variablelist>
+ <variablelist>Compile the source code, with the command <command>make</command></variablelist>
+ <variablelist>Install the executables, help files, include files, and libraries,using <command>make install</command>. (This is the only step that needsroot/administrator permissions; so on a system that uses sudo toelevate permissions, for instance, write it as <command>sudo makeinstall</command>.)</variablelist>
+ </varlistentry>
+ <para>On all systems, it's worth just trying this to see if it works. This
+requires a lot of software on your computer to work, but all of it is
+standard on Linux and UNIX systems. The first command is a
+shell-script which will analyse your system and set settings
+accordingly; it will explain what it's doing and what settings it
+detected, and create several files in the installation directory to
+record its results. (This is a configure script produced by the GNU
+autoconf (config.sh is produced by the Linux version, configdj.sh by
+the DJGPP version); its autoconf source code is available in the file
+<filename>config.in</filename>.) The second command actually compiles the source
+code to produce binaries; this takes the longest of any of the steps.
+You will see all the commands that it's running as it runs them. (The
+most time-consuming one is the compilation of <filename>idiotism.c</filename>, by
+the way; be prepared for this to take longer than the other
+compilations.) The third command will copy the files it's compiled to
+appropriate shared locations on your system so that anyone on the
+system can just use <command>ick</command>.</para>
+ <para>There may be various factors that prevent this simple installation
+method working. On a system not based on UNIX or Linux, you may find
+that you don't have some of the software required to run this (for
+instance, you may be missing the shell <command>sh</command>, and don't have the
+shell <command>bash</command> which can emulate it, and so can't run <command>sh
+config.sh</command> that depends on one of those shells being available) and so
+this method won't work for you. In such cases, one solution may be to
+install all the software required; the GNU project has a version of all
+the commands required, for instance, and there may be ports available
+for your operating system. However, the only software absolutely
+required is a C compiler (<abbrev>C-INTERCAL</abbrev> was designed to work with <command>gcc</command>
+and has only been tested in combination with that compiler, but in
+theory it should be possible to adapt it to work with other compilers)
+and the associated software needed to compile C files to object files
+and executables, combine object files into libraries, etc.</para>
+ <para>Another possiblity that might stop this process working is if your
+version of the relevant software is incompatible with the GNU versions
+that were used for testing. For instance, I have come across
+proprietary versions of <command>lex</command> that need directives in the source
+file to say in advance how much memory the lexer-generator needs to
+allocate. In such cases, pay attention to the error messages you're
+getting; normally they will suggest trivial modifications to the source
+files that will cause the compilation to work again.</para>
+ <informalfigure>installation, Debian</informalfigure>
+ <informalfigure>installation, Ubuntu</informalfigure>
+ <informalfigure>Debian</informalfigure>
+ <informalfigure>Ubuntu</informalfigure>
+ <para>Some Linux and UNIX systems (notably Debian and Ubuntu) don't have the
+required files for compilation installed by default. To install them,
+just download and install the required packages: for Ubuntu at the
+time of writing, they are ‘<literal>binutils</literal>’, ‘<literal>bison</literal>’, ‘<literal>cpp</literal>’,
+‘<literal>flex</literal>’, ‘<literal>gcc</literal>’, ‘<literal>libc6-dev</literal>’, ‘<literal>make</literal>’ to compile
+<abbrev>C-INTERCAL</abbrev>, and if you want to modify it, you may also need
+‘<literal>autoconf</literal>’. For debugging help, you may also want ‘<literal>gdb</literal>’,
+and to recompile the documentation, you may need ‘<literal>groff</literal>’,
+‘<literal>tetex-bin</literal>’, ‘<literal>texinfo</literal>’, and ‘<literal>tidy</literal>’. Of course, if
+<acronym>INTERCAL</acronym> ever (the author of this sentence was going to write something
+like “becomes popular, someone will probably package up a compiler
+for Debian or Ubuntu anyway”, but at that point on a whim did an
+Ubunutu package search for 'intercal' and actually came up with two
+results, which look suspiciously like <abbrev>C-INTERCAL</abbrev> and <abbrev>CLC-INTERCAL</abbrev>, later
+confirming this. The author was vaguely aware that there was a
+<abbrev>CLC-INTERCAL</abbrev> package floating around, but was unaware of the <abbrev>C-INTERCAL</abbrev>
+package, and as a result was too surprised to finish the sentence.)</para>
+ <para>If you're trying to do something unusual, you probably want to set some
+of the settings yourself rather than letting the compilation process
+guess everything. In this case, use <command>sh config.sh --help</command> to
+view the options that you can set on <command>config.sh</command>; there's a wide
+range of settings that you can set available there, and one of them may
+be what you want. For the special case of a non-administrator user who
+wants to test the <abbrev>C-INTERCAL</abbrev> compiler without having admin rights, or
+equivalently any user who wants to test the compiler without installing
+it, see .</para>
+ </sect1>
+
+ <sect1 label="1.4" id="DOS-Windows-Install">
+ <para>DOS/Windows Install</para>
+ <informalfigure>installation, on DOS or Windows</informalfigure>
+ <informalfigure>DOS</informalfigure>
+ <informalfigure>Windows</informalfigure>
+ <informalfigure>DJGPP</informalfigure>
+ <informalfigure>makeick.sh</informalfigure>
+ <informalfigure>makeick.bat</informalfigure>
+ <para>On DOS and Windows, it's possible to install <abbrev>C-INTERCAL</abbrev> by using the C
+compiler and utilities provided by DJGPP. (Possibly other environments
+also work, but DJGPP is the only C compilation system on which recent
+versions of <abbrev>C-INTERCAL</abbrev> have been tested.) If you don't have a copy of DJGPP,
+or you're not sure whether you have the most recent version, visit
+http://www.delorie.com/djgpp. I think it's possible to compile
+<abbrev>C-INTERCAL</abbrev> to binaries from only the files in the distribution and the C
+compilation parts of DJGPP, but this relies on some prebuilt files
+enclosed in the distribution, and I haven't actually tested this, so I
+might be wrong. At the other extreme, if you download and install not
+only the DJGPP C compiler but also all the DJGPP ports of the GNU
+utilities required to run <command>config.sh</command> and <command>make</command>, you
+can use the simple installation method; see .
+(This is actually somewhat recommended; doing this will not only allow
+you to change source code, recompile, and be guaranteed to have your
+changes to the source code affect the executables, and allow you to
+install <abbrev>C-INTERCAL</abbrev> without having to fiddle around with the ‘<literal>PATH</literal>’
+environment variable, but also you may then be able to install other
+programs distributed in source form without further hassle.)</para>
+ <para>Assuming that you decide not to download all the utilites required to
+carry out a simple install, follow the following instructions to compile
+and install the <abbrev>C-INTERCAL</abbrev> compiler:</para>
+ <varlistentry numeration="arabic">
+ <variablelist>If you haven't already installed DJGPP, do that now, following theinstructions given there.</variablelist>
+ <variablelist>Open a command prompt if you aren't at one already, unpack thedistribution if you haven't already, and change directory to the maininstallation directory (see ).</variablelist>
+ <variablelist>Run one of two commands included in the distribution especially forinstalling <abbrev>C-INTERCAL</abbrev> under DJGPP. Which one you run depends on the shellyou're using: if you're running under one of the DOS/Windows shells(<command>cmd.exe</command> or <command>command.com</command>), type<command>makeick.bat</command>, and if you're running under a port of a UNIX orLinux shell (such as <command>bash</command>), type <command>makeick.sh</command>.</variablelist>
+ <variablelist>The distribution should now have been compiled, but it still needs to beinstalled. To do this, you will need to edit your ‘<literal>PATH</literal>’environment variable. Under DOS and earlier versions of Windows, youcan do this by editing <filename>C:\autoexec.bat</filename>; look for the last commandthat sets the ‘<literal>PATH</literal>’ environment variable (i.e. that startswith ‘<literal>set PATH=</literal>’), and add another semicolon and the <filename>bin</filename>subdirectory of your main installation directory to it (for instance, ifyour installation directory is<filename>C:\stuff\intercal\ick-0.28</filename>, you want to add‘<literal>;C:\stuff\intercal\ick-0.28\bin</literal>’ to the end of thatline). Under later versions of Windows, this won't work (I'm not sureexactly where the cutoff is, but I know the other method doesn't work onWindows XP); instead, go via the Start menu to Settings, Control Panel,System, Advanced, Environment Variables, and edit either your own or thesystem-wide PATH setting (depending on whether you want to install foryourself or for everyone) to end with the <filename>bin</filename> subdirectory of themain installation directory, the same way as for older versions ofWindows.</variablelist>
+ </varlistentry>
+ <para>To test that the ‘<literal>PATH</literal>’ setting is set correctly, try changing to
+an unrelated directory (for instance, by typing <command>cd \</command> at a
+command prompt), and typing <command>ick -@</command>; if you get a usage
+message for <command>ick</command>, then you've set the ‘<literal>PATH</literal>’ setting
+correctly. Note that if things go wrong during compilation, other than
+errors about inability to find <command>flex</command> or <command>bison</command> (the
+compilation process can succeed despite either of these errors), it's
+likely that you've messed up your DJGPP installation (maybe by setting
+the ‘<literal>PATH</literal>’ or ‘<literal>DJDIR</literal>’ environment variables incorrectly for
+it).</para>
+ </sect1>
+
+ <sect1 label="1.5" id="Not-Installing">
+ <para>Not Installing</para>
+ <informalfigure><command>ick</command>, using without installation</informalfigure>
+ <informalfigure><command>ick</command>, not installating</informalfigure>
+ <informalfigure>trying out <command>ick</command></informalfigure>
+ <informalfigure>not installing</informalfigure>
+ <informalfigure>non-root installation</informalfigure>
+ <informalfigure>installation, non-root</informalfigure>
+ <informalfigure>live CD/USB stick</informalfigure>
+ <informalfigure>making a live CD/USB stick</informalfigure>
+ <para>You don't have to install <abbrev>C-INTERCAL</abbrev> to be able to use it; you can instead
+stop any of the other install techniques just after compiling the source
+code, before the installation step. (This may be useful if you just
+want to try out <abbrev>C-INTERCAL</abbrev>, or if you aren't a root/admin user and therefore
+don't have the permissions to install things.) When <abbrev>C-INTERCAL</abbrev> hasn't been
+installed, <command>ick</command> won't be able to find the files it looks for in
+the places that they ought to have been installed, so it will look in a
+variety of places they might be instead (the installation directory, if
+it can figure out where it is; the same directory as the binary; the
+current directory). In order for this to work, just don't move any of
+the files that were compiled anywhere else.</para>
+ <para>Of course, if you haven't installed the compiler, just typing
+<command>ick</command> is unlikely to work, because your computer won't know what
+you mean. Instead, you should give a pathname (absolute or relative) to
+where <command>ick</command> is, so that your computer can find it. With any
+luck, your computer will communicate the pathname you used to
+<command>ick</command> itself, and if that happens <command>ick</command> will use it to
+figure out where the main installation directory is, and find the files
+it needs that way. If you suspect that errors you are getting are due
+to inability to find files (such as E127 (see ) or E999
+(see )), try giving the <option>-u</option> (see ) option to
+<command>ick</command> to see where it's looking.</para>
+ <para>You can make a `live' CD or USB-stick version of <abbrev>C-INTERCAL</abbrev> using similar
+methods; configure (if possible) and compile it, but instead of
+installing it, copy the entire <filename>ick-0.28</filename> directory to the
+CD or USB stick. <acronym>INTERCAL</acronym> can then be run from there by explicitly giving
+a pathname to <filename>bin/ick</filename> or <filename>bin/ick.exe</filename>.</para>
+ </sect1>
+
+ <sect1 label="1.6" id="Uninstalling">
+ <para>Uninstalling</para>
+ <informalfigure>uninstalling</informalfigure>
+ <informalfigure><command>ick</command>, uninstalling</informalfigure>
+ <para>It may happen that you decide to uninstall <abbrev>C-INTERCAL</abbrev> after installing it;
+this may be useful if you want to test the installation system, or
+change the location you install programs, or for some reason you don't
+want it on your computer. It's worth uninstalling just before you
+install a new version of <abbrev>C-INTERCAL</abbrev> because this will save some disk space;
+you cannot install two versions of <abbrev>C-INTERCAL</abbrev> at once (but see for information on how you can use <abbrev>C-INTERCAL</abbrev> without installing
+it).</para>
+ <para>If you installed <abbrev>C-INTERCAL</abbrev> using <command>make install</command>, you can uninstall
+it by using <command>make uninstall</command> from the installation directory,
+assuming that it still exists. If you can't use that method for some
+reason, you can uninstall it by deleting the files <filename>ick.exe</filename> where
+your computer installs binaries, <filename>libick.a</filename>, <filename>libickmt.a</filename>,
+<filename>libyuk.a</filename>, <filename>COPYING.txt</filename>, and <filename>coopt.sh</filename> where your
+computer installs libraries, and the subdirectories
+<filename>ick-0.28</filename> in the places where your computer installs
+data files and include files, and their contents.</para>
+ <para>If you installed <abbrev>C-INTERCAL</abbrev> by changing your ‘<literal>PATH</literal>’ environment
+variable, you can uninstall by changing it back.</para>
+ <para>You can go further than uninstalling. Running <command>make distr</command>,
+<command>districk.sh</command>, or <command>districk.bat</command> will delete any files
+created by compilation; <command>make distclean</command> will delete those
+files, and also any files created by configuring. The distribution
+contains prebuilt versions of the parser, lexical analyser and OIL
+compiler; doing <command>make clean</command> (or <command>cleanick.sh</command> or
+<command>cleanick.bat</command>) will do the same thing as <command>make distr</command>
+and also delete those prebuilt versions.</para>
+ </sect1>
+
+ <sect1 label="1.7" id="Reporting-Bugs">
+ <para>Reporting Bugs</para>
+ <informalfigure>bugs, reporting</informalfigure>
+ <informalfigure>reporting bugs</informalfigure>
+ <informalfigure>patches, submitting</informalfigure>
+ <informalfigure>submitting patches</informalfigure>
+ <para>If you can't get <abbrev>C-INTERCAL</abbrev> to install at all, or something goes wrong when
+you're using it, reporting a bug is probably a good idea. (This is
+still important even if you figure out how to fix it, and the
+information isn't in the manual, because the fix can be added to the
+source code if possible, or at least to the manual, to benefit future
+users.) For general help, you may want to post to the
+alt.lang.intercal news group; to report
+a bug or submit a patch, email the person who released the most recent
+<abbrev>C-INTERCAL</abbrev> version (which you can determine by looking at that newsgroup).</para>
+ <para>If you do find a bug (either the compiler not behaving in the way you'd
+expect, or if you find a way to cause E778 (see ) without
+modifying the source code), it helps a lot if you can submit a bug
+report explaining what causes it. If you're not sure, say that; it
+helps if you give examples of input, command line options, etc. that
+cause the bug. There are several debug options (see )
+that you can use to help pin down a bug if you're interested in trying
+to solve the problem yourself; looking at the output C code can also
+help pin down a bug if the compiler gets that far.</para>
+ <para>Information that should be given in a bug report is what you expect to
+happen, what actually happens, what input and command line options you
+gave to the compiler, what operating system you're using, any ideas you
+might have as to what the problem is, and any appropriate debug traces
+(for instance, <option>-H</option> (see -H) output if you think the bug
+is in the optimizer). Core dumps aren't portable between systems, so
+don't send those; however, if you're getting an internal error and can
+dump core with <option>-U</option> (see -U), it helps if you can load a
+debugger (such as <command>gdb</command>) on the core dump, use the debugger to
+produce a backtrace, and send that backtrace.</para>
+ <para>If you figure out how to solve the bug yourself, and want to submit the
+patches to help other users (this also carries the advantage that your
+patches will then be maintained along with the rest of the distribution,
+and that you won't have to reapply them every time you upgrade to a
+newer version of <abbrev>C-INTERCAL</abbrev>), you must first agree to license your code
+under the same license as the code that surrounds it (normally, that's
+the GNU General Public License, but if you submit a patch to a file with
+a different license, like this manual (yes, documentation patches are
+useful too), you must agree to that license). You will be credited for
+the patch in the source code unless you specifically ask not to be or
+you don't give your name (in both these cases, you must license the code
+to the public domain so that it can be incorporated without the
+attribution requirement). Preferably, patches should be submitted in
+the format created by the command <command>diff -u</command>; this command is
+likely to be available on UNIX and Linux systems and versions are also
+available for DOS and Windows (including a DJGPP port of the GNU
+version). If you can't manage that, just submit your new code with
+enough lines of old code around it to show where it's meant to go, and a
+description of approximately where in the file it was. Patches should
+be submitted by email to the person who most recently released a version
+of <abbrev>C-INTERCAL</abbrev>.</para>
+ <para>If you have a suggestion for a new feature, it makes sense to first
+discuss it on the alt.lang.intercal news
+group; other <acronym>INTERCAL</acronym> compiler maintainers may also want to implement
+that feature. If you have developed code to implement that feature in
+<abbrev>C-INTERCAL</abbrev>, you can submit it the same way that you would submit a patch for
+a bug.</para>
+ </sect1>
+
+ <sect1 label="1.8" id="Distributing">
+ <para>Distributing</para>
+ <informalfigure>C-INTERCAL, distributing</informalfigure>
+ <informalfigure>distributing C-INTERCAL</informalfigure>
+ <informalfigure>releasing C-INTERCAL</informalfigure>
+ <para>Due to the licensing conditions of <abbrev>C-INTERCAL</abbrev>, you are allowed to release
+your own version or distribution if you want to. In such cases, it's
+recommended that you follow the following guidelines:</para>
+ <varlistentry numeration="arabic">
+ <variablelist>Make sure the new version is based on the most recent existing version.Looking at the alt.lang.intercalnewsgroup will normally let you know what version is most recent.</variablelist>
+ <variablelist>Increment the version number; if you add any new features, incrementthe major version number (after the decimal point) and drop the minorversion number (before the decimal point) to 0, and otherwiseincrement the minor version number. You have to update the versionnumber in the following files: <filename>config.in</filename>, <filename>config.sh</filename>,<filename>configdj.sh</filename>, and <filename>doc/ick.txi</filename>. You also have to renamethe installation directory to reflect the new version number.</variablelist>
+ <variablelist>Add an entry to the <filename>NEWS.txt</filename> file explaining what's new in theversion that you're releasing, following the same format as the otherentries.</variablelist>
+ <variablelist>Update the <filename>README.txt</filename> with a description of any new files you mayhave added.</variablelist>
+ <variablelist>Remove any autosave or backup files that may be littering theinstallation directory or its subdirectories.</variablelist>
+ <variablelist>Run <command>make distclean</command>, or <command>districk.sh</command> or<command>districk.bat</command> if you didn't manage to configure; this willremove all files created by the compilation process that shouldn't bein the distribution.</variablelist>
+ <variablelist>Update the <filename>MANIFEST.txt</filename> file that lists all files in thedistribution; on a Linux or UNIX system, you can do this by typing<command>ls -R1 > MANIFEST.txt</command> in the main installation directory.</variablelist>
+ <variablelist>If creating the distribution under DJGPP, run <command>etc/ctrlmfix.bat</command>or <command>etc/ctrlmfix.sh</command>, even if you managed to configure; thiswill sort out portability problems with newlines.</variablelist>
+ <variablelist>Create a gzipped tar file containing the installation directory. Itsfilename should be ‘<literal>ick-</literal>’, followed by the version number with thedot replaced by a dash, followed by ‘<literal>.tgz</literal>’; this form of filenameis friendly to DOS.</variablelist>
+ <variablelist>Place the new version somewhere on the Internet, and announce thelocation and the fact that a new version has been released onalt.lang.intercal.</variablelist>
+ </varlistentry>
+ </sect1>
+ </chapter>
+
+ <chapter label="2" id="Invoking-ick">
+ <para>Invoking ick</para>
+ <informalfigure>command line options</informalfigure>
+ <informalfigure>options, to <command>ick</command></informalfigure>
+ <informalfigure><command>ick</command>, command line options</informalfigure>
+ <informalfigure><command>ick</command>, invoking</informalfigure>
+ <informalfigure><command>ick</command>, options</informalfigure>
+ <informalfigure>compiling, <acronym>INTERCAL</acronym> source code</informalfigure>
+ <para>All operations on <acronym>INTERCAL</acronym> source code available in <abbrev>C-INTERCAL</abbrev> are currently
+carried out by the compiler <command>ick</command>.</para>
+ <para>The syntax is</para>
+ <programlisting>
+ick -options <replaceable>inputfile</replaceable>
+</programlisting>
+ <para role="continues">(Options can be given preceded by separate hyphens, or all in a row
+after one hyphen, or a mixture; they're all single characters.) By
+default, this compiles one <acronym>INTERCAL</acronym> program given as the input file
+directly to an executable without doing anything fancy; usually you will
+want to give options, which are described below.</para>
+
+ <sect1 label="2.1" id="Language-affecting-Options">
+ <para>Language-affecting Options</para>
+ <informalfigure>options, language-affecting</informalfigure>
+ <informalfigure>language-affecting options</informalfigure>
+ <informalfigure>options, dialect</informalfigure>
+ <informalfigure>dialect options</informalfigure>
+ <para>The following command-line options to <command>ick</command> affect what dialect
+of the <acronym>INTERCAL</acronym> language is compiled by the compiler; you may need to set
+one or more of these options if your input is not the default <abbrev>C-INTERCAL</abbrev> but
+instead some other language like <abbrev>INTERCAL-72</abbrev> or <abbrev>CLC-INTERCAL</abbrev>, or just because
+you like certainty or like being different with respect to your output.
+Note that there is no command-line option corresponding to
+<abbrev>TriINTERCAL</abbrev> (or the base 4-7 versions); instead, the numeric base
+to use is determined by looking at the filename extension (‘<literal>.i</literal>’ for
+base 2, the default, or ‘<literal>.3i</literal>’ to ‘<literal>.7i</literal>’ for the base 3-7
+versions.)</para>
+ <term><indexterm><option>-b</option>
+ <variablelist><inlinemediaobject name="-b"></inlinemediaobject>
+ <informalfigure>-b</informalfigure>
+ <informalfigure>random bug</informalfigure>
+ <informalfigure>E774, disabling</informalfigure>If this option is <emphasis>not</emphasis> given, there is a small chance that arandom bug appears in the compiler, which causes the programs it createsto manifest a bug that causes error E774 (see ). Giving theoption means that this bug will not happen. (You may wonder why thisbug was preserved; it is in fact a bug that was carefully preservedsince the days of <abbrev>INTERCAL-72</abbrev>, in this case, but the option to turn it offis available as a workaround. (There are no plans to fix this or any ofthe other carefully preserved bugs any time soon, because that wouldkind of defeat the point of having preserved them.) Interestingly, the<abbrev>INTERCAL-72</abbrev> compiler documentation mentions a similar command-line optionthat is a workaround for the same bug.)</variablelist>
+ </indexterm><indexterm><option>-m</option>
+ <variablelist><inlinemediaobject name="-m"></inlinemediaobject>
+ <informalfigure>-m</informalfigure>
+ <informalfigure>multithreading, enabling</informalfigure>
+ <informalfigure>backtracking, enabling</informalfigure>This option needs to be given to allow any multithreading orbacktracking commands or identifiers to be used. (Unlike with otherlanguage features, this is not autodetected because it's legal to have aprogram with multiple COME FROM (see ) commands aiming atthe same line even when it isn't multithreaded, in which case thecommands cause error E555 (see ) when that line is encountered(with the usual caveats about both commands having to be active at thetime).) Attempts to use non-COME FROM multithreading or backtrackingcommands without this option produce error E405 (see ).</variablelist>
+ </indexterm><indexterm><option>-t</option>
+ <variablelist><inlinemediaobject name="-t"></inlinemediaobject>
+ <informalfigure>-t</informalfigure>
+ <informalfigure>INTERCAL-72 compatibility mode</informalfigure>
+ <informalfigure>compatibility, INTERCAL-72</informalfigure>This option tells the compiler to treat the source code as <abbrev>INTERCAL-72</abbrev>; as aresult, any language constructs that are used but weren't available in1972 will trigger error E111 (see ).</variablelist>
+ </indexterm><indexterm><option>-v</option>
+ <variablelist><inlinemediaobject name="-v"></inlinemediaobject>
+ <informalfigure>-v</informalfigure>
+ <informalfigure>constants, assigning to</informalfigure>
+ <informalfigure>assigning to constants</informalfigure>It is possible to write <acronym>INTERCAL</acronym> code sufficiently tortuous that it endsup assigning to a constant. Generally speaking, this isn't what youwanted to do, so the compiler will kindly cause an error (E277;see ) that stops the insanity at that point, but at the cost ofa significant amount of performance you can give this option to tell thecompiler to simply change the constant and keep on going anyway. (Notethat unlike <abbrev>CLC-INTERCAL</abbrev>, this only changes uses of the constant preceded by<literal>#</literal> in your program, not things like line numbers; you wantForte for that.)</variablelist>
+ </indexterm><indexterm><option>-C</option>
+ <variablelist><inlinemediaobject name="-C+"></inlinemediaobject>
+ <informalfigure>-C</informalfigure>
+ <informalfigure>clockface mode</informalfigure>When this option is given, the generated programs will write the number4 as ‘<literal>IIII</literal>’ rather than ‘<literal>IV</literal>’, in case you're writing a clockprogram.</variablelist>
+ </indexterm><indexterm><option>-P</option>
+ <variablelist><inlinemediaobject name="-P+"></inlinemediaobject>
+ <informalfigure>-P</informalfigure>
+ <informalfigure>PIC-INTERCAL, command line option</informalfigure>
+ <informalfigure>E256, avoiding</informalfigure>
+ <informalfigure>E652, avoiding</informalfigure>This tells the compiler to treat the input as <abbrev>PIC-INTERCAL</abbrev>(see ) rather than ordinary <abbrev>C-INTERCAL</abbrev> input, and generatePIC output code accordingly. There are a lot of options that areincompatible with this, as well as many language features, due to thelimited memory available on a PIC. If you get error E256(see ), you have this option given when it shouldn't be;likewise, if you get error E652 (see ), you should be using thisoption but aren't. (A few simple programs are<abbrev>C-INTERCAL</abbrev>/<abbrev>PIC-INTERCAL</abbrev> polyglots, but such programs are incapable ofdoing input or output, meaning that they aren't particularly useful.)</variablelist>
+ </indexterm><indexterm><option>-X</option>
+ <variablelist><inlinemediaobject name="-X+"></inlinemediaobject>
+ <informalfigure>-X</informalfigure>
+ <informalfigure>Princeton syntax, option</informalfigure>
+ <informalfigure>syntax, Princeton</informalfigure>The <abbrev>C-INTERCAL</abbrev> and <abbrev>CLC-INTERCAL</abbrev> compilers use different notation for variousthings, sometimes to the extent where the same notation is legal in bothcases but has a different meaning. As this is the <abbrev>C-INTERCAL</abbrev> compiler, itrather guessably uses its own notation by default; however, the <abbrev>CLC-INTERCAL</abbrev>notation can be used as the default instead using this option. (In mostsituations where there isn't an ambiguity about what something means,you can use the `wrong' syntax freely.) The option causes ambiguouscharacters like <literal>?</literal> to be interpreted with Princeton rather thanAtari meanings.</variablelist>
+ </indexterm><indexterm><option>-x</option>
+ <variablelist><inlinemediaobject name="-x"></inlinemediaobject>
+ <informalfigure>-x</informalfigure>
+ <informalfigure>CLC-INTERCAL compatibility mode</informalfigure>
+ <informalfigure>compatibility, CLC-INTERCAL</informalfigure>This option causes some constructs with different meanings in <abbrev>C-INTERCAL</abbrev>and <abbrev>CLC-INTERCAL</abbrev> to use the <abbrev>CLC-INTERCAL</abbrev> meaning rather than the <abbrev>C-INTERCAL</abbrev>meaning. At present, it affects the abstention of a GIVE UP(see ) command by line number, which is possible as long asthis switch isn't given; reading through the <abbrev>INTERCAL-72</abbrev> manual, there area lot of things that imply that this probably wasn't intended to bepossible, but as far as I can tell that manual doesn't actually<emphasis>say</emphasis> anywhere that this particular case is disallowed, eventhough it rules out all other similar cases. It also causes I/O onarray variables to be done in <abbrev>CLC-INTERCAL</abbrev>'s extended Baudot syntax,rather than using the Turing Tape method.</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+
+ <sect1 label="2.2" id="Debug-Options">
+ <para>Debug Options</para>
+ <informalfigure>options, debug</informalfigure>
+ <informalfigure>debug options</informalfigure>
+ <para>Sometimes things will go wrong with your program, or with the way
+<command>ick</command> was installed. There may even be unknown bugs in
+<command>ick</command> itself (if you find one of these, please report it). The
+following options are used to debug the whole system on various levels.</para>
+ <term><indexterm><option>-d</option>
+ <variablelist><inlinemediaobject name="-d"></inlinemediaobject>
+ <informalfigure>-d</informalfigure>
+ <informalfigure>debugging, parser</informalfigure>
+ <informalfigure>parser, debugging</informalfigure>
+ <informalfigure>debugging, lexical analyser</informalfigure>
+ <informalfigure>lexical analyser, debugging</informalfigure>If you think that something has gone wrong with the parser, or you wantto see how your program is being parsed, you can give this option on thecommand line. All the debug output produced by the parser and lexicalanalyser will be output on standard error.</variablelist>
+ </indexterm><indexterm><option>-g</option>
+ <variablelist><inlinemediaobject name="-g"></inlinemediaobject>
+ <informalfigure>-g</informalfigure>
+ <informalfigure>debugging, C code</informalfigure>
+ <informalfigure>C code, debugging</informalfigure>
+ <informalfigure>C code, leaving in place</informalfigure>This option allows debugging of the final executable at the C codelevel. Any C code generated will be left in place, and the <option>-g</option>option will be given to the C compiler that's used to compile the code,so all the information needed for a C debugger to be used on theexecutable will be present there.</variablelist>
+ </indexterm><indexterm><option>-h</option><option>-H</option><option>-hH</option>
+ <variablelist><inlinemediaobject name="-h"></inlinemediaobject><inlinemediaobject name="-H+"></inlinemediaobject><inlinemediaobject name="-hH"></inlinemediaobject>
+ <informalfigure>-h</informalfigure>
+ <informalfigure>-H</informalfigure>
+ <informalfigure>-hH</informalfigure>
+ <informalfigure>optimizer, debugging</informalfigure>
+ <informalfigure>debugging, optimizer</informalfigure>
+ <informalfigure>OIL, debugging</informalfigure>
+ <informalfigure>debugging, OIL</informalfigure>These options allow debugging of the optimiser, or produce outputhelpful for understanding how your program has been summarised.<option>-h</option> produces a summary of what optimiser rules were used, theinitial expression and what it was optimised to; <option>-H</option> produces amore expanded view that shows each intermediate step of optimisation,and <option>-hH</option> shows the same output as <option>-H</option>, but writtencompletely using C syntax (the other options output in a strange mix of<acronym>INTERCAL</acronym> and C).</variablelist>
+ </indexterm><indexterm><option>-l</option>
+ <variablelist><inlinemediaobject name="-l"></inlinemediaobject>
+ <informalfigure>-l</informalfigure>
+ <informalfigure>warnings, enabling</informalfigure>This option turns on generation of warnings (see ). To makesure that they aren't actually useful, or are only marginally useful,the warning generator is far too sensitive, and there is no way todecide which warnings are given and which ones aren't; you either getall of them or none.</variablelist>
+ </indexterm><indexterm><option>-p</option>
+ <variablelist><inlinemediaobject name="-p"></inlinemediaobject>
+ <informalfigure>-p</informalfigure>
+ <informalfigure>profiling</informalfigure>
+ <informalfigure>yuk, profiling</informalfigure>This option causes the program to run immediately after being compiled,and profiles the resulting program to identify performance bottlenecks,etc. The usefulness of this depends on the resolution of the timers onthe computer and operating system; DOS, in particular, is really badwith timer resolution. The output will be saved in a file called<filename>yuk.out</filename> when the program finishes running. It's legal to turn onboth the profiler and the interactive debugger at the same time, but ifyou do this the profiler will also identify bottlenecks in the persontyping in commands to step through the program! The profiler will, infact, identify all the timings that particular commands in the programtake; so <literal>WRITE IN</literal> instructions will often show up as taking along time due to their need to wait for input.</variablelist>
+ </indexterm><indexterm><option>-u</option>
+ <variablelist><inlinemediaobject name="-u"></inlinemediaobject>
+ <informalfigure>-u</informalfigure>
+ <informalfigure>skeleton file, directory problems</informalfigure>
+ <informalfigure>system library, directory problems</informalfigure>
+ <informalfigure>syslib, directory problems</informalfigure>
+ <informalfigure>directory problems</informalfigure>
+ <informalfigure>E999, debugging</informalfigure>
+ <informalfigure>E127, debugging</informalfigure>When you are getting problems with finding files – for instance, thecompiler can't find the skeleton file (see ) or the systemlibrary (see ) – this option will let you know, on standarderror, where the compiler is looking for files. This may hopefully helpyou pin down where the file-finding problems are coming from, and alsooffers the option of simply placing copies of the files where thecompiler is looking as a last resort.</variablelist>
+ </indexterm><indexterm><option>-y</option>
+ <variablelist><inlinemediaobject name="-y"></inlinemediaobject>
+ <informalfigure>-y</informalfigure>
+ <informalfigure>yuk, command line option</informalfigure>This is the main debugging option: it loads yuk, an interactive <acronym>INTERCAL</acronym>debugger with ability to step through the program, set breakpoints, viewand modify variables, etc. See .</variablelist>
+ </indexterm><indexterm><option>-U</option>
+ <variablelist><inlinemediaobject name="-U+"></inlinemediaobject>
+ <informalfigure>-U</informalfigure>
+ <informalfigure>internal errors, debugging</informalfigure>
+ <informalfigure>debugging, internal errors</informalfigure>
+ <informalfigure>internal errors, dumping core</informalfigure>
+ <informalfigure>dumping core on error</informalfigure>
+ <informalfigure>E778, debugging</informalfigure>The internal error E778 (see ) should never happen. However,there are all sorts of potential problems that may come up, and if partof the code detects something impossible, or more usually when theoperating system detects things have got too insane and segfaults,normally this error will just be generated and that's that. (I mostoften get this when I've been writing a new section of code and havemade a mistake; hopefully, all or at least most of these errors arefixed before release, though.) If you want more information as to what'sgoing on, you can give the <option>-U</option> option, which will cause thecompiler to raise an abort signal when an internal error happens. Thiscan generally be caught by a debugger that's being run on <command>ick</command>itself at the time; on many systems, it will also cause a core dump.</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+
+ <sect1 label="2.3" id="Output-Options">
+ <para>Output Options</para>
+ <informalfigure>output options</informalfigure>
+ <informalfigure>options, output</informalfigure>
+ <para>These options allow you to control how far to compile (all the way to an
+executable, or only to C, etc.), and where the output will be created.
+Note that the output options may change depending on the other options
+selected; for instance, many of the debug options will prevent the code
+being compiled all the way to an executable.</para>
+ <term><indexterm><option>-c</option>
+ <variablelist><inlinemediaobject name="-c"></inlinemediaobject>
+ <informalfigure>-c</informalfigure>
+ <informalfigure>code generation, stopping at C code</informalfigure>
+ <informalfigure>C, stopping after C is generated</informalfigure>
+ <informalfigure>output, C only</informalfigure>By default, the original <acronym>INTERCAL</acronym> code will be compiled all the way to anexecutable, and the intermediate C and object files produced will bedeleted. Giving this option causes the compiler to stop when it hasfinished producing the C file, leaving the C file there as the finaloutput of the compiler. (Its filename is the same as the source file,but with ‘<literal>.c</literal>’ as its extension/suffix rather than the source file'sextension.) Without this option, an executable will be produced with theextension changed to whatever's appropriate for the system you are on(or omitted entirely if that's appropriate for the system).This option also places verbose comments in the output C file.</variablelist>
+ </indexterm><indexterm><option>-o</option>
+ <variablelist><inlinemediaobject name="-o"></inlinemediaobject>
+ <informalfigure>-o</informalfigure>
+ <informalfigure>output, to standard output</informalfigure>
+ <informalfigure>standard output</informalfigure>This option causes the compiler to progress no further than producingthe C output file, but instead of writing it to a file writes itdirectly to standard output. This might occasionally be useful whenusing <command>ick</command> as part of a pipe; it can also be useful to see howfar the compiler gets with compiling code before an error happens, whenyou're trying to track down an error.</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+
+ <sect1 label="2.4" id="Optimizer-Options">
+ <para>Optimizer Options</para>
+ <informalfigure>optimizer options</informalfigure>
+ <informalfigure>options, optimizer</informalfigure>
+ <informalfigure>optimization</informalfigure>
+ <para>There are various command line options that can be used to tell
+<command>ick</command> whether and in what ways to optimize code.</para>
+ <term><indexterm><option>-f</option>
+ <variablelist><inlinemediaobject name="-f"></inlinemediaobject>
+ <informalfigure>-f</informalfigure>
+ <informalfigure>flow optimization</informalfigure>
+ <informalfigure>optimization, flow</informalfigure>
+ <informalfigure>optimization, control flow</informalfigure>This option requests the compiler to attempt to analyse the flow of theprogram and optimize accordingly; for instance, it will detect whichcommands can't possibly be <literal>ABSTAINED</literal> from and refrain fromgenerating code to check the abstention status of those commands.</variablelist>
+ </indexterm><indexterm><option>-F</option>
+ <variablelist><inlinemediaobject name="-F+"></inlinemediaobject>
+ <informalfigure>-F</informalfigure>
+ <informalfigure>optimization, extreme</informalfigure>
+ <informalfigure>extreme optimization</informalfigure>This option tells the compiler to optimize the output for speed. Thisis done to crazy extremes; the compiler may take several hours/daysanalysing the program in some cases and still not come up with animprovement. It turns on all the other optimizer options. Note thatnot all systems accept this option, because it sometimes outputs a shellscript disguised as an executable rather than an actual executable.</variablelist>
+ </indexterm><indexterm><option>-O</option>
+ <variablelist><inlinemediaobject name="-O+"></inlinemediaobject>
+ <informalfigure>-O</informalfigure>
+ <informalfigure>optimization, idioms</informalfigure>
+ <informalfigure>idiom optimization</informalfigure>
+ <informalfigure>optimization, OIL</informalfigure>
+ <informalfigure>OIL, optimizing code</informalfigure>This option tells the compiler to apply optimizer idioms to theexpressions in the code given, when appropriate. The list of idioms isstored in the file <filename>src/idiotism.oil</filename>; note that it is compiledinto the compiler, though, so you will have to rebuild and reinstall thecompiler if you change it. For more information about changing the listof idioms, see .</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+
+ <sect1 label="2.5" id="Other-Options">
+ <para>Other Options</para>
+ <informalfigure>other options</informalfigure>
+ <informalfigure>options, other</informalfigure>
+ <para>Some options just can't be classified.</para>
+ <term><indexterm><option>-@</option>
+ <variablelist><inlinemediaobject name="-at"></inlinemediaobject>
+ <informalfigure>-@</informalfigure>
+ <informalfigure>options, help</informalfigure>
+ <informalfigure>help with options</informalfigure>
+ <informalfigure>usage instructions, printing</informalfigure>If this option is given, the compiler doesn't run at all, but insteadprints a set of instructions for using it, explaining which options areavailable on the system you're on and which options conflict with whichother options.</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+
+ <sect1 label="2.6" id="Options-to-Generated-Programs">
+ <para>Options to Generated Programs</para>
+ <informalfigure>generated programs, options</informalfigure>
+ <informalfigure>options, to generated programs</informalfigure>
+ <para>Once the compiler runs and produces an output executable, that
+executable itself will accept a range of options that control the way it
+runs. None of these options have to be used; a default value will be
+assumed if they aren't.</para>
+ <term><indexterm><option>+help</option><option>-help</option>
+ <variablelist><inlinemediaobject name="+help"></inlinemediaobject><inlinemediaobject name="-help"></inlinemediaobject>
+ <informalfigure>+help</informalfigure>
+ <informalfigure>-help</informalfigure>Whether ‘<literal>+</literal>’ or ‘<literal>-</literal>’ is given at the start of this option, itwill cause the program to print out what options are available and whatstate they are in. It will then cause the program to exit via aninternal error.</variablelist>
+ </indexterm><indexterm><option>+wimpmode</option><option>-wimpmode</option>
+ <variablelist><inlinemediaobject name="+wimpmode"></inlinemediaobject><inlinemediaobject name="-wimpmode"></inlinemediaobject>
+ <informalfigure>+wimpmode</informalfigure>
+ <informalfigure>-wimpmode</informalfigure>
+ <informalfigure>wimpmode</informalfigure>
+ <informalfigure>Roman numerals, disabling</informalfigure>
+ <informalfigure>Arabic numberals, enabling</informalfigure>
+ <informalfigure>input, in Arabic numerals</informalfigure>
+ <informalfigure>output, in Arabic numerals</informalfigure>If the ‘<literal>+</literal>’ version of this is given (rather than the default‘<literal>-</literal>’), then the program will print a message explaining that you area wimp (the mode itself is known as wimpmode), and for the rest ofexecution will input in Arabic numerals (‘<literal>123</literal>’ rather than‘<literal>ONE TWO THREE</literal>’) and likewise will output in Arabic numerals ratherthan Roman numerals (such as ‘<literal>CXXIII</literal>’). True <acronym>INTERCAL</acronym> programmersshould rarely have to use this mode.</variablelist>
+ </indexterm><indexterm><option>+traditional</option><option>-traditional</option>
+ <variablelist><inlinemediaobject name="+traditional"></inlinemediaobject><inlinemediaobject name="-traditional"></inlinemediaobject>
+ <informalfigure>+traditional</informalfigure>
+ <informalfigure>-traditional</informalfigure>This option does not actually appear to do anything.</variablelist>
+ </indexterm><indexterm><option>+printflow</option><option>-printflow</option>
+ <variablelist><inlinemediaobject name="+printflow"></inlinemediaobject><inlinemediaobject name="-printflow"></inlinemediaobject>
+ <informalfigure>+printflow</informalfigure>
+ <informalfigure>-printflow</informalfigure>
+ <informalfigure>flow, printing</informalfigure>
+ <informalfigure>debugging, flow</informalfigure>
+ <informalfigure>debugging, multithreaded programs</informalfigure>
+ <informalfigure>multithreading, debugging</informalfigure>
+ <informalfigure>backtracking, debugging</informalfigure>The usual debugging methods don't work with multithreaded orbacktracking programs. This option exists to give at least a slimchance of working out what is going on with them. It causes the programto print the line number of the command it thinks it may be executingnext (i.e. the line number that would be printed if that line had anerror) immediately after executing each command, and also an internalidentifier for the thread that that command was in. It also prints atrace of what parts of the multithreader are being activated; so forinstance, it will tell you when a thread is being forked into multiplethreads or when a choicepoint has been deleted.</variablelist>
+ </indexterm><indexterm><option>+mystery</option><option>-mystery</option>
+ <variablelist><inlinemediaobject name="+mystery"></inlinemediaobject><inlinemediaobject name="-mystery"></inlinemediaobject>
+ <informalfigure>+mystery</informalfigure>
+ <informalfigure>-mystery</informalfigure>This option is occasionally capable of doing something, but isdeliberately undocumented. Normally changing it will have no effect,but changing it is not recommended.</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+
+ <sect1 label="2.7" id="Environment-Variables">
+ <para>Environment Variables</para>
+ <informalfigure>environment variables</informalfigure>
+ <para>Various environment variables can be set to affect the operation of
+<command>ick</command>.</para>
+ <colspec>
+ <thead cols="2">
+ <tbody colwidth="30*"></tbody>
+ <tbody colwidth="70*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo>Variable</bookinfo>
+ <bookinfo>Meaning</bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>ICKINCLUDEDIRICKLIBDIRICKDATADIR</bookinfo>
+ <bookinfo>
+These three environment variables suggest locations in which
+<command>ick</command> should look to find various files that it needs: the
+skeleton file, system library, C header files and libraries that it
+needs, constant-output optimiser, and the GNU General Public License
+(which the debugger needs to be able to display on demand for legal
+reasons).</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>CC</bookinfo>
+ <bookinfo>
+The name of a C compiler to use (defaults to gcc, which is the only
+compiler with which <abbrev>C-INTERCAL</abbrev> has been tested recently). This option has
+no effect on DJGPP, where gcc is always used.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>ICKTEMPTMPDIRTEMPTMP</bookinfo>
+ <bookinfo>
+On DJGPP, <command>ick</command> creates temporary files to pass options to gcc
+as a method of getting around the limit on the length of a command line
+that can sometimes affect DOS programs. These four environment
+variables are tried (in this order) to determine a location for the
+temporary file; if none of them are set, the current directory is used.</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ </sect1>
+ </chapter>
+
+ <chapter label="3" id="Errors-and-Warnings">
+ <para>Errors and Warnings</para>
+ <informalfigure><command>ick</command>, errors and warnings</informalfigure>
+ <informalfigure>errors and warnings</informalfigure>
+ <para>Things may go wrong, either during the compilation or the execution of
+your program. Note that some things that would be compile-time errors
+in many other languages – such as syntax errors – are in fact run-time
+errors in <acronym>INTERCAL</acronym>.</para>
+ <para>Errors and warnings appear as an error code starting with ‘<literal>ICL</literal>’,
+followed by a three digit number, followed by ‘<literal>I</literal>’ for an error or
+‘<literal>W</literal>’ for a warning. However, they will be notated here as
+‘<literal>E000</literal>’, etc., to save space and because consistency was never a
+strong point of <acronym>INTERCAL</acronym>. This is followed by a text description of the
+error, and a hint as to the location of the error. This is not the line
+on which the error occurred, but rather the line on which the next
+command to be executed is. To add to the fun, the calculation of the
+next command to be executed is done at compile-time rather than runtime,
+so it may be completely wrong due to things like abstention on
+<literal>COME FROM</literal>s or computed <literal>COME FROM</literal>s. The moral of this
+story is that, if you really want to know where the error is, use a
+debugger. Note also that if the error happens at compile-time, there is
+no guarantee that the line number given makes any sense at all. Some
+errors don't give next line numbers, mostly those for which it doesn't
+make logical sense, such as E633 (see ). After this is a
+suggestion to correct (or reconsider) the source code and to resubnit
+it. (This typo has been carefully preserved for over a decade.)</para>
+
+ <sect1 label="3.1" id="Errors">
+ <para>Errors</para>
+ <informalfigure>errors</informalfigure>
+ <informalfigure><command>ick</command>, errors</informalfigure>
+ <para>This is a list of the error messages that might be produced during the
+compilation or execution of an <acronym>INTERCAL</acronym> program.</para>
+ <term><indexterm>E000
+ <variablelist><inlinemediaobject name="E000"></inlinemediaobject>
+ <informalfigure>E000</informalfigure>
+ <informalfigure>syntax error</informalfigure>This is an unusual error; it's what's printed when a syntax error isencounted at runtime, in a situation in which it would be executed. (An<literal>ABSTAIN</literal>ed syntax error, for instance, would not be executed; thisis one of the mechanisms available for writing comments.) The text ofthe error message is simply the statement that couldn't be decoded.</variablelist>
+ </indexterm><indexterm>E017
+ <variablelist><inlinemediaobject name="E017"></inlinemediaobject>
+ <informalfigure>E017</informalfigure>
+ <informalfigure>syntax error, serious</informalfigure>
+ <screen>DO YOU EXPECT ME TO FIGURE THIS OUT?
+</screen>It sometimes happens that a syntax error manages to get the parser soconfused that it can't figure out what to do next; that causes thiserror, which happens at compile time.</variablelist>
+ </indexterm><indexterm>E079
+ <variablelist><inlinemediaobject name="E079"></inlinemediaobject>
+ <informalfigure>E079</informalfigure>
+ <informalfigure>politesse</informalfigure>
+ <informalfigure><literal>PLEASE</literal>, proportion required</informalfigure>
+ <screen>PROGRAMMER IS INSUFFICIENTLY POLITE
+</screen>The balance between various statement identifiers is important. If lessthan approximately one fifth of the statement identifiers used are thepolite versions containing <literal>PLEASE</literal>, that causes this error atcompile time.</variablelist>
+ </indexterm><indexterm>E099
+ <variablelist><inlinemediaobject name="E099"></inlinemediaobject>
+ <informalfigure>E099</informalfigure>
+ <screen>PROGRAMMER IS OVERLY POLITE
+</screen>Of course, the same problem can happen in the other direction; thiserror is caused at compile time if over about one third of the statementidentifiers are the polite form.</variablelist>
+ </indexterm><indexterm>E111
+ <variablelist><inlinemediaobject name="E111"></inlinemediaobject>
+ <informalfigure>E111</informalfigure>
+ <screen>COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING
+</screen>This error happens when you give the <option>-t</option> option (see ) butyou use a language construct that wasn't available in <abbrev>INTERCAL-72</abbrev>. If thishappens, then either there's a mistake in the program that prevents itbeing <abbrev>INTERCAL-72</abbrev> or you shouldn't be compiling it as <abbrev>INTERCAL-72</abbrev> in the firstplace.</variablelist>
+ </indexterm><indexterm>E123
+ <variablelist><inlinemediaobject name="E123"></inlinemediaobject>
+ <informalfigure>E123</informalfigure>
+ <informalfigure>black lagoon</informalfigure>
+ <informalfigure><literal>NEXT</literal>, stack overflow</informalfigure>
+ <informalfigure>stack overflow</informalfigure>
+ <screen>PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON
+</screen>There is a hard limit of 80 <command>NEXT</command>s at a time; this is todiscourage excessive use of <command>NEXTING</command> for things like recursion.(Recursive programs are entirely legal; you simply have to figure outhow to do it with computed <command>COME FROM</command> instead. (For therecord, it is possible. (Using lots of nested brackets when talkingabout recursion is great (yay!).))) Another problem with writing thesource code that can cause this error is a failure to properly<command>FORGET</command> the entry on the <command>NEXT</command> stack created whentrying to simulate a goto.</variablelist>
+ </indexterm><indexterm>E127
+ <variablelist><inlinemediaobject name="E127"></inlinemediaobject>
+ <informalfigure>E127</informalfigure>
+ <informalfigure>system library, errors</informalfigure>
+ <informalfigure>syslib, errors</informalfigure>
+ <screen>SAYING 'ABRACADABRA' WITHOUT A MAGIC WAND WON'T DO YOU ANY GOOD
+</screen>Your program asked to include the system library (by specifying a linenumber from 1000 to 1999 inclusive without including a line with thatnumber), but due to installation problems the copmiler couldn't find thesystem library to include. You could try using the <option>-u</option>(see ) option to see where the compiler's looking; that may giveyou an idea of where you need to copy the system library so that thecompilation will work. This error happens at compile time and doesn'tgive a next command line number.</variablelist>
+ </indexterm><indexterm>E129
+ <variablelist><inlinemediaobject name="E129"></inlinemediaobject>
+ <informalfigure>E129</informalfigure>
+ <informalfigure><literal>NEXT</literal>, nonexistent target</informalfigure>
+ <screen>PROGRAM HAS GOTTEN LOST
+</screen>This error happens at compile time when the compiler can't figure outwhere a <command>NEXT</command> command is actually aiming (normally due to atypo in either the line label given or the line label on the line aimedfor). The logic behind this error means that the next line to beexecuted is unknown (after all, that's the whole point of the error) andis therefore not given.</variablelist>
+ </indexterm><indexterm>E139
+ <variablelist><inlinemediaobject name="E139"></inlinemediaobject>
+ <informalfigure>E139</informalfigure>
+ <informalfigure><literal>ABSTAIN</literal>, nonexistent target</informalfigure>
+ <informalfigure><literal>REINTSTATE</literal>, nonexistent target</informalfigure>
+ <screen>I WASN'T PLANNING TO GO THERE ANYWAY
+</screen>This error happens at compile time when an <literal>ABSTAIN</literal> or<literal>REINSTATE</literal> references a non-existent target line. This generallyhappens for much the same reasons as E129 (see ).</variablelist>
+ </indexterm><indexterm>E182
+ <variablelist><inlinemediaobject name="E182"></inlinemediaobject>
+ <informalfigure>E182</informalfigure>
+ <informalfigure>line label, duplicate</informalfigure>
+ <informalfigure>duplicate line label</informalfigure>
+ <screen>YOU MUST LIKE THIS LABEL A LOT!
+</screen>At present, it's impossible to have more than one line with the sameline number. That would make <literal>NEXT</literal> act too much like <literal>COMEFROM</literal> in reverse to be interesting. This error happens at compile time.</variablelist>
+ </indexterm><indexterm>E197
+ <variablelist><inlinemediaobject name="E197"></inlinemediaobject>
+ <informalfigure>E197</informalfigure>
+ <informalfigure>line label, illegal value</informalfigure>
+ <informalfigure>illegal line label value</informalfigure>
+ <informalfigure>invalid line label value</informalfigure>
+ <screen>SO! 65535 LABELS AREN'T ENOUGH FOR YOU?
+</screen>Legal values for line labels are 1 to 65535 (with values from 1000 to1999 reserved if you want to use the system library). This error comesup if you use nonpositive or twospot values for a line label.</variablelist>
+ </indexterm><indexterm>E200
+ <variablelist><inlinemediaobject name="E200"></inlinemediaobject>
+ <informalfigure>E200</informalfigure>
+ <informalfigure>variable, illegal number</informalfigure>
+ <informalfigure>illegal variable number</informalfigure>
+ <informalfigure>invalid variable number</informalfigure>
+ <screen>NOTHING VENTURED, NOTHING GAINED
+</screen>You used a variable that isn't actually in your program. Failing that(which would be quite impressive and is probably impossible, at least inthe present version of <abbrev>C-INTERCAL</abbrev>), you specified an illegal number for avariable (legal numbers are positive and onespot). This error happensat compile time, at least for illegal variable numbers.</variablelist>
+ </indexterm><indexterm>E222
+ <variablelist><inlinemediaobject name="E222"></inlinemediaobject>
+ <informalfigure>E222</informalfigure>
+ <informalfigure>out of memory, during <literal>STASH</literal></informalfigure>
+ <screen>BUMMER, DUDE!
+</screen>In <acronym>INTERCAL</acronym>, you're allowed to <literal>STASH</literal> as much as you like; thismakes the language Turing-complete and allows for unlimited recursionwhen combined with computed <literal>COME FROM</literal> in the right way.Unfortunately, real computers aren't so idealised; if you manage towrite a program so memory-intensive that the computer runs out of memoryto store stashes, it causes this error at runtime. To fix this error,you either have to simplify the program or upgrade your computer'smemory, and even then that will only help to some extent.</variablelist>
+ </indexterm><indexterm>E240
+ <variablelist><inlinemediaobject name="E240"></inlinemediaobject>
+ <informalfigure>E240</informalfigure>
+ <informalfigure>array, invalid dimension</informalfigure>
+ <informalfigure>invalid array dimension</informalfigure>
+ <informalfigure>illegal array dimension</informalfigure>
+ <screen>ERROR HANDLER PRINTED SNIDE REMARK
+</screen>Arrays have to be large enough to hold at least one element; you triedto dimension an array which isn't large enough to hold any data. Thiserror happens at run time.</variablelist>
+ </indexterm><indexterm>E241
+ <variablelist><inlinemediaobject name="E241"></inlinemediaobject>
+ <informalfigure>E241</informalfigure>
+ <informalfigure>array, wrong dimension</informalfigure>
+ <informalfigure>wrong array dimension</informalfigure>
+ <informalfigure>array, out of bounds</informalfigure>
+ <informalfigure>out of bounds</informalfigure>
+ <screen>VARIABLES MAY NOT BE STORED IN WEST HYPERSPACE
+</screen>This error happens at run time when the subscripts given to an arrayare inconsistent with the way the array was dimensioned, eitherbecause there were the wrong number of subscripts or because asubscript was too large to fit in the array. It can also happen whena multidimensional array is given to a command, such as <literal>WRITEIN</literal>, that expects it to be monodimensional.</variablelist>
+ </indexterm><indexterm>E252
+ <variablelist><inlinemediaobject name="E252"></inlinemediaobject>
+ <informalfigure>E252</informalfigure>
+ <informalfigure>I/O, out of memory</informalfigure>
+ <informalfigure>out of memory, I/O</informalfigure>
+ <screen>I'VE FORGOTTEN WHAT I WAS ABOUT TO SAY
+</screen>This run-time error message is caused by the compiler running out ofmemory whilst trying to do I/O; at present, it can only happen during<abbrev>CLC-INTERCAL</abbrev>-style I/O.</variablelist>
+ </indexterm><indexterm>E256
+ <variablelist><inlinemediaobject name="E256"></inlinemediaobject>
+ <informalfigure>E256</informalfigure>
+ <informalfigure>PIC-INTERCAL, unsupported command</informalfigure>
+ <screen>THAT'S TOO HARD FOR MY TINY BRAIN
+</screen>Some commands simply aren't available in <abbrev>PIC-INTERCAL</abbrev>. I mean,<acronym>PIC</acronym>s generally have less than a kilobyte of memory; you're notgoing to be able to use some of the more confusing language featureswith that sort of resource limitation. The solution is to replace theaffected command, or to not give the <option>-P</option> option(see -P) if you didn't mean to compile as <abbrev>PIC-INTERCAL</abbrev>in the first place.</variablelist>
+ </indexterm><indexterm>E275
+ <variablelist><inlinemediaobject name="E275"></inlinemediaobject>
+ <informalfigure>E275</informalfigure>
+ <informalfigure>overflow, over onespot</informalfigure>
+ <informalfigure>overflow, over 16 bits</informalfigure>
+ <informalfigure>onespot overflow</informalfigure>
+ <informalfigure>16 bit overflow</informalfigure>
+ <screen>DON'T BYTE OFF MORE THAN YOU CAN CHEW
+</screen>This error happens when there is an attempt to store a twospot value ina onespot variable. The actual size of the value is what matters whencounting its spots; so you can store the output of a mingle in a onespotvariable if it happens to be less than or equal to 65535, for instance.(This is not necessarily the case in versions of <acronym>INTERCAL</acronym> other than<abbrev>C-INTERCAL</abbrev>, though, so you have to be careful with portability when doingthis.)</variablelist>
+ </indexterm><indexterm>E277
+ <variablelist><inlinemediaobject name="E277"></inlinemediaobject>
+ <informalfigure>E277</informalfigure>
+ <informalfigure>reverse assignment, impossible</informalfigure>
+ <informalfigure>reverse assignment, error</informalfigure>
+ <informalfigure>operand overloading, impossible</informalfigure>
+ <informalfigure>impossible reverse assignment</informalfigure>
+ <screen>YOU CAN ONLY DISTORT THE LAWS OF MATHEMATICS SO FAR
+</screen>Reverse assignments are not always mathematically possible. Also,sometimes they require changing the value of a constant; this is onlylegal if you specifically specified that it was legal by using the<option>-v</option> option. In the case of an impossible reverse assignment(including a situation in which operand overloading causes a reverseassignment to happen), this error happens at runtime.</variablelist>
+ </indexterm><indexterm>E281
+ <variablelist><inlinemediaobject name="E281"></inlinemediaobject>
+ <informalfigure>E281</informalfigure>
+ <informalfigure>spark, nesting limit</informalfigure>
+ <informalfigure>ears, nesting limit</informalfigure>
+ <informalfigure>rabbit-ears, nesting limit</informalfigure>
+ <informalfigure>nesting limit</informalfigure>
+ <informalfigure>SENESTMAX</informalfigure>
+ <screen>THAT MUCH QUOTATION AMOUNTS TO PLAGIARISM
+</screen>There is a limit of 256 on the number of nested spark/ears groupsallowed. If you somehow manage to exceed that limit, that will causethis error. Try breaking the expression up into smaller expressions.(The limit is trivial to increase by changing <literal>SENESTMAX</literal> in<filename>ick.h</filename>; if you ever actually come across a program that hits thelimit but wasn't designed to, just email the maintainer to request ahigher limit.)</variablelist>
+ </indexterm><indexterm>E333
+ <variablelist><inlinemediaobject name="E333"></inlinemediaobject>
+ <informalfigure>E333</informalfigure>
+ <informalfigure>variables, limit</informalfigure>
+ <screen>YOU CAN'T HAVE EVERYTHING, WHERE WOULD YOU PUT IT?
+</screen>Your program references so many variables that the compiler couldn'tcope. This error is unlikely to ever happen; if it does, try reducingthe number of variables you use by combining some into arrays. This isa compile-time error.</variablelist>
+ </indexterm><indexterm>E404
+ <variablelist><inlinemediaobject name="E404"></inlinemediaobject>
+ <informalfigure>E404</informalfigure>
+ <informalfigure><literal>GO BACK</literal>, no choicepoint</informalfigure>
+ <informalfigure><literal>GO AHEAD</literal>, no choicepoint</informalfigure>
+ <screen>I'M ALL OUT OF CHOICES!
+</screen>Your program asked that a choicepoint be backtracked to or removed, butthere aren't any choicepoints at the moment. This runtime error usuallyindicates a logic mistake in your program. In backtracking programstranslated from other backtracking languages, this indicates that theprogram has failed.</variablelist>
+ </indexterm><indexterm>E405
+ <variablelist><inlinemediaobject name="E405"></inlinemediaobject>
+ <informalfigure>E405</informalfigure>
+ <informalfigure>multithreading, not enabled</informalfigure>
+ <informalfigure>backtracking, not enabled</informalfigure>
+ <informalfigure><literal>WHILE</literal>, not enabled</informalfigure>
+ <informalfigure><literal>MAYBE</literal>, not enabled</informalfigure>
+ <informalfigure><literal>GO AHEAD</literal>, not enabled</informalfigure>
+ <informalfigure><literal>GO BACK</literal>, not enabled</informalfigure>
+ <screen>PROGRAM REJECTED FOR MENTAL HEALTH REASONS
+</screen>Your program used a construct that only makes sense when multithreadingor backtracking (<literal>WHILE</literal>, <literal>MAYBE</literal>, <literal>GO BACK</literal>, or <literal>GOAHEAD</literal>), but you didn't specify the <option>-m</option> option (see ). Ifyou meant to write a multithreaded or backtracking program, just givethat option; if you didn't, be careful what words you use in comments!This error happens at compile-time.</variablelist>
+ </indexterm><indexterm>E436
+ <variablelist><inlinemediaobject name="E436"></inlinemediaobject>
+ <informalfigure>E436</informalfigure>
+ <informalfigure><literal>RETRIEVE</literal>, without stashing</informalfigure>
+ <informalfigure>stash failure</informalfigure>
+ <screen>THROW STICK BEFORE RETRIEVING!
+</screen>In order to <literal>RETRIEVE</literal> a variable, it has to be <literal>STASH</literal>edfirst; if it isn't, then this error happens at runtime.</variablelist>
+ </indexterm><indexterm>E444
+ <variablelist><inlinemediaobject name="E444"></inlinemediaobject>
+ <informalfigure>E444</informalfigure>
+ <informalfigure><literal>COME FROM</literal>, no target</informalfigure>
+ <informalfigure><literal>NEXT FROM</literal>, no target</informalfigure>
+ <screen>IT CAME FROM BEYOND SPACE
+</screen>A <literal>COME FROM</literal> aiming at a line label — as opposed to a computed<literal>COME FROM</literal>, which is allowed to be pointing at a nonexistent line— must point to a valid line label. The same applies to <literal>NEXTFROM</literal>. This error happens at compile time if a nonexistent line label isfound in one of these contexts.</variablelist>
+ </indexterm><indexterm>E533
+ <variablelist><inlinemediaobject name="E533"></inlinemediaobject>
+ <informalfigure>E533</informalfigure>
+ <informalfigure>overflow, over twospot</informalfigure>
+ <informalfigure>overflow, over 32 bits</informalfigure>
+ <informalfigure>twospot overflow</informalfigure>
+ <informalfigure>32 bit overflow</informalfigure>
+ <screen>YOU WANT MAYBE WE SHOULD IMPLEMENT 64-BIT VARIABLES?
+</screen>This error is like E275 (see ), but applies when an attempt ismade at runtime to store a threespot value (or even a fourspot ormorespot value) in a twospot variable, or a threespot or greater valueis produced as an intermediate during a calculation (for instance by amingle operation). No values above twospot are allowed at any pointduring an <acronym>INTERCAL</acronym> program; if you want to process higher numbers, youhave to figure out a different way of storing them.</variablelist>
+ </indexterm><indexterm>E555
+ <variablelist><inlinemediaobject name="E555"></inlinemediaobject>
+ <informalfigure>E555</informalfigure>
+ <informalfigure><literal>COME FROM</literal>, ambiguity</informalfigure>
+ <screen>FLOW DIAGRAM IS EXCESSIVELY CONNECTED
+</screen>Aiming two <literal>COME FROM</literal>s at the same line only makes sense in amultithreaded program. In a non-multithread program, doing that willcause this error at compile time (if neither <literal>COME FROM</literal> iscomputed) or at run time (if the command that has just finished runningis simultaneously the target of two or more <literal>COME FROM</literal>s). Thiseither indicates an error in your program or that you've forgotten touse the <option>-m</option> option (see ) if you are actually trying tosplit the program into two threads.</variablelist>
+ </indexterm><indexterm>E562
+ <variablelist><inlinemediaobject name="E562"></inlinemediaobject>
+ <informalfigure>E562</informalfigure>
+ <informalfigure>input, EOF</informalfigure>
+ <informalfigure>EOF</informalfigure>
+ <informalfigure>end of file</informalfigure>
+ <screen>I DO NOT COMPUTE
+</screen>The program asked for input, but for some reason it wasn't available.(This is a runtime error, obviously.) The error may happen because theinput is being piped in from a command or file which has reachedend-of-file, or because the user typed <userinput><keycap>CTRL</keycap>-<keycap>D</keycap></userinput>(UNIX/Linux) or <userinput><keycap>CTRL</keycap>-<keycap>Z</keycap></userinput> (DOS/Windows) while the programwas trying to <literal>WRITE IN</literal> some data.</variablelist>
+ </indexterm><indexterm>E579
+ <variablelist><inlinemediaobject name="E579"></inlinemediaobject>
+ <informalfigure>E579</informalfigure>
+ <informalfigure>input, invalid</informalfigure>
+ <screen>WHAT BASE AND/OR LANGUAGE INCLUDES <replaceable>string</replaceable>?
+</screen>When reading spelt-out-digit input, the input didn't seem to be a validdigit in English, Sanskrit, Basque, Tagalog, Classical Nahuatl,Georgian, Kwakiutl, Volapük, or Latin. This seems to have languagescovered pretty well; what on earth were you using, or did you just makea spelling mistake?</variablelist>
+ </indexterm><indexterm>E621
+ <variablelist><inlinemediaobject name="E621"></inlinemediaobject>
+ <informalfigure>E621</informalfigure>
+ <informalfigure><literal>RESUME</literal>, by 0</informalfigure>
+ <screen>ERROR TYPE 621 ENCOUNTERED
+</screen>The compiler encountered error E621 (see ). This happens atruntime when the program requests that no entries are removed from the<literal>NEXT</literal> stack (which is possible), but that the last entry removedshould be jumped to (which given the circumstances isn't, because noentries were removed).</variablelist>
+ </indexterm><indexterm>E632
+ <variablelist><inlinemediaobject name="E632"></inlinemediaobject>
+ <informalfigure>E632</informalfigure>
+ <screen>THE NEXT STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!
+</screen>When an attempt is made to <literal>RESUME</literal> past the end of the <literal>NEXT</literal>stack, the program ends; however, this cause the program to end in amanner other than via <literal>GIVE UP</literal> or <literal>DON'T TRY AGAIN</literal>, so anerror message must be printed, and this is that error message.</variablelist>
+ </indexterm><indexterm>E633
+ <variablelist><inlinemediaobject name="E633"></inlinemediaobject>
+ <informalfigure>E633</informalfigure>
+ <screen>PROGRAM FELL OFF THE EDGE
+</screen>You can't just let execution run off the end of the program. At least,that is, if it doesn't end with <literal>TRY AGAIN</literal>. An attempt to do thatcauses this error at runtime. Note that if your program references thesystem library, then it counts as being appended to your program and sothe program will run into the first line of the system library ratherthan cause this error. As it happens, the first line of the systemlibrary is a syntax error, so doing this will cause E000 (see )with the error text ‘<literal>PLEASE KNOCK BEFORE ENTERING</literal>’. There isn't anext statement to be executed with E633, so the next statement won't begiven in the error message.</variablelist>
+ </indexterm><indexterm>E652
+ <variablelist><inlinemediaobject name="E652"></inlinemediaobject>
+ <informalfigure>E652</informalfigure>
+ <informalfigure><literal>PIN</literal>, in a non-PIC program</informalfigure>
+ <screen>HOW DARE YOU INSULT ME!
+</screen>The <literal>PIN</literal> command doesn't make much sense for anything bigger thana <acronym>PIC</acronym>; using it in a non-<acronym>PIC</acronym> program causes thiserror at compile-time. Try using the normal input and output mechanismsinstead. This error may also be a clue that you are trying to compile a<abbrev>PIC-INTERCAL</abbrev> program without giving the <option>-P</option> option(see -P).</variablelist>
+ </indexterm><indexterm>E666
+ <variablelist><inlinemediaobject name="E666"></inlinemediaobject>
+ <informalfigure>E666</informalfigure>
+ <informalfigure>out of memory, during compile</informalfigure>
+ <screen>COMPILER HAS INDIGESTION
+</screen>There isn't a limit on the length of an input program other than yourcomputer's memory; if your computer does run out of memory duringcompilation, it causes this error.</variablelist>
+ </indexterm><indexterm>E774
+ <variablelist><inlinemediaobject name="E774"></inlinemediaobject>
+ <informalfigure>E774</informalfigure>
+ <informalfigure>random bug, error message</informalfigure>
+ <screen>RANDOM COMPILER BUG
+</screen>No compiler is perfect; sometimes errors just happen at random. In thiscase, the random error is E774. If you don't like the idea that yourprogram may be shot down by a random compiler bug, or you are doingsomething important, you can use the <option>-b</option> option (see ) toprevent this bug happening. (You may wonder why this bug is in there atall if it's so easily prevented. The answer is that such a bug waspresent in the original <abbrev>INTERCAL-72</abbrev> compiler, which also had an option toturn the bug off. It's also a reward for people who actually read themanual.)</variablelist>
+ </indexterm><indexterm>E777
+ <variablelist><inlinemediaobject name="E777"></inlinemediaobject>
+ <informalfigure>E777</informalfigure>
+ <informalfigure>directory problems, source file</informalfigure>
+ <informalfigure>no source file</informalfigure>
+ <screen>A SOURCE IS A SOURCE, OF COURSE, OF COURSE
+</screen>You specified a file to compile on the command line, but the compilercouldn't find or couldn't open it. This is almost certainly because youmade a typo specifying the file.</variablelist>
+ </indexterm><indexterm>E778
+ <variablelist><inlinemediaobject name="E778"></inlinemediaobject>
+ <informalfigure>E778</informalfigure>
+ <informalfigure>internal errors</informalfigure>
+ <screen>UNEXPLANED COMPILER BUG
+</screen>This should never come up, either at compile time or at run time. Itcould come up at either when an internal check by the compiler or theruntime libraries realises that something has gone badly wrong; mistakeshappen, and in such cases the mistake will have been detected. (If thishappens at compile time you can use the <option>-U</option> option(see -U) to cause the compiler to send an abort signal – whichnormally causes a core dump – when the error happens, to help debugwhat's causing it.) More often, this error comes up when the operatingsystem has noticed something impossible, like an attempt to freeallocated memory twice or to write to a null pointer, and tells thecompiler an error has occured, in which case the same response ofputting up this error happens. The point is that in all cases thiserror indicates a bug in the compiler (even if it happens at run time);in such cases, it would be very helpful if you figure out what caused itand send a bug report (see ).</variablelist>
+ </indexterm><indexterm>E810
+ <variablelist><inlinemediaobject name="E810"></inlinemediaobject>
+ <informalfigure>E810</informalfigure>
+ <informalfigure>yuk, input overflow</informalfigure>
+ <screen>ARE ONE-CHARACTER COMMANDS TOO SHORT FOR YOU?
+</screen>This is a debug-time error caused when you give too much input to thedebugger when all it wanted was to know what you wanted to do next.</variablelist>
+ </indexterm><indexterm>E811
+ <variablelist><inlinemediaobject name="E811"></inlinemediaobject>
+ <informalfigure>E811</informalfigure>
+ <informalfigure>yuk, breakpoint overflow</informalfigure>
+ <informalfigure>yuk, too many breakpoints</informalfigure>
+ <informalfigure>breakpoints, too many</informalfigure>
+ <screen>PROGRAM IS TOO BADLY BROKEN TO RUN
+</screen>There's a limit to how many breakpoints you can have in a program;you've broken the limit and therefore broken the debugger. This is adebug-time error.</variablelist>
+ </indexterm><indexterm>E888
+ <variablelist><inlinemediaobject name="E888"></inlinemediaobject>
+ <informalfigure>E888</informalfigure>
+ <screen>I HAVE NO FILE AND I MUST SCREAM
+</screen>The output file couldn't be written, maybe because the disk is full orbecause there's already a read-only file with the same name. This is acompile-time error.</variablelist>
+ </indexterm><indexterm>E991
+ <variablelist><inlinemediaobject name="E991"></inlinemediaobject>
+ <informalfigure>E991</informalfigure>
+ <informalfigure>out of memory, multithreading</informalfigure>
+ <informalfigure>out of memory, backtracking</informalfigure>
+ <informalfigure>multithreading, out of memory</informalfigure>
+ <informalfigure>backtracking, out of memory</informalfigure>
+ <screen>YOU HAVE TOO MUCH ROPE TO HANG YOURSELF
+</screen>There is no limit on the number of threads or choicepoints that you canhave in a multithreaded or backtracking program (in a program that isn'tmultithreaded or backtracking, these are obviously limited to 1 and 0respectively). However, your computer may not be able to cope; if itruns out of memory in the multithreader, it will cause this error atruntime.</variablelist>
+ </indexterm><indexterm>E993
+ <variablelist><inlinemediaobject name="E993"></inlinemediaobject>
+ <informalfigure>E993</informalfigure>
+ <informalfigure><literal>TRY AGAIN</literal>, not last</informalfigure>
+ <screen>I GAVE UP LONG AGO
+</screen><literal>TRY AGAIN</literal> has to be the last command in a program, if it's thereat all; you can't even follow it by comments, not even if you know inadvance that they won't be <literal>REINSTATE</literal>d. This error happens atcompile time if a command is found after a <literal>TRY AGAIN</literal>.</variablelist>
+ </indexterm><indexterm>E995
+ <variablelist><inlinemediaobject name="E995"></inlinemediaobject>
+ <informalfigure>E995</informalfigure>
+ <screen>DO YOU REALLY EXPECT ME TO HAVE IMPLEMENTED THAT?
+</screen>Some parts of the code haven't been written yet. There ought to be noway to cause those to actually run; however, if you do somehow find away to cause them to run, they will cause this error at compile time.</variablelist>
+ </indexterm><indexterm>E997
+ <variablelist><inlinemediaobject name="E997"></inlinemediaobject>
+ <informalfigure>E997</informalfigure>
+ <informalfigure>whirlpool, in base 2</informalfigure>
+ <informalfigure>sharkfin, in base 2</informalfigure>
+ <informalfigure>TriINTERCAL, operators in base 2</informalfigure>
+ <screen>ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR
+</screen>Some operators (such as whirlpool (<literal>@</literal>) and sharkfin (<literal>^</literal>))only make sense in <abbrev>TriINTERCAL</abbrev> programs, and some have a minimumbase in which they make sense. This error happens at compile-time ifyou try to use an operator that conflicts with the base you're in (suchas using <abbrev>TriINTERCAL</abbrev> operators in an <acronym>INTERCAL</acronym> program in thedefault base 2).</variablelist>
+ </indexterm><indexterm>E999
+ <variablelist><inlinemediaobject name="E999"></inlinemediaobject>
+ <informalfigure>E999</informalfigure>
+ <informalfigure>skeleton file, errors</informalfigure>
+ <screen>NO SKELETON IN MY CLOSET, WOE IS ME!
+</screen>The skeleton file <filename>ick-wrap.c</filename> or <filename>pickwrap.c</filename> is needed to beable to compile <acronym>INTERCAL</acronym> to C. If the compiler can't find it, it willgive this error message. This indicates a problem with the way thecompiler has been installed; try using the <option>-u</option> option(see ) to find out where it's looking (you may be able to place acopy of the skeleton file in one of those places).</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+
+ <sect1 label="3.2" id="Warnings">
+ <para>Warnings</para>
+ <informalfigure>warnings</informalfigure>
+ <informalfigure><command>ick</command>, warnings</informalfigure>
+ <para>This is a list of the warnings stored in the warning database.
+Warnings only come up when the <option>-l</option> option (see ) is
+given; even then, some of the warnings are not currently implemented
+and therefore will never come up.</para>
+ <term><indexterm>W016
+ <variablelist><inlinemediaobject name="W016"></inlinemediaobject>
+ <informalfigure>W016</informalfigure>
+ <screen>DON'T TYPE THAT SO HASTILY
+</screen>The positional precedence rules for unary operators are somewhatcomplicated, and it's easy to make a mistake. This warning is meant todetect such mistakes, but is not currently implemented.</variablelist>
+ </indexterm><indexterm>W018
+ <variablelist><inlinemediaobject name="W018"></inlinemediaobject>
+ <informalfigure>W018</informalfigure>
+ <screen>THAT WAS MEANT TO BE A JOKE
+</screen>If an <acronym>INTERCAL</acronym> expression has been translated from another language suchas C, the optimiser is generally capable of translating it back intosomething similar to the original, at least in base 2. When afteroptimisation there are still <acronym>INTERCAL</acronym> operators left in an expression,then this warning is produced. (Therefore, it's likely to come up quitea lot if optimisation isn't used!) The system library produces some ofthese warnings (you can tell if a warning has come up in the systemlibrary because you'll get a line number after the end of your program).</variablelist>
+ </indexterm><indexterm>W112
+ <variablelist><inlinemediaobject name="W112"></inlinemediaobject>
+ <informalfigure>W112</informalfigure>
+ <informalfigure>warnings, non-INTERCAL-72</informalfigure>
+ <informalfigure>non-INTERCAL-72 warning</informalfigure>
+ <screen>THAT RELIES ON THE NEW WORLD ORDER
+</screen>This warning comes up whenever the compiler recognises that you've addedsome code that didn't exist in <abbrev>INTERCAL-72</abbrev>. This allows you to checkwhether your code is valid <abbrev>INTERCAL-72</abbrev> (although <option>-t</option> (see ) ismore useful for that); it also warns you that code might not be portable(because <abbrev>INTERCAL-72</abbrev> is implemented by most <acronym>INTERCAL</acronym> compilers, but morerecent language features may not be).</variablelist>
+ </indexterm><indexterm>W128
+ <variablelist><inlinemediaobject name="W128"></inlinemediaobject>
+ <informalfigure>W128</informalfigure>
+ <screen>SYSLIB IS OPTIMIZED FOR OBUSCATION
+</screen>There is an idiom used in the system library that does a right-shift byselecting alternate bits from a twospot number and then mingling themthe other way round. A rightshift can much more easily be done with asingle rightshift, so this is a silly way to do it, and this warningwarns that this idiom was used. However, the present optimizer isincapable of recognising whether this problem exists or not, so thewarning is not currently implemented.</variablelist>
+ </indexterm><indexterm>W276
+ <variablelist><inlinemediaobject name="W276"></inlinemediaobject>
+ <informalfigure>W276</informalfigure>
+ <informalfigure>onespot, overflow warning</informalfigure>
+ <informalfigure>overflow, warning</informalfigure>
+ <screen>YOU CAN'T EXPECT ME TO CHECK BACK THAT FAR
+</screen>It's an error to assign a twospot value (a value over 65535) to aonespot variable, or to use it as an argument to a mingle. If theoptimizer can't guarantee at compile time that there won't be anoverflow, it issues this warning. (Note that this doesn't necessarilymean there's a problem — for instance, the system library generatessome of these warnings — only that the optimiser couldn't work out forsure that there wasn't a problem.)</variablelist>
+ </indexterm><indexterm>W239
+ <variablelist><inlinemediaobject name="W239"></inlinemediaobject>
+ <informalfigure>W239</informalfigure>
+ <screen>WARNING HANDLER PRINTED SNIDE REMARK
+</screen>Your code looks like it's trying to assign 0 to an array, giving it nodimension; this is an error. This warning is produced at compile timeif it looks like a line in your code will cause this error, but it isn'tnecessarily an error because that line of code might never be executed.</variablelist>
+ </indexterm><indexterm>W278
+ <variablelist><inlinemediaobject name="W278"></inlinemediaobject>
+ <informalfigure>W278</informalfigure>
+ <screen>FROM A CONTRADICTION, ANYTHING FOLLOWS
+</screen>It's sometimes impossible to reverse an assignment (a reverseassignment can happen if the <option>-v</option> option (see ) is usedand an expression is placed on the left of an assignment, or inoperand overloading); if the compiler detects that a reversal failureis inevitable, it will cause this warning. Note that this doesn'talways cause an error, because the relevant code might never beexecuted.</variablelist>
+ </indexterm><indexterm>W534
+ <variablelist><inlinemediaobject name="W534"></inlinemediaobject>
+ <informalfigure>W534</informalfigure>
+ <informalfigure>unary operators, portability</informalfigure>
+ <informalfigure>portability, unary operators</informalfigure>
+ <screen>KEEP LOOKING AT THE TOP BIT
+</screen><abbrev>C-INTERCAL</abbrev> uses a slightly different typing mechanism to some other <acronym>INTERCAL</acronym>compilers; types are calculated at compile time rather than run time.This only makes a difference in some cases involving unary operators.It's impossible to detect at compile time for certain whether such acase has come up or not, but if the compiler or optimizer thinks thatsuch a case might have come up, it will issue this warning.</variablelist>
+ </indexterm><indexterm>W622
+ <variablelist><inlinemediaobject name="W622"></inlinemediaobject>
+ <informalfigure>W622</informalfigure>
+ <screen>WARNING TYPE 622 ENCOUNTERED
+</screen>Your code looks like it's trying to resume by 0; this is an error. Thiswarning is produced at compile time if it looks like a line in your codewill cause this error, but it isn't necessarily an error because thatline of code might never be executed.</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+ </chapter>
+
+ <chapter label="4" id="The-yuk-debugger">
+ <para>The yuk debugger</para>
+ <informalfigure>yuk</informalfigure>
+ <informalfigure>debugging, yuk</informalfigure>
+ <informalfigure>debugging, runtime</informalfigure>
+ <informalfigure>runtime debugger</informalfigure>
+ <para><inlinemediaobject name="yuk"></inlinemediaobject></para>
+ <para>The <abbrev>C-INTERCAL</abbrev> distribution contains a runtime debugger called `yuk'.
+Unlike most other debuggers, it is stored as object code rather than as
+an executable, and it is compiled into the code rather than operating on
+it. To debug code, add <option>-y</option> (see ) to the command line of
+<command>ick</command> when invoking it; that tells it to compile the debugger
+into the code and then execute the resulting combination. (The
+resulting hybrid debugger/input executable is deleted afterwards; this
+is to prevent it being run by mistake, and to prevent spreading the
+debugger's licence onto the code it was compiled with.)</para>
+ <para>yuk can also be used as a profiler using the <option>-p</option> option
+(see ); this produces a file <filename>yuk.out</filename> containing information
+on how much time was spent running each command in your program, and
+does not prompt for debugger commands.</para>
+ <para>Note that some command line arguments are incompatible with the
+debugger, such as <option>-m</option> and <option>-f</option>. In particular, this
+means that multithreaded programs and programs that use backtracking
+cannot be debugged using this method; the <option>+printflow</option> option
+(see ) to a compiled program may or may not be useful for
+debugging multithreaded programs.</para>
+ <para>When the debugger starts, it will print a copyright message and a
+message on how to access online help; then you can enter commands to
+run/debug the program. The debugger will show a command prompt,
+‘<literal>yuk007 </literal>’, to let you know you can input a command.</para>
+ <informalfigure>yuk, commands</informalfigure>
+ <para>Here are the commands available. Commands are single characters
+followed by newlines, or followed by a line number (in decimal) and a
+newline or a variable name (a <literal>.</literal>, <literal>,</literal>, <literal>:</literal> or <literal>;</literal>
+followed by a number in decimal; note that some commands only allow
+onespot and twospot variables as arguments).</para>
+ <colspec>
+ <thead cols="2">
+ <tbody colwidth="15*"></tbody>
+ <tbody colwidth="85*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo>Command</bookinfo>
+ <bookinfo>Description</bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>a<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+All non-abstained commands on line <replaceable>LINE</replaceable> become abstained from
+once.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>b<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+A breakpoint is set on line <replaceable>LINE</replaceable>. The breakpoint causes execution
+with ‘<literal>c</literal>’ to stop when it is reached.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>c</bookinfo>
+ <bookinfo>
+The program is run until it ends (which also ends the debugger) or a
+breakpoint is reached.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>d<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+Any breakpoint that may be on line <replaceable>LINE</replaceable> is removed.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>e<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+An explanation of the main expression in each command on line <replaceable>LINE</replaceable>
+is printed to the screen. The explanation is in the same format as the
+format produced by <option>-h</option> (see ) and shows what the optimiser
+optimised the expression to (or the original expression if the optimiser
+wasn't used).</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>f<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+Removes the effect of the ‘<literal>m</literal>’ command on line <replaceable>LINE</replaceable>.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>g<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+Causes the current command to be the first command on <replaceable>LINE</replaceable> (if not
+on that line already) or the next command on <replaceable>LINE</replaceable>, as if that line
+was <literal>NEXT</literal>ed to and then that <literal>NEXT</literal> stack item was forgotten.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>h</bookinfo>
+ <bookinfo>
+Lists 10 lines either side of the current line; if there aren't 10 lines
+to one or the other side of the current line, instead more lines will be
+shown on the other side to compensate, if available.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>i<replaceable>VAR</replaceable></bookinfo>
+ <bookinfo>
+Causes variable <replaceable>VAR</replaceable> to become <literal>IGNORE</literal>d, making it read-only.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>j<replaceable>VAR</replaceable></bookinfo>
+ <bookinfo>
+Causes variable <replaceable>VAR</replaceable> to become <literal>REMEMBER</literal>ed, making it no
+longer read-only.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>k</bookinfo>
+ <bookinfo>
+Continues executing commands until the <command>NEXT</command> stack is the same
+size or smaller than it was before. In other words, if the current
+command is not a <command>NEXT</command> and doesn't have a <command>NEXT FROM</command>
+aiming at it, one command is executed; but if a <command>NEXT</command> does
+happen, execution will continue until that <command>NEXT</command> returns or is
+forgotten. A breakpoint or the end of the program also end this.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>l<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+Lists 10 lines of source code either side of line <replaceable>LINE</replaceable>, the same
+way as with ‘<literal>h</literal>’, but using a line stated in the command rather than
+the current line.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>m<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+Produces a message onscreen every time a command on line <replaceable>LINE</replaceable> is
+executed, but without interrupting the program.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>n</bookinfo>
+ <bookinfo>
+Show the <command>NEXT</command> stack on the screen.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>o</bookinfo>
+ <bookinfo>
+Continue executing commands until the <command>NEXT</command> stack is smaller
+than it was before. If you are using <command>NEXT</command>s like procedures,
+then this effectively means that the procedure will run until it
+returns. A breakpoint or the end of the program also end this.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>p</bookinfo>
+ <bookinfo>
+Displays the value of all onespot and twospot variables.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>q</bookinfo>
+ <bookinfo>
+Aborts the current program and exits the debugger.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>r<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+Reinstates once all abstained commands on line <replaceable>LINE</replaceable>.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>s</bookinfo>
+ <bookinfo>
+Executes one command.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>t</bookinfo>
+ <bookinfo>
+Continues execution until the end of the program or a breakpoint: each
+command that executes is displayed while this command is running.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>u<replaceable>LINE</replaceable></bookinfo>
+ <bookinfo>
+Continues execution of the program until just before a command on line
+<replaceable>LINE</replaceable> is run (or a breakpoint or the end of the program).</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>v<replaceable>VAR</replaceable></bookinfo>
+ <bookinfo>
+Adds a `view' on variable <replaceable>VAR</replaceable> (which must be onespot or twospot),
+causing its value to be displayed on the screen whenever a command is
+printed on screen (for instance, because the command has just been
+stepped past, or due to the ‘<literal>m</literal>’ or ‘<literal>t</literal>’ commands).</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>w</bookinfo>
+ <bookinfo>
+Displays the current line and current command onscreen.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>x<replaceable>VAR</replaceable></bookinfo>
+ <bookinfo>
+Removes any view and any action that may be associated with it on
+variable <replaceable>VAR</replaceable> (which must be onespot or twospot).</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>y<replaceable>VAR</replaceable></bookinfo>
+ <bookinfo>
+Adds a view on variable <replaceable>VAR</replaceable>; also causes a break, as if a
+breakpoint was reached, whenever the value of that variable changes.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>z<replaceable>VAR</replaceable></bookinfo>
+ <bookinfo>
+Adds a view on variable <replaceable>VAR</replaceable>; also causes a break, as if a
+breakpoint was reached, whenever that variable's value becomes 0.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><replaceable>VAR</replaceable></bookinfo>
+ <bookinfo>
+A onespot or twospot variable written by itself prints out the value of
+that variable.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><<replaceable>VAR</replaceable></bookinfo>
+ <bookinfo>
+<command>WRITEs IN</command> a new value for variable <replaceable>VAR</replaceable>. Note that input
+must be in the normal ‘<literal>ONE TWO THREE</literal>’ format; input in any other
+format will cause error E579 (see ) and as that is a fatal
+error, the debugger and program it's debugging will end.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>*</bookinfo>
+ <bookinfo>
+Displays the license conditions under which <command>ick</command> is
+distributed.</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>?</bookinfo>
+ <bookinfo>
+Displays a summary of what each command does. (‘<literal>@</literal>’ does the same
+thing.)</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>While the code is executing (for instance, during a ‘<literal>c</literal>’, ‘<literal>k</literal>’,
+‘<literal>o</literal>’, ‘<literal>t</literal>’ or ‘<literal>u</literal>’ command), it's possible to interrupt it
+with <userinput><keycap>CTRL</keycap>-<keycap>C</keycap></userinput> (on UNIX/Linux) or
+<userinput><keycap>CTRL</keycap>-<keycap>BREAK</keycap></userinput> (on Windows/DOS); this will cause the
+current command to finish running and the debugger prompt to come back
+up.</para>
+ </chapter>
+
+ <chapter label="" xreflabel="PART II: THE INTERCAL LANGUAGE">
+ <para>PART II: THE <acronym>INTERCAL</acronym> LANGUAGE</para>
+ </chapter>
+
+ <chapter label="5" id="Syntax">
+ <para>Syntax</para>
+ <informalfigure>syntax, INTERCAL</informalfigure>
+ <informalfigure>INTERCAL, syntax</informalfigure>
+ <para><acronym>INTERCAL</acronym> programs consist of a list of statements. Execution of a
+program starts with its first statement; generally speaking each
+statement runs after the previous statement, although many situations
+can change this.</para>
+ <para>Whitespace is generally insignificant in <acronym>INTERCAL</acronym> programs; it cannot be
+added in the middle of a keyword (unless the keyword contains whitespace
+itself) or inside a decimal number, but it can be added more or less
+anywhere else, and it can be removed from anywhere in the program as
+well.</para>
+ <para>An <acronym>INTERCAL</acronym> statement consists of an optional line label, a statement
+identifier, an optional execution chance, the statement itself
+(see ), and optionally <literal>ONCE</literal> or <literal>AGAIN</literal>.</para>
+
+ <sect1 label="5.1" id="Princeton-and-Atari-Syntax">
+ <para>Princeton and Atari Syntax</para>
+ <informalfigure>syntax, dialects</informalfigure>
+ <informalfigure>dialects of syntax</informalfigure>
+ <informalfigure>character sets</informalfigure>
+ <para>The history of <acronym>INTERCAL</acronym> is plagued with multiple syntaxes and character
+sets. The result has settled down with two versions of the syntax;
+the original Princeton syntax, and the Atari syntax (which is more
+suited to the operating systems of today).</para>
+ <informalfigure>syntax, Princeton</informalfigure>
+ <informalfigure>Princeton syntax</informalfigure>
+ <bridgehead renderas="sect2">Princeton syntax</bridgehead>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>some versions</bookinfo>
+ <bookinfo>version 0.18+</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The original <abbrev>INTERCAL-72</abbrev> compiler was the Princeton compiler, which
+introduced what has become known as the Princeton syntax for <acronym>INTERCAL</acronym>;
+this is the syntax used in the original manual, for instance, and can
+be considered to be the `original' or `official' <acronym>INTERCAL</acronym> syntax. It
+is notable for containing various characters not found in some
+character sets; for instance, it writes the operator for mingle as a
+cent sign (known as `change'). The other operator that often causes
+problems is the bookworm operator ‘<literal>V</literal>’, backspace, ‘<literal>-</literal>’, which
+is used for exclusive-or; the backspace can cause problems on some
+systems (which was probably the original intention). This syntax is
+also the default syntax in the <abbrev>CLC-INTERCAL</abbrev> compiler, which is the <wordasword>de
+facto</wordasword> standard for expanding the Princeton syntax to modern <acronym>INTERCAL</acronym>
+features that are not found in <abbrev>INTERCAL-72</abbrev>; however, it does not appear to
+have been used as the default syntax in any other compilers.
+Nowadays, there are other ways to write the required characters than
+using backspace; for instance, the cent sign appears in Latin-1 and
+UTF-8, and there are various characters that approximate bookworms
+(for instance, <abbrev>CLC-INTERCAL</abbrev> uses the Latin-1 yen symbol for this, which
+just to make things confusing, refers to a mingle in modern Atari
+syntax).</para>
+ <informalfigure>syntax, Atari</informalfigure>
+ <informalfigure>Atari syntax</informalfigure>
+ <bridgehead renderas="sect2">Atari syntax</bridgehead>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>some versions</bookinfo>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>version 0.05+</bookinfo>
+ <bookinfo>yes</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The other main syntax is the Atari syntax, so called because it was
+originally used by the “Atari implementation” of <abbrev>INTERCAL-72</abbrev>. It is not
+clear why the implementation was given this name, because the authors
+of the implementation are not known; it is not clear whether it has
+any connection with Atari other than running on an Atari computer, for
+instance. The syntax was designed to work better on ASCII-based
+systems, by avoiding the change character (although it can still be
+written as ‘<literal>c</literal>’, backspace, ‘<literal>/</literal>’, which the Atari compiler
+documentation claims that the Princeton compiler supported) in favour
+of a `big money' character (‘<literal>$</literal>’), and using the `what' (‘<literal>?</literal>’)
+as an alternative character for exclusive-or. This is the syntax that
+<abbrev>C-INTERCAL</abbrev> and <abbrev>J-INTERCAL</abbrev> have always used, and is the one most commonly used
+for communicating <acronym>INTERCAL</acronym> programs on Usenet and other similar fora
+(where ASCII is one of the most reliable-to-send character sets). It
+is also the syntax used for examples in this manual, for much the same
+reason. The Atari syntax for constructs more modern than <abbrev>INTERCAL-72</abbrev> is
+normally taken to be that used by the <abbrev>C-INTERCAL</abbrev> compiler, because it is
+the only Atari-syntax-based compiler that contains non-<abbrev>INTERCAL-72</abbrev>
+constructs that actually need their own notation.</para>
+ </sect1>
+
+ <sect1 label="5.2" id="Line-Labels">
+ <para>Line Labels</para>
+ <informalfigure>line label</informalfigure>
+ <informalfigure>line number</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The first part of an <acronym>INTERCAL</acronym> statement is a line label that specifies
+what its line number is. This is optional; it's allowed to have a
+statement without a line number, although that prevents other commands
+referring to it by number. Line numbers must be constants, and unique
+within the program. However, they do not have to be in order; unlike
+some other languages with line numbers, a line with a higher number can
+come earlier in the program than a line with a lower number, and the
+numbers don't affect the order in which commands are executed.</para>
+ <para>A line label is a integer expressed in decimal within a wax/wane pair
+(<literal>(</literal> and <literal>)</literal>). For instance, this is a valid line label:</para>
+ <programlisting>
+(1000)
+</programlisting>
+ <para>Note that line numbers from 1000 to 1999 are used by the system library,
+so using them within your own programs may produce unexpected errors if
+the system library is included. Apart from this, line numbers from 1 to
+65535 are allowed.</para>
+ <para>It has become reasonably customary for people writing <acronym>INTERCAL</acronym> libraries
+to pick a range of 1000 line numbers (for instance, 3000 to 3999) and
+stick to that range for all line numbers used in the program (apart from
+when calling the system library), so if you want to write an <acronym>INTERCAL</acronym>
+library, it may be a good idea to look at the existing libraries (in the
+<filename>pit/lib</filename> directory in the <abbrev>C-INTERCAL</abbrev> distribution) and choose a range
+of numbers that nobody else has used. If you aren't writing a library,
+it may be a good idea to avoid such number ranges (that is, use only
+line numbers below 1000 or very high numbers that are unlikely to be
+used by libraries in the future), so that you can easily add libraries
+to your program without renumbering in the future.</para>
+ </sect1>
+
+ <sect1 label="5.3" id="Statement-Identifiers">
+ <para>Statement Identifiers</para>
+ <informalfigure>statement identifier</informalfigure>
+ <informalfigure>DO</informalfigure>
+ <informalfigure>PLEASE</informalfigure>
+ <informalfigure>NOT</informalfigure>
+ <informalfigure>N'T</informalfigure>
+ <informalfigure>abstain, at program start</informalfigure>
+ <informalfigure>reinstate, at program start</informalfigure>
+ <informalfigure>initial abstention</informalfigure>
+ <informalfigure>abstained state</informalfigure>
+ <informalfigure>reinstated state</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>After the line label (if a statement has one) comes the statement
+identifier, which marks where the statement starts. Either the label or
+the statement identifier, whichever one comes first, marks where the
+preceding statement finishes.</para>
+ <para><inlinemediaobject name="DO"></inlinemediaobject><inlinemediaobject name="PLEASE"></inlinemediaobject></para>
+ <para>The main statement identifier is <literal>DO</literal>. It also has two synonyms,
+<literal>PLEASE</literal> and <literal>PLEASE DO</literal>; these synonyms are the 'polite'
+forms of statement identifiers. Although the three identifiers have the
+same meaning, using either polite or non-polite identifiers too much can
+cause an error; the correct proportion is approximately 3 non-polite
+identifiers for every polite identifier used. None of these identifiers
+actually does anything else apart from marking where the statement
+starts; they leave the statements in the default `reinstated' state.</para>
+ <para><inlinemediaobject name="NOT"></inlinemediaobject><inlinemediaobject name="N'T"></inlinemediaobject></para>
+ <para>Adding <literal>NOT</literal> or <literal>N'T</literal> to the end of any of these identifiers,
+to create a statement identifier such as <literal>DO NOT</literal> or <literal>PLEASE
+DON'T</literal>, also creates a valid statement identifier. These differ in
+meanings from the previous set of identifiers, though; they cause the
+statement they precede to not be executed by default; that is, the
+command will be skipped during execution (this is known as the
+`abstained' state). This applies even if the command in question is in
+fact a syntax error, thus causing this to be a useful method of writing
+comments. One common idiom is to write code like this:</para>
+ <programlisting>
+PLEASE NOTE: This is a comment.
+</programlisting>
+ <para>The statement identifier (<literal>PLEASE NOT</literal>) is the only part of this
+statement that is valid <acronym>INTERCAL</acronym>; however, because the statement
+identifier is in the negated form that contains <literal>NOT</literal>, the syntax
+error won't be executed, and therefore this is a valid statement. (In
+<acronym>INTERCAL</acronym>, syntax errors happen at runtime, so a program containing a
+statement like <literal>DOUBT THIS WILL WORK</literal> will still compile, and will
+not end due to the syntax error unless that statement is actually
+executed. See .)</para>
+ <para>The <literal>ABSTAIN</literal> and <literal>REINSTATE</literal> statements can override the
+<literal>NOT</literal> or otherwise on a statement identifier; see .</para>
+ <para>In backtracking programs, <literal>MAYBE</literal> is also a valid statement
+identifier; see . It comes before the other keywords in the
+statement identifier, and an implicit <literal>DO</literal> is added if there wasn't
+one already in the statement identifier (so <literal>MAYBE</literal>, <literal>MAYBE
+DO</literal>, <literal>MAYBE DON'T</literal>, <literal>MAYBE PLEASE</literal>, and so on are all valid
+statement identifiers).</para>
+ </sect1>
+
+ <sect1 label="5.4" id="Execution-Chance">
+ <para>Execution Chance</para>
+ <informalfigure>execution chance</informalfigure>
+ <informalfigure>double-oh-seven</informalfigure>
+ <informalfigure>%</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>version 0.02+</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>It's possible to specify that a command should be run only a certain
+proportion of the time, at random. This is a rarely used feature of
+<acronym>INTERCAL</acronym>, although it is the only way to introduce randomness into a
+program. (The <abbrev>C-INTERCAL</abbrev> compiler approximates this with pseudorandomness.)
+An execution chance specification comes immediately after the statement
+identifier, but before the rest of the statement, and consists of a
+double-oh-seven (<literal>%</literal>) followed by an integer from 1 to 99
+inclusive, written in decimal; this gives the percentage chance of the
+statement running. The execution chance only acts to prevent a
+statement running when it otherwise would have run; it cannot cause a
+statement that would otherwise not have run to run. For instance, the
+statement <literal>DO %40 WRITE OUT #1</literal> has a 40% chance of writing out
+‘<literal>I</literal>’, but the statement <literal>DON'T %40 WRITE OUT #1</literal> has no chance
+of writing out <literal>I</literal> or anything else, because the <literal>N'T</literal>
+prevents it running and the double-oh-seven cannot override that.</para>
+ </sect1>
+
+ <sect1 label="5.5" id="ONCE-and-AGAIN">
+ <para>ONCE and AGAIN</para>
+ <informalfigure>ABSTAIN, self-abstaining</informalfigure>
+ <informalfigure>REINSTATE, self-reinstating</informalfigure>
+ <informalfigure>self-abstaining</informalfigure>
+ <informalfigure>self-reinstating</informalfigure>
+ <informalfigure>ONCE</informalfigure>
+ <informalfigure>AGAIN</informalfigure>
+ <para><inlinemediaobject name="ONCE"></inlinemediaobject><inlinemediaobject name="AGAIN"></inlinemediaobject></para>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.25+</bookinfo>
+ <bookinfo>no</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The last part of a statement is an optional <literal>ONCE</literal> or <literal>AGAIN</literal>.
+<literal>ONCE</literal> specifies that the statement is self-abstaining or
+self-reinstating (this will be explained below); <literal>AGAIN</literal> specifies
+that the statement should behave like it has already self-reinstated or
+self-abstained. Whether the behaviour is self-abstention or
+self-reinstatement depends on whether the statement was initially
+abstained or not; a <literal>ONCE</literal> on an initially reinstated statement or
+<literal>AGAIN</literal> on an initially abstained statement indicates a
+self-abstention, and a <literal>ONCE</literal> on an initially abstained statement
+or <literal>AGAIN</literal> on an initially reinstated statement indicates a
+self-reinstatement.</para>
+ <para>The first time a self-abstaining statement is encountered, it is
+executed as normal, but the statement is then abstained from and
+therefore will not run in future. Likewise, the first time
+self-reinstating statement is encountered, it is not executed (as is
+normal for an abstained statement), but then becomes reinstated and will
+run in future. In each of these cases, the <literal>ONCE</literal> effectively
+changes to an <literal>AGAIN</literal>; the <literal>ONCE</literal> only happens once, as might
+be expected.</para>
+ <para><literal>REINSTATING</literal> a currently abstained self-abstaining statement or
+<literal>ABSTAINING</literal> (that is, with the <literal>ABSTAIN</literal> or <literal>REINSTATE</literal>
+commands) a currently reinstated self-reinstating statement causes the
+<literal>AGAIN</literal> on the statement to change back into a <literal>ONCE</literal>, so the
+statement will again self-abstain or self-reinstate. Likewise,
+<literal>REINSTATING</literal> a currently abstained self-reinstating statement or
+<literal>ABSTAINING</literal> a currently reinstated self-abstaining statement
+causes its <literal>ONCE</literal> to turn into an <literal>AGAIN</literal>.</para>
+ <para>Historical note: <literal>ONCE</literal> was devised by Malcom Ryan as a method of
+allowing synchronisation between threads in a multithreaded program
+(<literal>ONCE</literal> is atomic with the statement it modifies, that is, there is
+no chance that threads will change between the statement and the
+<literal>ONCE</literal>). <literal>AGAIN</literal> was added to Malcom Ryan's Threaded Intercal
+standard on the suggestion of Kyle Dean, as a method of adding extra
+flexibility (and to allow the <literal>ONCE</literal>s to happen multiple times,
+which is needed to implement some multithreaded algorithms).</para>
+ </sect1>
+ </chapter>
+
+ <chapter label="6" id="Expressions">
+ <para>Expressions</para>
+ <informalfigure>expressions</informalfigure>
+ <para>Many <acronym>INTERCAL</acronym> statements take expressions as arguments. Expressions are
+made up out of operands and operators between them. Note that there is
+no operator precedence in <acronym>INTERCAL</acronym>; different compilers resolve
+ambiguities different ways, and some versions of some compilers
+(including the original <abbrev>INTERCAL-72</abbrev> compiler) will cause error messages on
+compiling or executing an ambiguous expression, so it's safest to fully
+group each expression.</para>
+
+ <sect1 label="6.1" id="Constants-and-Variables">
+ <para>Constants and Variables</para>
+ <informalfigure>constant</informalfigure>
+ <informalfigure>variable</informalfigure>
+ <informalfigure>mesh</informalfigure>
+ <informalfigure>onespot</informalfigure>
+ <informalfigure>twospot</informalfigure>
+ <informalfigure>tail</informalfigure>
+ <informalfigure>hybrid</informalfigure>
+ <informalfigure>#</informalfigure>
+ <informalfigure>.</informalfigure>
+ <informalfigure>:</informalfigure>
+ <informalfigure>,</informalfigure>
+ <informalfigure>;</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The basic operands in <acronym>INTERCAL</acronym> are constants and variables. These
+together make up what in other languages are known as `lvalues', that
+is, operands to which values can be assigned. (Constants can also be
+lvalues in <acronym>INTERCAL</acronym>, but by default <abbrev>C-INTERCAL</abbrev> turns this off because it
+carries an efficiency penalty and can be confusing; this can be turned
+on with the <option>-v</option> option (see ).)</para>
+ <para>Constants can have any integer value from 0 to 65535 inclusive; higher
+values (up to 4294967295) can be generated in programs, but cannot be
+specified literally as constants. (The usual way to work around this
+limitation is to interleave two constants together; see .) A
+constant is written as a mesh (<literal>#</literal>) followed by a number in
+decimal. At the start of the program, all constants have the same value
+as the number that identifies them; for instance, <literal>#100</literal> has 100 as
+its value, and it's strongly advised not to change the value of a
+constant during the execution of a program.</para>
+ <para>There are four types of variable: 16-bit and 32-bit unsigned integers,
+and arrays of 16-bit and 32-bit unsigned integers. These are
+represented with a spot, twospot, tail, and hybrid (<literal>.</literal>, <literal>:</literal>,
+<literal>,</literal>, and <literal>;</literal>) respectively. For this reason, integers within
+the range 0 to 65535 inclusive are known as `onespot numbers', and
+integers within the range 0 to 4294967295 inclusive are known as
+`twospot numbers'; variables with those ranges are known as onespot and
+twospot variables. (Note that arrays did not work in <abbrev>C-INTERCAL</abbrev> before
+version 0.7.)</para>
+ <para>Variables are represented with a character representing their data type,
+followed by an integer from 1 to 65535 inclusive, written in decimal.
+Non-array variables don't need to be declared before they are used; they
+automatically exist in any program that uses them. For instance,
+<literal>.1</literal> and <literal>.001</literal> are the same variable, onespot number 1.
+Array variables need to be dimensioned before they are used, by
+assigning dimensions to them; see .</para>
+ </sect1>
+
+ <sect1 label="6.2" id="Grouping-Rules">
+ <para>Grouping Rules</para>
+ <informalfigure>grouping rules</informalfigure>
+ <informalfigure>positional precedence</informalfigure>
+ <informalfigure>spark</informalfigure>
+ <informalfigure>rabbit-ears</informalfigure>
+ <informalfigure>ears</informalfigure>
+ <informalfigure>'</informalfigure>
+ <informalfigure>"</informalfigure>
+ <para>Because there are no operator precedences in <acronym>INTERCAL</acronym>, there are various
+solutions to specifying what precedences actually are.</para>
+ <term><indexterm>The portable solution
+ <variablelist>All known versions of <acronym>INTERCAL</acronym> accept the <abbrev>INTERCAL-72</abbrev> grouping rules. Thesestate that it's possible to specify that an operator takes precedence bygrouping it inside sparks (<literal>'</literal>) or rabbit-ears (<literal>"</literal>), the sameway as wax/wane pairs (parentheses) are used in other programminglanguages. <abbrev>INTERCAL-72</abbrev> and earlier <abbrev>C-INTERCAL</abbrev> versions demanded thatexpressions were grouped fully like this, and this practice is stillrecommended because it leads to portable programs and is easier tounderstand. Whether sparks or rabbit-ears (often called just `ears' forshort) are used normally doesn't matter, and programmers can use one orthe other for clarity or for aesthetic appeal. (One common technique isto use just sparks at the outermost level of grouping, just ears at thenext level, just sparks at the next level, and so on; but expressionslike <literal>''#1~#2'~"#3~#4"'~#5</literal> are completely unambiguous, at least tothe compiler.)There are, however, some complicated situations involving arrayssubscripting where it is necessary to use sparks and ears at alternatelevels, if you want to write a portable program. This limitation is in<abbrev>C-INTERCAL</abbrev> to simplify the parsing process; <abbrev>INTERCAL-72</abbrev> has the same limitation,probably for the same reason. Compare these two statements:
+ <programlisting>
+DO .1 <- ,3SUB",2SUB.1".2
+DO .1 <- ,3SUB",2SUB.1".2~.3"".4
+</programlisting>The problem is that in the first statement, the ears close a group, andin the second statement, the ears open a group, and it's impossible totell the difference without unlimited lookahead in the expression.Therefore, in similar situations (to be precise, in situations where agroup is opened inside an array subscript), it's necessary to use theother grouping character to the one that opened the current group if youwant a portable program.One final comment about sparks and rabbit-ears; if the next character inthe program is a spot, as often happens because onespot variables arecommon choices for operands, a spark and the following spot can becombined into a wow (<literal>!</literal>). Unfortunately, none of the charactersets that <abbrev>C-INTERCAL</abbrev> accepts as input (UTF-8, Latin-1, and ASCII-7) containthe rabbit character, although the Hollerith input format that <abbrev>CLC-INTERCAL</abbrev>can use does.</variablelist>
+ </indexterm><indexterm>Positional precedences: <abbrev>CLC-INTERCAL</abbrev> rules
+ <variablelist>The precedence rules used by <abbrev>CLC-INTERCAL</abbrev> for grouping when full groupingisn't used are simple to explain: the largest part of the input thatlooks like an expression is taken to be that expression. The mainpractical upshot of this is that binary operators right-associate; thatis, <literal>.1~.2~.3</literal> is equivalent to <literal>.1~'.2~.3'</literal>. <abbrev>C-INTERCAL</abbrev> versions0.26 and later also right-associate binary operators so as to producethe same results as <abbrev>CLC-INTERCAL</abbrev> rules in this situation, but as nobody hasyet tried to work out what the other implications of <abbrev>CLC-INTERCAL</abbrev> rules arethey are not emulated in <abbrev>C-INTERCAL</abbrev>, except possibly by chance.</variablelist>
+ </indexterm><indexterm>Prefix and infix unary operators
+ <variablelist><inlinemediaobject name="Prefix and infix unary operators"></inlinemediaobject>
+ <informalfigure>unary operator, prefix</informalfigure>
+ <informalfigure>unary operator, infix</informalfigure>In <abbrev>INTERCAL-72</abbrev> and versions of <abbrev>C-INTERCAL</abbrev> before 0.26, unary operators werealways in the `infix' position. (If you're confused about how you canhave an infix unary operator: they go one character inside a group thatthey apply to, or one character after the start of a constant orvariable representation; so for instance, to portably apply the unaryoperator <literal>&</literal> to the variable <literal>:1</literal>, write <literal>:&1</literal>, and toportably apply it to the expression <literal>'.1~.2'</literal>, write<literal>'&.1~.2'</literal>.) <abbrev>CLC-INTERCAL</abbrev>, and versions of <abbrev>C-INTERCAL</abbrev> from 0.26 onwards,allow the `prefix' position of a unary operator, which is just beforewhatever it applies to (as in <literal>&:1</literal>). This leads to ambiguities asto whether an operator is prefix or infix. The portable solution is, ofcourse, to use only infix operators and fully group everything, but whenwriting for recent versions of <abbrev>C-INTERCAL</abbrev>, it's possible to rely on itsgrouping rule, which is: unary operators are interpreted as infix wherepossible, but at most one infix operator is allowed to apply to eachvariable, constant, or group, and infix operators can't apply toanything else. So for instance, the <abbrev>C-INTERCAL</abbrev> <literal>'&&&.1~.2'</literal> isequivalent to the portable <literal>'&"&.&1"~.2'</literal> (or the more readableversion of this, <literal>"&'"&.&1"~.2'"</literal>, which is also portable). Ifthese rules are counter-intuitive to you, remember that this is <acronym>INTERCAL</acronym>we're talking about; note also that this rule is unique to <abbrev>C-INTERCAL</abbrev>, atleast at the time of writing, and in particular <abbrev>CLC-INTERCAL</abbrev> is likely tointerpret this expression differently.</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+
+ <sect1 label="6.3" id="Operators">
+ <para>Operators</para>
+ <informalfigure>operator</informalfigure>
+ <para>Operators are used to operate on operands, to produce more complicated
+expressions that actually calculate something rather than just fetch
+information from memory. There are two types of operators, unary and
+binary operators, which operate on one and two arguments respectively.
+Binary operators are always written between their two operands; to
+portably write a unary operator, it should be in the `infix' position,
+one character after the start of its operand; see for the full details of how to write unary operators
+portably, and how else you can use them if you aren't aiming for
+portability. This section only describes <abbrev>INTERCAL-72</abbrev> operators; many
+<acronym>INTERCAL</acronym> extensions add their own operators.</para>
+
+ <sect2 label="6.3.1" id="Mingle">
+ <para>Mingle</para>
+ <informalfigure>mingle</informalfigure>
+ <informalfigure>interleave</informalfigure>
+ <informalfigure>$</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>Mingle, or interleave, is one of the two binary operators in <abbrev>INTERCAL-72</abbrev>.
+However, different <acronym>INTERCAL</acronym> compilers represent it in different ways, so
+it is impossible to write a mingle in a program completely portably,
+because it differs between Princeton and Atari syntax, and worse, the
+sequence of character codes needed to represent it in each syntax has
+varied from compiler to compiler.</para>
+ <para>The original <abbrev>INTERCAL-72</abbrev> compiler (the Princeton compiler) used the
+'change' (cent) character for a mingle, represented as <literal>c</literal>,
+backspace, <literal>/</literal>. (By the way, this is still the most portable way
+to write a mingle; both <abbrev>C-INTERCAL</abbrev> and <abbrev>CLC-INTERCAL</abbrev> accept it, at least if a
+lowercase <literal>c</literal> is used, the Atari compiler accepted it, and its
+documentation claimed that the Princeton compiler also accepted it;
+<abbrev>CLC-INTERCAL</abbrev> also accepts a capital <literal>C</literal> before the backspace and
+<literal>/</literal>, and allows <literal>|</literal> rather than <literal>/</literal>.) The Atari
+compiler, another <abbrev>INTERCAL-72</abbrev> compiler, used a 'big money' character
+(<literal>$</literal>) as the mingle character; this character is also the only
+one accepted for mingle by the <abbrev>J-INTERCAL</abbrev> compiler. <abbrev>C-INTERCAL</abbrev> originally
+also used the <literal>$</literal> character for mingle, and this character is the
+one most commonly seen in existing <abbrev>C-INTERCAL</abbrev> programs, and most often
+used when giving examples of <acronym>INTERCAL</acronym> on Usenet, because it exists in
+the ASCII-7 character set, and because it doesn't contain control
+characters. From version 0.18 of <abbrev>C-INTERCAL</abbrev> onwards, various other units
+of currency (change, quid, and zlotnik if Latin-1 is used as the
+input, and euro if Latin-9 is used as the input) are accepted; from
+version 0.20 onwards, in addition to the Latin-1 characters, all the
+currency symbols in Unicode are accepted if UTF-8 is used as the input
+format. <abbrev>CLC-INTERCAL</abbrev> has always used the change character (either the
+Latin-1 version or the version that contains a backspace) for mingle.
+In this manual, mingle will be represented as <literal>$</literal>, but it's
+important to bear in mind that this character is not the most portable
+choice.</para>
+ <para>The mingle operator should be applied to two operands or expressions.
+To be portable, the operands must both be onespot expressions, that is
+expressions which have a 16-bit result; <abbrev>C-INTERCAL</abbrev> relaxes this rule
+slightly and only requires that the result be in the onespot range.
+(This is because the data type of a select operator's value is meant to
+be determined at runtime; <abbrev>C-INTERCAL</abbrev> determines all data types at compile
+time, so has to guess a 32-bit result for a select with a 32-bit type as
+its right operand even when the result might actually turn out to be of
+a 16-bit type, and so this behaviour prevents an error when a select
+operation returns a value with a 16-bit data type and is used as an
+argument to amingle.) The result is a 32-bit value (that is, it is of a
+32-bit data type, even if its value fits into the onespot range), which
+consists of bits alternated from the two arguments; to be precise, its
+most significant bit is the most significant bit of its first argument,
+its second most significant bit is the most significant bit of its
+second argument, its third most significant bit is the second most
+significant bit of its first argument, and so on until its least
+significant bit, which is the least significant bit of its second
+argument.</para>
+ <para>One of the most common uses of interleaving is to create a constant with
+a value greater than 65535; for instance, 65536 is <literal>#256$#0</literal>. It
+is also commonly used in expressions that need to produce 32-bit
+results; except in some simple cases, this is usually coded by
+calculating separately the odd-numbered and even-numbered bits of the
+result, and mingling them together at the end. It is also used in
+expressions that need to left-shift values or perform similar
+value-increasing operations, as none of the other operators can easily
+do this; and mingle results are commonly used as the argument to unary
+binary logic operators, because this causes them to behave more like the
+binary logic operators found in some other languages.</para>
+ </sect2>
+
+ <sect2 label="6.3.2" id="Select">
+ <para>Select</para>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The select operator is one of the two binary operators in <abbrev>INTERCAL-72</abbrev>;
+unlike mingle, every known implementation of <acronym>INTERCAL</acronym> ever has used the
+sqiggle character (<literal>~</literal>) as the representation of the select
+operator, meaning that writing it portably is easy.</para>
+ <para>The select operator takes two arguments, which can be of either
+datatype (that is, 16- or 32-bit). It returns a value made by
+selecting certain bits of its first operand indicated by the second
+operand, and right-justifying them. What it does is that it ignores
+all the bits of the first operand where the second operand has a 0 as
+the corresponding bit, that is, deletes them from a copy of the
+operand's value; the bits that are left are squashed together towards
+the least-significant end of the number, and the result is filled with
+0s to make it up to 16 or 32 bits. (In <abbrev>INTERCAL-72</abbrev> the minimum multiple
+of 16 bits possible that the result fits into is chosen, although if
+:1 has the value 131061 (in hex, 1FFFF) the expression <literal>#21~:1</literal>
+produces a 32-bit result because 17 bits were selected, even though
+many of the leading bits were zeros; in <abbrev>C-INTERCAL</abbrev> the data type of the
+result is the same as of the right operand of the select, so that it
+can be determined at run time, and so using a unary binary logic
+operator on the result of select when the right operand has a 32-bit
+type is nonportable and not recommended.) As an example,
+<literal>#21~:1</literal> produces 21 as its result if :1 has the value 131061, 10
+as its result if :1 has the value 30 (1E in hex; the least significant
+bit of 21 is removed because it corresponds to a 0 in :1), and 7 as
+its result if :1 has the value 21 (because three bits in 21 are set,
+and those three bits from 21 are therefore selected by 21).</para>
+ <para>Select is used for right-shifts, to select every second bit from a
+number (either to produce what will eventually become an argument to
+mingle, or to interpret the result of a unary binary logic operator, or
+occasionally both), to test if a number is zero or not (by selecting it
+from itself and selecting 1 from the result), in some cases as a limited
+version of bitwise-and (that only works if the right operand is 1 less
+than a power of 2), and for many other purposes.</para>
+ </sect2>
+
+ <sect2 label="6.3.3" id="Unary-Binary-Logic">
+ <para>Unary Binary Logic</para>
+ <informalfigure>unary binary logic</informalfigure>
+ <informalfigure>and</informalfigure>
+ <informalfigure>or</informalfigure>
+ <informalfigure>xor</informalfigure>
+ <informalfigure>exor</informalfigure>
+ <informalfigure>exclusive or</informalfigure>
+ <informalfigure>?</informalfigure>
+ <informalfigure>&</informalfigure>
+ <informalfigure>V</informalfigure>
+ <informalfigure>what</informalfigure>
+ <informalfigure>ampersand</informalfigure>
+ <informalfigure>book</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>There are three unary operators in <abbrev>INTERCAL-72</abbrev>, each of which carries out
+a binary logic operation on adjacent bits of the number. The operators
+are and, or, and exclusive or; and and or are represented by an
+ampersand (<literal>&</literal>) and book (<literal>V</literal>) respectively, and exclusive
+or has the same notational problems as mingle, as it differs between
+Princeton and Atari syntax. It was represented by a bookworm, written
+<literal>V</literal>, backspace, <literal>-</literal>, in the Princeton <abbrev>INTERCAL-72</abbrev>
+implementation, and this is still the most portable way to write it
+(<abbrev>C-INTERCAL</abbrev> and <abbrev>CLC-INTERCAL</abbrev> accept it). The Atari implementation of <abbrev>INTERCAL-72</abbrev>
+wrote it with a what (<literal>?</literal>), and this is the representation
+originally used by <abbrev>C-INTERCAL</abbrev> (and still accepted), the only
+representation accepted by <abbrev>J-INTERCAL</abbrev>, the one most commonly used on
+Usenet, and the one used in this manual (although again, it's worth
+pointing out that this isn't portable). <abbrev>CLC-INTERCAL</abbrev> approximates a
+bookworm with the yen character, which being a currency character is
+one of the possible representations for mingle in <abbrev>C-INTERCAL</abbrev>; <abbrev>C-INTERCAL</abbrev> uses
+the rather confusing method of interpreting a yen character as
+exclusive-or if input in Latin-1 but as mingle if input in UTF-8.
+(This usually does the right thing, because <abbrev>CLC-INTERCAL</abbrev> doesn't support
+UTF-8.) In the same way, <abbrev>CLC-INTERCAL</abbrev> has a <abbrev>C-INTERCAL</abbrev> compatibility option
+to allow the use of <literal>?</literal> for exclusive-or.</para>
+ <para>The operators take each pair of consecutive bits in their arguments
+(that is, the least significant with the second least significant, the
+second least significant with the third least significant, the third
+least significant with the fourth least significant, and so on, with the
+pair consisting of the most significant and least significant being used
+to calculate the most significant bit of the result), and perform an
+appropriate logic operation on them; and sets a bit of the result if and
+only if both bits in the pair were set, or sets each bit corresponding to
+each pair where either bit was set, and exclusive or sets if and only if
+the bits in the pair had different values (that is, one was set, but not
+both). So for instance, <literal>#&26</literal> is 16 (26 is 1A in hexadecimal or
+11010 in binary); <literal>#V26</literal> is 31 (11111 in binary), and <literal>#?26</literal>
+is 23 (10111 in binary).</para>
+ <para>The most commonly seen use for these operators is to carry out bitwise
+ands, ors, and exclusive ors between two different 16-bit expressions,
+by mingling them together, applying a unary binary logic operator, and
+selecting every second bit of the result; such code often results due to
+people thinking in terms of some other language when writing <acronym>INTERCAL</acronym>,
+but is still often useful. (Historically, the first idiom added to the
+optimizer, apart from constant folding, was the mingle/unary/select
+sequence.) There are more imaginative uses; one impressive example is
+the exclusive or in the test for greater-than from the original <abbrev>INTERCAL-72</abbrev>
+system library:</para>
+ <programlisting>
+DO :5 <- "'?":1~'#65535$#0'"$":2~'#65535$#0'"'
+ ~'#0$#65535'"$"'?":1~'#0$#65535'"$":2~'#0$
+ #65535'"'~'#0$#65535'"
+DO .5 <- '?"'&"':2~:5'~'"'?"'?":5~:5"~"#65535~
+ #65535"'~'#65535$#0'"$#32768'~'#0$#65535'"
+ $"'?":5~:5"~"#65535$#65535"'~'#0$#65535'"'
+ "$"':5~:5'~#1"'~#1"$#2'~#3
+</programlisting>
+ <para>The first statement works out the value of :1 bitwise exclusive or :2;
+the second statement then works out whether the most significant set bit
+in :5 (that is, the most significant bit that differs between :1 and :2)
+corresponds to a set bit in :2 or not. In case that's a bit too
+confusing to read, here's the corresponding optimizer idiom (in OIL):</para>
+ <programlisting>
+((_1~:2)~((?32(:2~:2))^#2147483648))->(_1>(:2^_1))
+</programlisting>
+ <para>(Here, the ^ refers to a bitwise exclusive or, an operation found in OIL
+but not in <acronym>INTERCAL</acronym>, which is why the <acronym>INTERCAL</acronym> version is so much longer.)
+The <acronym>INTERCAL</acronym> version also has some extra code to check for equality and
+to produce 1 or 2 as the output rather than 0 or 1.</para>
+ </sect2>
+
+ <sect2 label="6.3.4" id="Array-Subscript">
+ <para>Array Subscript</para>
+ <informalfigure>arrays, subscripting</informalfigure>
+ <informalfigure>subscripts</informalfigure>
+ <informalfigure>SUB</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>version 0.7+</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>In order to access the elements of an array, either to read or write
+the array, it is necessary to use the array subscript operator
+<literal>SUB</literal>. Note that an array element is not a variable, so it is
+not accepted as an acceptable argument to statements like
+<literal>IGNORE</literal>; however, it can be assigned to.</para>
+ <para>The syntax for an array element is the array, followed by the keyword
+<literal>SUB</literal>, followed by an expression for the element number in the
+array. In the case of a multidimensional array, more than one
+expression is given after the keyword <literal>SUB</literal> to give the location
+of the element in each of the array's dimensions. The first element
+in an array or array dimension is numbered 1.</para>
+ <para>For instance, this is a legal (but not particularly useful) <acronym>INTERCAL</acronym>
+program with no syntax errors that shows some of the syntaxes possible
+with array subscripting:</para>
+ <programlisting>
+PLEASE ,1 <- #2
+DO .1 <- #2
+DO ,1 SUB .1 <- #1
+DO ,1 SUB #1 <- ,1 SUB #2
+PLEASE ;1 <- #2 BY #2
+DO ;1 SUB #1 #2 <- ,1 SUB ,1 SUB .1
+DO READ OUT ;1SUB#1.1
+DO GIVE UP
+</programlisting>
+ <para>Grouping can get complicated when nested array subscripting is used,
+particularly with multiple subscripts. It is the programmer's job to
+write an unambiguous statement, and also obey the extra grouping rules
+that apply to array subscripts; see .</para>
+ </sect2>
+ </sect1>
+ </chapter>
+
+ <chapter label="7" id="Statements">
+ <para>Statements</para>
+ <informalfigure>statements</informalfigure>
+ <informalfigure>statements, INTERCAL</informalfigure>
+ <para>There is a wide range of statements available to <acronym>INTERCAL</acronym> programs;
+some identifiably belong to a particular variant or dialect (such as
+Backtracking <acronym>INTERCAL</acronym>), but others can be considered to be part of the
+'core language'. The statements listed here are those that the <abbrev>C-INTERCAL</abbrev>
+compiler will accept with no compiler switches to turn on particular
+dialect options. Note that many statements have slightly different
+effects in different implementations of <acronym>INTERCAL</acronym>; known
+incompatibilities are listed here, but it's important to check your
+program on multiple compilers when attempting to write a portable
+program.</para>
+
+ <sect1 label="7.1" id="Syntax-Error">
+ <para>Syntax Error</para>
+ <informalfigure>syntax error</informalfigure>
+ <informalfigure>comment</informalfigure>
+ <informalfigure>COMMENT</informalfigure>
+ <informalfigure>COMMENTS</informalfigure>
+ <informalfigure>COMMENTING</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>version 0.15+</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>One of the more commonly-used commands in <acronym>INTERCAL</acronym> is the syntax error.
+A properly-written syntax error looks nothing like any known <acronym>INTERCAL</acronym>
+command; a syntax error that looks vaguely like a command but isn't
+may confuse <abbrev>C-INTERCAL</abbrev>, and possibly other compilers, into bailing out at
+compile time in some situations (this is known as a `serious syntax
+error'), and so is not portable. For other syntax errors, though, the
+semantics are easily explained: there is a run-time error whenever the
+syntax error is actually executed, and the line containing the syntax
+error is used as the error message.</para>
+ <para>One purpose of this is to allow your programs to produce their own
+custom errors at run time; however, it's very important to make sure
+that they start and end in the right place, by manipulating where
+statement identifiers appear. Here's a correct example from the
+system library:</para>
+ <programlisting>
+DOUBLE OR SINGLE PRECISION ARITHMETIC OVERFLOW
+</programlisting>
+ <para>This is a valid <acronym>INTERCAL</acronym> command, that produces an error when run (note
+the <literal>DO</literal> at the start). An even more common use is to produce an
+initially abstained syntax error by using an appropriate statement
+identifier, for instance</para>
+ <programlisting>
+PLEASE NOTE THAT THIS IS A COMMENT
+</programlisting>
+ <para>This would produce an error if reinstated somehow, but assuming that
+this isn't done, this is a line of code that does nothing, which is
+therefore equivalent to a comment in other programming languages.
+(The initial abstention is achieved with the statement identifier
+<literal>PLEASE NOT</literal>; the extra <literal>E</literal> causes the command to be a
+syntax error, and this particular construction is idiomatic.)</para>
+ <para>Referring to the set of all syntax errors in a program (or the set of
+all commands of any other given type) is achieved with a special
+keyword known as a `gerund'; gerund support for syntax errors is
+resonably recent, and only exists in <abbrev>CLC-INTERCAL</abbrev> (version 1.-94.-3 and
+later, with <literal>COMMENT</literal>, <literal>COMMENTS</literal>, or <literal>COMMENTING</literal>),
+and <abbrev>C-INTERCAL</abbrev> (<literal>COMMENT</literal> in version 0.26 and later, and also
+<literal>COMMENTS</literal> and <literal>COMMENTING</literal> in version 0.27 and later).
+Therefore, it is not portable to refer to the set of all syntax errors
+by gerund; using a line label is a more portable way to refer to an
+individual syntax-error command.</para>
+ </sect1>
+
+ <sect1 label="7.2" id="Calculate">
+ <para>Calculate</para>
+ <informalfigure>CALCULATING</informalfigure>
+ <informalfigure>calculate</informalfigure>
+ <informalfigure>assignment</informalfigure>
+ <informalfigure>arrays, dimensioning</informalfigure>
+ <informalfigure>dimensioning arrays</informalfigure>
+ <informalfigure>variables, assignment</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>At present, the only <acronym>INTERCAL</acronym> command that contains no keywords (apart
+from the statement identifier and possibly <literal>ONCE</literal> or
+<literal>AGAIN</literal>) is what is known as the `calculate' command. It is used
+to assign values to variables, array elements, and arrays; assigning a
+value to an array changes the number of elements that that array can
+hold, and causes the values of all elements previously in that array
+to be lost. The syntax of a calculate command is as follows:</para>
+ <programlisting>
+DO .1 <- ':2~:3'~#55
+</programlisting>
+ <para>That is, the command is written as a variable or array element, then
+the <literal><-</literal> operator (known as an `angle-worm' and pronounced
+`gets'), then an expression to assign to it. In the special case when
+an array is being dimensioned by assigning a value to it, the
+expression can contain the keyword <literal>BY</literal> to cause the array to
+become multidimensional; so for a 3 by 4 by 5 array, it would be
+possible to write</para>
+ <programlisting>
+DO ,1 <- #3 BY #4 BY #5
+</programlisting>
+ <para>The calculate command always evaluates the expression, even if for
+some reason the assignment can't be done (for instance, if the
+variable being assigned to is read-only); this is important if the
+expression has side-effects (for instance, giving an overflow error).
+If the variable does happen to be read-only, there is not an error;
+the expression being assigned to it is just evaluated, with the
+resulting value being discarded.</para>
+ <para>The gerund to refer to calculations is <literal>CALCULATING</literal>; however, if
+you are planning to use this, note that a bug in older versions of
+<abbrev>C-INTERCAL</abbrev> means that assignments to arrays are not affected by this
+gerund before version 0.27.</para>
+ </sect1>
+
+ <sect1 label="7.3" id="NEXT-FORGET-and-RESUME">
+ <para>NEXT, FORGET and RESUME</para>
+ <informalfigure>NEXT</informalfigure>
+ <informalfigure>FORGET</informalfigure>
+ <informalfigure>RESUME</informalfigure>
+ <informalfigure>NEXTING</informalfigure>
+ <informalfigure>FORGETTING</informalfigure>
+ <informalfigure>RESUMING</informalfigure>
+ <informalfigure>NEXT stack</informalfigure>
+ <informalfigure>flow control, INTERCAL-72</informalfigure>
+ <informalfigure>stack, NEXT</informalfigure>
+ <informalfigure>stack, instruction pointer</informalfigure>
+ <para><inlinemediaobject name="NEXT"></inlinemediaobject>
+<inlinemediaobject name="FORGET"></inlinemediaobject></para>
+ <para><inlinemediaobject name="RESUME"></inlinemediaobject></para>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>see text</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The only flow-control commands in <abbrev>INTERCAL-72</abbrev> were <literal>NEXT</literal>,
+<literal>RESUME</literal>, and <literal>FORGET</literal>; together these manipulate a stack of
+locations in the program known as the `NEXT stack'. Although all
+<acronym>INTERCAL</acronym> compilers have implemented these, from <abbrev>CLC-INTERCAL</abbrev> version 0.05
+onwards <abbrev>CLC-INTERCAL</abbrev> has considered them obsolete, and therefore a special
+command-line switch needs to be used to enable them. (They are still
+the most portable flow-control commands currently available, though,
+precisely because <abbrev>INTERCAL-72</abbrev> implements nothing else.) Note that there
+is a strict limit of 80 locations on the NEXT stack, enforced by all
+known <acronym>INTERCAL</acronym> compilers; this helps to enforce good programming style,
+by discouraging NEXT-stack leaks (which are otherwise quite easy to
+write).</para>
+ <para>Here are examples to show the syntax of these three statements:</para>
+ <programlisting>
+DO (1000) NEXT
+DO FORGET '.1~.1'~#1
+DO RESUME .5
+</programlisting>
+ <para>The <literal>NEXT</literal> command takes a line label as its argument (unlike
+most other <acronym>INTERCAL</acronym> commands, it comes after its argument rather than
+before); both <literal>FORGET</literal> and <literal>RESUME</literal> take expressions.
+(<abbrev>C-INTERCAL</abbrev> from version 0.05 onwards also allows an expression in
+<literal>NEXT</literal>, rather than a label, to give a computed <literal>NEXT</literal>, but
+this behaviour was not implemented in other compilers, and is
+deprecated in <abbrev>CLC-INTERCAL</abbrev> along with noncomputed <literal>NEXT</literal>; if computed
+<literal>NEXT</literal> is ever implemented in <abbrev>C-INTERCAL</abbrev>, it will likely likewise be
+deprecated upon introduction). Running a <literal>NEXT</literal> causes the
+program control to transfer to the command whose line label is
+referenced, and also saves the location in the program immediately
+after the <literal>NEXT</literal> command on the top of the NEXT stack.</para>
+ <para>In order to remove items from the <literal>NEXT</literal> stack, to prevent it
+filling up (which is what happens with a naive attempt to use the
+<literal>NEXT</literal> command as an equivalent to what some other languages call
+GOTO), it is possible to use the <literal>FORGET</literal> or <literal>RESUME</literal>
+commands. They each remove a number of items from the NEXT stack
+equal to their argument; <literal>RESUME</literal> also transfers control flow to
+the last location removed from the <literal>NEXT</literal> stack this way. Trying
+to remove no items, or more items than there are in the stack, does
+not cause an error when <literal>FORGET</literal> is used (no items or all the
+items are removed respectively); however, both of these cases are
+errors in a <literal>RESUME</literal> statement.</para>
+ <para>Traditionally, boolean values in <acronym>INTERCAL</acronym> programs have been stored
+using #1 and #2 as the two logic levels. This is because the easiest
+way to implement an if-like construct in <abbrev>INTERCAL-72</abbrev> is by <literal>NEXTING</literal>,
+then <literal>NEXTING</literal> again, then <literal>RESUMING</literal> either by 1 or 2
+according to an expression, and then if the expression evaluated to 1
+<literal>FORGETTING</literal> the remaining NEXT stack entry. By the way, the
+previous sentence also explained what the appropriate gerunds are for
+<literal>NEXT</literal>, <literal>RESUME</literal>, and <literal>FORGET</literal>.</para>
+ </sect1>
+
+ <sect1 label="7.4" id="STASH-and-RETRIEVE">
+ <para>STASH and RETRIEVE<inlinemediaobject name="STASH"></inlinemediaobject>
+<inlinemediaobject name="RETRIEVE"></inlinemediaobject></para>
+ <informalfigure>STASH</informalfigure>
+ <informalfigure>RETRIEVE</informalfigure>
+ <informalfigure>STASHING</informalfigure>
+ <informalfigure>RETRIEVING</informalfigure>
+ <informalfigure>stack, variable</informalfigure>
+ <informalfigure>stashes</informalfigure>
+ <informalfigure>variables, stashes</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The NEXT stack is not the only stack available in an <acronym>INTERCAL</acronym> program;
+each variable used in the program also has its own stack, which holds
+values of the same type as the variable. The <literal>STASH</literal> command
+pushes a variable's value onto that variable's stack; <literal>RETRIEVE</literal>
+can be used in the same way to pop the top element of a variable's
+stack to replace that variable's value. The syntax is the same as
+most other <acronym>INTERCAL</acronym> commands, with the word <literal>STASH</literal> or
+<literal>RETRIEVE</literal> followed by the variable or variables to stash or
+retrieve:</para>
+ <programlisting>
+DO STASH .1 + ;2
+DO RETRIEVE ,3
+</programlisting>
+ <para>Note that it is possible to stash or retrieve multiple variables at
+once, by listing their names separated by intersections (<literal>+</literal>);
+it's even possible to stash or retrieve a variable twice in the same
+statement.</para>
+ <para>It is not entirely clear how <literal>RETRIEVE</literal> interacts with
+<literal>IGNORE</literal> in historical <abbrev>INTERCAL-72</abbrev> compilers; the three modern
+<acronym>INTERCAL</acronym> compilers all use different rules for the interaction:</para>
+ <informalfigure><literal>IGNORE</literal>/<literal>RETRIEVE</literal> interaction</informalfigure>
+ <informalfigure><literal>RETRIEVE</literal>/<literal>IGNORE</literal> interaction</informalfigure>
+ <listitem mark="bullet">
+ <variablelist><abbrev>C-INTERCAL</abbrev> treats a retrieval just like an assignment. That is, aread-only variable will not be changed by a retrieval, and will remainread-only, but the side-effect of popping that variable's stash willstill happen.</variablelist>
+ <variablelist><abbrev>J-INTERCAL</abbrev> ignores the read-only status of a variable when retrieving itfrom a stash; the value of the variable changes despite beingread-only. The variable remains read-only; the <literal>RETRIEVE</literal> simplyallows a change to its value despite the read-only status.</variablelist>
+ <variablelist><abbrev>CLC-INTERCAL</abbrev> is the most complicated; it stores read-only status orotherwise in the stash, along with the variable's value. This meansthat if a variable was stashed when read-only, retrieving it willretrieve its value and set it to read-only regardless of its previousread-only status; likewise, if a variable was stashed when read-write,retrieving it will retrieve its value and set it to read-write even ifit was previously read-only.</variablelist>
+
+ </listitem>
+ <para>The appropriate gerunds for <literal>STASH</literal> and <literal>RETRIEVE</literal> are
+<literal>STASHING</literal> and <literal>RETRIEVING</literal> respectively.</para>
+ </sect1>
+
+ <sect1 label="7.5" id="IGNORE-and-REMEMBER">
+ <para>IGNORE and REMEMBER<inlinemediaobject name="IGNORE"></inlinemediaobject>
+<inlinemediaobject name="REMEMBER"></inlinemediaobject></para>
+ <informalfigure>IGNORE</informalfigure>
+ <informalfigure>IGNORING</informalfigure>
+ <informalfigure>REMEMBER</informalfigure>
+ <informalfigure>REMEMBERING</informalfigure>
+ <informalfigure>variables, read-only</informalfigure>
+ <informalfigure>variables, read-write</informalfigure>
+ <informalfigure>read-only variables</informalfigure>
+ <informalfigure>read-write variables</informalfigure>
+ <informalfigure>variables, ignoring</informalfigure>
+ <informalfigure>variables, remembering</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>Variables in <acronym>INTERCAL</acronym> can be either read-write or read-only. At the
+start of a program, all variables are read-only, but this status can
+be changed dynamically during execution of a program using the
+<literal>IGNORE</literal> and <literal>REMEMBER</literal> statements (whose gerunds are
+<literal>IGNORING</literal> and <literal>REMEMBERING</literal> respectively). The syntax is
+the same as for <literal>STASH</literal> and <literal>RETRIEVE</literal>: the command's name
+followed by an intersection-separated list of variables. For
+instance:</para>
+ <programlisting>
+DO IGNORE .4
+DO REMEMBER ,4 + ;5
+</programlisting>
+ <para>Using the <literal>IGNORE</literal> statement sets a variable to be read-only (or
+does nothing if it's read-only already); <literal>REMEMBER</literal> sets it to be
+read-write. Any attempt to assign to a read-only variable silently
+fails. One place that this is used is in the system library; instead
+of not assigning to a variable in certain control flow paths, it
+instead sets it to be read-only so that subsequent assignments don't
+change its value (and sets it to be read-write at the end, which
+succeeds even if it was never set read-only in the first place); the
+advantage of this is that it doesn't need to remember what flow path
+it's on except in the variable's ignorance status.</para>
+ <para>The interaction between <literal>IGNORE</literal> and <literal>RETRIEVE</literal> was never
+defined very clearly, and is in fact different in <abbrev>C-INTERCAL</abbrev>, <abbrev>CLC-INTERCAL</abbrev> and
+<abbrev>J-INTERCAL</abbrev>; for more details, see .</para>
+ </sect1>
+
+ <sect1 label="7.6" id="ABSTAIN-and-REINSTATE">
+ <para>ABSTAIN and REINSTATE<inlinemediaobject name="ABSTAIN"></inlinemediaobject>
+<inlinemediaobject name="REINSTATE"></inlinemediaobject></para>
+ <informalfigure>ABSTAIN</informalfigure>
+ <informalfigure>ABSTAINING</informalfigure>
+ <informalfigure>REINSTATE</informalfigure>
+ <informalfigure>REINSTATING</informalfigure>
+ <informalfigure>abstain, during execution</informalfigure>
+ <informalfigure>reinstate, during execution</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The statement identifier of a statement determines whether it's
+in an abstained or reinstated state at the start of a program; these
+states determine whether the statement runs at all when it's
+encountered. It is, however, possible to change this state
+dynamically during a program's execution, and the statements to do
+this are rather appropriately named <literal>ABSTAIN</literal> and
+<literal>REINSTATE</literal>. There are two forms of each, one which takes a
+single line label (which must be constant in most compilers, but can
+instead be an expression in recent <abbrev>CLC-INTERCAL</abbrev> versions), and one which
+takes an intersection-delimited list of gerunds. They look like this:</para>
+ <programlisting>
+DO ABSTAIN FROM ABSTAINING + REINSTATING
+DO ABSTAIN FROM (10)
+DO REINSTATE CALCULATING
+DO REINSTATE (22)
+</programlisting>
+ <para>(This also illustrates the gerunds used for these commands; note that
+<literal>ABSTAINING</literal> from <literal>REINSTATING</literal> is generally a bad idea!)
+The line referenced, or every command represented by any gerund
+referenced, are reinstated or abstained as appropriate (effectively
+changing the DO to DON'T (or PLEASE to PLEASE DON'T, etc.), or vice
+versa). Using these forms of <literal>ABSTAIN</literal> and/or <literal>REINSTATE</literal>
+won't abstain from a command that's already abstained, or reinstate a
+command that's already reinstated.</para>
+ <para>There is a strange set of restrictions on <literal>ABSTAIN</literal> and
+<literal>REINSTATE</literal> that has existed since <abbrev>INTERCAL-72</abbrev>; historically such
+restrictions have not always been implemented, or have not been
+implemented properly. They together define an unusual interaction of
+<literal>ABSTAIN</literal> and <literal>GIVE UP</literal> (note, for instance, that there
+isn't a gerund for <literal>GIVE UP</literal>). The wording used in the <abbrev>INTERCAL-72</abbrev>
+manual is:</para>
+ <screen>[...] the statement DO ABSTAIN FROM GIVING UP is not accepted, even
+though DON'T GIVE UP is. [...] DO REINSTATE GIVING UP is invalid, and
+attempting to REINSTATE a GIVE UP statement by line label will have no
+effect. Note that this insures that DON'T GIVE UP will always be a
+"do-nothing" statement.
+</screen>
+ <para>This restriction was not implemented at all in the only <abbrev>CLC-INTERCAL</abbrev>
+version before 0.02 (i.e. version 0.01), or in <abbrev>C-INTERCAL</abbrev> versions
+before 1.26. The restriction was implemented in <abbrev>C-INTERCAL</abbrev> version 1.26
+and <abbrev>CLC-INTERCAL</abbrev> versions 0.02 and later as “<literal>GIVE UP</literal> cannot be
+<literal>REINSTATED</literal> or <literal>ABSTAINED FROM</literal>”; however, this is not
+strictly the same as the definition used by <abbrev>INTERCAL-72</abbrev> (<abbrev>C-INTERCAL</abbrev> still uses
+this definition in <abbrev>CLC-INTERCAL</abbrev> compatibility mode). The <abbrev>J-INTERCAL</abbrev>
+implementation of this restriction is to make <literal>REINSTATING</literal> or
+<literal>ABSTAINING</literal> from a line label that refers to a <literal>GIVE UP</literal>
+statement a compile-time error, but this does not fit the <abbrev>INTERCAL-72</abbrev>
+definition either. The definition adopted with version 0.27 and
+later of <abbrev>C-INTERCAL</abbrev>, which is hopefully correct, is to allow abstaining
+from a <literal>GIVE UP</literal> statement by line number but to rule out the
+other three cases (reinstating by line number silently fails,
+reinstating or abstaining by gerund is impossible because there is no
+gerund).</para>
+ <para>As well as <abbrev>CLC-INTERCAL</abbrev>'s extension to abstain/reinstate by computed line
+number, there is also (since version 0.25) a <abbrev>C-INTERCAL</abbrev>-specific extension
+to <literal>ABSTAIN</literal>, also known as `computed abstain', but with a
+different syntax and different semantics. It's written like an
+ordinary <literal>ABSTAIN</literal>, but with an expression between the words
+<literal>ABSTAIN</literal> and <literal>FROM</literal>, for instance:</para>
+ <programlisting>
+DO ABSTAIN #1 FROM (1000)
+DO ABSTAIN .2 FROM WRITING IN
+</programlisting>
+ <para>Unlike non-computed <literal>ABSTAIN</literal>, this form (available from <abbrev>C-INTERCAL</abbrev>
+version 0.25 onwards) allows a command to be abstained from even if
+it's already been abstained from; so if the first example command is
+run and line (1000) is already abstained, it becomes
+`double-abstained'. The number of times the statement is abstained
+from is equal to the number of times it was already abstained from,
+plus the expression (whereas with non-computed abstain, it ends up
+abstained once if it wasn't abstained at all, and otherwise stays at
+the same abstention status). Reinstating a statement always
+de-abstains it exactly once; so double-abstaining from a statement,
+for instance, means it needs to be reinstated twice before it will
+actually execute.</para>
+ <para>There are many uses for <literal>ABSTAIN</literal> (both the computed and
+non-computed versions) and <literal>REINSTATE</literal>, especially when
+interacting with <literal>ONCE</literal> and <literal>AGAIN</literal> (see ); the computed version, in particular, is a major part of a
+particular concise way to write conditionals and certain kinds of
+loops. They also play an important role in multithreaded programs.</para>
+ </sect1>
+
+ <sect1 label="7.7" id="READ-OUT-and-WRITE-IN">
+ <para>READ OUT and WRITE IN<inlinemediaobject name="READ OUT"></inlinemediaobject>
+<inlinemediaobject name="WRITE IN"></inlinemediaobject></para>
+ <informalfigure>READ OUT</informalfigure>
+ <informalfigure>READING OUT</informalfigure>
+ <informalfigure>WRITE IN</informalfigure>
+ <informalfigure>WRITING IN</informalfigure>
+ <informalfigure>I/O</informalfigure>
+ <informalfigure>input</informalfigure>
+ <informalfigure>output</informalfigure>
+ <para>The <literal>READ OUT</literal> and <literal>WRITE IN</literal> commands are the output and
+input commands in <acronym>INTERCAL</acronym>; they allow communication between the
+program and its user. There was a numeric I/O mechanism implemented
+in <abbrev>INTERCAL-72</abbrev>, and it (or trivial variants) have been likewise
+implemented in all more modern variants. However, it had some obvious
+deficiences (such as not being able to read its own output) which
+meant that other methods of I/O were implemented in <abbrev>C-INTERCAL</abbrev> and
+<abbrev>CLC-INTERCAL</abbrev>.</para>
+ <para>The syntax of <literal>READ OUT</literal> and <literal>WRITE IN</literal> is the same in all
+cases: the name of the command followed by an intersection-separated
+list of items; the form of each item, the compiler you are using, and
+its command line arguments together determine what sort of I/O is
+used, which can in be different for different elements in the list.</para>
+
+ <sect2 label="7.7.1" id="INTERCAL-72-I-O">
+ <para>INTERCAL-72 I/O</para>
+ <informalfigure>I/O, INTERCAL-72</informalfigure>
+ <informalfigure>input, INTERCAL-72</informalfigure>
+ <informalfigure>output, INTERCAL-72</informalfigure>
+ <informalfigure>INTERCAL-72, I/O</informalfigure>
+ <informalfigure>Roman numerals</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>see text</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para><abbrev>INTERCAL-72</abbrev> had its own versions of I/O commands; these commands are
+available in all modern <acronym>INTERCAL</acronym> compilers as well (but <abbrev>CLC-INTERCAL</abbrev>
+implements output slightly differently). To distinguish <abbrev>INTERCAL-72</abbrev> input
+and output from the other more modern types of I/O, the <literal>READ
+OUT</literal> and <literal>WRITE IN</literal> commands must take one of the following
+values: a onespot or twospot variable, a single element of a tail or
+hybrid array, or (in the case of <literal>READ OUT</literal>) a constant, meaning
+that these are some examples of the possible forms:</para>
+ <programlisting>
+READ OUT .1
+READ OUT ;2 SUB .3:4
+READ OUT #3
+WRITE IN :4
+WRITE IN ,5 SUB #6
+</programlisting>
+ <para>The statements do what you would expect; <literal>READ OUT</literal> outputs its
+argument to the user, and <literal>WRITE IN</literal> inputs a number from the
+user and assigns it to the variable or array element referenced. (If
+the variable, or the array that contains the array element, happens to
+be read-only, the input or output still happens but in the case of
+<literal>WRITE IN</literal> silently skips the assignment, instead throwing away
+the input.) The formats used for input and output are, however,
+different from each other and from the formats used by most mainstream
+languages.</para>
+ <para>Input is achieved by writing a number in decimal, one digit at a time,
+with each digit written out as a word; so to input the number 12345, a
+user would have to type <literal>ONE TWO THREE FOUR FIVE</literal> as input (if
+they were using English, the most portable choice of language). In
+<abbrev>INTERCAL-72</abbrev> only English is accepted as a language, but other compilers
+accept other languages in addition. <abbrev>C-INTERCAL</abbrev> from version
+0.10 onwards accepts English, Sanskrit, Basque, Tagalog, Classical
+Nahuatl, Georgian, and Kwakiutl; also Volapük from version 0.11
+onwards, and Latin from version 0.20 onwards. <abbrev>J-INTERCAL</abbrev> accepts the same
+languages, except with Esperanto instead of Latin; from version 0.05
+of <abbrev>CLC-INTERCAL</abbrev> onwards, the same list of languages as <abbrev>C-INTERCAL</abbrev> is supported
+(apart from Latin, which was added in version 1.-94.-8).</para>
+ <para>The format that output can be read in is a modified form of Roman
+numerals, known as `butchered' Roman numerals. <abbrev>INTERCAL-72</abbrev>, <abbrev>C-INTERCAL</abbrev> and
+<abbrev>J-INTERCAL</abbrev> do this the same way; <abbrev>CLC-INTERCAL</abbrev> is somewhat different. The
+characters ‘<literal>I</literal>’, ‘<literal>V</literal>’, ‘<literal>X</literal>’, ‘<literal>L</literal>’, ‘<literal>C</literal>’, ‘<literal>D</literal>’,
+and ‘<literal>M</literal>’ mean 1, 5, 10, 50, 100, 500 and 1000 respectively,
+placing a lower-valued letter after a higher-valued letter adds them,
+and placing a lower-valued letter before a higher-valued letter
+subtracts it from the value; so ‘<literal>XI</literal>’ is 11 and ‘<literal>IX</literal>’ is 9,
+for instance. In <abbrev>INTERCAL-72</abbrev>, <abbrev>C-INTERCAL</abbrev>, and <abbrev>J-INTERCAL</abbrev>, a bar over a numeral
+multiplies its value by 1000, and writing a letter in lowercase
+multiplies its value by 1000000; however, <abbrev>CLC-INTERCAL</abbrev> uses lowercase to
+represent multiplication by 1000 and for multiplication by 1000000
+writes a backslash before the relevant numeral.</para>
+ </sect2>
+
+ <sect2 label="7.7.2" id="C-INTERCAL-I-O">
+ <para>C-INTERCAL I/O</para>
+ <informalfigure>I/O, C-INTERCAL</informalfigure>
+ <informalfigure>input, C-INTERCAL</informalfigure>
+ <informalfigure>output, C-INTERCAL</informalfigure>
+ <informalfigure>C-INTERCAL, I/O</informalfigure>
+ <informalfigure>Turing Tape</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.07+</bookinfo>
+ <bookinfo>version 0.05+</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para><abbrev>C-INTERCAL</abbrev>'s method of character-based (rather than numeric) input and
+output is known as the Turing Tape method; it is a binary
+(character-set-agnostic) input/output mechanism. To specify that
+<abbrev>C-INTERCAL</abbrev>-style I/O is being used, an array must be used as the argument
+to <literal>READ OUT</literal> or <literal>WRITE IN</literal>; as the syntax is the same as
+for <abbrev>CLC-INTERCAL</abbrev>'s I/O, command-line arguments and the capabilities of the
+version of the compiler being used serve to distinguish the two
+mechanisms.</para>
+ <para>The character-based input writes as many characters into a tail or
+hybrid array as will fit, one character in each element. The number
+that's written into the array is not the character code, though, but
+the difference between the character code and the previous character
+code, modulo 256. (To be precise, the code is the new character minus
+the previous character, or 256 minus (the previous character minus the
+new character) if the previous character had a higher character code;
+the 'previous character' is the previous character from the input, not
+the previous character written into the array.) End-of-file causes
+256 to be written into the array. The concept is that of a circular
+tape containing all the characters, where the program measures how
+many spaces it needs to move along the tape to reach the next
+character. The 'previous character' starts at 0, but is preserved
+throughout the entire program, even from one <literal>WRITE IN</literal> to the
+next.</para>
+ <para>Character-based output uses a similar model, but conceptually the
+output device moves on the inside of the tape, rather than on the
+outside. Therefore, the character is that is actually output is the
+bit-reversal of the difference between the last character output
+before it was bit-reversed and the number found in the array
+(subtracting in that order, and adding 256 if the result is
+negative). (Rather than trying to parse the previous sentence, you
+may find it easier to look either at the source code to the compiler
+if you have it (the relevant part is binout in <filename>src/cesspool.c</filename>)
+or at some example <abbrev>C-INTERCAL</abbrev> programs that do text-based I/O.)</para>
+ </sect2>
+
+ <sect2 label="7.7.3" id="CLC-INTERCAL-I-O">
+ <para>CLC-INTERCAL I/O</para>
+ <informalfigure>Baudot</informalfigure>
+ <informalfigure>I/O, Baudot</informalfigure>
+ <informalfigure>I/O, CLC-INTERCAL</informalfigure>
+ <informalfigure>CLC-INTERCAL I/O</informalfigure>
+ <informalfigure>input, CLC-INTERCAL</informalfigure>
+ <informalfigure>output, CLC-INTERCAL</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.27+</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>There are also two <abbrev>CLC-INTERCAL</abbrev>-specific I/O mechanisms. These are
+Baudot-based text I/O (which is also implemented from <abbrev>C-INTERCAL</abbrev> version
+0.27 onwards), and <abbrev>CLC-INTERCAL</abbrev> generalised binary I/O (not implemented in
+<abbrev>C-INTERCAL</abbrev>).</para>
+ <para>Baudot text-based I/O is specified by using a tail array as an
+argument to <literal>WRITE IN</literal> or <literal>READ OUT</literal>. (A tail array can
+also be used to specift <abbrev>C-INTERCAL</abbrev>-style Turing Tape I/O. In order to
+determine which is used: both <abbrev>C-INTERCAL</abbrev> and <abbrev>CLC-INTERCAL</abbrev> use their own sort
+of I/O unless a command-line argument instructs them to use the
+other.) In the case of <literal>WRITE IN</literal>, one line of input is
+requested from the user (<abbrev>C-INTERCAL</abbrev> requires this to be input in Latin-1,
+and will then automatically convert it; <abbrev>CLC-INTERCAL</abbrev> gives the option of
+various character sets for this input as command-line options); the
+final newline is removed from this line, then it is converted to
+extended Baudot and stored in the tail array specified (causing an
+error if the array is too small). Because Baudot is only a 5-bit
+character set, each element is padded to 16 bits; <abbrev>CLC-INTERCAL</abbrev> pads with
+zeros, <abbrev>C-INTERCAL</abbrev> pads with random bits. Trying to input at end-of-file
+will act as if the input were a blank line. <literal>READ OUT</literal> is the
+reverse; it interprets the array as extended Baudot and converts it to
+an appropriate character set (Latin-1 for <abbrev>C-INTERCAL</abbrev>, or whatever was
+specified on the command line for <abbrev>CLC-INTERCAL</abbrev>), which is output to the
+user, followed by a newline. Note that the Baudot is often longer
+than the corresponding character in other character sets due to the
+need to insert shift codes; for information on the extended Baudot
+character set, .</para>
+ <para>Generalised binary I/O is specified using a hybrid array as an
+argument to <literal>WRITE IN</literal> or <literal>READ OUT</literal>. Input works by
+reading in a number of bytes equal to the length of the array (without
+trying to interpret them or translating them to a different character
+set), prepending a byte with 172 to the start, padding each byte to 16
+bits with random data, then replacing each pair of consecutive bytes
+(that is, the first and second, the second and third, the third and
+fourth, and so on) with (the first element selected from the second
+element) mingled with (the complement of the first element selected from
+the complement of the second element). Output is the exact opposite
+of this process. End-of-file reads a 0, which is padded with 0s
+rather than random data; if a non-end-of-file 0 comes in from the
+data, its padding will contain at least one 1. Any
+all-bits-0-even-the-padding being read out will be skipped.</para>
+ </sect2>
+ </sect1>
+
+ <sect1 label="7.8" id="GIVE-UP">
+ <para>GIVE UP</para>
+ <informalfigure>GIVE UP</informalfigure>
+ <informalfigure>quitting</informalfigure>
+ <informalfigure>exiting</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The <literal>GIVE UP</literal> command causes the program to end (or, in a
+multithreaded program, causes the current thread to end). It is
+written simply as <literal>GIVE UP</literal>. There is not much else to say about
+it, except to mention that it is the only way to end the program
+without an error unless the last line of the program is <literal>TRY
+AGAIN</literal>, and that it has an unusual interaction with <literal>ABSTAIN</literal>;
+for details of this, see . (Going past the last command
+in the program is an error.)</para>
+ <para>There is no gerund for <literal>GIVE UP</literal>; in particular, <literal>GIVING UP</literal>
+is a syntax error.</para>
+ </sect1>
+
+ <sect1 label="7.9" id="TRY-AGAIN">
+ <para>TRY AGAIN</para>
+ <informalfigure>TRY AGAIN</informalfigure>
+ <informalfigure>loops, entire program</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.25+</bookinfo>
+ <bookinfo>no</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The <literal>TRY AGAIN</literal> command is a very simple command with many
+limitations; its effect is to place the entire program in a loop. If
+it exists, it must be the very last command in the program (it cannot
+even be followed by syntax errors), and it causes execution of the
+program to go back to the first command. If the <literal>TRY AGAIN</literal>
+command is abstained or for some other reason doesn't execute when
+reached, it exits the program without the error that would usually be
+caused by going past the last line of code.</para>
+ <para>The gerund for <literal>TRY AGAIN</literal> is <literal>TRYING AGAIN</literal>.</para>
+ </sect1>
+
+ <sect1 label="7.10" id="COME-FROM-and-NEXT-FROM">
+ <para>COME FROM and NEXT FROM<inlinemediaobject name="COME FROM"></inlinemediaobject>
+<inlinemediaobject name="NEXT FROM"></inlinemediaobject></para>
+ <informalfigure>COME FROM</informalfigure>
+ <informalfigure>NEXT FROM</informalfigure>
+ <informalfigure>reverse goto</informalfigure>
+ <informalfigure>goto, time-reversed</informalfigure>
+ <informalfigure>time-reversed goto</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>see text</bookinfo>
+ <bookinfo>see text</bookinfo>
+ <bookinfo>see text</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The <literal>COME FROM</literal> statement (incidentally also invented in 1972,
+but not in connection with <acronym>INTERCAL</acronym>) is the main control-flow command
+in <abbrev>CLC-INTERCAL</abbrev> (which deprecates <literal>NEXT</literal>), and one of two main
+control flow structures in other modern <acronym>INTERCAL</acronym> compilers. It takes
+either a label or an expression as its argument; these forms are
+noncomputed <literal>COME FROM</literal> and computed <literal>COME FROM</literal>.</para>
+ <para>Noncomputed <literal>COME FROM</literal> was implemented in version 0.5 of <abbrev>C-INTERCAL</abbrev>,
+but did not conform to modern-day semantics until version 0.7; it is
+available in every version of <abbrev>CLC-INTERCAL</abbrev> and <abbrev>J-INTERCAL</abbrev>. Computed
+<literal>COME FROM</literal> support is available in every version of <abbrev>CLC-INTERCAL</abbrev> and
+in <abbrev>C-INTERCAL</abbrev> from version 0.25 onwards, but not in <abbrev>J-INTERCAL</abbrev>; the variant
+<literal>NEXT FROM</literal> of <literal>COME FROM</literal> is available from <abbrev>CLC-INTERCAL</abbrev>
+version 1.-94.-8 and <abbrev>C-INTERCAL</abbrev> version 0.26 (both computed and
+noncomputed). <abbrev>C-INTERCAL</abbrev> and <abbrev>CLC-INTERCAL</abbrev> also have a from-gerund form of
+<literal>COME FROM</literal> and <literal>NEXT FROM</literal>, which was also implemented from
+<abbrev>CLC-INTERCAL</abbrev> version 1.-94.-8 and <abbrev>C-INTERCAL</abbrev> version 0.26.</para>
+ <para>The basic rule of <literal>COME FROM</literal> is that if a <literal>COME FROM</literal>
+statement references another statement, whenever that statement is
+reached, control flow will be transferred to the <literal>COME FROM</literal>
+after that statement finishes executing. (<literal>NEXT FROM</literal> is
+identical except that in addition to the <literal>COME FROM</literal> behaviour,
+the location immediately after the statement that was nexted from is
+saved on the NEXT stack, in much the same way as if the statement
+being nexted from was iteslf a <literal>NEXT</literal>.)</para>
+ <para>Here are examples of noncomputed, computed, and from-gerund <literal>COME
+FROM</literal>:</para>
+ <programlisting>
+DO COME FROM (10)
+DO COME FROM #2$'.1~#1'
+DO COME FROM COMING FROM
+</programlisting>
+ <para>(The last example is an infinite loop. If it said <literal>DO NEXT FROM
+NEXTING FROM</literal>, it would not be an infinite loop because the NEXT stack
+would overflow and cause an error. This also establishes the gerunds
+used for <literal>COME FROM</literal> and <literal>NEXT FROM</literal>.)</para>
+ <para>There are some things to be careful with involving <literal>COME FROM</literal>
+and <literal>NEXT FROM</literal>. First, if the statement come from or nexted
+from happens to be a <literal>NEXT</literal>, the <literal>NEXT</literal> doesn't count as
+'finishing executing' until the NEXT stack entry created by the
+<literal>NEXT</literal> is <literal>RESUME</literal>d to. In particular, this means that if
+<literal>FORGET</literal> is used to remove the entry, or a <literal>RESUME</literal> with a
+large argument resumes a lower entry, the <literal>COME FROM</literal> doesn't
+steal execution at all.</para>
+ <para>Second, you may be wondering what happens if two <literal>COME FROM</literal>s or
+<literal>NEXT FROM</literal>s aim at the same line. In a non-multithreaded
+program (whether a program is multithreaded or not is determined by a
+compiler option for those compilers that support it), this is an
+error; but it is only an error if the statement that they both point
+to finishes running, and both <literal>COME FROM</literal>s or <literal>NEXT FROM</literal>s
+try to execute as a result (they might not if, for instance, one is
+abstained or has a double-oh-seven causing it not to run some of the
+time). If both <literal>COME FROM</literal>s or <literal>NEXT FROM</literal>s are
+noncomputed, however, a compiler can (but does not have to) give a
+compile time error if two <literal>COME FROM</literal>s or <literal>NEXT FROM</literal>s share
+a label, and so that situation should be avoided in portable code.
+(If it is wanted, one solution that works for <abbrev>C-INTERCAL</abbrev> and <abbrev>CLC-INTERCAL</abbrev> is
+to use computed <literal>COME FROM</literal>s or <literal>NEXT FROM</literal>s with a constant
+expression.)</para>
+ </sect1>
+ </chapter>
+
+ <chapter label="8" id="System-Library">
+ <para>System Library</para>
+ <informalfigure>system libary</informalfigure>
+ <informalfigure>syslib</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>yes</bookinfo>
+ <bookinfo>all versions</bookinfo>
+ <bookinfo>no</bookinfo>
+ <bookinfo>all versions</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para><acronym>INTERCAL</acronym> has a system library, called ‘<literal>syslib</literal>’. It is included
+automatically at the end of your program by the compiler whenever your
+program refers to a line from (1000) to (1999) without defining any
+line in that range in the program. (Although it is not added
+automatically by the compiler in <abbrev>CLC-INTERCAL</abbrev>, it is trivial to
+concatenate a copy onto the end of the program.)</para>
+ <para>The intention of the system library is to provide a range of useful
+capabilities, like multiplication, that can otherwise be hard to write
+in <acronym>INTERCAL</acronym>. System library routines are used by <literal>NEXTING</literal> to
+their line number (see ), where they will make changes to
+certain variables depending on certain other variables (depending on
+which routine is called), and <literal>RESUME</literal> back to the original
+program. As the system library is itself written in <acronym>INTERCAL</acronym>, there
+are some restrictions that need to be obeyed for calls to it to be
+guaranteed to work; none of the variables it uses (<literal>.1</literal> to
+<literal>.6</literal> and <literal>:1</literal> to <literal>:5</literal>) should be read-only or
+overloaded (although the value of any variables that aren't mentioned
+in the routine's description will be preserved by the routine), and
+none of the lines in it should have their abstention status changed by
+lines outside it (this can happen with blatant infractions like
+<literal>DO ABSTAIN FROM (1500)</literal> or more subtle problems like
+gerund-abstention) or have <literal>COME FROM</literal>s or <literal>NEXT FROM</literal>s
+aiming at them.</para>
+ <para>The system library is currently available in all bases from 2 to 7
+(see ), but not every command is available in every
+base, and <abbrev>C-INTERCAL</abbrev> is the only one of the three compilers listed above
+that use the system library to ship with a version in bases other than
+2. (This table was originally based on the <abbrev>INTERCAL-72</abbrev> manual, but has
+had extra information added for bases other than 2.) Here, “overflow
+checked” means that #1 is assigned to .4 if there is not an overflow,
+and #2 is assigned to .4 if there is; “overflow captured” means that
+if there is overflow, the digit that overflowed is stored in the
+variable referenced. In all cases, division by 0 returns 0.</para>
+ <colspec>
+ <thead cols="3">
+ <tbody colwidth="10*"></tbody>
+ <tbody colwidth="70*"></tbody>
+ <tbody colwidth="15*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo>Line</bookinfo>
+ <bookinfo>Description</bookinfo>
+ <bookinfo>Bases</bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>(1000)</bookinfo>
+ <bookinfo>
+.3 <- .1 plus .2, error exit on overflow</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1009)</bookinfo>
+ <bookinfo>
+.3 <- .1 plus .2, overflow checked</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1010)</bookinfo>
+ <bookinfo>
+.3 <- .1 minus .2, no action on overflow</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1020)</bookinfo>
+ <bookinfo>
+.1 <- .1 plus #1, no action on overflow</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1030)</bookinfo>
+ <bookinfo>
+.3 <- .1 times .2, error exit on overflow</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1039)</bookinfo>
+ <bookinfo>
+.3 <- .1 times .2, overflow checked</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1040)</bookinfo>
+ <bookinfo>
+.3 <- .1 divided by .2</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1050)</bookinfo>
+ <bookinfo>
+.2 <- :1 divided by .1, error exit on overflow</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1200)</bookinfo>
+ <bookinfo>
+.2 <- .1 times #2, overflow captured in .3</bookinfo>
+ <bookinfo>4, 6</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1210)</bookinfo>
+ <bookinfo>
+.2 <- .1 divided by #2, one digit after the quartic or sextic point
+stored in .3</bookinfo>
+ <bookinfo>4, 6</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1500)</bookinfo>
+ <bookinfo>
+:3 <- :1 plus :2, error exit on overflow</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1509)</bookinfo>
+ <bookinfo>
+:3 <- :1 plus :2, overflow checked</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1510)</bookinfo>
+ <bookinfo>
+:3 <- :1 minus :2, no action on overflow</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1520)</bookinfo>
+ <bookinfo>
+:1 <- .1 concatenated with .2</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1530)</bookinfo>
+ <bookinfo>
+:1 <- .1 times .2</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1540)</bookinfo>
+ <bookinfo>
+:3 <- :1 times :2, error exit on overflow</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1549)</bookinfo>
+ <bookinfo>
+:3 <- :1 times :2, overflow checked</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1550)</bookinfo>
+ <bookinfo>
+:3 <- :1 divided by :2</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1700)</bookinfo>
+ <bookinfo>
+:2 <- :1 times #2, overflow captured in .1</bookinfo>
+ <bookinfo>4, 6</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1710)</bookinfo>
+ <bookinfo>
+:2 <- :1 divided by #2, one digit after the quartic or sextic point
+stored in .1</bookinfo>
+ <bookinfo>4, 6</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1720)</bookinfo>
+ <bookinfo>
+:2 <- :1 times the least significant digit of .1, overflow captured in
+.2</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1900)</bookinfo>
+ <bookinfo>
+.1 <- uniform random number from #0 to #65535</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>(1910)</bookinfo>
+ <bookinfo>
+.2 <- normal random number from #0 to .1, with standard deviation .1
+divided by #12</bookinfo>
+ <bookinfo>2, 3, 4, 5, 6, 7</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ </chapter>
+
+ <chapter label="" xreflabel="PART III: INTERCAL DIALECTS AND EXTENSIONS">
+ <para>PART III: <acronym>INTERCAL</acronym> DIALECTS AND EXTENSIONS</para>
+ </chapter>
+
+ <chapter label="9" id="TriINTERCAL">
+ <para>TriINTERCAL</para>
+ <informalfigure>TriINTERCAL</informalfigure>
+ <informalfigure>ternary</informalfigure>
+ <informalfigure>whirlpool</informalfigure>
+ <informalfigure>sharkfin</informalfigure>
+ <informalfigure>BUT</informalfigure>
+ <informalfigure>add-without-carry</informalfigure>
+ <informalfigure>subtract-without-borrow</informalfigure>
+ <informalfigure>controlled unary operator</informalfigure>
+ <informalfigure>^</informalfigure>
+ <informalfigure>@</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.7+</bookinfo>
+ <bookinfo>version 1.-94.-8+</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>One extension to <acronym>INTERCAL</acronym> that is implemented by both <abbrev>C-INTERCAL</abbrev> and
+<abbrev>CLC-INTERCAL</abbrev> is known as TriINTERCAL, and extends <acronym>INTERCAL</acronym> to bases other
+than binary. Unlike ordinary <acronym>INTERCAL</acronym> programs, which have the
+extension ‘<literal>.i</literal>’, TriINTERCAL programs in bases from 3 to 7 (the
+only allowed bases) have extensions from ‘<literal>.3i</literal>’ to ‘<literal>.7i</literal>’
+respectively.</para>
+ <para>The change of numeric base only affects expressions, and in particular
+the behaviour of operators, and the range of variables. (The onespot
+and twospot ranges become the highest number of trits or other digits
+in the base required that fit inside the binary ranges, so for
+instance, the maximum value of a onespot variable in ternary is 59048,
+or 3 to the power 10 minus 1.) Interleave/mingle is the simplest to
+explain; it alternates digits just as it alternated bits in binary.
+The other operators all change, as follows:</para>
+ <listitem mark="bullet">
+ <variablelist>Exclusive-or becomes two operators, known either assubtract-without-borrow and add-without-carry due to theirmathematical interpretations, or what and sharkfin after their Atarisyntax representations (<literal>?</literal> and <literal>^</literal>). (In Princeton syntax,these are the bookworm or yen sign, and a spike (<literal>|</literal>).) The twooperators do the same thing in binary, but differ in higher bases.(Nevertheless, it is an error to use a sharkfin in binary, because itis a so-called `controlled unary operator', as are the rest of thenew operators defined in this section, which has a lower limit onwhich base it is allowed in.) Instead of doing the exclusive-oroperation, the bits being combined are either subtracted or added; ifthe result is out of range for the base being used, the base is addedor subtracted from the result until it is in range. (For thesubtraction, the bit that was less significant is subtracted from thebit that was more significant in any given pair of bits, except forthe subtraction between the most and least significant bits, where themost significant bit is subtracted from the least.)</variablelist>
+ <variablelist>The AND and OR operators are generalised into an entire sequence ofoperators; the number of operators available is the same as the basethat is being used. In base 3, the third operator is known as BUT; inother bases, there are no commonly accepted names for the extraoperators, so names that reflect the notation are used here.The way to think of it is this: in base 2, an AND gives the result 0if either argument is a 0, and otherwise a 1, and likewise, an ORgives the result 1 if either argument is a 1, and otherwise a 0; theycould be said to favour 0 over 1 and 1 over 0 respectively. In base3, AND favours 0 over 2 over 1, OR favours 2 over 1 over 0, and BUTfavours 1 over 0 over 2. (The symbol for BUT is <literal>@</literal> (a`whirlpool', which is another name for the BUT operation) in Atarisyntax, and <literal>?</literal> in Princeton syntax.) The pattern continues: inbase 4, AND favours 0 over 3 over 2 over 1, BUT favours 1 over 0 over3 over 2, 2BUT (written <literal>2@</literal> or <literal>2?</literal>) favours 2 over 1 over0 over 3, and OR favours 3 over 2 over 1 over 0. (This can beextended to higher bases following the same pattern, introducingoperators <literal>3@</literal> or <literal>3?</literal>, etc., to favour 3, etc., whenneither AND (which always favours 0) nor OR (which favours the highestdigit in the base) are available.) All the whirlpool operators arecontrolled unary operators, which are only legal when both the basecontains the favoured digit, and they aren't redundant to AND nor OR.</variablelist>
+ <variablelist>Select has its semantics modified to deal with more than one nonzerodigit in the base. It starts off by doing an OR (in whatever base isbeing used) between the two numbers being selected; then the bits ofthe result are sorted by the bits of the right-hand argument to theselect, with bits corresponding to 0s in the right-hand argumentending up more significant than bits corresponding to high digits inthe right-hand argument. In base 2, this has the same effect as atraditional-style select.</variablelist>
+
+ </listitem>
+ <para>Note that the base doesn't affect anything other than variable ranges
+and expressions; in particular, it doesn't affect the bit-reversal
+used by Turing Tape I/O. (The tape still has characters written on it
+in binary, even though the program uses a different base.)</para>
+ </chapter>
+
+ <chapter label="10" id="Multithreading-and-Backtracking">
+ <para>Multithreading and Backtracking</para>
+ <informalfigure>multithreading</informalfigure>
+ <informalfigure>threading</informalfigure>
+ <informalfigure>Threaded INTERCAL</informalfigure>
+ <informalfigure>Backtracking INTERCAL</informalfigure>
+ <para>The multithreading and backtracking extensions to <acronym>INTERCAL</acronym> were
+originally invented by Malcom Ryan, who implemented <literal>COME
+FROM</literal>-based multithreading as a modified version of <abbrev>C-INTERCAL</abbrev>, but did
+not implement backtracking, known as Threaded <acronym>INTERCAL</acronym>. (The same
+functionality is implemented in <abbrev>C-INTERCAL</abbrev> today, but with different code.
+Most likely, this means that the original code was better.) He also
+invented the original version of Backtracking <acronym>INTERCAL</acronym>, but did not
+implement it; the only known implementation is the <abbrev>C-INTERCAL</abbrev> one. A
+different version of multithreading, using <literal>WHILE</literal>, was
+implemented as part of <abbrev>CLC-INTERCAL</abbrev> (like all extensions first available
+in <abbrev>CLC-INTERCAL</abbrev>, it is most likely due to Claudio Calvelli) and then added
+to <abbrev>C-INTERCAL</abbrev>, although its implications were not noticed for some time
+afterwards.</para>
+ <para>So nowadays, three freely-mixable threading-like extensions to <acronym>INTERCAL</acronym>
+exist, all of which are implemented in <abbrev>C-INTERCAL</abbrev>. (A fourth, Quantum
+<acronym>INTERCAL</acronym>, is implemented in <abbrev>CLC-INTERCAL</abbrev> but not <abbrev>C-INTERCAL</abbrev>, and so will not be
+discussed further here.) If you're wondering about the description of
+backtracking as a threading-like extension, it's implemented with much
+of the same code as multithreading in <abbrev>C-INTERCAL</abbrev>, because the <acronym>INTERCAL</acronym>
+version can be seen as roughly equivalent to multithreading where the
+threads run one after another rather than simultaneously. (This
+conceptualisation is probably more confusing than useful, though, and
+is also not strictly correct. The same could probably be said about
+<acronym>INTERCAL</acronym> as a whole, for that matter.)</para>
+
+ <sect1 label="10.1" id="Multithreading-using-COME-FROM">
+ <para>Multithreading using COME FROM</para>
+ <informalfigure><literal>COME FROM</literal>, multithreading</informalfigure>
+ <informalfigure><literal>NEXT FROM</literal>, multithreading</informalfigure>
+ <informalfigure>multithreading, separate threads</informalfigure>
+ <informalfigure>threading, separate</informalfigure>
+ <informalfigure>threading, unwoven</informalfigure>
+ <informalfigure>separate threads</informalfigure>
+ <informalfigure>unwoven threads</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.25+</bookinfo>
+ <bookinfo>version 0.05+</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The original multithreading implementation worked by giving a new
+meaning to what was previously an error condition. If in a
+multithreaded program (a program is marked as multithreaded using
+options to a compiler) two or more <literal>COME FROM</literal>s or <literal>NEXT
+FROM</literal>s (or a mixture of the two) attempt to steal control
+simultaneously, the original thread splits into multiple threads, one
+for each of the commands trying to take control, and a different
+command gains control of the program in each case.</para>
+ <para>From then on, all the threads run simultaneously. The only thing
+shared between threads (apart from the environment in which they run)
+is the abstained/reinstated status of each command; everything else is
+separate. This means, for instance, that it's possible to change the
+value of a variable in one thread, and it will not affect the
+corresponding variable in other threads created this way. Likewise,
+there is a separate NEXT stack in each thread; if both a <literal>COME
+FROM</literal> and a <literal>NEXT FROM</literal> aim at the same line, for instance, the
+<literal>NEXT FROM</literal> thread will end up with a NEXT stack entry that isn't
+in the <literal>COME FROM</literal> thread, created by the <literal>NEXT FROM</literal>
+itself. This is known as unwoven thread creation; none of the threads
+created this way are `woven' with any of the other threads created
+this way. (Whether threads are woven depends on how they were
+created.) If the thread being split was itself woven with other
+threads, exactly one of the resulting threads after the split is woven
+with the threads that the original thread was woven to, but the rest
+will not be woven to anything. (If that seems a somewhat unusual
+rule: well, this is <acronym>INTERCAL</acronym>.)</para>
+ <para>In <abbrev>C-INTERCAL</abbrev>, there are other guarantees that can be made about unwoven
+threads (that is, threads not woven to any other thread). In
+particular, they can all be guaranteed to run at approximately the
+same speed; to be more precise, the number of commands that have been
+given the chance to execute in any given thread will not differ by
+more than 2 from the number of commands that have been given the
+chance to execute in any other thread that was created at the same
+time. (However, <literal>COME FROM</literal>s and <literal>NEXT FROM</literal>s can make this
+relationship less precise; it is unspecified (in the technical sense
+that means the compiler can choose any option it likes and change its
+mind on a whim without telling anyone) whether a <literal>COME FROM</literal> or
+<literal>NEXT FROM</literal> aiming at the current command counts towards the
+command total or not, thus causing the relationship to become weaker
+the more of them have the chance to execute. In versions of <abbrev>C-INTERCAL</abbrev>
+from 0.27 onwards, there is a third guarantee; that if a <literal>COME
+FROM</literal> comes from itself, it will actually give other threads at least
+some chance to run, at some speed, by counting itself as a command
+every now and then; previously this requirement didn't exist, meaning
+that a <literal>COME FROM</literal> could block all threads if it aimed for itself
+due to the speed restrictions and the fact that <literal>COME FROM</literal>s need
+not count towards the total command count.) Also, all commands,
+including any <literal>ONCE</literal> or <literal>AGAIN</literal> attached to the command, are
+atomic; this means that it's impossible for another thread to conflict
+with what the command is doing. (In a departure from the usual
+<acronym>INTERCAL</acronym> status quo, these guarantees are somewhat <emphasis>better</emphasis> than
+in most other languages that implement threading, amusingly continuing
+to leave <acronym>INTERCAL</acronym> with the status of being unlike any other mainstream
+language.)</para>
+ <para>The only way to communicate between unwoven threads is by changing the
+abstention status of commands; this always affects all threads in the
+program, whether woven or not. (The combination of <literal>ABSTAIN</literal> and
+<literal>ONCE</literal> is one way to communicate atomically, due to the atomic
+nature of <literal>ONCE</literal>.)</para>
+ <para>If there are at least two threads, the <literal>GIVE UP</literal> command ends the
+current thread, rather than the current program.</para>
+ </sect1>
+
+ <sect1 label="10.2" id="Multithreading-using-WHILE">
+ <para>Multithreading using WHILE</para>
+ <informalfigure>WHILE</informalfigure>
+ <para><inlinemediaobject name="WHILE"></inlinemediaobject></para>
+ <informalfigure>multithreading, connected threads</informalfigure>
+ <informalfigure>threading, connected</informalfigure>
+ <informalfigure>threading, woven</informalfigure>
+ <informalfigure>connected threads</informalfigure>
+ <informalfigure>woven threads</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.27+</bookinfo>
+ <bookinfo>version 0.05+</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>The <literal>WHILE</literal> command (which is not strictly speaking a command,
+but more a sort of metacommand that joins commands) is a second method
+of achieving multithreading. (In <abbrev>CLC-INTERCAL</abbrev>, there are at least two
+other meanings for <literal>WHILE</literal>, but only the one implemented in
+<abbrev>C-INTERCAL</abbrev> is discussed here.) The syntax is somewhat unusual, and
+consists of two commands separated by the <literal>WHILE</literal> keyword, but
+sharing the statement identifier, execution chance, and any
+<literal>ONCE</literal>/<literal>AGAIN</literal> keyword that may be present. For instance:</para>
+ <programlisting>
+(1) DO COME FROM ".2~.2"~#1 WHILE :1 <-
+ "'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$
+ "'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1"
+</programlisting>
+ <para>(OK, maybe that's an unnecessarily complicated example, and maybe it
+shouldn't have included the <literal>/</literal> operator which is part of another
+<acronym>INTERCAL</acronym> extension (see ). Still, I thought
+that maybe you'd want to see how addition can be implemented in <acronym>INTERCAL</acronym>.)</para>
+ <para>A <literal>WHILE</literal> command starts two threads (the original thread that
+ran that command and a new one), one of which runs the command to the
+left of the <literal>WHILE</literal> and one of which runs the command to the
+right. Any line number applies to the left-hand command, not the
+WHILE as a whole, which is a metalanguage construct. <literal>NEXTING
+FROM</literal>, <literal>ABSTAINING FROM</literal> or similar behaviour with respect to the
+<literal>WHILE</literal> itself is impossible, although it's certainly possible to
+abstain from either of its operands (and abstaining from the left
+operand has much the same effect as abstaining from the <literal>WHILE</literal>
+itself; the right-hand thread deliberately takes a bit of time to get
+started just so that this behaviour happens). The right-command
+thread starts just before the left command is run (so <literal>NEXTING</literal>,
+etc., directly to the left command will not start that loop in the
+first place); if that command finishes (which may be almost
+immediately for something like a calculate command, or take a long
+time for something like <literal>NEXT</literal>), that thread loops and reruns
+that command as long as the left command has not finished;
+<literal>COMING FROM</literal> that command, or a <literal>NEXT</literal>/<literal>NEXT FROM</literal>
+from/aiming at that command, doesn't count as finishing that command
+until it is <literal>RESUME</literal>d back to (if possible; if it's come from,
+that command can never end and the right-hand loop will continue
+forever, or until it <literal>GIVE</literal>s <literal>UP</literal> or the loop ends due to
+the command ending later in another thread). A <literal>WHILE</literal> command
+itself exists across all threads of a multithreaded program in a way;
+for each left-hand command that ends (in any thread), the next time a
+right-hand command ends it will cause the thread it's looping in to
+end, regardless of whether that thread corresponds to the thread in
+which the left-hand command ended. (As well as a right-hand command
+ending, there's also the possibility that it never got started; there
+is a delay before the right-hand command runs during which a left-hand
+command ending can prevent the right-hand thread starting in the first
+place; this counts as the same sort of event as terminating a
+right-hand loop, and can substitute for it anywhere a right-hand
+command ending is mentioned.) There is one exception, in that if two
+or more left-hand commands end in a space of time in which no
+right-hand commands for that <literal>WHILE</literal> ends, they together only
+cause one right-hand command to end. (What, did you expect the
+logical and orthogonal behaviour?)</para>
+ <para>The two threads produced by a <literal>WHILE</literal> (the original thread and a
+new copy of it) have more in common than ordinary <acronym>INTERCAL</acronym> threads
+created by <literal>COME FROM</literal>; ordinary threads share only
+<literal>ABSTAIN</literal>/<literal>REINSTATE</literal> information, whereas the
+<literal>WHILE</literal>-produced threads count as `woven' threads which also
+share variables and stashes. (They still have separate instruction
+pointers, separate instruction pointer stacks, such as the NEXT stack,
+and separate choicepoint lists. Overloading information is shared,
+though. Being woven is a relationship between two or more threads,
+rather than an attribute of a thread, although a thread can be
+referred to as being unwoven if it is not woven to any other thread.</para>
+ <para>Ordinary multithreading cannot create woven threads. When threads are
+created by multiple <literal>COME FROM</literal>s from an original thread, which
+was woven with at least one other thread, one of the resulting threads
+counts as the `original' thread and remains woven; the rest are `new'
+threads which initially start out with the same data as the original,
+but are not woven with anything. Backtracking in a thread
+(see ) causes it to unweave with any threads it may be
+woven with at the time (so the data in the thread that backtracks is
+set back to the data it, and the threads it was woven with at the
+time, had at the time of the <literal>MAYBE</literal>, but the other threads
+continue with the same data as before). The only way to cause three
+or more threads to become woven is with a new <literal>WHILE</literal> inside one
+of the threads that is already woven, which causes all the new threads
+to be woven together (the weaving relationship is transitive).</para>
+ </sect1>
+
+ <sect1 label="10.3" id="Backtracking">
+ <para>Backtracking</para>
+ <informalfigure>backtracking</informalfigure>
+ <informalfigure>choicepoints</informalfigure>
+ <informalfigure>dormant thread</informalfigure>
+ <informalfigure>threading, in series</informalfigure>
+ <informalfigure>threading, dormant</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.25+</bookinfo>
+ <bookinfo>no</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>A somewhat unusual threading construct that's available is
+backtracking. In case you haven't come across it before (the concept
+exists in other languages but is implemented differently and usually
+in a less general way), the basic idea is that instead of executing or
+not executing a command, you can <literal>MAYBE</literal> execute a command. This
+causes the command to be executed, but also creates a dormant thread
+in which the command wasn't executed; at any time later, the program
+can either decide that it liked the consequences of the command and
+<literal>GO AHEAD</literal> and get rid of the dormant thread, or decide that it
+didn't like the consquences of the command and <literal>GO BACK</literal> to the
+dormant thread, discarding the current one. The dormant thread is
+more commonly called a `choicepoint', that is, a point at which a
+choice was made but a different choice can still be made, and is
+generally not thought of as a thread at all by most programmers. (In
+case you're wondering: dormant threads are always unwoven.)</para>
+ <para><inlinemediaobject name="MAYBE"></inlinemediaobject></para>
+ <informalfigure>MAYBE</informalfigure>
+ <informalfigure>choicepoints, creating</informalfigure>
+ <para>To create a choicepoint, the statement identifier <literal>MAYBE</literal> is
+used, rather than the more usual <literal>DO</literal> or <literal>PLEASE</literal>.
+(Combination statement identifiers are still allowed, but must be in
+the order <literal>MAYBE DO PLEASE NOT</literal> with optionally some parts
+omitted, or different versions of <literal>NOT</literal> used, or both.) Here's an
+example:</para>
+ <programlisting>
+MAYBE DON'T GIVE UP
+</programlisting>
+ <para>When a command whose statement identifer contains <literal>MAYBE</literal> is
+reached, it is executed or not executed as normal, but in addition a
+choicepoint is created containing the program as it is at that time.
+Only <literal>ABSTAIN</literal> and <literal>REINSTATE</literal>, which always affect all
+threads in a program (even choicepoints), can alter the values stored
+in the choicepoint; so in this way, a choicepoint is also somewhat
+similar to the concept of a continuation in other languages. The
+choicepoint is placed on a choicepoint stack, which is maintained
+separately for each thread in much the same way that stashes and the
+<literal>NEXT</literal> stack are.</para>
+ <para><inlinemediaobject name="GO BACK"></inlinemediaobject></para>
+ <informalfigure>GO BACK</informalfigure>
+ <informalfigure>choicepoints, activating</informalfigure>
+ <para>The choicepoint does not actually do anything immediately, but if the
+program doesn't like the look of where it's ended up, or it decides to
+change its mind, or just wants to try all the possibilities, it can
+call the <literal>GO BACK</literal> command (which has no arguments, and is just
+the statement identifier, optional execution chance, <literal>GO BACK</literal>,
+and optional <literal>ONCE</literal> or <literal>AGAIN</literal>). This causes the current
+thread to unweave from all other threads and then replace itself with
+the thread created by the choicepoint on top of the choicepoint stack.
+The difference is that this time, the abstention or reinstatement
+status of the command that was modified with <literal>MAYBE</literal> is
+temporarily reversed for determining whether it runs or not (this
+reversal only lasts immediately after the <literal>GO BACK</literal>, and does not
+affect uses of the command in other threads or later in the same
+thread), so unless it has been <literal>ABSTAIN</literal>ed or <literal>REINSTATE</literal>d
+in the meantime it will run if and only if it wasn't run the first
+time. The choicepoint stack's top entry is replaced by a `stale'
+choicepoint that definitely isn't a thread; attempting to <literal>GO
+BACK</literal> to a stale choicepoint instead causes the stale choicepoint to
+be deleted and the program to continue executing. (This is what gives
+<acronym>INTERCAL</acronym>'s backtracking greater flexibility in some ways than some
+other languages; to get backtracking without the stale choicepoints
+having an effect, simply run <literal>COME FROM</literal> the <literal>GO BACK</literal> as
+the previous statement.)</para>
+ <para>Note that, though, when a thread splits into separate threads (whether
+woven or unwoven), the choicepoint stack doesn't split completely, but
+remains joined at the old top of stack. The two choicepoint stacks
+can add and remove items independently, but an attempt to <literal>GO
+BACK</literal> to before the current thread split off from any other threads
+that are still running instead causes the current thread to end,
+although it will <literal>GO BACK</literal> as normal if all other threads that
+split off from it or that it split off from since the top choicepoint
+of the stack was created have ended since. This means that it's
+possible to backtrack past a thread splitting and get the effect of
+the thread unsplitting, as long as both resulting threads backtrack;
+this is another way in which <acronym>INTERCAL</acronym>'s backtracking is more flexible
+than that of some other languages.</para>
+ <para><inlinemediaobject name="GO AHEAD"></inlinemediaobject></para>
+ <informalfigure>GO AHEAD</informalfigure>
+ <informalfigure>choicepoints, discarding</informalfigure>
+ <para>If, on the other hand, a program decides that it likes where it is and
+doesn't need to <literal>GO BACK</literal>, or it wants to <literal>GO BACK</literal> to a
+choicepoint lower down the stack while skipping some of the ones
+nearer the top of the stack, it can run the <literal>GO AHEAD</literal> command,
+which removes the top choicepoint on the stack, whether it's a genuine
+choicepoint or just a stale one.</para>
+ <para>Both <literal>GO AHEAD</literal> and <literal>GO BACK</literal> cause errors if an attempt is
+made to use them when the choicepoint stack is empty.</para>
+ </sect1>
+ </chapter>
+
+ <chapter label="11" id="Operand-Overloading">
+ <para>Operand Overloading</para>
+ <informalfigure>operand overloading</informalfigure>
+ <informalfigure>/</informalfigure>
+ <informalfigure>slat</informalfigure>
+ <informalfigure>reverse assignment</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.26+</bookinfo>
+ <bookinfo>version 0.05+</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>(Operand overloading in <abbrev>C-INTERCAL</abbrev> is nowhere near as advanced as it is in
+<abbrev>CLC-INTERCAL</abbrev>. This chapter only explains the partial implementation used
+by <abbrev>C-INTERCAL</abbrev>; for a full implementation, see <abbrev>CLC-INTERCAL</abbrev> and its
+documentation.)</para>
+ <para>Operand overloading is a method of using a onespot or twospot variable
+as a substitute for an expression. When a variable is overloaded to
+an expression (which could be another variable, or something more
+complex), any uses of that variable cause the expression to be
+substituted instead.</para>
+ <para>At the beginning of the program, all variables stand for themselves;
+so <literal>.1</literal> really does mean <literal>.1</literal>, for instance. The meaning of
+a variable can be overloaded using the slat operator (<literal>/</literal>), which
+is the same in both Princeton and Atari syntax: it is a binary
+operator whose left argument must be a onespot or variable and whose
+right argument can be any expression. The slat operator returns the
+true value of its left argument, but as a side effect, changes the
+meaning of its left argument to be its right argument. Here is an
+example:</para>
+ <programlisting>
+DO .1 <- .2/'.3~.4'
+</programlisting>
+ <para>The example causes <literal>.2</literal>'s true value to be assigned to <literal>.1</literal>
+(unless of course <literal>.1</literal> is read-only), but also causes <literal>.2</literal>
+from then on to actually mean <literal>'.3~.4'</literal>, except when it's the
+left operand of a slat operator. So for instance, <literal>DO .1 <- .2</literal>
+would actually assign <literal>'.3~.4'</literal> to <literal>.1</literal>. Somewhat
+confusingly, this also works in the other direction; <literal>DO .2 <-
+.1</literal> would assign <literal>.1</literal> to <literal>'.3~.4'</literal>, which would have the
+effect of changing the values of <literal>.3</literal> and <literal>.4</literal> so that
+<literal>'.3~.4'</literal> had the correct value, or throw an error if it couldn't
+manage this. (The general rule in this case is that any variable or
+constant in the expression that overloads the variable is at risk of
+being changed; this is known as a `reverse assignment'. Code like
+<literal>DO .1 <- .1/#1</literal> is entirely capable of changing the value of
+<literal>#1</literal>, although to protect new <acronym>INTERCAL</acronym> users <abbrev>C-INTERCAL</abbrev> will refuse to
+carry out operations that change the value of constants unless a
+command-line switch (see ) is used to give it permission. In
+<abbrev>C-INTERCAL</abbrev>, changing the value of a constant only changes meshes with that
+value, but in <abbrev>CLC-INTERCAL</abbrev> it can also change non-mesh uses of that
+constant, so doing so is not portable anyway.)</para>
+ <para>When multiple overloading rules are in effect, they are all applied;
+overloading <literal>.1</literal> to <literal>'.2~.3'</literal> and <literal>.2</literal> to
+<literal>'.3$.4'</literal> will cause <literal>.1</literal> to refer to <literal>''.3$.4'~.3'</literal>.
+However, this expansion stops if this would cause a loop; to be
+precise, overloading is not expanded if the expansion is nested within
+the same expansion at a higher level (so <literal>.1/.2</literal> and <literal>.2/.1</literal>
+together cause <literal>.1</literal> to expand to <literal>.2</literal>, which expands to
+<literal>.1</literal>, which cannot expand any further). In <abbrev>C-INTERCAL</abbrev>, the
+expression on the right hand side of a slat is not evaluated and not
+expanded by operand overloading.</para>
+ <para><literal>STASHING</literal> a variable causes its overloading information to be
+stashed too; <literal>RETRIEVING</literal> it causes its overload rule to also be
+retrieved from the stash (or any overload rule on the variable to be
+removed if there wasn't one when the variable was stashed).</para>
+ <para>Overloading a onespot variable to a twospot variable or vice versa is
+possible, but the results are unlikely to be predictable, especially
+if a onespot variable is used to handle a twospot value. Possible
+outcomes include truncating the value down to the right bitwidth,
+throwing an error if a value outside the onespot range is used, and
+even temporarily handling the entire twospot value as long as it
+doesn't end up eventually being assigned a value greater than twospot.</para>
+ <para>Note that reverse assignments can cause unpredictable behaviour if an
+attempt is made to reverse-assign the same variable twice in the same
+expression. In particular, sequences of commands like <literal>DO .1 <-
+.2/'.3$.3' DO .2 <- #6</literal> are liable to succeed assigning garbage to
+<literal>.3</literal> rather than failing as they ought to do, and likewise any
+situation where a variable is reverse-assigned twice in the same
+expression may assign garbage to it. This behaviour is seen as
+unsatisfactory, though, and plans exist to improve it for future
+versions.</para>
+ </chapter>
+
+ <chapter label="12" id="PIC-INTERCAL">
+ <para>PIC-INTERCAL</para>
+ <informalfigure>PIC-INTERCAL</informalfigure>
+ <informalfigure>embedded systems</informalfigure>
+ <informalfigure>microcontrollers</informalfigure>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <tbody colwidth="23*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo><abbrev>INTERCAL-72</abbrev></bookinfo>
+ <bookinfo><abbrev>C-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>CLC-INTERCAL</abbrev></bookinfo>
+ <bookinfo><abbrev>J-INTERCAL</abbrev></bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>no</bookinfo>
+ <bookinfo>version 0.26+</bookinfo>
+ <bookinfo>no</bookinfo>
+ <bookinfo>no</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>PIC-INTERCAL is a simplified version of <acronym>INTERCAL</acronym> designed especially
+for embedded systems, designed to minimise code and data usage by
+<acronym>INTERCAL</acronym> programs so that they can fit on devices whose memory is
+measured in bytes rather than megabytes. (It is named after the first
+microcontroller for which code was successfully generated, and which
+influenced the choices of commands, the PIC16F628 manufactured by
+Microchip, and is most likely to be portable to other microcontrollers
+in the same range.) <abbrev>C-INTERCAL</abbrev> only compilers as far as C code when
+producing PIC-INTERCAL; it is up to the user to find the appropriate
+cross-compiler to translate this C into the relevant dialect of
+machine code. (Two header files in the distribution,
+<filename>src/pick1.h</filename> and <filename>src/pick2.h</filename>, don't have any affect on
+the compiler but are referenced by the generated code, and the intent
+is for the user to change them to suit the behaviour of the PIC
+compiler used, because these are not as standardised as C compilers
+for everyday systems.)</para>
+ <para>There are several restrictions on PIC-INTERCAL programs:</para>
+ <listitem mark="bullet">
+ <variablelist>It's impossible to store more than one item in the STASH for any givenvariable.</variablelist>
+ <variablelist>Many errors are not checked at runtime; it is the programmer's job toensure that runtime errors are avoided. (The few errors that aredetected will send the program into an infinite loop, as there is nosensible way to exit from a PIC program.)</variablelist>
+ <variablelist>Double-oh-sevens are not randomised, but instead depend merely onwhether the probability given is greater than 50% or not.</variablelist>
+ <variablelist>The NEXT stack is limited to 16 entries rather than the usual 80.</variablelist>
+ <variablelist><literal>ABSTAIN</literal> and <literal>REINSTATE</literal> still work, but cannot be computed<literal>ABSTAIN</literal>s, and will not necessarily work when used to affect thesystem library or calls to it.</variablelist>
+ <variablelist><literal>READ OUT</literal> and <literal>WRITE IN</literal> don't work. (See below for areplacement.)</variablelist>
+ <variablelist><literal>COME FROM</literal> and <literal>NEXT FROM</literal> must aim at a label, not anexpression or gerund.</variablelist>
+ <variablelist>Multithreading and TriINTERCAL cannot be used on PICs. (Operandoverloading can be used, but only if your PIC cross-compiler supportsfunction pointers; some don't.)</variablelist>
+
+ </listitem>
+ <para><inlinemediaobject name="PIN"></inlinemediaobject></para>
+ <informalfigure>PIN</informalfigure>
+ <informalfigure>I/O, PIC-INTERCAL</informalfigure>
+ <para>In order to provide I/O capabilities, a new command <literal>PIN</literal> is
+available. It controls up to 16 I/O pins on the PIC or other embedded
+system; an I/O pin is capable of receiving or sending voltages to an
+electrical or electronic circuit. This explanation assumes that the
+device being controlled is a PIC16F628A, and therefore has its pins in
+two blocks of 8 named ‘<literal>PORTA</literal>’ and ‘<literal>PORTB</literal>’; for other
+microcontrollers, adapting the code in <filename>src/pick1.h</filename> is likely to
+be necessary to tell the compiler how to control the I/O pins, and the
+way in which this done will affect which I/O pins it is that the
+program will end up being able to communicate with.</para>
+ <para>The <literal>PIN</literal> command takes one twospot variable as its argument,
+like this:</para>
+ <programlisting>
+DO PIN :2
+</programlisting>
+ <para>The twospot variable is conceptually divided into 4 blocks of 8 bits.
+The highet two blocks control the directions of the pins in
+<literal>PORTB</literal> (most significant block) and <literal>PORTA</literal> (second most
+significant block); a 1 on any bit means that the corresponding I/O
+pin should be set to send data, and a 0 means that it should be set to
+receive data. The lower two blocks control the values on the pins
+that are sending (and are ignored for receiving pins); the second
+least significant block controls <literal>PORTB</literal> and the least
+significant block controls <literal>PORTA</literal>, with a 1 causing the program
+to set the output voltage to that of the microcontroller's negative
+voltage supply rail, and a 0 causing the program to set the output
+voltage to that of the microcontroller's positive voltage supply
+rail. (These voltages may vary on other systems; consult your
+system's datasheet and the changes you made to the header files.)
+After setting the pins, the <literal>PIN</literal> command then reads them as part
+of the same operation, this time setting the values of the lower
+blocks that are receiving, rather than setting the pins from the lower
+blocks that are sending. However, 1 and 0 bits on all bits of the
+twospot variable have the opposite meaning when doing this, so that 1
+means receiving/positive voltage rail and 0 means sending/negative
+voltage rail. There is no way to input without output, or vice versa,
+but it's trivial to just send the same output again (which has no
+effect, because the voltage on sending pins is maintained at the same
+level until it is changed), or to ignore the input received.</para>
+ </chapter>
+
+ <chapter label="13" id="External-Calls">
+ <para>External Calls</para>
+ <informalfigure>external calls</informalfigure>
+ <informalfigure>other languages</informalfigure>
+ <informalfigure>foreign functions</informalfigure>
+ <informalfigure>calls, external</informalfigure>
+ <para><abbrev>C-INTERCAL</abbrev> (from version 0.28 onwards) has a feature allowing <acronym>INTERCAL</acronym> and
+non-<acronym>INTERCAL</acronym> code to be mixed. This is achieved by causing the
+non-<acronym>INTERCAL</acronym> programs to participate in the <acronym>INTERCAL</acronym> line-numbering
+model.</para>
+ <para>To create a combined program containing <acronym>INTERCAL</acronym> and non-<acronym>INTERCAL</acronym> code,
+use <command>ick</command> as the compiler as normal, but specify both the
+<acronym>INTERCAL</acronym> and non-<acronym>INTERCAL</acronym> source files on the command line.
+<command>ick</command> will invoke other compilers as necessary, possibly after
+modifying the source files accordingly. At present, external calls
+are only supported to and from C.</para>
+ <para>In each case, it will be the <acronym>INTERCAL</acronym> program that is invoked first.
+(This means that it is impossible to link together more than one
+<acronym>INTERCAL</acronym> program, but you probably don't want to, because concatenating
+the programs is likely to have a similar effect.) You can get the
+<acronym>INTERCAL</acronym> program to <literal>NEXT</literal> to the non-<acronym>INTERCAL</acronym> program immediately,
+or the non-<acronym>INTERCAL</acronym> program to <literal>COME FROM</literal> or <literal>NEXT FROM</literal> the
+<acronym>INTERCAL</acronym> program immediately, to obtain the effect of running the
+non-<acronym>INTERCAL</acronym> program first.</para>
+ <para>Note that external calls are incompatible with PIC-INTERCAL and with
+multithreading.</para>
+
+ <sect1 label="13.1" id="External-Calls-to-C">
+ <para>External Calls to C</para>
+ <informalfigure>C</informalfigure>
+ <informalfigure>other languages, C</informalfigure>
+ <informalfigure>external calls, to C</informalfigure>
+ <para>Linking C and <acronym>INTERCAL</acronym> programs is acheived by placing various
+constructs into the C programs that are equivalent to various <acronym>INTERCAL</acronym>
+constructs. It is possible to simulate a line with a label and a
+dummy command (which serves as a <literal>COME FROM</literal> suckpoint and
+<literal>NEXT</literal> target), <literal>NEXT</literal>, <literal>RESUME</literal>, and <literal>FORGET</literal>,
+and <literal>COME FROM</literal> and <literal>NEXT FROM</literal>. Onespot and twospot
+variables are accessible from inside the C program, where they can be
+read and written; however, the <acronym>INTERCAL</acronym> program cannot access any
+variables inside the C program that weren't part of the <acronym>INTERCAL</acronym>
+program originally.</para>
+ <para>To prevent various logical impossibilities, there are restrictions on
+where these can be used and what preparation is needed before they are
+used. Also, the semantics are not always exactly what you might
+expect for technical reasons.</para>
+ <para>It should be observed that the <acronym>INTERCAL</acronym> link intrudes on the user
+namespace. To prevent possible namespace clashes, no identifiers
+starting with <literal>ick_</literal> or <literal>ICK_</literal> should be used anywhere in
+the linked C program for any reason, except where specified in this
+manual.</para>
+ <term><indexterm><literal>#include <ick_ec.h></literal>
+ <variablelist>
+ <informalfigure>ick_ec.h</informalfigure>The header file <filename>ick_ec.h</filename> must be included using thepreprocessor in any file which uses any of the <acronym>INTERCAL</acronym> external callfunctions, variables, or macros. (Note that this file may notnecessarily exist, or exist in the usual place; <command>ick</command> willdeal with making sure the correct header file is included.)</variablelist>
+ </indexterm><indexterm><literal>ICK_EC_FUNC_START</literal><literal>ICK_EC_FUNC_END</literal>
+ <variablelist>
+ <informalfigure>ICK_EC_FUNC_START</informalfigure>
+ <informalfigure>ICK_EC_FUNC_END</informalfigure>Many of the <acronym>INTERCAL</acronym> interface macros (<literal>ick_linelabel</literal>,<literal>ick_comefrom</literal>, and <literal>ick_nextfrom</literal>) make it possible tojump from an <acronym>INTERCAL</acronym> program to a C program. Because C doesn't allowjumping into the middle of a function, there has to be some way tocreate a block of code which <emphasis>can</emphasis> be jumped into. This is whatthese two macros achieve.This declaration and definition:
+ <programlisting>
+ICK_EC_FUNC_START(identifier)
+{
+ /* code goes here */
+}
+ICK_EC_FUNC_END
+</programlisting>is equivalent to this:
+ <programlisting>
+void identifier(void)
+{
+ /* code goes here */
+}
+</programlisting>except that it is possible to jump from an <acronym>INTERCAL</acronym> program into thedeclared and defined program. (If you need to write a prototype forthe function early, <literal>void identifier(void);</literal> is perfectlyacceptable, but an early prototype is not required unless you call thefunction from earlier within the C code.) Of course, you cansubstitute any identifier that's legal as a function name for<literal>identifier</literal> (as long as it doesn't start with <literal>ick_</literal> or<literal>ICK_</literal>). The resulting function is a function (for instance, youcan take its address or call it in the usual ways); the onlydifferences are that it can be jumped into from <acronym>INTERCAL</acronym> code and thatit is constrained to take no arguments and return no data. (It canstill access global and <acronym>INTERCAL</acronym> variables.) If the function is jumpedinto from <acronym>INTERCAL</acronym> code, but then control flow reaches the end of thefunction, a <literal>RESUME #1</literal> is automatically done to give the programsome way to continue. (There will be the usual error message if the<literal>NEXT</literal> stack happens to be empty at the time.)</variablelist>
+ </indexterm><indexterm><literal>ick_linelabel</literal>
+ <variablelist>
+ <informalfigure>ick_linelabel</informalfigure>
+ <informalfigure>line labels, C</informalfigure>A line label is something that can be <literal>NEXT</literal>ed to and <literal>COMEFROM</literal>. Unlike an <acronym>INTERCAL</acronym> line label, it does not label a statement,and therefore attempts to <literal>ABSTAIN</literal> or <literal>REINSTATE</literal> it may beerrors, or may be ignored (it's unspecified which, which means thateither may happen for any or no reason, but exactly one will happen inany given case, although the choice might not be consistent).The macro <literal>ick_linelabel(expression);</literal> may appear anywhere acompound statement would normally be able to appear. (That is, itlooks like a function call being used as a standalone expression, butin fact the places where it can appear are more limited.) In contrastto ordinary line labels, an expression can be used rather than just aconstant; however, the behaviour is undefined if the expression hasside-effects. Upon encountering the line label, any <literal>COME FROM</literal>sor <literal>NEXT FROM</literal>s aiming at the line label (including<literal>ick_comefrom</literal>s and <literal>ick_nextfrom</literal>s) will steal control fromthe program; <literal>RESUM</literal>ing after a <literal>NEXT FROM</literal> will work, butsuffers from the same caveats as setjmp/longjmp do (any auto variablesthat change their value between the <literal>NEXT FROM</literal> and <literal>RESUME</literal>will have their value clobbered (i.e. their value is no longerreliable and should not be accessed)). Note that the <acronym>INTERCAL</acronym>variables are immune to this problem.It is possible to <literal>NEXT</literal> or <literal>ick_donext</literal> to a<literal>ick_linelabel</literal>, which has the same effect as saving the<literal>NEXT</literal> stack, calling the function containing the<literal>ick_linelabel</literal> and then immediately doing a C <literal>goto</literal> to animaginary label preceding it. Due to this possibility, an<literal>ick_linelabel</literal> is only allowed within a function defined with<literal>ICK_EC_FUNC_START</literal>.</variablelist>
+ </indexterm>
+ </term>
+ </sect1>
+ </chapter>
+
+ <chapter label="14" id="Differences-to-Other-Compilers">
+ <para>Differences to Other Compilers</para>
+ <informalfigure>INTERCAL compilers</informalfigure>
+ <para>The <abbrev>C-INTERCAL</abbrev> compiler exists in a world of several other compilers.</para>
+ <bridgehead renderas="sect2">Differences to the Princeton compiler</bridgehead>
+ <para>The Princeton compiler was the first <acronym>INTERCAL</acronym> compiler available, and
+compiled <abbrev>INTERCAL-72</abbrev>. Using <command>convickt</command> (see ) to
+translate its programs from the original EBCDIC to Latin-1 or
+Atari-syntax ASCII is required to run them under the <abbrev>C-INTERCAL</abbrev> compiler,
+but apart from that there should be no problems; everything that that
+compiler can do can be reproduced by <abbrev>C-INTERCAL</abbrev>, even including some of
+its bugs. The only potential problems may be where constructs were
+nonportable or dubious to begin with (such as the
+<literal>IGNORE</literal>/<literal>RETRIEVE</literal> interaction), or where commands intended
+to be syntax errors were used in the program but have a meaning in
+<abbrev>C-INTERCAL</abbrev>. For extra portability, it's possible to use the <literal>-t</literal>
+compiler option to <command>ick</command> (see ) to tell it to interpret
+the program as <abbrev>INTERCAL-72</abbrev>, but as <abbrev>C-INTERCAL</abbrev>'s dialect of <acronym>INTERCAL</acronym> is
+basically backward-compatible anyway this mostly serves to check newer
+programs for compatibility with older compilers.</para>
+ <bridgehead renderas="sect2">Differences to the Atari compiler</bridgehead>
+ <para>The Atari compiler was another implementation of <abbrev>INTERCAL-72</abbrev>, which was
+basically identical to the Princeton compiler apart from its use of
+ASCII and Atari syntax. Everything said under the previous section
+applies, except that as it uses the same syntax as <abbrev>C-INTERCAL</abbrev> anyway
+(<abbrev>C-INTERCAL</abbrev>'s syntax was based on the Atari compiler's), there is no need
+to use <command>convickt</command>.</para>
+ <bridgehead renderas="sect2">Differences to <abbrev>J-INTERCAL</abbrev></bridgehead>
+ <para>The <abbrev>J-INTERCAL</abbrev> compiler is an implementation of <acronym>INTERCAL</acronym> written in Java
+that compiles <acronym>INTERCAL</acronym> into Java (and so has a similar relationship
+with Java to that of the <abbrev>C-INTERCAL</abbrev> compiler (which is written in C and
+compiles into C) with C). <abbrev>J-INTERCAL</abbrev> has much the same feature set as
+older versions of <abbrev>C-INTERCAL</abbrev>, with a few changes (such as the addition of
+Esperanto and error messages coming up in different situations).
+<abbrev>J-INTERCAL</abbrev> programs should run fine on <abbrev>C-INTERCAL</abbrev> without trouble (as it is
+also an Atari syntax compiler), except in nonportable cases such as
+<literal>IGNORE</literal>/<literal>RETRUEVE</literal> interaction.</para>
+ <bridgehead renderas="sect2">Differences to <abbrev>CLC-INTERCAL</abbrev></bridgehead>
+ <para>The <abbrev>CLC-INTERCAL</abbrev> compiler is the most modern <acronym>INTERCAL</acronym> compiler apart from
+<abbrev>C-INTERCAL</abbrev> (both compilers are maintained and updated every now and then
+as of the time of writing, so which is more modern is normally a
+matter of when you happen to check). Unlike the other three compilers
+mentioned above, it has a quite significant feature set, including
+many features not implemented or only partially implemented in <abbrev>C-INTERCAL</abbrev>,
+and is responsible for the origin of many of the features added in
+more recent versions of <abbrev>C-INTERCAL</abbrev>. Generally speaking, a <abbrev>CLC-INTERCAL</abbrev>
+program that uses its advanced features is unlikely to run on <abbrev>C-INTERCAL</abbrev>,
+or vice versa, whatever you do (apart from completely rewriting the
+more advanced parts of the program.)</para>
+ <para>However, there are certain steps that can be taken to transfer less
+advanced programs from one compiler to the other. First, translate
+the program to Latin-1 Princeton syntax (if translating from <abbrev>CLC-INTERCAL</abbrev>
+to <abbrev>C-INTERCAL</abbrev>) or Atari syntax (if translating from <abbrev>C-INTERCAL</abbrev> to <abbrev>CLC-INTERCAL</abbrev>),
+maybe using <command>convickt</command>, if necessary. (Note that here the
+program is being translated to the syntax that is not default for the
+target compiler.) Then use command-line arguments to switch the
+compiler into the correct emulation mode for the other compiler;
+<abbrev>C-INTERCAL</abbrev> uses the options <option>-xX</option>, and on <abbrev>CLC-INTERCAL</abbrev> this is done by
+selecting the appropriate preloads, or by changing the program's file
+extension to ‘<literal>.ci</literal>’. In each case other options may be needed to
+turn on various extensions (maybe <option>-m</option> or <option>-v</option> if
+translating to <abbrev>C-INTERCAL</abbrev>, maybe the preload for gerund-based <literal>COME
+FROM</literal> if translating to <abbrev>CLC-INTERCAL</abbrev>), and if translating to <abbrev>CLC-INTERCAL</abbrev> you
+need to append the system library to your program yourself because
+<abbrev>CLC-INTERCAL</abbrev> doesn't load it automatically.</para>
+ <para>In the case of very simple programs, or if you want to spend the
+effort in translating compiler-specific code from one compiler to
+another, you may be able to work without emulation options. (This is
+a good target to aim for, in any case.) In such a case, you would do
+nothing other than possibly edit the program to be more portable and a
+possible character set and syntax change using <command>convickt</command>. If
+you need compiler-specific code, you may be able to detect the
+compiler in the code itself and adapt accordingly; making use of the
+<literal>IGNORE</literal>/<literal>RETRIEVE</literal> interaction is one way to do this, as it
+differs between <abbrev>C-INTERCAL</abbrev>, <abbrev>J-INTERCAL</abbrev>, and <abbrev>CLC-INTERCAL</abbrev>. The other things to
+watch out for when doing this are that <abbrev>CLC-INTERCAL</abbrev> needs an explicit
+option to enable the use of <literal>NEXT</literal>, that <abbrev>CLC-INTERCAL</abbrev> doesn't load
+the system library iteslf (you need to manually append it to the end
+of the program) and that you probably shouldn't number a line (666)
+unless you know what you're doing, because that line number has a
+special meaning in <abbrev>CLC-INTERCAL</abbrev>.</para>
+ </chapter>
+
+ <chapter label="" xreflabel="PART IV: APPENDICES AND INDICES">
+ <para>PART IV: APPENDICES AND INDICES</para>
+ </chapter>
+
+ <appendix id="Character-Sets">
+ <para>Character Sets</para>
+ <informalfigure>character sets</informalfigure>
+ <informalfigure>Atari, character set</informalfigure>
+ <informalfigure>Baudot</informalfigure>
+ <informalfigure>EBCDIC</informalfigure>
+ <informalfigure>Latin-1</informalfigure>
+ <para>The following table explains the equivalences between the various
+character sets used for <acronym>INTERCAL</acronym>: 7-bit ASCII Atari syntax, 5-bit
+Baudot Princeton syntax, 8-bit EBCDIC Princeton syntax, and 8-bit
+Latin-1 Princeton syntax. (The Baudot and EBCDIC are the <abbrev>CLC-INTERCAL</abbrev>
+versions, which are used by <acronym>INTERCAL</acronym> compilers but basically nowhere
+else.) The characters themselves are not shown in the table below,
+because they would have to be shown in some syntax, which would be
+misleading. (Atari syntax is used throughout this manual; you could
+convert from that, assuming you have an ASCII table handy.) You can
+also use the <command>convickt</command> command-line tool to translate <acronym>INTERCAL</acronym>
+programs from one format to another (see ). Note that
+Baudot has more than one 'shift state'; the shift state (1, 2, 3, or
+4) is written before the hexadecimal code for each character, and *
+represents a character available in every shift state. To change from
+one shift state to another, use character 1f to change from shift
+states 3 or 4 to 1, or from 1 or 2 to 2, and character 1b to change
+from shift states 1 or 2 to 3, or from 3 or 4 to 4.</para>
+ <colspec>
+ <thead cols="4">
+ <tbody colwidth="32*"></tbody>
+ <tbody colwidth="33*"></tbody>
+ <tbody colwidth="33*"></tbody>
+ <tbody colwidth="34*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo>Atari</bookinfo>
+ <bookinfo>Baudot</bookinfo>
+ <bookinfo>EBCDIC</bookinfo>
+ <bookinfo>Latin-1</bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>09</bookinfo>
+ <bookinfo>N/A</bookinfo>
+ <bookinfo>09</bookinfo>
+ <bookinfo>09</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>0a</bookinfo>
+ <bookinfo>* 02</bookinfo>
+ <bookinfo>0a</bookinfo>
+ <bookinfo>0a</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>0d</bookinfo>
+ <bookinfo>* 08</bookinfo>
+ <bookinfo>0d</bookinfo>
+ <bookinfo>0d</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>20</bookinfo>
+ <bookinfo>* 04</bookinfo>
+ <bookinfo>40</bookinfo>
+ <bookinfo>20</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>21</bookinfo>
+ <bookinfo>3 0d</bookinfo>
+ <bookinfo>4f</bookinfo>
+ <bookinfo>21</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>22</bookinfo>
+ <bookinfo>3 11</bookinfo>
+ <bookinfo>7f</bookinfo>
+ <bookinfo>22</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>23</bookinfo>
+ <bookinfo>4 06</bookinfo>
+ <bookinfo>7b</bookinfo>
+ <bookinfo>23</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>24</bookinfo>
+ <bookinfo>4 01</bookinfo>
+ <bookinfo>4a</bookinfo>
+ <bookinfo>a2</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>25</bookinfo>
+ <bookinfo>4 1c</bookinfo>
+ <bookinfo>6c</bookinfo>
+ <bookinfo>25</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>26</bookinfo>
+ <bookinfo>3 1a</bookinfo>
+ <bookinfo>50</bookinfo>
+ <bookinfo>26</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>27</bookinfo>
+ <bookinfo>3 0b</bookinfo>
+ <bookinfo>7d</bookinfo>
+ <bookinfo>27</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>28</bookinfo>
+ <bookinfo>3 0f</bookinfo>
+ <bookinfo>4d</bookinfo>
+ <bookinfo>28</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>29</bookinfo>
+ <bookinfo>3 12</bookinfo>
+ <bookinfo>5d</bookinfo>
+ <bookinfo>29</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>2a</bookinfo>
+ <bookinfo>4 09</bookinfo>
+ <bookinfo>5c</bookinfo>
+ <bookinfo>2a</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>2b</bookinfo>
+ <bookinfo>4 03</bookinfo>
+ <bookinfo>4e</bookinfo>
+ <bookinfo>2b</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>2c</bookinfo>
+ <bookinfo>3 0c</bookinfo>
+ <bookinfo>6b</bookinfo>
+ <bookinfo>2c</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>2d</bookinfo>
+ <bookinfo>3 03</bookinfo>
+ <bookinfo>60</bookinfo>
+ <bookinfo>2d</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>2e</bookinfo>
+ <bookinfo>3 1c</bookinfo>
+ <bookinfo>4b</bookinfo>
+ <bookinfo>2e</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>2f</bookinfo>
+ <bookinfo>3 1d</bookinfo>
+ <bookinfo>61</bookinfo>
+ <bookinfo>2f</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>30</bookinfo>
+ <bookinfo>3 16</bookinfo>
+ <bookinfo>f0</bookinfo>
+ <bookinfo>30</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>31</bookinfo>
+ <bookinfo>3 17</bookinfo>
+ <bookinfo>f1</bookinfo>
+ <bookinfo>31</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>32</bookinfo>
+ <bookinfo>3 13</bookinfo>
+ <bookinfo>f2</bookinfo>
+ <bookinfo>32</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>33</bookinfo>
+ <bookinfo>3 01</bookinfo>
+ <bookinfo>f3</bookinfo>
+ <bookinfo>33</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>34</bookinfo>
+ <bookinfo>3 0a</bookinfo>
+ <bookinfo>f4</bookinfo>
+ <bookinfo>34</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>35</bookinfo>
+ <bookinfo>3 10</bookinfo>
+ <bookinfo>f5</bookinfo>
+ <bookinfo>35</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>36</bookinfo>
+ <bookinfo>3 15</bookinfo>
+ <bookinfo>f6</bookinfo>
+ <bookinfo>36</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>37</bookinfo>
+ <bookinfo>3 07</bookinfo>
+ <bookinfo>f7</bookinfo>
+ <bookinfo>37</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>38</bookinfo>
+ <bookinfo>3 06</bookinfo>
+ <bookinfo>f8</bookinfo>
+ <bookinfo>38</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>39</bookinfo>
+ <bookinfo>3 18</bookinfo>
+ <bookinfo>f9</bookinfo>
+ <bookinfo>39</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>3a</bookinfo>
+ <bookinfo>3 0e</bookinfo>
+ <bookinfo>7a</bookinfo>
+ <bookinfo>3a</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>3b</bookinfo>
+ <bookinfo>3 1e</bookinfo>
+ <bookinfo>5e</bookinfo>
+ <bookinfo>3b</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>3c</bookinfo>
+ <bookinfo>4 0f</bookinfo>
+ <bookinfo>4c</bookinfo>
+ <bookinfo>3c</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>3d</bookinfo>
+ <bookinfo>4 07</bookinfo>
+ <bookinfo>7e</bookinfo>
+ <bookinfo>3d</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>3e</bookinfo>
+ <bookinfo>4 12</bookinfo>
+ <bookinfo>6e</bookinfo>
+ <bookinfo>3e</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>3f</bookinfo>
+ <bookinfo>4 0c</bookinfo>
+ <bookinfo>65</bookinfo>
+ <bookinfo>a5</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>40</bookinfo>
+ <bookinfo>3 19</bookinfo>
+ <bookinfo>6f</bookinfo>
+ <bookinfo>3f</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>41</bookinfo>
+ <bookinfo>1 03</bookinfo>
+ <bookinfo>c1</bookinfo>
+ <bookinfo>41</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>42</bookinfo>
+ <bookinfo>1 19</bookinfo>
+ <bookinfo>c2</bookinfo>
+ <bookinfo>42</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>43</bookinfo>
+ <bookinfo>1 0e</bookinfo>
+ <bookinfo>c3</bookinfo>
+ <bookinfo>43</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>44</bookinfo>
+ <bookinfo>1 09</bookinfo>
+ <bookinfo>c4</bookinfo>
+ <bookinfo>44</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>45</bookinfo>
+ <bookinfo>1 01</bookinfo>
+ <bookinfo>c5</bookinfo>
+ <bookinfo>45</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>46</bookinfo>
+ <bookinfo>1 0d</bookinfo>
+ <bookinfo>c6</bookinfo>
+ <bookinfo>46</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>47</bookinfo>
+ <bookinfo>1 1a</bookinfo>
+ <bookinfo>c7</bookinfo>
+ <bookinfo>47</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>48</bookinfo>
+ <bookinfo>1 14</bookinfo>
+ <bookinfo>c8</bookinfo>
+ <bookinfo>48</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>49</bookinfo>
+ <bookinfo>1 06</bookinfo>
+ <bookinfo>c9</bookinfo>
+ <bookinfo>49</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>4a</bookinfo>
+ <bookinfo>1 0b</bookinfo>
+ <bookinfo>d1</bookinfo>
+ <bookinfo>4a</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>4b</bookinfo>
+ <bookinfo>1 0f</bookinfo>
+ <bookinfo>d2</bookinfo>
+ <bookinfo>4b</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>4c</bookinfo>
+ <bookinfo>1 13</bookinfo>
+ <bookinfo>d3</bookinfo>
+ <bookinfo>4c</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>4d</bookinfo>
+ <bookinfo>1 1c</bookinfo>
+ <bookinfo>d4</bookinfo>
+ <bookinfo>4d</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>4e</bookinfo>
+ <bookinfo>1 0c</bookinfo>
+ <bookinfo>d5</bookinfo>
+ <bookinfo>4e</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>4f</bookinfo>
+ <bookinfo>1 18</bookinfo>
+ <bookinfo>d6</bookinfo>
+ <bookinfo>4f</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>50</bookinfo>
+ <bookinfo>1 16</bookinfo>
+ <bookinfo>d7</bookinfo>
+ <bookinfo>50</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>51</bookinfo>
+ <bookinfo>1 17</bookinfo>
+ <bookinfo>d8</bookinfo>
+ <bookinfo>51</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>52</bookinfo>
+ <bookinfo>1 0a</bookinfo>
+ <bookinfo>d9</bookinfo>
+ <bookinfo>52</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>53</bookinfo>
+ <bookinfo>1 05</bookinfo>
+ <bookinfo>e2</bookinfo>
+ <bookinfo>53</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>54</bookinfo>
+ <bookinfo>1 10</bookinfo>
+ <bookinfo>e3</bookinfo>
+ <bookinfo>54</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>55</bookinfo>
+ <bookinfo>1 07</bookinfo>
+ <bookinfo>e4</bookinfo>
+ <bookinfo>55</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>56</bookinfo>
+ <bookinfo>1 1e</bookinfo>
+ <bookinfo>e5</bookinfo>
+ <bookinfo>56</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>57</bookinfo>
+ <bookinfo>1 12</bookinfo>
+ <bookinfo>e6</bookinfo>
+ <bookinfo>57</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>58</bookinfo>
+ <bookinfo>1 1d</bookinfo>
+ <bookinfo>e7</bookinfo>
+ <bookinfo>58</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>59</bookinfo>
+ <bookinfo>1 15</bookinfo>
+ <bookinfo>e8</bookinfo>
+ <bookinfo>59</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>5a</bookinfo>
+ <bookinfo>1 11</bookinfo>
+ <bookinfo>e9</bookinfo>
+ <bookinfo>5a</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>5b</bookinfo>
+ <bookinfo>4 10</bookinfo>
+ <bookinfo>9e</bookinfo>
+ <bookinfo>5b</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>5c</bookinfo>
+ <bookinfo>4 05</bookinfo>
+ <bookinfo>N/A</bookinfo>
+ <bookinfo>5c</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>5d</bookinfo>
+ <bookinfo>4 13</bookinfo>
+ <bookinfo>5a</bookinfo>
+ <bookinfo>5d</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>5e</bookinfo>
+ <bookinfo>4 0d</bookinfo>
+ <bookinfo>6a</bookinfo>
+ <bookinfo>7c</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>5f</bookinfo>
+ <bookinfo>4 15</bookinfo>
+ <bookinfo>7c</bookinfo>
+ <bookinfo>40</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>60</bookinfo>
+ <bookinfo>N/A</bookinfo>
+ <bookinfo>N/A</bookinfo>
+ <bookinfo>60</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>61</bookinfo>
+ <bookinfo>2 03</bookinfo>
+ <bookinfo>81</bookinfo>
+ <bookinfo>61</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>62</bookinfo>
+ <bookinfo>2 19</bookinfo>
+ <bookinfo>82</bookinfo>
+ <bookinfo>62</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>63</bookinfo>
+ <bookinfo>2 0e</bookinfo>
+ <bookinfo>83</bookinfo>
+ <bookinfo>63</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>64</bookinfo>
+ <bookinfo>2 09</bookinfo>
+ <bookinfo>84</bookinfo>
+ <bookinfo>64</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>65</bookinfo>
+ <bookinfo>2 01</bookinfo>
+ <bookinfo>85</bookinfo>
+ <bookinfo>65</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>66</bookinfo>
+ <bookinfo>2 0d</bookinfo>
+ <bookinfo>86</bookinfo>
+ <bookinfo>66</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>67</bookinfo>
+ <bookinfo>2 1a</bookinfo>
+ <bookinfo>87</bookinfo>
+ <bookinfo>67</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>68</bookinfo>
+ <bookinfo>2 14</bookinfo>
+ <bookinfo>88</bookinfo>
+ <bookinfo>68</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>69</bookinfo>
+ <bookinfo>2 06</bookinfo>
+ <bookinfo>89</bookinfo>
+ <bookinfo>69</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>6a</bookinfo>
+ <bookinfo>2 0b</bookinfo>
+ <bookinfo>91</bookinfo>
+ <bookinfo>6a</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>6b</bookinfo>
+ <bookinfo>2 0f</bookinfo>
+ <bookinfo>92</bookinfo>
+ <bookinfo>6b</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>6c</bookinfo>
+ <bookinfo>2 13</bookinfo>
+ <bookinfo>93</bookinfo>
+ <bookinfo>6c</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>6d</bookinfo>
+ <bookinfo>2 1c</bookinfo>
+ <bookinfo>94</bookinfo>
+ <bookinfo>6d</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>6e</bookinfo>
+ <bookinfo>2 0c</bookinfo>
+ <bookinfo>95</bookinfo>
+ <bookinfo>6e</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>6f</bookinfo>
+ <bookinfo>2 18</bookinfo>
+ <bookinfo>96</bookinfo>
+ <bookinfo>6f</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>70</bookinfo>
+ <bookinfo>2 16</bookinfo>
+ <bookinfo>97</bookinfo>
+ <bookinfo>70</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>71</bookinfo>
+ <bookinfo>2 17</bookinfo>
+ <bookinfo>98</bookinfo>
+ <bookinfo>71</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>72</bookinfo>
+ <bookinfo>2 0a</bookinfo>
+ <bookinfo>99</bookinfo>
+ <bookinfo>72</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>73</bookinfo>
+ <bookinfo>2 05</bookinfo>
+ <bookinfo>a2</bookinfo>
+ <bookinfo>73</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>74</bookinfo>
+ <bookinfo>2 10</bookinfo>
+ <bookinfo>a3</bookinfo>
+ <bookinfo>74</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>75</bookinfo>
+ <bookinfo>2 07</bookinfo>
+ <bookinfo>a4</bookinfo>
+ <bookinfo>75</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>76</bookinfo>
+ <bookinfo>2 1e</bookinfo>
+ <bookinfo>a5</bookinfo>
+ <bookinfo>76</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>77</bookinfo>
+ <bookinfo>2 12</bookinfo>
+ <bookinfo>a6</bookinfo>
+ <bookinfo>77</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>78</bookinfo>
+ <bookinfo>2 1d</bookinfo>
+ <bookinfo>a7</bookinfo>
+ <bookinfo>78</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>79</bookinfo>
+ <bookinfo>2 15</bookinfo>
+ <bookinfo>a8</bookinfo>
+ <bookinfo>79</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>7a</bookinfo>
+ <bookinfo>2 11</bookinfo>
+ <bookinfo>a9</bookinfo>
+ <bookinfo>7a</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>7b</bookinfo>
+ <bookinfo>4 0a</bookinfo>
+ <bookinfo>9c</bookinfo>
+ <bookinfo>7b</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>7c</bookinfo>
+ <bookinfo>4 1e</bookinfo>
+ <bookinfo>fe</bookinfo>
+ <bookinfo>N/A</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>7d</bookinfo>
+ <bookinfo>4 11</bookinfo>
+ <bookinfo>dc</bookinfo>
+ <bookinfo>7d</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>7e</bookinfo>
+ <bookinfo>4 0b</bookinfo>
+ <bookinfo>a1</bookinfo>
+ <bookinfo>7e</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ </appendix>
+
+ <appendix id="convickt">
+ <para>convickt</para>
+ <informalfigure>convickt</informalfigure>
+ <informalfigure>character sets, converting</informalfigure>
+ <informalfigure>converting between character sets</informalfigure>
+ <para>A variety of character sets have historically been used to represent
+<acronym>INTERCAL</acronym> programs. Atari syntax was designed specifically for use with
+ASCII-7, and all Atari-syntax-based <acronym>INTERCAL</acronym> compilers accept that
+character set as possible input. (<abbrev>C-INTERCAL</abbrev> also accepts Latin-1 and
+UTF-8.) However, the story is more complicated with Princeton syntax;
+the original Princeton compiler was designed to work with EBCDIC, but
+because modern computers are often not designed to work with this
+character set other character sets are often used to represent it,
+particularly Latin-1. The <abbrev>CLC-INTERCAL</abbrev> compiler accepts Latin-1, a custom
+dialect of EBCDIC, Baudot, and a punched-card format as input; <abbrev>C-INTERCAL</abbrev>
+can cope with Latin-1 Princeton syntax, but for the other character
+sets, for other compilers, or just for getting something
+human-readable, it's useful to have a conversion program.
+<command>convickt</command> is an <acronym>INTERCAL</acronym> character set conversion program
+designed with these needs in mind.</para>
+ <para>The syntax for using <command>convickt</command> is</para>
+ <programlisting>
+convickt <replaceable>inputset</replaceable> <replaceable>outputset</replaceable> [<replaceable>padding</replaceable>]
+</programlisting>
+ <para>(that is, the input and output character sets are compulsory, but the
+parameter specifying what sort of padding to use is optional).</para>
+ <para>The following values for <replaceable>inputset</replaceable> and <replaceable>outputset</replaceable> are
+permissible:</para>
+ <term><indexterm>‘<literal>latin1</literal>’
+ <variablelist>Latin-1, or to give it its official name ISO-8859-1, is the characterset most commonly used for transmitting <abbrev>CLC-INTERCAL</abbrev> programs, andtherefore nowadays the most popular character set for Princeton syntaxprograms. Because it is identical to ASCII-7 in all codepoints thatdon't have the high bit set, most of the characters in it can be readby most modern editors and terminals. It is also far more likely tobe supported by modern editors than EBCDIC, Baudot, or punched cards,all of which have fallen into relative disuse since 1972. It is alsothe only input character set that <abbrev>C-INTERCAL</abbrev> supports for Princeton syntaxprograms. It uses 8 bit characters.</variablelist>
+ </indexterm><indexterm>‘<literal>ebcdic</literal>’
+ <variablelist>EBCDIC is an 8-bit character set that was an alternative to ASCII in1972, and is the character set used by the original Princetoncompiler. Unfortunately, there is no single standard version; theversion of EBCDIC used by <command>convickt</command> is the one that <abbrev>CLC-INTERCAL</abbrev>uses. It is the default input character set that <abbrev>CLC-INTERCAL</abbrev> uses(although more recent versions of <abbrev>CLC-INTERCAL</abbrev> instead try to guess theinput character set based on the input program.)</variablelist>
+ </indexterm><indexterm>‘<literal>baudot</literal>’
+ <variablelist>Baudot is a 5-bit character set with shift codes; therefore whenstoring it in a file on an 8-bit computer, padding is needed to fillin the remaining three bits. The standard Baudot character set doesnot contain all the characters needed by <acronym>INTERCAL</acronym>; therefore, <abbrev>CLC-INTERCAL</abbrev>uses repeated shift codes to add two more sets of characters.<command>convickt</command> uses the <abbrev>CLC-INTERCAL</abbrev> version of Baudot, so as to beable to translate programs designed for that compiler; however,standard Baudot is also accepted in input if it contains no redundantshift codes, and if the input contains no characters not in standardBaudot, the output will be written so that it is both correct standardBaudot and correct <abbrev>CLC-INTERCAL</abbrev> Baudot for those characters.</variablelist>
+ </indexterm><indexterm>‘<literal>atari</literal>’
+ <variablelist>This option causes <command>convickt</command> to attempt a limited conversionto or from Atari syntax; this uses ASCII-7 as the character set, butalso tries to translate between Atari and Princeton syntax at thecharacter level, which is sometimes but not always effective. Forinstance, <literal>?</literal> is translated from Atari to Princeton as a yensign, and from Princeton to Atari as a whirlpool (<literal>@</literal>); thissort of behaviour is often capable of translating expressionsautomatically, but will fail when characters outside ASCII-7 (Atari)or Latin-1 (Princeton) are used, and will not, for instance, translatea Princeton <literal>V</literal>, backspace, <literal>-</literal> into Atari <literal>?</literal>, butinstead leave it untouched. ASCII-7 is a 7-bit character set, so onan 8 bit computer, there is one bit of padding that needs to begenerated; note, however, that it is usual nowadays to clear the topbit when transmitting ASCII-7, which the `printable' and `zero'padding styles will do, but the `random' style may not do.</variablelist>
+ </indexterm>
+ </term>
+ <para>When using a character set where not all bits in each byte are
+specified, a third argument can be given to specify what sort of
+padding to use for the top bits of each character. There are three
+options for this:</para>
+ <colspec>
+ <thead cols="2">
+ <tbody colwidth="11*"></tbody>
+ <tbody colwidth="52*"></tbody>
+ <entry>
+ <abstract>
+ <bookinfo>Option</bookinfo>
+ <bookinfo>Meaning</bookinfo>
+
+ </abstract>
+ </entry>
+ <row>
+ <abstract>
+ <bookinfo>printable</bookinfo>
+ <bookinfo>Keep the output in the range 32-126 where possible</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>zero</bookinfo>
+ <bookinfo>Zero the high bits in the output</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo>random</bookinfo>
+ <bookinfo>Pad with random bits (avoiding all-zero bytes)</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>Note that not all conversions are possible. If a character cannot be
+converted, it will normally be converted to a NUL byte (which is
+invalid in every character set); note that this will prevent
+round-tripping, because NUL is interpreted as end-of-input if given in
+the input. There is one exception; if the character that could not be
+converted is a tab character, it will be converted to the other
+character set's representation of a space character, if possible,
+because the two characters have the same meaning in <acronym>INTERCAL</acronym> (the only
+difference is if the command is a syntax error that's printed as an
+error message). (The exception exists to make it possible to
+translate existing <acronym>INTERCAL</acronym> source code into Baudot.)</para>
+ </appendix>
+
+ <appendix id="Optimizer-Idiom-Language">
+ <para>Optimizer Idiom Language</para>
+ <informalfigure>Optimizer Idiom Language</informalfigure>
+ <informalfigure>OIL</informalfigure>
+ <para>One file in the <abbrev>C-INTERCAL</abbrev> distribution (<filename>src/idiotism.oil</filename>) is written
+in Optimizer Idiom Language, a programming language designed especially
+for expressing optimizer idioms for <acronym>INTERCAL</acronym> in an easily editable form
+(well, at least it's easier than the unmaintainable set of idioms
+hard-coded in C that were used in previous versions of the <acronym>INTERCAL</acronym>
+compiler).</para>
+
+ <sect1 id="OIL-Basics">
+ <para>OIL Basics</para>
+ <informalfigure>OIL, basics</informalfigure>
+ <informalfigure><filename>src/idiotism.oil</filename></informalfigure>
+ <informalfigure><filename>idiotism.oil</filename></informalfigure>
+ <informalfigure>OIL, execution</informalfigure>
+ <para>The structure of an <acronym>OIL</acronym> file consists of a sequence of idioms.
+An optimizer idiom looks for a certain pattern in an expression (which
+could be an <acronym>INTERCAL</acronym> expression, or an expression that has already been
+partly optimized and therefore contains some non-<acronym>INTERCAL</acronym> operators), and
+replaces it with a replacement that's `simpler' in some sense (in the
+case of <abbrev>C-INTERCAL</abbrev>, `simpler' is interpreted to mean `compiles into a faster
+or smaller executable when run through a C compiler'). When an
+<acronym>OIL</acronym> program acts on an input <acronym>INTERCAL</acronym> file, it keeps on
+matching idioms to simplify expressions, until none of the idioms act
+any more (and if a situation occurs where idioms can keep matching
+indefinitely, the compiler goes into an infinite loop; so don't allow
+that to happen); at present, the idioms are tried from left to right,
+from the leaves of an expression to its root, and from the start of the
+OIL file to the end; but don't rely on that, because it's subject to
+change (and gets confusing when you think about what happens when the
+program actually does a replacement). Anyway, the point is that if an
+idiom can match an expression, and another idiom doesn't change it
+first, then the idiom will be matched against that part of the
+expression eventually, and the program won't end until there are no
+idioms that match the optimized expression.</para>
+ <para>At present, the only place that <acronym>OIL</acronym> is used in the <abbrev>C-INTERCAL</abbrev>
+compiler is when the <option>-O</option> option (see -O) is used in
+base 2. (Syntax is planned to extend <acronym>OIL</acronym> to higher bases, and
+some of this is documented and even implemented, but there's no way to
+use it.) The idioms are read from the file <filename>src/idiotism.oil</filename>
+during the compilation of the <abbrev>C-INTERCAL</abbrev> from sources; you can change the
+idioms, but you will then have to recompile the distribution (and if you
+are using the <command>config.sh</command> method, also reinstall, but that will
+be pretty fast.)</para>
+ </sect1>
+
+ <sect1 id="OIL-Syntax">
+ <para>OIL Syntax</para>
+ <informalfigure>OIL, syntax</informalfigure>
+ <informalfigure>syntax, of OIL</informalfigure>
+ <para>An <acronym>OIL</acronym> file is encoded as an <acronym>ASCII</acronym> text file using
+no codepoints outside the range 0-127; using 10 for newline (as on a
+UNIX or Linux system) is always acceptable, but using 13 then 10 (as is
+common on Windows or DOS) for newline is acceptable only if your C
+compiler recognizes that as a newline. I have no idea what happens if
+you use just 13 on an Apple computer on which that is the common newline
+convention.</para>
+ <informalfigure>OIL, comments</informalfigure>
+ <informalfigure>comments, OIL</informalfigure>
+ <para>Comments can be given anywhere in the file by writing lines starting
+with semicolons (known as hybrids to <acronym>INTERCAL</acronym> programmers). It's also
+possible to write a semicolon after part of a line to comment out the
+rest of the line. Inside braced C expressions, comments can be given
+anywhere whitespace would be allowed by placing them between <literal>/*</literal>
+and <literal>*/</literal> (in such cases, the comments will be copied verbatim to
+the C temporary files used when building the <abbrev>C-INTERCAL</abbrev> compiler, where your
+C compiler will ignore them). Whitespace is ignored nearly everywhere;
+the only places it isn't ignored are in the middle of a decimal
+constant, inside square brackets, immediately after one of the
+characters ‘<literal>.:#_}</literal>’, and anywhere that C doesn't allow it in quoted
+C code. (This means that you can even place it inside operators like &&
+if you like, as long as they're part of OIL code and not C code,
+although doing this is not recommended.) If you use whitespace in a
+situation where it isn't ignored, that's almost certainly an error.</para>
+ <informalfigure>OIL, idiom groups</informalfigure>
+ <para>Idioms are grouped into groups of idioms by placing an identifier in
+square brackets before the group; this follows the rules for C
+identifiers, except that there's a maximum length of 30 characters.
+This identifier is the `name' of the group, which has no effect except
+on optimizer debug output; for that matter, the only effect a group has
+is that all idioms in the group look the same in optimizer debug output,
+because they have the same name. It's recommended that idioms only have
+the same name if they are the same idiom, possibly written in several
+ways. For example, a shift by 0 has no effect and may as well be
+removed from the output; the way to express this in OIL is:</para>
+ <programlisting>
+[nullshift]
+(_1 >> #0)->(_1)
+(_1 << #0)->(_1)
+</programlisting>
+ <para>Here, nullshift is the name of the group of idioms, and two idioms are
+given; one which removes a null rightshift, and one which removes a null
+leftshift.</para>
+ <informalfigure>OIL, idioms</informalfigure>
+ <informalfigure>idiom</informalfigure>
+ <para>As the example above shows, the syntax of an idiom itself is</para>
+ <programlisting>
+(pattern)->(replacement)
+</programlisting>
+ <para>The parentheses here are actually part of the pattern and/or
+replacement, and as such sparks (apostrophes) or rabbit-ears (double
+quotes) can be used instead; they're shown in the syntax because the
+outer layer of parenthesising is always required. Both the pattern and
+replacement are <acronym>OIL</acronym> expressions, although they both have their
+own special syntax elements as well.</para>
+ </sect1>
+
+ <sect1 id="OIL-Expressions">
+ <para>OIL Expressions</para>
+ <informalfigure>expressions, OIL</informalfigure>
+ <informalfigure>OIL, expressions</informalfigure>
+ <para>An <acronym>OIL</acronym> expression is built around subexpressions connected by
+infix binary operators and/or preceded by prefix unary operators, the
+same way as in C or <acronym>INTERCAL</acronym> (although unary operators must be entirely
+before their argument; the one character later position is not allowed.)
+As in <acronym>INTERCAL</acronym>, there is no operator precedence; expressions must be very
+fully bracketed to show unambiguously what the precedences must be, and
+then more so; for instance, bracketing marks must be placed around the
+argument of a unary operator in most circumstances. Bracketing of
+expressions can be done with parentheses, sparks (apostrophes) or
+rabbit-ears (double-quotes).</para>
+ <para>The following unary and binary operators are allowed in OIL expressions:</para>
+ <informalfigure>OIL, operators</informalfigure>
+ <informalfigure>operators, OIL</informalfigure>
+ <colspec>
+ <thead cols="2">
+ <tbody colwidth="31*"></tbody>
+ <tbody colwidth="66*"></tbody>
+ <row>
+ <abstract>
+ <bookinfo><literal>$</literal></bookinfo>
+ <bookinfo>INTERCAL mingle</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>~</literal></bookinfo>
+ <bookinfo>INTERCAL select</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>&16</literal></bookinfo>
+ <bookinfo>INTERCAL unary AND (16-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>V16</literal></bookinfo>
+ <bookinfo>INTERCAL unary OR (16-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>?16</literal></bookinfo>
+ <bookinfo>INTERCAL unary XOR (16-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>^16</literal></bookinfo>
+ <bookinfo>INTERCAL unary sharkfin (16-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>@16</literal></bookinfo>
+ <bookinfo>INTERCAL unary whirlpool (16-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>@216..@516</literal></bookinfo>
+ <bookinfo>INTERCAL unary generalised whirlpool (16-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>&32</literal></bookinfo>
+ <bookinfo>INTERCAL unary AND (32-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>V32</literal></bookinfo>
+ <bookinfo>INTERCAL unary OR (32-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>?32</literal></bookinfo>
+ <bookinfo>INTERCAL unary XOR (32-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>^32</literal></bookinfo>
+ <bookinfo>INTERCAL unary sharkfin (32-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>@32</literal></bookinfo>
+ <bookinfo>INTERCAL unary whirlpool (32-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>@232..@532</literal></bookinfo>
+ <bookinfo>INTERCAL unary generalised whirlpool (32-bit)</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>&</literal></bookinfo>
+ <bookinfo>C binary bitwise AND</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>|</literal></bookinfo>
+ <bookinfo>C binary bitwise OR</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>^</literal></bookinfo>
+ <bookinfo>C binary bitwise XOR</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>+</literal></bookinfo>
+ <bookinfo>C addition</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>-</literal></bookinfo>
+ <bookinfo>C subtraction</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>*</literal></bookinfo>
+ <bookinfo>C multiplication</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>/</literal></bookinfo>
+ <bookinfo>C integer division</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>%</literal></bookinfo>
+ <bookinfo>C modulus</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>></literal></bookinfo>
+ <bookinfo>C greater than</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal><</literal></bookinfo>
+ <bookinfo>C less than</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>~</literal></bookinfo>
+ <bookinfo>C unary bitwise complement</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>!=</literal></bookinfo>
+ <bookinfo>C not equals operator</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>==</literal></bookinfo>
+ <bookinfo>C equals operator</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>&&</literal></bookinfo>
+ <bookinfo>C logical AND</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>||</literal></bookinfo>
+ <bookinfo>C logical OR</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>>></literal></bookinfo>
+ <bookinfo>C bitwise rightshift</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal><<</literal></bookinfo>
+ <bookinfo>C bitwise leftshift</bookinfo>
+
+ </abstract>
+ <abstract>
+ <bookinfo><literal>!</literal></bookinfo>
+ <bookinfo>C unary logical NOT</bookinfo>
+
+ </abstract>
+ </row>
+ </thead>
+ </colspec>
+ <para>(Note that in some cases two operators are expressed the same way, but
+that this doesn't matter because one is unary and the other is binary so
+that there can't be any ambiguity, only confusion. Also note that
+unlike <acronym>INTERCAL</acronym> unary logic operators, OIL unary logic operators must
+have a bitwidth stated.)</para>
+ <para>It hasn't yet been explained what operands these operators have to
+operate on; the syntax for those depends on whether it's a pattern or
+replacement that the expression is representing.</para>
+ </sect1>
+
+ <sect1 id="OIL-Patterns">
+ <para>OIL Patterns</para>
+ <informalfigure>patterns</informalfigure>
+ <informalfigure>OIL, patterns</informalfigure>
+ <para>Patterns are simply <acronym>OIL</acronym> expressions; the expressions match
+either original <acronym>INTERCAL</acronym> input or expressions produced by earlier idioms.
+Each operator must match the same operator in the (possibly
+partially-optimised) input; the operands themselves are pattern
+templates specifying what operands in the input they can match.</para>
+ <para>One special simple form of match is possible: <literal>#<replaceable>NUMBER</replaceable></literal>,
+where <replaceable>NUMBER</replaceable> is in decimal, matches a constant with that value.
+(Unlike in <acronym>INTERCAL</acronym>, this constant is not limited to being a onespot
+value; it is, however, limited to being at most twospot, as are all
+operands and intermediate values in <acronym>OIL</acronym>.)</para>
+ <para>Otherwise, an operand consists of the following parts, written in order:</para>
+ <informalfigure>operands, OIL, in patterns</informalfigure>
+ <informalfigure>patterns, operands</informalfigure>
+ <varlistentry numeration="arabic">
+ <variablelist>A character to specify the data type of what's being matched. Usually,this will be <literal>_</literal> to specify that any data type can be matched. Ina few cases, you may want to use <literal>.</literal> or <literal>:</literal> to specify thatyou only want to match a onespot or twospot value respectively (that is,16- or 32-bit). You can also use <literal>#</literal>; this specifies a value thatcan be any width, but must be known to be a constant with a known valueat optimize time (either because it was hardcoded as a constantoriginally or because a constant was produced there by the optimizer,for instance via a constant folding optimization).</variablelist>
+ <variablelist>Optionally, an expression in braces (<literal>{</literal> and <literal>}</literal>). Thisexpression is written in C, not <acronym>OIL</acronym> (as are all expressions inbraces), and puts an extra condition on whether the pattern matches.The exact meaning of this will be explained later.</variablelist>
+ <variablelist>A reference number, which must be one decimal digit long. A referencenumber of 0 causes the operand to be discarded immediately aftermatching; normally, you will want to specify a positive referencenumber. Two operands with the same reference number must be exactly thesame for the pattern to match (for instance, both references to the samevariable, or identical subexpressions). The reference number alsoallows the operand to be referenced by C expressions on other operandsand by replacements. Reference numbers must be unique within the idiom(unless two or reference numbers are deliberately the same so that theoperands they reference have to be identical to produce a match), andthey are scoped only as far as the containing idiom; they don't carryfrom one idiom to another.</variablelist>
+ </varlistentry>
+ <para>Note that syntax like <literal>#2</literal> is ambiguous given what comes so far;
+the first interpretation is the one that is taken in practice, and if
+the second interpretation is wanted the operand should be expressed as
+<literal>#{1}2</literal>, using a no-op braced expression to tell them apart.
+This particular no-op is recommended because it's detected and optimized
+by the <literal>OIL</literal> compiler.</para>
+ <para>Braced expressions, which must be written purely in C, add extra
+conditions; they must return nonzero to allow a possible match or zero
+to prevent one. They can reference the following variables and
+functions:</para>
+ <informalfigure>functions, OIL in C</informalfigure>
+ <informalfigure>OIL, functions in C</informalfigure>
+ <informalfigure>C, within OIL</informalfigure>
+ <para><inlinemediaobject name="C functions in OIL"></inlinemediaobject></para>
+ <term><indexterm><literal>c</literal><literal>c<replaceable>NUMBER</replaceable></literal>
+ <variablelist>
+ <informalfigure>c</informalfigure>
+ <informalfigure>c1–c9</informalfigure>This accesses a calculation made automatically by the compiled<acronym>OIL</acronym> program to identify which bits of the operand can possiblybe set, and which ones cannot be. <literal>c</literal> by itself refers to theoperand to which the braced expression is attached; if a number isgiven, it refers to another node (the number is interpreted as areference numer). The actual value of <literal>c</literal> is a 32-bit unsignedinteger, each bit of which is true, or 1, if there is any chance thatthe corresponding bit of the operand might be 1, and false, or 0, ifit's known for certain that the corresponding bit of the operand is 0.For instance:
+ <programlisting>
+_{!(c&4294901760LU)}1
+</programlisting>The constant given here is FFFF0000 when expressed in hexadecimal; thepoint is that the expression matches any operand that is known to have avalue no greater than 65535. Unless the operand is the argument to aunary AND, this check generally makes more point than explicitlyspecifying <literal>.</literal> rather than <literal>_</literal>, because it will identify both16- and 32-bit values as long as they're small enough to fit into aonespot variable. This code could, for instance, be used to check thatan argument to a mingle must be small enough before optimising it (thisis important because an optimisation shouldn't optimise an error – inthis case, an overflowing mingle – into a non-error).</variablelist>
+ </indexterm><indexterm><literal>x</literal><literal>x<replaceable>NUMBER</replaceable></literal>
+ <variablelist>
+ <informalfigure>x</informalfigure>
+ <informalfigure>x1–x9</informalfigure><literal>x</literal> is like <literal>c</literal>, and refers to operands in the same way,except that it can only refer to an operand marked with <literal>#</literal>. Itholds the value of that constant (a 32-bit unsigned integer), which willbe known to the optimizer at optimize time. One common use of this isto detect whether a constant happens to be a power of 2, although thereare many other possibilities that may be useful.</variablelist>
+ </indexterm><indexterm><literal>r</literal>
+ <variablelist>
+ <informalfigure>r</informalfigure>When inside a loop, <literal>r</literal> is the value of the loop counter. (It'salmost certainly a mistake if you have a loop but don't reference theloop counter at least once, and usually at least twice, within theloop.) See .</variablelist>
+ </indexterm><indexterm><literal>and16</literal><literal>and32</literal><literal>or16</literal><literal>or32</literal><literal>xor16</literal><literal>xor32</literal><literal>iselect</literal><literal>mingle</literal>
+ <variablelist>
+ <informalfigure>and16</informalfigure>
+ <informalfigure>and32</informalfigure>
+ <informalfigure>or16</informalfigure>
+ <informalfigure>or32</informalfigure>
+ <informalfigure>xor16</informalfigure>
+ <informalfigure>xor32</informalfigure>
+ <informalfigure>iselect</informalfigure>
+ <informalfigure>mingle</informalfigure>These are all functions with one argument (apart from iselect andmingle, which each take two arguments); they exist so that <acronym>INTERCAL</acronym>operators can be used by C expressions. They all take unsigned longs asinput and output, even if they are onespot operators. Note that it'sentirely possible for these to cause a compile-time error if used oninvalid arguments (such as mingling with an operand over 65535), or tosilently truncate an invalid argument down to the right number of bits;both of these should be avoided if possible, so the optimiser shouldcheck first to make sure that it doesn't use any of these functions oninvalid arguments.</variablelist>
+ </indexterm><indexterm><literal>xselx</literal>
+ <variablelist>
+ <informalfigure>xselx</informalfigure>This function returns its argument selected with itself; so<literal>xselx(c)</literal> is shorthand for <literal>iselect(c,c)</literal>. When the argumentis very complicated, this can save a lot of space in the original<acronym>OIL</acronym> program.</variablelist>
+ </indexterm><indexterm><literal>setbitcount</literal>
+ <variablelist>
+ <informalfigure>setbitcount</informalfigure>This function simply returns the number of bits with value 1 in itsargument. This is sometimes useful with respect to variousselect-related optimisations, and can be a useful alternative to havingto take logarithms in various situations.</variablelist>
+ </indexterm><indexterm><literal>smudgeright</literal><literal>smudgeleft</literal>
+ <variablelist>
+ <informalfigure>smudgeright</informalfigure>
+ <informalfigure>smudgeleft</informalfigure>The <literal>smudgeright</literal> function returns its argument but with all thebits less significant than the most significant bit with value 1 set to1; likewise, <literal>smudgeleft</literal> returns its argument with all the bitsmore significant than the least significant bit with value 1 set to 1.</variablelist>
+ </indexterm>
+ </term>
+ <para>Note that all <acronym>OIL</acronym> character is done internally using unsigned
+32-bit numbers, and C expressions you write should do the same. The
+practical upshot of this is that you should write <literal>LU</literal> after any
+constant you write in C code; if you don't do this, you are reasonably
+likely to get compiler warnings, and the resulting program may not work
+reliably, although the <acronym>OIL</acronym> compiler itself will not complain.</para>
+ <para>Here's a more complicated example of an optimizer operand:</para>
+ <programlisting>
+#{!(x&2863311530LU)&&iselect(x,1431655765LU)==
+ xselx(iselect(x,1431655765LU))}3
+</programlisting>
+ <para>It helps to understand this if you know that 2863311530 in hexadecimal
+is AAAAAAAA and 1431655765 is hexadecimal is 55555555. (It's worth
+putting a comment with some frequently-used decimal constants in an
+<acronym>OIL</acronym> input file to help explain what these numbers mean and
+make the code more maintainable.) The operand matches any constant
+integer which has no bits in common with AAAAAAAA, and for which if any
+bit in common with 55555555 is set, all less significant bits in common
+with that number are also set.</para>
+ </sect1>
+
+ <sect1 id="OIL-Replacements">
+ <para>OIL Replacements</para>
+ <informalfigure>OIL, replacements</informalfigure>
+ <informalfigure>replacements</informalfigure>
+ <para>Replacements have much the same syntax as patterns. The expressions are
+parsed in much the same way; however, one peculiarity of replacements is
+that bitwidths must be specified. <acronym>INTERCAL</acronym> has a typecaster that figures
+out whether each expression is 16 bits or 32 bits wide, but it runs
+before the optimizer, and as the optimizer can produce expressions whose
+bitwidths don't obey <acronym>INTERCAL</acronym>'s rules, this information needs to be
+inserted somehow in a replacement. In <abbrev>C-INTERCAL</abbrev>, it usually doesn't matter
+what the bitwidth is, and in cases where it doesn't matter the normal
+operators (<literal>$</literal>, <literal>~</literal>, and so on) can be used. (Note that the
+bit width of the entire replacement is always set to the same bit width
+as the bit width of the expression matched by the pattern; so you don't
+have to worry about the effect on unary logical operators that might be
+operating on the expression being optimized. This is an exception to
+the normal bitwidth rules for a replacement.) In cases where it does
+matter (due to <abbrev>C-INTERCAL</abbrev>'s lenient interpretation of bitwidth on mingle
+inputs, the only place it matters is in the input to <acronym>INTERCAL</acronym> unary
+logical operators), both the bidwidth of the operator and the argument
+on which it operates must be explicitly given, and given as the same
+value; to set the bitwidth of an operator's result, simply write the
+bitwidth (16 or 32 for onespot and twospot respectively) immediately
+after the operator; for instance, <literal>!=32</literal> will generate a not-equals
+operation with a 32-bit bitwidth. If an operator's width is set to 16,
+and during the course of execution of the optimized program, a value
+that doesn't fit into 16 bits is encountered, that's undefined behaviour
+and anything might happen (most likely, though, the program will just
+act as though its width had been set to 32 bits instead); this error
+condition is not detected. Also note that operators like <literal>&32</literal>
+already have a bitwidth specified, so specifying <literal>&3232</literal> (or worse,
+<literal>&3216</literal>) is not allowed.</para>
+ <informalfigure>operands, OIL, in replacements</informalfigure>
+ <informalfigure>replacements, operands</informalfigure>
+ <para>Replacement operands are simpler than pattern operands, because there
+are only a few forms they can take.</para>
+ <term><indexterm><literal>_<replaceable>NUMBER</replaceable></literal><literal>.<replaceable>NUMBER</replaceable></literal><literal>:<replaceable>NUMBER</replaceable></literal>
+ <variablelist>This tells the optimiser to copy the operand or expression withreference number <replaceable>NUMBER</replaceable> to this point in the replacement used forthe expression matched by the pattern. The three forms are identical;the last two are provided for aesthetic reasons (it can look better andbe clearer to match <literal>.1</literal> in the pattern with <literal>.1</literal> in thereplacement, for instance). You cannot use <literal>#<replaceable>NUMBER</replaceable></literal> here tocopy in a constant from the left-hand side, though, nor<literal>#{1}<replaceable>NUMBER</replaceable></literal>, because the first means something else andthe second is undefined behaviour (that is, no behaviour for the secondcase has been specifically implemented in the compiler and therefore itsbehaviour is unpredictable and subject to change in future versions);use <literal>_<replaceable>NUMBER</replaceable></literal> to copy over a constant with an unknown atoptimizer compile time (but known at optimize time) value from the lefthand side, as you can do with any other operand being copied.</variablelist>
+ </indexterm><indexterm><literal>#<replaceable>NUMBER</replaceable></literal>
+ <variablelist>Insert a constant with the literal value <replaceable>NUMBER</replaceable> here.</variablelist>
+ </indexterm><indexterm><literal>#{<replaceable>EXPRESSION</replaceable>}0</literal>
+ <variablelist>Calculate the value of <replaceable>EXPRESSION</replaceable> (a C expression, which canreference the same variables and functions as a C expression in apattern can; see .</variablelist>
+ </indexterm>
+ </term>
+ <para>As an example, here's an idiom that moves C bitwise AND operations
+inside leftshifts. (This is useful because if the optimizer has
+generated a large sequence of mixed ANDs and bitshifts, moving all the
+ANDs to one end allows them to be clumped together and optimized down to
+one AND.)</para>
+ <programlisting>
+((_1 << #{1}2) & #{1}3)->((_1 & #{x3>>x2}0) << _2)
+</programlisting>
+ </sect1>
+
+ <sect1 id="OIL-Loops">
+ <para>OIL Loops</para>
+ <informalfigure>loops, OIL</informalfigure>
+ <informalfigure>OIL, loops</informalfigure>
+ <para>When writing idioms, sometimes instead of using very complicated
+expressions to try to match multiple situations at once it's easier to
+have a separate idiom for each possible situation; for instance, it's
+easier to write idioms for right-shift by 1, right-shift by 2,
+right-shift by 3, etc., rather than a general idiom to rightshift by any
+amount. When the idioms follow a pattern, as they will do in basically
+every case of this sort, it's possible to automatically generate them
+using a loop. For instance, idioms to optimize a one-bit rightshift
+and a two-bit rightshift are:</para>
+ <programlisting>
+(_1~#{xselx(x)<<1==x&&x}2)->((_1&_2)>>#1)
+(_1~#{xselx(x)<<2==x&&x}2)->((_1&_2)>>#2)
+</programlisting>
+ <para>Adding a loop to automatically generate the idioms, and placing a name
+for the group of idioms at the start, produces the following code:</para>
+ <programlisting>
+[rshift]
+<#1-#31
+(_1~#{xselx(x)<<r==x&&x}2)->((_1&_2)>>#{r}0)
+>
+</programlisting>
+ <para>That's 31 different idioms, generated with a loop. As the above example
+shows, a loop starts with <literal><#<replaceable>NUMBER</replaceable>-#<replaceable>NUMBER</replaceable></literal> and ends
+with <literal>></literal>; a different idiom is generated for each possible value of
+the loop counter <literal>r</literal> in the range given by the opening line of the
+loop. Loops must be placed around idioms, but inside a group of
+idioms. Note the use of <literal>#{r}0</literal> to generate a constant whose
+value is equal to the value of the loop counter.</para>
+ </sect1>
+
+ <sect1 id="OIL-Tips">
+ <para>OIL Tips</para>
+ <informalfigure>tips, OIL</informalfigure>
+ <informalfigure>OIL, tips</informalfigure>
+ <para>Here are some tips for the best use of <acronym>OIL</acronym>:</para>
+ <listitem mark="bullet">
+ <variablelist>
+ <informalfigure>MAXTOFREE</informalfigure>The <acronym>OIL</acronym> compiler has a few deficiencies, such as errormessages that don't give you much of an idea of what you did wrong (tocompensate for this, it does give a reasonably accurate line andcharacter number where the error happened), limits on things like howdeep expressions can be nested and how many idioms are allowed (if youhit the first, you should really break it up into smaller idioms ifpossible, and if you hit the second, increase <literal>MAXTOFREE</literal> in oil.y;this isn't a limit on the number of idioms but on the number of stringsthat are allocated internally to process the idioms), and lack of errorchecking (invalid <acronym>OIL</acronym> may produce errors in the <acronym>OIL</acronym>compiler, or cause the output C code to contain errors or warnings, ormay even appear to work).</variablelist>
+ <variablelist>When you have symmetrical operators in an idiom (like C binary logicaloperators), you need to write the idiom both ways round (in the samegroup of idioms, preferably), or write another idiom to standardise theformat first; the first method can get very tedious when there are manysymmetrical operators in an idiom, and the second is prone to optimizerloops and subtle errors (both methods have been used in the provided<filename>idiotism.oil</filename> file.)</variablelist>
+ <variablelist>Idioms should preferably be as general as possible, broken down intomany separate idioms rather than all as one big idiom, and match thesmallest part of the expression being optimized that is necessary forthe idiom to be correct in all cirucmstances; all of these help toimprove the performance of the optimizer in terms of what it canoptimize.</variablelist>
+ <variablelist>If a program's optimizing incorrectly, or you just want to see how theoptimizer deals with a particular program, it's possible to debug theoptimizer by giving the <option>-h</option>, <option>-H</option>, or <option>-hH</option>(see ) switch to the <abbrev>C-INTERCAL</abbrev> compiler, which will cause debuginformation to be output on stderr. <option>-h</option> will show the initialand final expressions for each expression that was given as input to theoptimizer, as well as a list of all optimizations used, in a languagethat's a sort of mix of C, <acronym>INTERCAL</acronym>, and <acronym>OIL</acronym>; <option>-H</option> willdo the same, and also show the intermediate stages in the optimization.<option>-hH</option> is like <option>-H</option>, but produces its output entirely in C,so that the various intermediate stages can be tried with a C compiler,or for people who are fed up of reading <acronym>INTERCAL</acronym>. <option>-H</option> can be auseful learning resource for people who want to understand how aparticular <acronym>INTERCAL</acronym> expression works.</variablelist>
+ <variablelist>Make sure that the optimizer doesn't change a statement from a run-timeerror into something that silently succeeds! Checking which bits canand can't be 1 is one good way to avoid this, especially with mingles.(At present, there are some idioms that can turn run-time errors intocompile-time errors, such as with the expression<literal>''#65535$#65535'$#0'</literal>; this could be avoided, but for the timebeing it isn't.)</variablelist>
+ <variablelist>You can help! If you find an idiom that the optimizer isn't optimizingcorrectly, feel free to add it, or multiple idioms that come to the samething, to <filename>idiotism.oil</filename>. In such a case, it would help otherusers if you would submit your new optimizer idiom to the project(see ); this will help other users and future releasesof <acronym>INTERCAL</acronym>, and also has a chance of allowing other users to check yournew idioms to see if they cause problems or could be written better.</variablelist>
+
+ </listitem>
+ </sect1>
+
+ <sect1 id="OIL-Example">
+ <para>OIL Example</para>
+ <informalfigure>OIL, example</informalfigure>
+ <informalfigure>examples, OIL</informalfigure>
+ <para>To finish off this appendix, here's an example of the power of
+<acronym>OIL</acronym>; this is the optimization of an idiom from the <abbrev>INTERCAL-72</abbrev>
+system library, as shown with <option>-H</option>; this should give a good idea
+of how <acronym>OIL</acronym> programs work. (All the relevant idioms are in
+<filename>idiotism.oil</filename> as of the time of writing.) Note how the expression
+is reduced one small step at a time; the smallness of the steps makes
+the optimizer more general, because if the original expression had been
+slightly different, the optimizer wouldn't have come to the same result
+but could have optimized it quite a bit of the way, up to the point
+where the optimizations were no longer valid; in an older version of
+<acronym>INTERCAL</acronym>, this idiom was simply hardcoded as a special case and so slight
+variations of it weren't optimized at all. If you look at the idioms
+themselves, it'll also be apparent how <literal>c</literal> (the record of which
+bits of an expression can be 1 and which bits can't be) is important
+information in being able to apply an optimization more aggressively.</para>
+ <screen>.3 <- ((((((((.3 $ 0x0) ~ (0x7fff $ 0x1)) $ 0x0) ~ (0x7fff $ 0x1)) $ 0x0) ~ (0x3fff $ 0x3)) $ 0x0) ~ (0xfff $ 0xf))
+[minglefold]
+.3 <- ((((((((.3 $ 0x0) ~ 0x2aaaaaab) $ 0x0) ~ (0x7fff $ 0x1)) $ 0x0) ~ (0x3fff $ 0x3)) $ 0x0) ~ (0xfff $ 0xf))
+[lshift16]
+.3 <- ((((((((((.3 >> 0x0) & 0x7fff) << 0x1) | 0x0) $ 0x0) ~ (0x7fff $ 0x1)) $ 0x0) ~ (0x3fff $ 0x3)) $ 0x0) ~ (0xfff $ 0xf))
+[noopor]
+.3 <- (((((((((.3 >> 0x0) & 0x7fff) << 0x1) $ 0x0) ~ (0x7fff $ 0x1)) $ 0x0) ~ (0x3fff $ 0x3)) $ 0x0) ~ (0xfff $ 0xf))
+[minglefold]
+.3 <- (((((((((.3 >> 0x0) & 0x7fff) << 0x1) $ 0x0) ~ 0x2aaaaaab) $ 0x0) ~ (0x3fff $ 0x3)) $ 0x0) ~ (0xfff $ 0xf))
+[lshift16]
+.3 <- (((((((((((.3 >> 0x0) & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) | 0x0) $ 0x0) ~ (0x3fff $ 0x3)) $ 0x0) ~ (0xfff $ 0xf))
+[noopor]
+.3 <- ((((((((((.3 >> 0x0) & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) $ 0x0) ~ (0x3fff $ 0x3)) $ 0x0) ~ (0xfff $ 0xf))
+[minglefold]
+.3 <- ((((((((((.3 >> 0x0) & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) $ 0x0) ~ 0xaaaaaaf) $ 0x0) ~ (0xfff $ 0xf))
+[lshift16]
+.3 <- ((((((((((((.3 >> 0x0) & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) >> 0x1) & 0x1fff) << 0x3) | 0x0) $ 0x0) ~ (0xfff $ 0xf))
+[noopor]
+.3 <- (((((((((((.3 >> 0x0) & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) >> 0x1) & 0x1fff) << 0x3) $ 0x0) ~ (0xfff $ 0xf))
+[minglefold]
+.3 <- (((((((((((.3 >> 0x0) & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) >> 0x1) & 0x1fff) << 0x3) $ 0x0) ~ 0xaaaaff)
+[lshift16]
+.3 <- (((((((((((((.3 >> 0x0) & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) >> 0x1) & 0x1fff) << 0x3) >> 0x3) & 0x1ff) << 0x7) | 0x0)
+[noopor]
+.3 <- ((((((((((((.3 >> 0x0) & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) >> 0x1) & 0x1fff) << 0x3) >> 0x3) & 0x1ff) << 0x7)
+[nullshift]
+.3 <- (((((((((((.3 & 0x7fff) << 0x1) >> 0x0) & 0x7fff) << 0x1) >> 0x1) & 0x1fff) << 0x3) >> 0x3) & 0x1ff) << 0x7)
+[combinelrshift]
+.3 <- ((((((((((.3 & 0x7fff) << 0x1) & 0x7fff) << 0x1) >> 0x1) & 0x1fff) << 0x3) >> 0x3) & 0x1ff) << 0x7)
+[andintolshift]
+.3 <- ((((((((((.3 & 0x7fff) & 0x3fff) << 0x1) << 0x1) >> 0x1) & 0x1fff) << 0x3) >> 0x3) & 0x1ff) << 0x7)
+[combinellshift]
+.3 <- (((((((((.3 & 0x7fff) & 0x3fff) << 0x2) >> 0x1) & 0x1fff) << 0x3) >> 0x3) & 0x1ff) << 0x7)
+[combinelrshift]
+.3 <- ((((((((.3 & 0x7fff) & 0x3fff) << 0x1) & 0x1fff) << 0x3) >> 0x3) & 0x1ff) << 0x7)
+[andintolshift]
+.3 <- ((((((((.3 & 0x7fff) & 0x3fff) & 0xfff) << 0x1) << 0x3) >> 0x3) & 0x1ff) << 0x7)
+[combinellshift]
+.3 <- (((((((.3 & 0x7fff) & 0x3fff) & 0xfff) << 0x4) >> 0x3) & 0x1ff) << 0x7)
+[combinelrshift]
+.3 <- ((((((.3 & 0x7fff) & 0x3fff) & 0xfff) << 0x1) & 0x1ff) << 0x7)
+[andintolshift]
+.3 <- ((((((.3 & 0x7fff) & 0x3fff) & 0xfff) & 0xff) << 0x1) << 0x7)
+[combinellshift]
+.3 <- (((((.3 & 0x7fff) & 0x3fff) & 0xfff) & 0xff) << 0x8)
+[combineand]
+.3 <- ((((.3 & 0x3fff) & 0xfff) & 0xff) << 0x8)
+[combineand]
+.3 <- (((.3 & 0xfff) & 0xff) << 0x8)
+[combineand]
+.3 <- ((.3 & 0xff) << 0x8)
+</screen>
+ </sect1>
+ </appendix>
+
+ <appendix id="Copying">
+ <para>Copying</para>
+ <informalfigure>copyright</informalfigure>
+ <informalfigure>copying conditions</informalfigure>
+ <para>The majority of the files in the <abbrev>C-INTERCAL</abbrev> distribution are licensed
+under the GNU General Public License (version 2 or later), but with
+some exceptions. The files <filename>ick-wrap.c</filename> and <filename>pickwrap.c</filename>
+are licensed under a license that allows them to be used for any
+purpose and redistributed at will, and are explicitly not GPL'd. This
+means that C source code generated by the compiler has the same
+copyright conditions as the original <acronym>INTERCAL</acronym> source. (Note that the
+libraries <filename>libick.a</filename> and <filename>libickmt.a</filename> are GPL, though, so
+you cannot redistribute an executable produced by <command>ick</command> or by
+linking a C file to either of those libraries unless the original
+<acronym>INTERCAL</acronym> source was GPL.) Also, this manual, and the files that are
+the source code for creating it, are licensed under the GNU Free
+Documentation License rather than the GPL, and the licenses themselves
+(<filename>fdl-1-2.txi</filename> and <filename>COPYING.txt</filename>) are licensed under a
+license that allows verbatim redistribution but not creation of
+derivative works. All other files, though (including the
+<command>man</command> pages, which are not part of <emphasis>this</emphasis> manual), are
+licensed under the GPL. For the full text of the GPL, see the file
+<filename>COPYING.txt</filename> in the distribution.</para>
+
+ <sect1 id="GNU-Free-Documentation-License">
+ <para>GNU Free Documentation License</para>
+ <informalfigure>GFDL</informalfigure>
+ <informalfigure>FDL</informalfigure>
+ <informalfigure>GNU Free Documentation License</informalfigure>
+ <informalfigure>Free Documentation License</informalfigure>
+<!-- The GNU Free Documentation License. -->
+ <blockquote>
+ <para>Version 1.2, November 2002</para>
+ </blockquote>
+<!-- This file is intended to be included within another document, -->
+<!-- hence no sectioning command or @node. -->
+ <screen>
+Copyright © 2000,2001,2002 Free Software Foundation, Inc.
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+</screen>
+ <varlistentry numeration="arabic" role="0">
+ <variablelist>PREAMBLEThe purpose of this License is to make a manual, textbook, or otherfunctional and useful document <firstterm>free</firstterm> in the sense of freedom: toassure everyone the effective freedom to copy and redistribute it,with or without modifying it, either commercially or noncommercially.Secondarily, this License preserves for the author and publisher a wayto get credit for their work, while not being considered responsiblefor modifications made by others.This License is a kind of “copyleft”, which means that derivativeworks of the document must themselves be free in the same sense. Itcomplements the GNU General Public License, which is a copyleftlicense designed for free software.We have designed this License in order to use it for manuals for freesoftware, because free software needs free documentation: a freeprogram should come with manuals providing the same freedoms that thesoftware does. But this License is not limited to software manuals;it can be used for any textual work, regardless of subject matter orwhether it is published as a printed book. We recommend this Licenseprincipally for works whose purpose is instruction or reference.</variablelist>
+ <variablelist>APPLICABILITY AND DEFINITIONSThis License applies to any manual or other work, in any medium, thatcontains a notice placed by the copyright holder saying it can bedistributed under the terms of this License. Such a notice grants aworld-wide, royalty-free license, unlimited in duration, to use thatwork under the conditions stated herein. The “Document”, below,refers to any such manual or work. Any member of the public is alicensee, and is addressed as “you”. You accept the license if youcopy, modify or distribute the work in a way requiring permissionunder copyright law.A “Modified Version” of the Document means any work containing theDocument or a portion of it, either copied verbatim, or withmodifications and/or translated into another language.A “Secondary Section” is a named appendix or a front-matter sectionof the Document that deals exclusively with the relationship of thepublishers or authors of the Document to the Document's overallsubject (or to related matters) and contains nothing that could falldirectly within that overall subject. (Thus, if the Document is inpart a textbook of mathematics, a Secondary Section may not explainany mathematics.) The relationship could be a matter of historicalconnection with the subject or with related matters, or of legal,commercial, philosophical, ethical or political position regardingthem.The “Invariant Sections” are certain Secondary Sections whose titlesare designated, as being those of Invariant Sections, in the noticethat says that the Document is released under this License. If asection does not fit the above definition of Secondary then it is notallowed to be designated as Invariant. The Document may contain zeroInvariant Sections. If the Document does not identify any InvariantSections then there are none.The “Cover Texts” are certain short passages of text that are listed,as Front-Cover Texts or Back-Cover Texts, in the notice that says thatthe Document is released under this License. A Front-Cover Text maybe at most 5 words, and a Back-Cover Text may be at most 25 words.A “Transparent” copy of the Document means a machine-readable copy,represented in a format whose specification is available to thegeneral public, that is suitable for revising the documentstraightforwardly with generic text editors or (for images composed ofpixels) generic paint programs or (for drawings) some widely availabledrawing editor, and that is suitable for input to text formatters orfor automatic translation to a variety of formats suitable for inputto text formatters. A copy made in an otherwise Transparent fileformat whose markup, or absence of markup, has been arranged to thwartor discourage subsequent modification by readers is not Transparent.An image format is not Transparent if used for any substantial amountof text. A copy that is not “Transparent” is called “Opaque”.Examples of suitable formats for Transparent copies include plainascii without markup, Texinfo input format, La&tex; inputformat, <acronym>SGML</acronym> or <acronym>XML</acronym> using a publicly available<acronym>DTD</acronym>, and standard-conforming simple <acronym>HTML</acronym>,PostScript or <acronym>PDF</acronym> designed for human modification. Examplesof transparent image formats include <acronym>PNG</acronym>, <acronym>XCF</acronym> and<acronym>JPG</acronym>. Opaque formats include proprietary formats that can beread and edited only by proprietary word processors, <acronym>SGML</acronym> or<acronym>XML</acronym> for which the <acronym>DTD</acronym> and/or processing tools arenot generally available, and the machine-generated <acronym>HTML</acronym>,PostScript or <acronym>PDF</acronym> produced by some word processors foroutput purposes only.The “Title Page” means, for a printed book, the title page itself,plus such following pages as are needed to hold, legibly, the materialthis License requires to appear in the title page. For works informats which do not have any title page as such, “Title Page” meansthe text near the most prominent appearance of the work's title,preceding the beginning of the body of the text.A section “Entitled XYZ” means a named subunit of the Document whosetitle either is precisely XYZ or contains XYZ in parentheses followingtext that translates XYZ in another language. (Here XYZ stands for aspecific section name mentioned below, such as “Acknowledgements”,“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title”of such a section when you modify the Document means that it remains asection “Entitled XYZ” according to this definition.The Document may include Warranty Disclaimers next to the notice whichstates that this License applies to the Document. These WarrantyDisclaimers are considered to be included by reference in thisLicense, but only as regards disclaiming warranties: any otherimplication that these Warranty Disclaimers may have is void and hasno effect on the meaning of this License.</variablelist>
+ <variablelist>VERBATIM COPYINGYou may copy and distribute the Document in any medium, eithercommercially or noncommercially, provided that this License, thecopyright notices, and the license notice saying this License appliesto the Document are reproduced in all copies, and that you add no otherconditions whatsoever to those of this License. You may not usetechnical measures to obstruct or control the reading or furthercopying of the copies you make or distribute. However, you may acceptcompensation in exchange for copies. If you distribute a large enoughnumber of copies you must also follow the conditions in section 3.You may also lend copies, under the same conditions stated above, andyou may publicly display copies.</variablelist>
+ <variablelist>COPYING IN QUANTITYIf you publish printed copies (or copies in media that commonly haveprinted covers) of the Document, numbering more than 100, and theDocument's license notice requires Cover Texts, you must enclose thecopies in covers that carry, clearly and legibly, all these CoverTexts: Front-Cover Texts on the front cover, and Back-Cover Texts onthe back cover. Both covers must also clearly and legibly identifyyou as the publisher of these copies. The front cover must presentthe full title with all words of the title equally prominent andvisible. You may add other material on the covers in addition.Copying with changes limited to the covers, as long as they preservethe title of the Document and satisfy these conditions, can be treatedas verbatim copying in other respects.If the required texts for either cover are too voluminous to fitlegibly, you should put the first ones listed (as many as fitreasonably) on the actual cover, and continue the rest onto adjacentpages.If you publish or distribute Opaque copies of the Document numberingmore than 100, you must either include a machine-readable Transparentcopy along with each Opaque copy, or state in or with each Opaque copya computer-network location from which the general network-usingpublic has access to download using public-standard network protocolsa complete Transparent copy of the Document, free of added material.If you use the latter option, you must take reasonably prudent steps,when you begin distribution of Opaque copies in quantity, to ensurethat this Transparent copy will remain thus accessible at the statedlocation until at least one year after the last time you distribute anOpaque copy (directly or through your agents or retailers) of thatedition to the public.It is requested, but not required, that you contact the authors of theDocument well before redistributing any large number of copies, to givethem a chance to provide you with an updated version of the Document.</variablelist>
+ <variablelist>MODIFICATIONSYou may copy and distribute a Modified Version of the Document underthe conditions of sections 2 and 3 above, provided that you releasethe Modified Version under precisely this License, with the ModifiedVersion filling the role of the Document, thus licensing distributionand modification of the Modified Version to whoever possesses a copyof it. In addition, you must do these things in the Modified Version:
+ <varlistentry numeration="upperalpha">
+ <variablelist>Use in the Title Page (and on the covers, if any) a title distinctfrom that of the Document, and from those of previous versions(which should, if there were any, be listed in the History sectionof the Document). You may use the same title as a previous versionif the original publisher of that version gives permission.</variablelist>
+ <variablelist>List on the Title Page, as authors, one or more persons or entitiesresponsible for authorship of the modifications in the ModifiedVersion, together with at least five of the principal authors of theDocument (all of its principal authors, if it has fewer than five),unless they release you from this requirement.</variablelist>
+ <variablelist>State on the Title page the name of the publisher of theModified Version, as the publisher.</variablelist>
+ <variablelist>Preserve all the copyright notices of the Document.</variablelist>
+ <variablelist>Add an appropriate copyright notice for your modificationsadjacent to the other copyright notices.</variablelist>
+ <variablelist>Include, immediately after the copyright notices, a license noticegiving the public permission to use the Modified Version under theterms of this License, in the form shown in the Addendum below.</variablelist>
+ <variablelist>Preserve in that license notice the full lists of Invariant Sectionsand required Cover Texts given in the Document's license notice.</variablelist>
+ <variablelist>Include an unaltered copy of this License.</variablelist>
+ <variablelist>Preserve the section Entitled “History”, Preserve its Title, and addto it an item stating at least the title, year, new authors, andpublisher of the Modified Version as given on the Title Page. Ifthere is no section Entitled “History” in the Document, create onestating the title, year, authors, and publisher of the Document asgiven on its Title Page, then add an item describing the ModifiedVersion as stated in the previous sentence.</variablelist>
+ <variablelist>Preserve the network location, if any, given in the Document forpublic access to a Transparent copy of the Document, and likewisethe network locations given in the Document for previous versionsit was based on. These may be placed in the “History” section.You may omit a network location for a work that was published atleast four years before the Document itself, or if the originalpublisher of the version it refers to gives permission.</variablelist>
+ <variablelist>For any section Entitled “Acknowledgements” or “Dedications”, Preservethe Title of the section, and preserve in the section all thesubstance and tone of each of the contributor acknowledgements and/ordedications given therein.</variablelist>
+ <variablelist>Preserve all the Invariant Sections of the Document,unaltered in their text and in their titles. Section numbersor the equivalent are not considered part of the section titles.</variablelist>
+ <variablelist>Delete any section Entitled “Endorsements”. Such a sectionmay not be included in the Modified Version.</variablelist>
+ <variablelist>Do not retitle any existing section to be Entitled “Endorsements” orto conflict in title with any Invariant Section.</variablelist>
+ <variablelist>Preserve any Warranty Disclaimers.</variablelist>
+ </varlistentry>If the Modified Version includes new front-matter sections orappendices that qualify as Secondary Sections and contain no materialcopied from the Document, you may at your option designate some or allof these sections as invariant. To do this, add their titles to thelist of Invariant Sections in the Modified Version's license notice.These titles must be distinct from any other section titles.You may add a section Entitled “Endorsements”, provided it containsnothing but endorsements of your Modified Version by variousparties—for example, statements of peer review or that the text hasbeen approved by an organization as the authoritative definition of astandard.You may add a passage of up to five words as a Front-Cover Text, and apassage of up to 25 words as a Back-Cover Text, to the end of the listof Cover Texts in the Modified Version. Only one passage ofFront-Cover Text and one of Back-Cover Text may be added by (orthrough arrangements made by) any one entity. If the Document alreadyincludes a cover text for the same cover, previously added by you orby arrangement made by the same entity you are acting on behalf of,you may not add another; but you may replace the old one, on explicitpermission from the previous publisher that added the old one.The author(s) and publisher(s) of the Document do not by this Licensegive permission to use their names for publicity for or to assert orimply endorsement of any Modified Version.</variablelist>
+ <variablelist>COMBINING DOCUMENTSYou may combine the Document with other documents released under thisLicense, under the terms defined in section 4 above for modifiedversions, provided that you include in the combination all of theInvariant Sections of all of the original documents, unmodified, andlist them all as Invariant Sections of your combined work in itslicense notice, and that you preserve all their Warranty Disclaimers.The combined work need only contain one copy of this License, andmultiple identical Invariant Sections may be replaced with a singlecopy. If there are multiple Invariant Sections with the same name butdifferent contents, make the title of each such section unique byadding at the end of it, in parentheses, the name of the originalauthor or publisher of that section if known, or else a unique number.Make the same adjustment to the section titles in the list ofInvariant Sections in the license notice of the combined work.In the combination, you must combine any sections Entitled “History”in the various original documents, forming one section Entitled“History”; likewise combine any sections Entitled “Acknowledgements”,and any sections Entitled “Dedications”. You must delete allsections Entitled “Endorsements.”</variablelist>
+ <variablelist>COLLECTIONS OF DOCUMENTSYou may make a collection consisting of the Document and other documentsreleased under this License, and replace the individual copies of thisLicense in the various documents with a single copy that is included inthe collection, provided that you follow the rules of this License forverbatim copying of each of the documents in all other respects.You may extract a single document from such a collection, and distributeit individually under this License, provided you insert a copy of thisLicense into the extracted document, and follow this License in allother respects regarding verbatim copying of that document.</variablelist>
+ <variablelist>AGGREGATION WITH INDEPENDENT WORKSA compilation of the Document or its derivatives with other separateand independent documents or works, in or on a volume of a storage ordistribution medium, is called an “aggregate” if the copyrightresulting from the compilation is not used to limit the legal rightsof the compilation's users beyond what the individual works permit.When the Document is included in an aggregate, this License does notapply to the other works in the aggregate which are not themselvesderivative works of the Document.If the Cover Text requirement of section 3 is applicable to thesecopies of the Document, then if the Document is less than one half ofthe entire aggregate, the Document's Cover Texts may be placed oncovers that bracket the Document within the aggregate, or theelectronic equivalent of covers if the Document is in electronic form.Otherwise they must appear on printed covers that bracket the wholeaggregate.</variablelist>
+ <variablelist>TRANSLATIONTranslation is considered a kind of modification, so you maydistribute translations of the Document under the terms of section 4.Replacing Invariant Sections with translations requires specialpermission from their copyright holders, but you may includetranslations of some or all Invariant Sections in addition to theoriginal versions of these Invariant Sections. You may include atranslation of this License, and all the license notices in theDocument, and any Warranty Disclaimers, provided that you also includethe original English version of this License and the original versionsof those notices and disclaimers. In case of a disagreement betweenthe translation and the original version of this License or a noticeor disclaimer, the original version will prevail.If a section in the Document is Entitled “Acknowledgements”,“Dedications”, or “History”, the requirement (section 4) to Preserveits Title (section 1) will typically require changing the actualtitle.</variablelist>
+ <variablelist>TERMINATIONYou may not copy, modify, sublicense, or distribute the Document exceptas expressly provided for under this License. Any other attempt tocopy, modify, sublicense or distribute the Document is void, and willautomatically terminate your rights under this License. However,parties who have received copies, or rights, from you under thisLicense will not have their licenses terminated so long as suchparties remain in full compliance.</variablelist>
+ <variablelist>FUTURE REVISIONS OF THIS LICENSEThe Free Software Foundation may publish new, revised versionsof the GNU Free Documentation License from time to time. Such newversions will be similar in spirit to the present version, but maydiffer in detail to address new problems or concerns. Seehttp://www.gnu.org/copyleft/.Each version of the License is given a distinguishing version number.If the Document specifies that a particular numbered version of thisLicense “or any later version” applies to it, you have the option offollowing the terms and conditions either of that specified version orof any later version that has been published (not as a draft) by theFree Software Foundation. If the Document does not specify a versionnumber of this License, you may choose any version ever published (notas a draft) by the Free Software Foundation.</variablelist>
+ </varlistentry>
+ <bridgehead renderas="sect1">ADDENDUM: How to use this License for your documents</bridgehead>
+ <para>To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:</para>
+ <programlisting>
+ Copyright (C) <replaceable>year</replaceable> <replaceable>your name</replaceable>.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+</programlisting>
+ <para>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the “with…Texts.” line with this:</para>
+ <programlisting>
+ with the Invariant Sections being <replaceable>list their titles</replaceable>, with
+ the Front-Cover Texts being <replaceable>list</replaceable>, and with the Back-Cover Texts
+ being <replaceable>list</replaceable>.
+</programlisting>
+ <para>If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.</para>
+ <para>If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.</para>
+<!-- Local Variables: -->
+<!-- ispell-local-pdict: "ispell-dict" -->
+<!-- End: -->
+ </sect1>
+ </appendix>
+xreflabel="Index" id="Main-Index">
+ <para>Index
+This is the index of everything in this manual. (Note that in some
+versions of the manual this is called ‘<literal>Main Index</literal>’ to prevent it
+transforming into a page called <filename>index.html</filename> in the HTML version of
+the manual. The complications that that caused were really odd.)</para>
+<tgroup>
+ <secondaryie>
+ <indexdiv>", see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>#, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>$, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>%, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>&, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>', see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>+help, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>+mystery, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>+printflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>+traditional, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>+wimpmode, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>,, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-@, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-b, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-c, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-C, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-d, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-F, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-f, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-g, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-H, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-h, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-help, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-hH, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-l, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-m, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-mystery, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-O, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-o, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-p, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-P, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-printflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-t, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-traditional, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-U, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-u, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-v, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-wimpmode, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-x, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-X, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>-y, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>., see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>/, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>16 bit overflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>32 bit overflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>:, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>;, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>?, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>@, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>^, see </indexdiv></secondaryie></tgroup>
+<tgroup>A
+ <secondaryie>
+ <indexdiv>About this manual, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ABSTAIN, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>abstain, at program start, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>abstain, during execution, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>ABSTAIN</literal>, nonexistent target, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ABSTAIN, self-abstaining, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>abstained state, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ABSTAINING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>add-without-carry, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>AGAIN, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ampersand, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>and, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>and16, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>and32, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Arabic numberals, enabling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>array, invalid dimension, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>array, out of bounds, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>array, wrong dimension, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>arrays, dimensioning, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>arrays, subscripting, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>assigning to constants, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>assignment, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Atari syntax, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Atari, character set, see </indexdiv></secondaryie></tgroup>
+<tgroup>B
+ <secondaryie>
+ <indexdiv>backtracking, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Backtracking INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>backtracking, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>backtracking, enabling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>backtracking, not enabled, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>backtracking, out of memory, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Baudot, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Baudot, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>black lagoon, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>book, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>breakpoints, too many, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>bugs, reporting, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>BUT, see </indexdiv></secondaryie></tgroup>
+<tgroup>C
+ <secondaryie>
+ <indexdiv>c, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C code, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C code, leaving in place, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C, stopping after C is generated, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C, within OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C-INTERCAL, distributing, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C-INTERCAL, I/O, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C-INTERCAL, obtaining a copy, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C-INTERCAL, unpacking, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>C-INTERCAL, unzipping, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>c1–c9, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>calculate, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>CALCULATING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>calls, external, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>character sets, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>character sets, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>character sets, converting, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>choicepoints, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>choicepoints, activating, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>choicepoints, creating, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>choicepoints, discarding, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>CLC-INTERCAL compatibility mode, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>CLC-INTERCAL I/O, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>clockface mode, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>code generation, stopping at C code, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>COME FROM, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>COME FROM</literal>, ambiguity, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>COME FROM</literal>, multithreading, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>COME FROM</literal>, no target, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>command line options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>COMMENT, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>comment, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>COMMENTING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>COMMENTS, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>comments, OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>compatibility, CLC-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>compatibility, INTERCAL-72, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>compiling, <command>ick</command> itself, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>compiling, <acronym>INTERCAL</acronym> source code, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>config.sh, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>configdj.sh, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>configuring, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>connected threads, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>constant, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>constants, assigning to, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>controlled unary operator, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>converting between character sets, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>convickt, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>copying conditions, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>copyright, see </indexdiv></secondaryie></tgroup>
+<tgroup>D
+ <secondaryie>
+ <indexdiv>Debian, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debug options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, C code, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, flow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, internal errors, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, lexical analyser, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, multithreaded programs, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, optimizer, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, parser, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, runtime, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>debugging, yuk, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>dialect options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>dialects of syntax, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>dimensioning arrays, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>directory problems, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>directory problems, source file, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>distributing C-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>DJGPP, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>DO, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>dormant thread, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>DOS, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>double-oh-seven, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>dumping core on error, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>duplicate line label, see </indexdiv></secondaryie></tgroup>
+<tgroup>E
+ <secondaryie>
+ <indexdiv>E000, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E017, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E079, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E099, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E111, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E123, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E127, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E127, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E129, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E139, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E182, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E197, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E200, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E222, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E240, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E241, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E252, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E256, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E256, avoiding, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E275, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E277, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E281, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E333, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E404, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E405, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E436, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E444, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E533, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E555, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E562, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E579, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E621, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E632, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E633, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E652, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E652, avoiding, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E666, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E774, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E774, disabling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E777, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E778, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E778, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E810, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E811, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E888, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E991, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E993, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E995, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E997, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E999, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>E999, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ears, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ears, nesting limit, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>EBCDIC, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>embedded systems, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>end of file, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>environment variables, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>EOF, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>errors, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>errors and warnings, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>examples, OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>exclusive or, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>execution chance, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>exiting, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>exor, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>expressions, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>expressions, OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>external calls, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>external calls, to C, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>extreme optimization, see </indexdiv></secondaryie></tgroup>
+<tgroup>F
+ <secondaryie>
+ <indexdiv>FDL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>flow control, INTERCAL-72, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>flow optimization, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>flow, printing, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>foreign functions, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>FORGET, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>FORGETTING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Free Documentation License, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>functions, OIL in C, see </indexdiv></secondaryie></tgroup>
+<tgroup>G
+ <secondaryie>
+ <indexdiv>generated programs, options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>GFDL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>GIVE UP, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>GNU Free Documentation License, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>GO AHEAD, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>GO AHEAD</literal>, no choicepoint, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>GO AHEAD</literal>, not enabled, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>GO BACK, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>GO BACK</literal>, no choicepoint, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>GO BACK</literal>, not enabled, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>goto, time-reversed, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>grouping rules, see </indexdiv></secondaryie></tgroup>
+<tgroup>H
+ <secondaryie>
+ <indexdiv>help with options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>hybrid, see </indexdiv></secondaryie></tgroup>
+<tgroup>I
+ <secondaryie>
+ <indexdiv>I/O, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>I/O, Baudot, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>I/O, C-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>I/O, CLC-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>I/O, INTERCAL-72, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>I/O, out of memory, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>I/O, PIC-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, command line options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, errors, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, errors and warnings, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, installing, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, invoking, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, not installating, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, uninstalling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, using without installation, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><command>ick</command>, warnings, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ick-0-28.tgz, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ick_ec.h, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ICK_EC_FUNC_END, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ICK_EC_FUNC_START, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ick_linelabel, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>idiom, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>idiom optimization, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><filename>idiotism.oil</filename>, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>IGNORE, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>IGNORE</literal>/<literal>RETRIEVE</literal> interaction, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>IGNORING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>illegal array dimension, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>illegal line label value, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>illegal variable number, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>impossible reverse assignment, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>initial abstention, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>input, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>input, C-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>input, CLC-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>input, EOF, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>input, in Arabic numerals, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>input, INTERCAL-72, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>input, invalid, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>installation, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>installation, Debian, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>installation, non-root, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>installation, on DOS or Windows, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>installation, simple, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>installation, Ubuntu, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>installation, via autoconf and make, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>INTERCAL compilers, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>INTERCAL, syntax, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>INTERCAL-72 compatibility mode, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>INTERCAL-72, I/O, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>interleave, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>internal errors, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>internal errors, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>internal errors, dumping core, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>invalid array dimension, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>invalid line label value, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>invalid variable number, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>iselect, see </indexdiv></secondaryie></tgroup>
+<tgroup>L
+ <secondaryie>
+ <indexdiv>language-affecting options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Latin-1, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>lexical analyser, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>line label, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>line label, duplicate, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>line label, illegal value, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>line labels, C, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>line number, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>live CD/USB stick, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>loops, entire program, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>loops, OIL, see </indexdiv></secondaryie></tgroup>
+<tgroup>M
+ <secondaryie>
+ <indexdiv>make, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>make install, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>makeick.bat, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>makeick.sh, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>making a live CD/USB stick, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>MAXTOFREE, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>MAYBE, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>MAYBE</literal>, not enabled, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>mesh, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>microcontrollers, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>mingle, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>mingle, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>multithreading, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>multithreading, connected threads, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>multithreading, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>multithreading, enabling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>multithreading, not enabled, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>multithreading, out of memory, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>multithreading, separate threads, see </indexdiv></secondaryie></tgroup>
+<tgroup>N
+ <secondaryie>
+ <indexdiv>N'T, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>nesting limit, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>NEXT, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>NEXT FROM, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>NEXT FROM</literal>, multithreading, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>NEXT FROM</literal>, no target, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>NEXT stack, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>NEXT</literal>, nonexistent target, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>NEXT</literal>, stack overflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>NEXTING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>no source file, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>non-INTERCAL-72 warning, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>non-root installation, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>NOT, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>not installing, see </indexdiv></secondaryie></tgroup>
+<tgroup>O
+ <secondaryie>
+ <indexdiv>obtaining C-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, basics, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, comments, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, example, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, execution, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, expressions, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, functions in C, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, idiom groups, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, idioms, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, loops, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, operators, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, optimizing code, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, patterns, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, replacements, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, syntax, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>OIL, tips, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ONCE, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>onespot, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>onespot overflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>onespot, overflow warning, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>operand overloading, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>operand overloading, impossible, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>operands, OIL, in patterns, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>operands, OIL, in replacements, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>operator, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>operators, OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>optimization, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>optimization, control flow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>optimization, extreme, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>optimization, flow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>optimization, idioms, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>optimization, OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Optimizer Idiom Language, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>optimizer options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>optimizer, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, debug, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, dialect, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, help, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, language-affecting, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, optimizer, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, other, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, output, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, to generated programs, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>options, to <command>ick</command>, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>or, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>or16, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>or32, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>other languages, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>other languages, C, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>other options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>out of bounds, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>out of memory, backtracking, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>out of memory, during compile, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>out of memory, during <literal>STASH</literal>, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>out of memory, I/O, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>out of memory, multithreading, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>output, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>output options, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>output, C only, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>output, C-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>output, CLC-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>output, in Arabic numerals, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>output, INTERCAL-72, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>output, to standard output, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>overflow, over 16 bits, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>overflow, over 32 bits, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>overflow, over onespot, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>overflow, over twospot, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>overflow, warning, see </indexdiv></secondaryie></tgroup>
+<tgroup>P
+ <secondaryie>
+ <indexdiv>parser, debugging, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>patches, submitting, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>patterns, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>patterns, operands, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>PIC-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>PIC-INTERCAL, command line option, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>PIC-INTERCAL, unsupported command, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>PIN, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>PIN</literal>, in a non-PIC program, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>PLEASE, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>PLEASE</literal>, proportion required, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>politesse, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>portability, unary operators, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>positional precedence, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Princeton syntax, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Princeton syntax, option, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>profiling, see </indexdiv></secondaryie></tgroup>
+<tgroup>Q
+ <secondaryie>
+ <indexdiv>quitting, see </indexdiv></secondaryie></tgroup>
+<tgroup>R
+ <secondaryie>
+ <indexdiv>r, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>rabbit-ears, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>rabbit-ears, nesting limit, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>random bug, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>random bug, error message, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>READ OUT, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>read-only variables, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>read-write variables, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>READING OUT, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>REINSTATE, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>reinstate, at program start, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>reinstate, during execution, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>REINSTATE, self-reinstating, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>reinstated state, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>REINSTATING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>REINTSTATE</literal>, nonexistent target, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>releasing C-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>REMEMBER, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>REMEMBERING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>replacements, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>replacements, operands, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>reporting bugs, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>RESUME, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>RESUME</literal>, by 0, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>RESUMING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>RETRIEVE, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>RETRIEVE</literal>, without stashing, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>RETRIEVE</literal>/<literal>IGNORE</literal> interaction, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>RETRIEVING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>reverse assignment, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>reverse assignment, error, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>reverse assignment, impossible, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>reverse goto, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Roman numerals, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Roman numerals, disabling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>runtime debugger, see </indexdiv></secondaryie></tgroup>
+<tgroup>S
+ <secondaryie>
+ <indexdiv>self-abstaining, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>self-reinstating, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>SENESTMAX, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>separate threads, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>setbitcount, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>sharkfin, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>sharkfin, in base 2, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>simple installation, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>skeleton file, directory problems, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>skeleton file, errors, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>slat, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>smudgeleft, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>smudgeright, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>spark, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>spark, nesting limit, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><filename>src/idiotism.oil</filename>, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>stack overflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>stack, instruction pointer, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>stack, NEXT, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>stack, variable, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>standard output, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>STASH, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>stash failure, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>stashes, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>STASHING, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>statement identifier, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>statements, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>statements, INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>SUB, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>submitting patches, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>subscripts, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>subtract-without-borrow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax error, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax error, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax error, serious, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax, Atari, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax, dialects, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax, INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax, of OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax, Princeton, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syntax, Princeton, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syslib, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syslib, directory problems, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>syslib, errors, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>system libary, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>system library, directory problems, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>system library, errors, see </indexdiv></secondaryie></tgroup>
+<tgroup>T
+ <secondaryie>
+ <indexdiv>tail, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>ternary, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Threaded INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>threading, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>threading, connected, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>threading, dormant, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>threading, in series, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>threading, separate, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>threading, unwoven, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>threading, woven, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>time-reversed goto, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>tips, OIL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>TriINTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>TriINTERCAL, operators in base 2, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>TRY AGAIN, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>TRY AGAIN</literal>, not last, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>trying out <command>ick</command>, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Turing Tape, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>twospot, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>twospot overflow, see </indexdiv></secondaryie></tgroup>
+<tgroup>U
+ <secondaryie>
+ <indexdiv>Ubuntu, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>unary binary logic, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>unary operator, infix, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>unary operator, prefix, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>unary operators, portability, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>uninstalling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>unpacking C-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>unwoven threads, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>unzipping C-INTERCAL, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>usage instructions, printing, see </indexdiv></secondaryie></tgroup>
+<tgroup>V
+ <secondaryie>
+ <indexdiv>V, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variable, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variable, illegal number, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variables, assignment, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variables, ignoring, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variables, limit, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variables, read-only, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variables, read-write, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variables, remembering, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>variables, stashes, see </indexdiv></secondaryie></tgroup>
+<tgroup>W
+ <secondaryie>
+ <indexdiv>W016, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>W018, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>W112, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>W128, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>W239, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>W276, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>W278, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>W534, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>W622, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>warnings, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>warnings, enabling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>warnings, non-INTERCAL-72, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>what, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>WHILE, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv><literal>WHILE</literal>, not enabled, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>whirlpool, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>whirlpool, in base 2, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>wimpmode, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>Windows, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>woven threads, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>WRITE IN, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>WRITING IN, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>wrong array dimension, see </indexdiv></secondaryie></tgroup>
+<tgroup>X
+ <secondaryie>
+ <indexdiv>x, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>x1–x9, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>xor, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>xor16, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>xor32, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>xselx, see </indexdiv></secondaryie></tgroup>
+<tgroup>Y
+ <secondaryie>
+ <indexdiv>yuk, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>yuk, breakpoint overflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>yuk, command line option, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>yuk, commands, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>yuk, input overflow, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>yuk, profiling, see </indexdiv></secondaryie>
+ <secondaryie>
+ <indexdiv>yuk, too many breakpoints, see </indexdiv></secondaryie></tgroup></book><!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-indent-step:1
+sgml-indent-data:nil
+End:
+-->
--- /dev/null
+
+
+
+
+
+
+ T\bTH\bHE\bE I\bIN\bNT\bTE\bER\bRC\bCA\bAL\bL P\bPR\bRO\bOG\bGR\bRA\bAM\bMM\bMI\bIN\bNG\bG L\bLA\bAN\bNG\bGU\bUA\bAG\bGE\bE
+ R\bRE\bEV\bVI\bIS\bSE\bED\bD R\bRE\bEF\bFE\bER\bRE\bEN\bNC\bCE\bE M\bMA\bAN\bNU\bUA\bAL\bL
+
+ _\bD_\bo_\bn_\ba_\bl_\bd _\bR_\b. _\bW_\bo_\bo_\bd_\bs
+ _\ba_\bn_\bd
+ _\bJ_\ba_\bm_\be_\bs _\bM_\b. _\bL_\by_\bo_\bn
+
+ _\bC_\b-_\bI_\bN_\bT_\bE_\bR_\bC_\bA_\bL _\br_\be_\bv_\bi_\bs_\bi_\bo_\bn_\bs_\b:
+ _\bL_\bo_\bu_\bi_\bs _\bH_\bo_\bw_\be_\bl_\bl
+ _\ba_\bn_\bd
+ _\bE_\br_\bi_\bc _\bS_\b. _\bR_\ba_\by_\bm_\bo_\bn_\bd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 2 -
+
+
+
+ _\b1_\b. _\bI_\bN_\bT_\bR_\bO_\bD_\bU_\bC_\bT_\bI_\bO_\bN
+
+
+ "But I don't want to go among mad people," Alice remarked.
+
+ "Oh, you ca'n't help that," said the Cat: "We're all mad
+ here. I'm mad. You're mad."
+
+ "How do you know I'm mad?" said Alice.
+
+ "You must be," said the Cat, "or you wouldn't have come
+ here."
+
+
+ The names you are about to ignore are true. However, the
+ story has been changed significantly. Any resemblance of the
+ programming language portrayed here to other programming
+ languages, living or dead, is purely coincidental.
+
+ _\b1_\b._\b1 _\bO_\br_\bi_\bg_\bi_\bn _\ba_\bn_\bd _\bP_\bu_\br_\bp_\bo_\bs_\be
+
+ The INTERCAL programming language was designed the morning
+ of May 26, 1972 by Donald R. Woods and James M. Lyon, at
+ Princeton University. Exactly when in the morning will
+ become apparent in the course of this manual.
+
+ Eighteen years later (give or take a few months) Eric S.
+ Raymond perpetrated a UNIX-hosted INTERCAL compiler as a
+ weekend hack. The C-INTERCAL implementation has since been
+ maintained and extended by an international community of
+ technomasochists, including Louis Howell, Steve Swales,
+ Michael Ernst, and Brian Raiter.
+
+ (There was evidently an Atari implementation sometime
+ between these two; notes on it got appended to the
+ INTERCAL-72 manual. The culprits have sensibly declined to
+ identify themselves.)
+
+ INTERCAL was inspired by one ambition: to have a compiler
+ language which has nothing at all in common with any other
+ major language. By 'major' was meant anything with which the
+ authors were at all familiar, e.g., FORTRAN, BASIC, COBOL,
+ ALGOL, SNOBOL, SPITBOL, FOCAL, SOLVE, TEACH, APL, LISP, and
+ PL/I. For the most part, INTERCAL has remained true to this
+ goal, sharing only the basic elements such as variables,
+ arrays, and the ability to do I/O, and eschewing all
+ conventional operations other than the assignment statement
+ (FORTRAN "=").
+
+ _\b1_\b._\b2 _\bA_\bc_\br_\bo_\bn_\by_\bm
+
+ The full name of the compiler is "Compiler Language With No
+ Pronounceable Acronym", which is, for obvious reasons,
+ abbreviated "INTERCAL".
+
+
+
+
+
+
+
+
+ - 3 -
+
+
+
+ _\b1_\b._\b3 _\bA_\bc_\bk_\bn_\bo_\bw_\bl_\be_\bd_\bg_\bm_\be_\bn_\bt_\bs
+
+ The authors are deeply indebted to Eric M. Van and Daniel J.
+ Warmenhoven, without whose unwitting assistance this manual
+ would still have been possible.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 4 -
+
+
+
+ _\b2_\b. _\bF_\bU_\bN_\bD_\bA_\bM_\bE_\bN_\bT_\bA_\bL _\bC_\bO_\bN_\bC_\bE_\bP_\bT_\bS
+
+
+ "There's nothing like eating hay when you're faint," the
+ White King remarked to Alice, as he munched away.
+
+ "I should think throwing cold water over you would be
+ better," Alice suggested: "-- or some sal-volatile."
+
+ "I didn't say there was nothing _\bb_\be_\bt_\bt_\be_\br," the King replied.
+ "I said there was nothing _\bl_\bi_\bk_\be it." Which Alice did not
+ venture to deny.
+
+
+ In this section an attempt is made to describe how and why
+ INTERCAL may be used; i.e., what it is like and what it is
+ good for.
+
+ _\b2_\b._\b1 _\bS_\ba_\bm_\bp_\bl_\be _\bP_\br_\bo_\bg_\br_\ba_\bm
+
+ Shown below is a relatively simple INTERCAL program which
+ will read in 32-bit unsigned integers, treat them as signed,
+ 2's-complement numbers, and print out their absolute values.
+ The program exits if the absolute value is zero. Note in
+ particular the inversion routine (statements 6 through 14),
+ which could be greatly simplified if the subroutine library
+ (see section ) were used.
+
+ A more detailed analysis of a program is made in section
+ of this manual.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 5 -
+
+
+
+ DO (5) NEXT
+ (5) DO FORGET #1
+ PLEASE WRITE IN :1
+ DO .1 <- 'V\b-":1~'#32768c\b/#0'"c\b/#1'~#3
+ DO (1) NEXT
+ DO :1 <- "'V\b-":1~'#65535c\b/#0'"c\b/#65535'
+ ~'#0c\b/#65535'"c\b/"'V\b-":1~'#0c\b/#65535'"
+ c\b/#65535'~'#0c\b/#65535'"
+ DO :2 <- #1
+ PLEASE DO (4) NEXT
+ (4) DO FORGET #1
+ DO .1 <- "V\b-':1~:2'c\b/#1"~#3
+ DO :1 <- "'V\b-":1~'#65535c\b/#0'"c\b/":2~'#65535
+ c\b/#0'"'~'#0c\b/#65535'"c\b/"'V\b-":1~'#0
+ c\b/#65535'"c\b/":2~'#0c\b/#65535'"'~'#0c\b/#65535'"
+ DO (1) NEXT
+ DO :2 <- ":2~'#0c\b/#65535'"
+ c\b/"'":2~'#65535c\b/#0'"c\b/#0'~'#32767c\b/#1'"
+ DO (4) NEXT
+ (2) DO RESUME .1
+ (1) PLEASE DO (2) NEXT
+ PLEASE FORGET #1
+ DO READ OUT :1
+ PLEASE DO .1 <- 'V\b-"':1~:1'~#1"c\b/#1'~#3
+ DO (3) NEXT
+ PLEASE DO (5) NEXT
+ (3) DO (2) NEXT
+ PLEASE GIVE UP
+
+
+ _\b2_\b._\b2 _\bU_\bs_\be_\bs _\bf_\bo_\br _\bI_\bN_\bT_\bE_\bR_\bC_\bA_\bL
+
+ INTERCAL's main advantage over other programming languages
+ is its strict simplicity. It has few capabilities, and thus
+ there are few restrictions to be kept in mind. Since it is
+ an exceedingly easy language to learn, one might expect it
+ would be a good language for initiating novice programmers.
+ Perhaps surprising, then, is the fact that it would be more
+ likely to initiate a novice into a search for another line
+ of work. As it turns out, INTERCAL is more useful (which
+ isn't saying much) as a challenge to professional
+ programmers. Those who doubt this need only refer back to
+ the sample program in section . This 23-statement program
+ took somewhere from 15 to 30 minutes to write, whereas the
+ same objectives can be achieved by single-statement programs
+ in either SNOBOL;
+
+ PLEASE INPUT POS(0) ('-' ! '')
+ + (SPAN('0123456789') $ OUTPUT)
+ + *NE(OUTPUT) :S(PLEASE)F(END)
+
+ or APL;
+
+ [1] ->0!=[]<-|[]
+
+
+
+
+
+
+
+
+ - 6 -
+
+
+
+ Admittedly, neither of these is likely to appear more
+ intelligible to anyone unfamiliar with the languages
+ involved, but they took roughly 60 seconds and 15 seconds,
+ respectively, to write. Such is the overwhelming power of
+ INTERCAL!
+
+ The other major importance of INTERCAL lies in its seemingly
+ inexhaustible capacity for amazing one's fellow programmers,
+ confounding programming shop managers, winning friends, and
+ influencing people. It is a well-known and oft-demonstrated
+ fact that a person whose work is incomprehensible is held in
+ high esteem. For example, if one were to state that the
+ simplest way to store a value of 65536 in a 32-bit INTERCAL
+ variable is:
+
+ DO :1 <- #0c\b/#256
+
+ any sensible programmer would say that that was absurd.
+ Since this is indeed the simplest method, the programmer
+ would be made to look foolish in front of his boss, who
+ would of course happened to turn up, as bosses are wont to
+ do. The effect would be no less devastating for the
+ programmer having been correct.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 7 -
+
+
+
+ _\b3_\b. _\bD_\bE_\bS_\bC_\bR_\bI_\bP_\bT_\bI_\bO_\bN
+
+
+ "I quite agree with you," said the Duchess; "and the moral
+ of that is -- 'Be what you would seem to be' -- or, if you'd
+ like it put more simply -- 'Never imagine yourself not to be
+ otherwise than what it might appear to others that what you
+ were or might have been was not otherwise than what you had
+ been would have appeared to them to be otherwise."
+ "I think I should understand that better," Alice said very
+ politely, "if I had it written down: but I ca'n't quite
+ follow it as you say it."
+
+ "That's nothing to what I could say if I chose," the Duchess
+ replied, in a pleased tone.
+
+
+ The examples of INTERCAL programming which have appeared in
+ the preceding sections of this manual have probably seemed
+ highly esoteric to the reader unfamiliar with the language.
+ With the aim of making them more so, we present here a
+ description of INTERCAL.
+
+ _\b3_\b._\b1 _\bV_\ba_\br_\bi_\ba_\bb_\bl_\be_\bs
+
+ INTERCAL allows only 2 different types of variables, the
+ 1\b16\b6-\b-b\bbi\bit\bt i\bin\bnt\bte\beg\bge\ber\br and the 3\b32\b2-\b-b\bbi\bit\bt i\bin\bnt\bte\beg\bge\ber\br.\b. These are
+ represented by a spot (.) or two-spot (:), respectively,
+ followed by any number between 1 and 65535, inclusive.
+ These variables may contain only non-negative numbers; thus
+ they have the respective ranges of values: 0 to 65535 and 0
+ to 4294967295. Note: .123 and :123 are two distinct
+ variables. On the other hand, .1 and .0001 are identical.
+ Furthermore, the latter may _\bn_\bo_\bt be written as 1E-3.
+
+ _\b3_\b._\b2 _\bC_\bo_\bn_\bs_\bt_\ba_\bn_\bt_\bs
+
+ C\bCo\bon\bns\bst\bta\ban\bnt\bts\bs are 16-bit values only and may range from 0 to
+ 65535. They are prefixed by a mesh (#). Caution! Under no
+ circumstances confuse the mesh with the interleave operator,
+ except under confusing circumstances!
+
+ _\b3_\b._\b3 _\bA_\br_\br_\ba_\by_\bs
+
+ A\bAr\brr\bra\bay\bys\bs are represented by a tail (,) for 16-bit values, or a
+ hybrid (;) for 32-bit values, followed by a number between 1
+ and 65535, inclusive. The number is suffixed by the word
+ SUB, followed by the subscripts, separated optionally by
+ spaces. Subscripts may be any expressions, including those
+ involving subscripted variables. This occasionally leads to
+ ambiguous constructions, which are resolved as discussed in
+ section . Definition of array dimensions will be discussed
+ later in greater detail, since discussing it in less detail
+ would be difficult. As before, ,123 and ;123 are distinct.
+
+
+
+
+
+
+
+
+ - 8 -
+
+
+
+ In summary, .123, :123, #123, ,123, and ;123 are all
+ distinct.
+
+ _\b3_\b._\b4 _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ INTERCAL recognizes 5 operators -- 2 binary and 3 unary 1.
+ Please be kind to our operators: they may not be very
+ intelligent, but they're all we've got. In a sense, all 5
+ operators are binary, as they are all bit-oriented, but it
+ is not our purpose here to quibble about bits of trivia.
+
+ _\b3_\b._\b4_\b._\b1 _\bB_\bi_\bn_\ba_\br_\by _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ The binary operators are i\bin\bnt\bte\ber\brl\ble\bea\bav\bve\be (also called m\bmi\bin\bng\bgl\ble\be) and
+ s\bse\bel\ble\bec\bct\bt, which are represented by a change (c\b/) and a sqiggle
+ [sic] (~), respectively. (In C-INTERCAL's ASCII
+ environment, EBCDIC c\b/ is replaced by a big money ($), but c\b/
+ can be used if encoded in Latin-1 as \0xA2 or UTF-8 as
+ 0xC2A2.)
+
+ The interleave operator takes two 16-bit values and produces
+ a 32-bit result by alternating the bits of the operands.
+ Thus, #65535c\b/#0 has the 32-bit binary form 101010....10 or
+ 2863311530 decimal, while #0c\b/#65535 = 0101....01 binary =
+ 1431655765 decimal, and #255c\b/#255 is equivalent to #65535.
+
+ The select operator takes from the first operand whichever
+ bits correspond to 1's in the second operand, and packs
+ these bits to the right in the result. Both operands are
+ automatically padded on the left with zeros to 32 bits
+ before the selection takes place, so the variable types are
+ unrestricted. If more than 16 bits are selected, the result
+ is a 32-bit value, otherwise it is a 16-bit value. For
+ example, #179~#201 (binary value 10110011~11001001) selects
+ from the first argument the 8th, 7th, 4th, and 1st from last
+ bits, namely, 1001, which = 9. But #201~#179 selects from
+ binary 11001001 the 8th, 6th, 5th, 2nd, and 1st from last
+ bits, giving 10001 = 17. #179~#179 has the value 31, while
+ #201~#201 has the value 15.
+
+ Perhaps a simpler way of understanding the operation of the
+ select operator would be to examine the logic diagram in
+ Figure 1, which performs the select operation upon two 8-bit
+ values, A and B. The gates used are Warmenhovian logic
+ gates, which means the outputs have four possible values:
+ low, high, undefined (value of an uninitialized flip-flop),
+ and oscillating (output of a NOR gate with one input low and
+ the other input connected to the output). These values are
+ represented symbolically by '0', '1', '?', and 'O\b|'. Note in
+ particular that, while NOT-0 is 1 and NOT-1 is 0 as in two-
+
+ ____________________
+
+ 1. Other operators are also available with C-INTERCAL's non-
+ standard dialects; see section .
+
+
+
+
+
+
+
+ - 9 -
+
+
+
+ valued logic, NOT-? is ? and NOT-O\b| is O\b|. The functions of
+ the various gates are listed in Table 1.
+
+ [Warning: The following picture will be garbled or missing.
+ Get a better output device.]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 10 -
+
+
+
+ --+-+---- --+---- +--+---- --+---- +--+----
+ A\b1 | | 1 +-+--+-+ 2 +-++-+ 3 ++-+-+ 3 ++|--+ 1 +--
+ B --+++ | |--+-+ | || | ||||++ |||| | | TO
+ 1 +++------++-+-+------+|-+--- +++++-----++|-+--- ---\bNEW
+ +-------++-+---------+-------+++++-----+ | YORK
+ +-+------++-+-+-----+ | +---- ||| +-----+ | +---- TO
+ A\b2 --+-+ | || +-+ || --+ |+++-+ |+-+-+ | ---\bNEW
+ --+-+ 1 +-++-+-+ 2 +++--+ 7 +-++-+ 3 +--+-+ 2 +-- YO\bTR\bOK
+ B\b2 |-+--- |||+-+--- || -+--- |+-+------++-+------- ---\bNEW
+ +--------+++-+------++---------+--------+|+--------- YORK
+ +-+------+++-++-----++--+-----+| ++-----++--+-----+ TO
+ A --+-+ | +++-++ |++--+ |++-++ ||+--+ || B ---\bNEW
+ 3 | 1 +-+++-+| 2 +-++-+ 3 +-++++ 3 ++++-+ 3 ++- YORK
+ B\b3 --+-+--- ||||+++--- |||-+--- ++|++--- ||+++--- | TO
+ +-------++++++------+++-------++++------++++------+-U ---\bNEW
+ +-+-----+++-+++-----+++-+-----+++|| ++++| | YORK
+ A --+-+----|||| ||+----||++-+----||++++----|+++++----|| S TO
+ 4 | 1 +++++|++ 2 ++++-+ 7 ++++++ 3 ++++-+ 4 ++- ---\bNEW
+ B --+-+--- ||||+-+--- ||+-+--- |||++--- ++--++--- | YO\bTR\bOK
+ 4 | |||+++ ++--+ +---++++++++++|+-+------+ ---\bNEW
+ +-------+++-++-------++++-+--+||+++++++-++++--+ YORK
+ --+-+-----+++-+++-----+++++-+--+++-++++++ +++++-+-- L TO
+ A\b5 | 1 ++++++++ 2 ++++++ 3 +++ ++ 3 +-++++ 5 +-- ---\bNEW
+ B --+-+ |||+++++ | ||| ||| || |++++| | YORK
+ 5 |-+--- |||||++-------|++----+|+--+-----+++++-------I TO
+ +-------+++++--------++------++++ +--- |+++ ---\bNEW
+ +-+-----+++++-+-----+|| +----++++++-----+|||+---- N YORK
+ A\b6 --+-+ |||-++++ |+++-+ |+++++ | ++++ | TO
+ --+-+ 1 +++-++++ 2 ++++-+ 3 +-++++ 4 ++++++ 4 +-- ---\bNEW
+ B\b6 |-+--- +++++++--- +++-+-----+||++-----+++++-------E YORK
+ +--------++++--------++------+||| ++-+ ---TO
+ +-+------++++-+-----+|| +----++++++---- || +---- NEW
+ A --+-+ | -+++-+ |+++-+ |+++++ ||+--+ | YO\bTR\bOK
+ 7 | 1 +--+|+-+ 2 +-++-+ 3 ++|+++ 4 ++-+-+ 5 +-- ---\bNEW
+ B\b7 --+-+--- ||++-+--- ||++--- || ++--- --+++--- YORK
+ +----+---++++--------+++------++ +------+-++------+- TO
+ +-+--+---++++-+-------+|| | || | || | ---\bNEW
+ A --+-+----| |+++-+----|+-+++----|+--++----||+--+----|| YORK
+ 8 | 1 +-+ |+-+ 2 ++ +++ 4 ++ +++ 3 ++++-+ 5 ++-8 TO
+ B --+-+--- +--+--- | ++--- | |++--- | |-+--- | ---\bNEW
+ 8 +----------------+ ++-+ +-++---+ ++-+------+| YORK
+ +--+++--------+|| +-++++------++- TO
+ +---- +-+--+-----+++-+---- ++++----+|++-+----++- ---\bNEW
+ | 6 +-+ +--+ 2 ++-+-+ 7 +-++-+ 3 +++|++ 4 ++- YO\bTR\bOK
+ | | -+--+ |+---+ | | | || ||| || --\bP-\bHILA-
+ -+--- | -+--- -+--- |-+--- +-+++--- | DELPHIA
+ +---------------------+---------+-------+-
+ +---- |+--+---------+------++-+-----+ +----
+ | | ++--+ | +-+ | |--+ ||+--+ |
+ | 6 +--++--+ 1 +-++-+ 1 +-+--+ 1 +++--+ 1 ++
+ -+--- -+--- --++-+--- | -+--- | -+-----+-
+ --- ---
+ FIGURE 1. CIRCUITOUS DIAGRAM
+
+
+
+
+
+
+
+
+
+ - 11 -
+
+
+
+ __________________________________________________________
+ |\ \
+ | \ 1. Logic gate. Inputs A, B. Output O = AB. \
+ | \ \
+ | \ \ 2. Logic gate. Inputs A, B, C. Output O = A+BC. \
+ | |\ \ \
+ | | \ \ 3. Logic gate. Inputs A, B. Output O = A+AB. \
+ | | \ \ \
+ | | |\ \ 4. Logic gate. Inputs A, B. Output O = AB O\b+ -(A+-B) \
+ | | | \ \ \
+ | | | \ \ 5. Logic gate. Inputs A, B. Output O = AO\b+A + AA \
+ | | | \ \ \
+ | | | \ \ 6. Uninitialized flip-flop. Inputs none. Output O = ? \
+ | | | \ \ \
+ | | | \ \ 7. Flip-flop-flap. Inputs A, B, C. Output O = 1 if \
+ | | | \ \ A=0 or B+C=0 and A=1. O = 0 if AC=1, B=0. O = O\b| if \
+ | | | \ \ AB=1, C=0. O = ? if ABC=1. O as yet undetermined \
+ | | | \ \ for other Warmenhovian inputs. See Figure 2. \
+ | | | \ \ \
+ | | | \ \ 8. Bus line. \
+ | | | \ \_________________________________________________________\
+ | | | \ | |
+ | | | | | _____________________________________________________ |
+ | | | | | | | | | | | |
+ | | | | | | | | | | | |
+ | | | | | | | | | | | |
+ | | | | | | | | | | | |
+ | | | | | | | | | | | |
+ \|__| | | | \|__| | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ \|__| \|__|
+
+ Table 1. Logical (and other) functions.
+
+
+
+
+
+
+
+
+
+
+
+
+ - 12 -
+
+
+
+ [Warning: The following picture will be garbled or missing.
+ Get a better output device.]
+
+
+
+
+
+
+
+
+
+
+ -------------------------+----
+ A +---+ |----+------------D
+ | | | |
+ +----
+
+
+
+ | | |
+ +---+---- |
+ B-------------------------+ |----+ |
+ +----| | |
+ | |
+ | |
+ | |
+ | |
+ | | |
+ C-------------------------+----| | |
+ +----------------+ |--+ | |
+ | +---- | | |
+ | | | |
+ | |
+ | |
+ | |
+ | | | | |
+ | | +-+----| |
+ | +---+ +- +-------+
+ | +-+--
+ 1-----+
+
+
+
+
+
+
+
+
+
+
+ FIGURE 2. FLIP FLAP FLOP
+
+
+
+
+
+
+
+
+
+
+
+ - 13 -
+
+
+
+ [Warning: The following picture will be garbled or missing.
+ Get a better output device.]
+
+ -----
+ ----- -----
+ -----
+ ----- -----
+
+ ----- -----
+ -----
+ ----- -----
+ ----- GATE TYPE 9. BLACK BOX
+ ----- 9 ----- INPUTS A1-8, B1-8.
+ ----- OUTPUT O1-8 = A1-8~B1-8
+ ----- -----
+ -----
+ ----- -----
+
+ ----- -----
+ -----
+ ----- -----
+ -----
+
+
+
+
+
+
+
+
+
+
+
+ FIGURE 1 (CONTINUED). NEW YORK
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 14 -
+
+
+
+ _\b3_\b._\b4_\b._\b1_\b._\b1 _\bR_\be_\bt_\bu_\br_\bn _\bt_\by_\bp_\be _\bo_\bf _\bS_\bE_\bL_\bE_\bC_\bT
+
+ INTERCAL-72 defined the return type of a select operation to
+ depend on the number of bits selected. The C-INTERCAL
+ compiler takes the easier route of defining the return type
+ to be that of the right operand, independent of its actual
+ value. This form has the advantage that all types can be
+ determined at compile time. Putting in run-time type-
+ checking would add significant overhead and complication, to
+ effect a very minor change in language semantics.
+
+ The only time this distinction makes any difference is when
+ a unary operator is applied to the select result. This
+ happens extremely rarely in practice, the only known
+ instance being the 32-bit greater-than test in the standard
+ library, where an XOR operator is applied to the result of
+ selecting a number against itself. The INTERCAL-72 authors
+ first select the result against #65535c\b/#65535 to insure that
+ XOR sees a 32-bit value. With the current compiler this
+ extra step is unnecessary, but harmless.
+
+ The cautious programmer should write code that does not
+ depend on the compiler version being used. We therefore
+ suggest the following guideline for determining the select
+ return type:
+
+ A select operation with a 16-bit right operand returns a
+ 16-bit value. The return type of a select operation with a
+ 32-bit right operand is undefined, but is guaranteed to be
+ an acceptable input to a mingle operation so long as 16 or
+ fewer bits are actually selected. Correct code should not
+ depend on whether the return type is 16 or 32 bits.
+
+ _\b3_\b._\b4_\b._\b2 _\bU_\bn_\ba_\br_\by _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ The unary operators are & (logical A\bAN\bND\bD), V (logical O\bOR\bR), and
+ V\b- (logical X\bXO\bOR\bR). This last character is obtained by
+ overpunching a worm (-) on a V (V). (In C-INTERCAL, V\b- is
+ replaced by what (?). The compiler recognizes V<backspace>-
+ as a valid equivalent, in case you are concerned about
+ compatibility with the Princeton compiler. In version 0.20
+ and later, the Unicode character U+2200 FOR ALL, which looks
+ exactly like V<backspace>- or an upside-down `A' is also
+ accepted in UTF-8 form.) The operator is inserted between
+ the spot, two-spot, mesh, or what-have-you, and the integer,
+ thus: .&123, #V\b-123. Multiple unary operators may not be
+ concatenated, thus the form #V\b-&123 is invalid. This will be
+ covered later when precedence is discussed. These operators
+ perform their respective logical operations on all pairs of
+ adjacent bits, the result from the first and last bits going
+ into the first bit of the result. The effect is that of
+ rotating the operand one place to the right and ANDing,
+ ORing, or XORing with its initial value. Thus, #&77 (binary
+ = 1001101) is binary 0000000000000100 = 4, #V77 is binary
+
+
+
+
+
+
+
+
+ - 15 -
+
+
+
+ 1000000001101111 = 32879, and #V\b-77 is binary
+ 1000000001101011 = 32875.
+
+ _\b3_\b._\b4_\b._\b3 _\bP_\br_\be_\bc_\be_\bd_\be_\bn_\bc_\be
+
+ Precedence of operators is as follows:
+
+
+
+
+
+
+
+
+
+
+ (The remainder of this page intentionally left blank)2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ____________________
+
+ 2. Keep in mind that the aim in designing INTERCAL was to
+ have no precedents.
+
+
+
+
+
+
+
+ - 16 -
+
+
+
+ This precedence (or lack thereof) may be overruled by
+ grouping expressions between pairs of sparks (') or rabbit-
+ ears ("). Thus '#165c\b/#203'~#358 (binary value
+ '10100101c\b/11001011'~101100110) has the value 15, but
+ #165c\b/'#203~#358' has the value 34915, and #165c\b/#203~#358 is
+ invalid syntax and is completely valueless (except perhaps
+ as an educational tool to the programmer). A unary operator
+ is applied to a sparked or rabbit-eared expression by
+ inserting the operator immediately following the opening
+ spark or ears. Thus, the invalid expression #V\b-&123, which
+ was described earlier, could be coded as 'V\b-#&123' or
+ 'V\b-"{"'. Note: In the interests of simplifying the
+ sometimes overly-complex form of expressions, INTERCAL
+ allows a spark-spot combination ('.) to be replaced with a
+ wow (!). Thus '.1~.2' is equivalent to !1~.2', and 'V.1c\b/.2'
+ is equivalent to "V!1c\b/.2'".
+
+ Combining a rabbit-ears with a spot to form a rabbit ("\b.) is
+ not permitted, although the programmer is free to use it
+ should he find an EBCDIC reader which will properly
+ translate a 12-3-7-8 punch.
+
+ Sparks and/or rabbit-ears must also be used to distinguish
+ among such otherwise ambiguous subscripted and multiply-
+ subscripted expressions as:
+
+ ,1 SUB #1 ~ #2
+ ,1 SUB ,2 SUB #1 #2 #3
+ ,1 SUB " ,2 SUB " ,3 SUB #1 " #2 " " #3 "
+
+ The third case may be isolated into either of its possible
+ interpretations by simply changing some pairs of rabbit-ears
+ to sparks, instead of adding more ears (which would only
+ confuse the issue further). Ambiguous cases are defined as
+ those for which the compiler being used finds a legitimate
+ interpretation which is different from that which the user
+ had in mind. See also section .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 17 -
+
+
+
+ _\b4_\b. _\bS_\bT_\bA_\bT_\bE_\bM_\bE_\bN_\bT_\bS
+
+
+ "There's glory for you!"
+
+ "I don't know what you mean by 'glory,'" Alice said.
+
+ Humpty Dumpty smiled contemptuously. "Of course you don't --
+ till I tell you. I meant 'there's a nice knock-down argument
+ for you!'"
+ "But 'glory' doesn't mean 'a nice knock-down argument.'"
+ Alice objected.
+
+ "When _\bI use a word," Humpty Dumpty said, in a rather
+ scornful tone, "it means just what I choose it to mean --
+ neither more nor less."
+
+
+ In this section is described the format of INTERCAL
+ statements.
+
+ _\b4_\b._\b1 _\bG_\be_\bn_\be_\br_\ba_\bl _\bF_\bo_\br_\bm_\ba_\bt
+
+ Statements may be entered in 'free format'. That is, more
+ than one statement may occur on a single card, and a
+ statement may begin on one card and end on a later one. Note
+ that if this is done, all intervening cards and portions
+ thereof must be part of the same statement. That this
+ restriction is necessary is immediately apparent from the
+ following example of what might occur if statements could be
+ interlaced.
+
+ DO .1 <- ".1c\b/'&:51~"#V\b-1c!12~;&75SUB"V\b-'V.1~
+ DO .2 <- '"!1c\b/"&';V\b-79SUB",&7SUB:173"'~!V\b-9c\b/
+ .2'c\b/,&1SUB:5~#33578"'"'"~'#65535c\b/"V\b-'V#&85'"'
+ #8196'"'~.1"c\b/.2'~'#&5c\b/"'#1279c\b/#4351'~#65535"'
+
+ The above statements are obviously meaningless. (For that
+ matter, so are the statements
+
+ DO .1 <- ".1c\b/"&:51~"#V\b-1c\b/!12~;&75SUB"V\b-'V.1~
+ .2'c\b/,&1SUB:5~#333578"'"'"~#65535c\b/"V\b-'V#&85'"'
+ DO .2 <- '"!1c\b/"&';V\b-79SUB",&7SUB:173"'~!V\b-9c\b/
+ #8196'"'~.1"c\b/.2'~'#&5c\b/"'#1279c\b/#4351'~#65535"'
+
+ but this is not of interest here.)
+
+ Spaces may be used freely to enhance program legibility (or
+ at least reduce program illegibility), with the restriction
+ that no word of a statement identifier (see section ) may
+ contain any spaces.
+
+ _\b4_\b._\b2 _\bL_\ba_\bb_\be_\bl_\bs
+
+
+
+
+
+
+
+
+
+ - 18 -
+
+
+
+ A statement may begin with a l\blo\bog\bgi\bic\bca\bal\bl l\bli\bin\bne\be l\bla\bab\bbe\bel\bl enclosed in
+ wax-wane pairs (()). A statement may not have more than one
+ label, although it is possible to omit the label entirely. A
+ line label is any integer from 1 to 65535, which must be
+ unique within each program. The user is cautioned, however,
+ that many line labels between 1000 and 1999 are used in the
+ INTERCAL System Library functions.
+
+ _\b4_\b._\b3 _\bI_\bd_\be_\bn_\bt_\bi_\bf_\bi_\be_\br_\bs _\ba_\bn_\bd _\bQ_\bu_\ba_\bl_\bi_\bf_\bi_\be_\br_\bs
+
+ After the line label (if any), must follow one of the
+ following statement identifiers: DO, PLEASE, or PLEASE DO.
+ These may be used interchangeably to improve the aesthetics
+ of the program. The identifier is then followed by either,
+ neither, or both of the following optional parameters
+ (qualifiers): (1) either of the character strings NOT or
+ N'T, which causes the statement to be automatically
+ abstained from (see section ) when execution begins, and (2)
+ a number between 0 and 100, preceded by a double-oh-seven
+ (%), which causes the statement to have only the specified
+ percent chance of being executed each time it is encountered
+ in the course of execution.
+
+ _\b4_\b._\b4 _\bS_\bt_\ba_\bt_\be_\bm_\be_\bn_\bt_\bs
+
+ Following the qualifiers (or, if none are used, the
+ identifier) must occur one of the 14 valid operations.
+ (Exception: see section .) These are described individually
+ in sections
+ through .
+
+ _\b4_\b._\b4_\b._\b1 _\bC_\ba_\bl_\bc_\bu_\bl_\ba_\bt_\be
+
+ The INTERCAL equivalent of the half-mesh (=) in FORTRAN,
+ BASIC, PL/I, and others, is represented by an angle (<)
+ followed by a worm (-). This combination is read 'gets'.
+ 32-bit variables may be assigned 16-bit values, which are
+ padded on the left with 16 zero bits. 16-bit variables may
+ be assigned 32-bit values only if the value is less than
+ 65535. Thus, to invert the least significant bit of the
+ first element of 16-bit 2-dimensional array number 1, one
+ could write:
+
+ ,1SUB#1#1 <- 'V\b-",1SUB#1#1"c\b/#1'~'#0c\b/#65535'
+
+ Similarly to SNOBOL and SPITBOL, INTERCAL uses the angle-
+ worm to define the dimensions of arrays. An example will
+ probably best describe the format. To define 32-bit array
+ number 7 as 3-dimensional, the first dimension being seven,
+ the second being the current value of 16-bit variable number
+ seven, and the third being the current value of the seventh
+ element of 16-bit array number seven (which is one-
+ dimensional) mingled with the last three bits of 32-bit
+ variable number seven, one would write (just before they
+
+
+
+
+
+
+
+
+ - 19 -
+
+
+
+ came to take him away):
+
+ ;7 <- #7 BY .7 BY ",7SUB#7"c\b/':7~#7'
+
+ This is, of course, different from the statement:
+
+ ;7 <- #7 BY .7 BY ,7SUB"#7c\b/':7~#7'"
+
+ INTERCAL also permits the redefining of array dimensioning,
+ which is done the same way as is the initial dimensioning.
+ All values of items in an array are lost upon
+ redimensioning, unless they have been STASHed (see section
+ ), in which case restoring them also restores the old
+ dimensions.
+
+ _\b4_\b._\b4_\b._\b2 _\bN_\bE_\bX_\bT
+
+ The NEXT statement is used both for subroutine calls and for
+ unconditional transfers. This statement takes the form:
+
+ DO (label) NEXT
+
+ (or, of course,
+
+ PLEASE DO (label) NEXT
+
+ etc.), where (label) represents any logical line label which
+ appears in the program. The effect of such a statement is to
+ transfer control to the statement specified, and to store in
+ a push down list (which is initially empty) the location
+ from which the transfer takes place. Items may be removed
+ from this list and may be discarded or used to return to the
+ statement immediately following the NEXT statement. These
+ operations are described in sections
+ and
+ respectively. The programmer is generally advised to
+ discard any stack entries which he does not intend to
+ utilize, since the stack has a maximum depth of 79 entries.
+ A program's attempting to initiate an 80th level of NEXTing
+ will result in the fatal error message, "PROGRAM HAS
+ DISAPPEARED INTO THE BLACK LAGOON."
+
+ _\b4_\b._\b4_\b._\b3 _\bF_\bO_\bR_\bG_\bE_\bT
+
+ The statement PLEASE FORGET exp, where exp represents any
+ expression (except colloquial and facial expressions),
+ causes the expression to be evaluated, and the specified
+ number of entries to be removed from the NEXTing stack and
+ discarded. An attempt to FORGET more levels of NEXTing than
+ are currently stacked will cause the stack to be emptied,
+ and no error condition is indicated. This is because the
+ condition is not considered to be an error. As described in
+ section , it is good programming practice to execute a DO
+ FORGET #1 after using a NEXT statement as an unconditional
+
+
+
+
+
+
+
+
+ - 20 -
+
+
+
+ transfer, so that the stack does not get cluttered up with
+ unused entries:
+
+ DO (123) NEXT
+ .
+ .
+ (123) DO FORGET #1
+
+
+ _\b4_\b._\b4_\b._\b4 _\bR_\bE_\bS_\bU_\bM_\bE
+
+ The statement PLEASE RESUME exp has the same effect as
+ FORGET, except that program control is returned to the
+ statement immediately following the NEXT statement which
+ stored in the stack the last entry to be removed. Note that
+ a rough equivalent of the FORTRAN computed GO TO and BASIC
+ ON exp GO TO is performed by a sequence of the form:
+
+ DO (1) NEXT
+ .
+ .
+ (1) DO (2) NEXT
+ PLEASE FORGET #1
+ .
+ .
+ (2) DO RESUME .1
+
+ Unlike the FORGET statement, an attempt to RESUME more
+ levels of NEXTing than has been stacked will cause program
+ termination. See also section .
+
+ _\b4_\b._\b4_\b._\b5 _\bS_\bT_\bA_\bS_\bH
+
+ Since subroutines are not explicitly implemented in
+ INTERCAL, the NEXT and RESUME statements must be used to
+ execute common routines. However, as these routines might
+ use the same variables as the main program, it is necessary
+ for them to save the values of any variables whose values
+ they alter, and later restore them. This process is
+ simplified by the STASH statement, which has the form DO
+ STASH list, where list represents a string of one or more
+ variable or array names, separated by intersections (+).
+ Thus
+
+ PLEASE STASH .123+:123+,123
+
+ stashes the values of two variables and one entire array.
+ The values are left intact, and copies thereof are saved for
+ later retrieval by (what else?) the RETRIEVE statement (see
+ section ). It is not possible to STASH single array items.
+
+ _\b4_\b._\b4_\b._\b6 _\bR_\bE_\bT_\bR_\bI_\bE_\bV_\bE
+
+ PLEASE RETRIEVE list restores the previously STASHed values
+
+
+
+
+
+
+
+
+ - 21 -
+
+
+
+ of the variables and arrays named in the list. If a value
+ has been stashed more than once, the most recently STASHed
+ values are RETRIEVEd, and a second RETRIEVE will restore the
+ second most recent values STASHed. Attempting to RETRIEVE a
+ value which has not been STASHed will result in the error
+ message, "THROW STICK BEFORE RETRIEVING."
+
+ _\b4_\b._\b4_\b._\b7 _\bI_\bG_\bN_\bO_\bR_\bE
+
+ The statement DO IGNORE list causes all subsequent
+ statements to have no effect upon variables and/or arrays
+ named in the list. Thus, for example, after the sequence
+
+ DO .1 <- #1
+ PLEASE IGNORE .1
+ DO .1 <- #0
+
+ 16-bit variable number 1 would have the value 1, not 0.
+ Inputting (see section ) into an IGNOREd variable also has
+ no effect. The condition is annulled via the REMEMBER
+ statement (see section ). Note that, when a variable is
+ being IGNOREd, its value, though immutable, is still
+ available for use in expressions and the like.
+
+ Though the INTERCAL-72 manual laid down that the value of an
+ IGNOREd variable cannot change, it was unclear about whether
+ or not a statement which appears to change an IGNOREd
+ variable is executed or not. This may appear to be a "If a
+ tree falls in the forest ..." type of question, but if the
+ statement in question has other side effects it is not.
+
+ Since another mechanism already exists for ABSTAINing from a
+ statement, C-INTERCAL's IGNORE only prevents the changing of
+ the specific variable in question, not the execution of the
+ entire statement. In the present version of the language
+ this only makes a difference for the WRITE IN (see ) and
+ RETRIEVE (see ) statements. Attempting to WRITE IN to an
+ IGNOREd variable will cause a number to be read from the
+ input, which will be discarded since it cannot be stored in
+ the variable. Using RETRIEVE on an IGNOREd variable will
+ pop the variable's stash stack without actually changing its
+ value.
+
+ _\b4_\b._\b4_\b._\b8 _\bR_\bE_\bM_\bE_\bM_\bB_\bE_\bR
+
+ PLEASE REMEMBER list terminates the effect of the IGNORE
+ statement for all variables and/or arrays named in the list.
+ It does not matter if a variable has been IGNOREd more than
+ once, nor is it an error if the variable has not been
+ IGNOREd at all.
+
+ _\b4_\b._\b4_\b._\b9 _\bA_\bB_\bS_\bT_\bA_\bI_\bN
+
+ INTERCAL contains no simple equivalent to an IF statement or
+
+
+
+
+
+
+
+
+ - 22 -
+
+
+
+ computed GO TO, making it difficult to combine similar
+ sections of code into a single routine which occasionally
+ skips around certain statements. The IGNORE statement (see
+ section ) is helpful in some cases, but a more viable method
+ is often required. In keeping with the goal of INTERCAL
+ having nothing in common with any other language, this is
+ made possible via the ABSTAIN statement.
+
+ This statement takes on one of two forms. It may not take on
+ both at any one time. DO ABSTAIN FROM (label) causes the
+ statement whose logical line label is (label) to be
+ abstained from. PLEASE ABSTAIN FROM gerund list causes all
+ statements of the specified type(s) to be abstained from, as
+ in
+
+ PLEASE ABSTAIN FROM STASHING
+ PLEASE ABSTAIN FROM IGNORING + FORGETTING
+ PLEASE ABSTAIN FROM NEXTING
+ or PLEASE ABSTAIN FROM CALCULATING
+
+ Statements may also be automatically abstained from at the
+ start of execution via the NOT or N'T parameter (see section
+ ).
+
+ If, in the course of execution, a statement is encountered
+ which is being abstained from, it is ignored and control
+ passes to the next statement in the program (unless it, too,
+ is being abstained from).
+
+ The statement DO ABSTAIN FROM ABSTAINING is perfectly valid,
+ as is DO ABSTAIN FROM REINSTATING (although this latter is
+ not usually recommended). However, the statement DO ABSTAIN
+ FROM GIVING UP is not accepted, even though DON'T GIVE UP
+ is.
+
+ _\b4_\b._\b4_\b._\b1_\b0 _\bR_\bE_\bI_\bN_\bS_\bT_\bA_\bT_\bE
+
+ The REINSTATE statement, like the ABSTAIN, takes as an
+ argument either a line label or a gerund list. No other form
+ of argument is permitted. For example, the following is an
+ invalid argument:
+
+ Given: x!=0, y!=0, Prove: x+y=0
+ Since x!=0, then x+1!=1, x+a!=a, x+y!=y.
+ But what is y? y is anything but 0.
+ Thus x+y != anything but 0.
+ Since x+y cannot equal anything but 0, x+y=0.
+ Q.E.D.
+
+ REINSTATEment nullifies the effects of an abstention. Either
+ form of REINSTATEment can be used to "free" a statement,
+ regardless of whether the statement was abstained from by
+ gerund list, line label, or NOT. Thus, PLEASE REINSTATE
+ REINSTATING is not necessarily an irrelevant statement,
+
+
+
+
+
+
+
+
+ - 23 -
+
+
+
+ since it might free a DON'T REINSTATE command or a REINSTATE
+ the line label of which was abstained from. However, DO
+ REINSTATE GIVING UP is invalid, and attempting to REINSTATE
+ a GIVE UP statement by line label will have no effect. Note
+ that this insures that DON'T GIVE UP will always be a "do-
+ nothing" statement.
+
+ _\b4_\b._\b4_\b._\b1_\b1 _\bG_\bI_\bV_\bE _\bU_\bP
+
+ PLEASE GIVE UP is used to exit from a program. It has the
+ effect of a PLEASE RESUME #80. DON'T GIVE UP, as noted in
+ section , is effectively a null statement.
+
+ _\b4_\b._\b4_\b._\b1_\b2 _\bI_\bn_\bp_\bu_\bt
+
+ Input is accomplished with the statement DO WRITE IN list,
+ where list represents a string of variables and/or elements
+ of arrays, separated by intersections. Numbers are
+ represented on cards, each number on a separate card, by
+ spelling out each digit (in English) and separating the
+ digits with one or more spaces. A zero (0) may be spelled as
+ either ZERO or OH. Thus the range of (32-bit) input values
+ permissible extends from ZERO (or OH) through FOUR TWO NINE
+ FOUR NINE SIX SEVEN TWO NINE FIVE. (For the convenience of
+ aviators, C-INTERCAL accepts the spelling NINER for NINE. In
+ the service of internationalization, C-INTERCAL also accepts
+ input digits in Sanskrit, Basque, Tagalog, Classical
+ Nahuatl, Georgian, Kwakiutl, and Volapuk.)
+
+ Attempting to write in a value greater than or equal to SIX
+ FIVE FIVE THREE SIX for a 16-bit variable will result in the
+ error message, "DON'T BYTE OFF MORE THAN YOU CAN CHEW."
+
+ (See also section
+ for a description of C-INTERCAL's character I/O.)
+
+ _\b4_\b._\b4_\b._\b1_\b3 _\bO_\bu_\bt_\bp_\bu_\bt
+
+ Values may be output to the printer, one value per line, via
+ the statement DO READ OUT list, where the list contains
+ variables, array elements, and/or constants. Output is in
+ the form of "extended" Roman numerals (also called
+ "butchered" Roman numerals), with an overline indicating the
+ value below is "times 1000", and lower-case letters
+ indicating "times 1000000". Zero is indicated by an overline
+ with no character underneath. Thus, the range of (32-bit)
+ output values possible is from
+ _
+
+ through
+ __ ____________
+ ivccxcivCMLXVIICCXCV.
+ Note: For values whose residues modulo 1000000 are less than
+ 4000, M is used to represent 1000; for values whose residues
+
+
+
+
+
+
+
+
+ - 24 -
+
+
+
+ are 4000 or greater,
+ _
+ I
+ is used. Thus #3999 would read out as MMMCMXCIX 3 while
+ #4000 would readout as
+ __
+ IV
+ Similar rules apply to the use of
+ _
+ M
+ and i for 1000000, and to that of m and
+ _
+ i
+ for 1000000000.
+
+ (See also section
+ for a description of C-INTERCAL's character I/O.)
+
+ _\b4_\b._\b4_\b._\b1_\b4 _\bC_\bO_\bM_\bE _\bF_\bR_\bO_\bM
+
+ In which we try to precisely define a statement that should
+ never have been born, but is nevertheless one of the more
+ useful statements in INTERCAL.
+
+ _\b4_\b._\b4_\b._\b1_\b4_\b._\b1 _\bB_\ba_\bc_\bk_\bg_\br_\bo_\bu_\bn_\bd
+
+ The earliest known description of the COME FROM statement in
+ the computing literature is in [R. L. Clark, "A linguistic
+ contribution to GOTO-less programming," Commun. ACM 27
+ (1984), pp. 349-350], part of the famous April Fools issue
+ of CACM. The subsequent rush by language designers to
+ include the statement in their languages was underwhelming,
+ one might even say nonexistent. It was therefore decided
+ that COME FROM would be an appropriate addition to C-
+ INTERCAL.
+
+ _\b4_\b._\b4_\b._\b1_\b4_\b._\b2 _\bD_\be_\bs_\bc_\br_\bi_\bp_\bt_\bi_\bo_\bn
+
+ There are two useful ways to visualize the action of the
+ COME FROM statement. The simpler is to see that it acts like
+ a GOTO when the program is traced backwards in time. More
+ precisely, the statements
+
+ (1) DO <any statement>
+ .
+ .
+ .
+ (2) DO COME FROM (1)
+
+ ____________________
+
+ 3. The original INTERCAL-72 manual claimed that #3999 should
+ render as MMMIM, but the C-INTERCAL developers have been
+ unable to find an algorithm that does this and is
+ consistent with the rest of the rules.
+
+
+
+
+
+
+
+ - 25 -
+
+
+
+ should be thought of as being equivalent to
+
+ (1) DO <any statement>
+ (2) DO GOTO (3)
+ .
+ .
+ .
+ (3) DO NOTHING
+
+ if INTERCAL actually had a GOTO statement at all, which of
+ course it doesn't.
+
+ What this boils down to is that the statement DO COME FROM
+ (label), anywhere in the program, places a kind of invisible
+ trap door immediately after statement (label). Execution or
+ abstention of that statement is immediately followed by an
+ unconditional jump to the COME FROM, unless the (label)ed
+ statement is an executed NEXT, in which case the jump occurs
+ if the program attempts to RESUME back to that NEXT
+ statement. It is an error for more than one COME FROM to
+ refer to the same (label).
+
+ Modification of the target statement by ABSTAIN or by the %
+ qualifier affects only that statement, not the subsequent
+ jump. Such modifications to the COME FROM itself, however,
+ do affect the jump. Encountering the COME FROM statement
+ itself, rather than its target, has no effect.
+
+ _\b4_\b._\b5 _\bC_\bo_\bm_\bm_\be_\bn_\bt_\bs
+
+ Unrecognizable statements, as noted in section , are flagged
+ with a splat (*) during compilation, and are not considered
+ fatal errors unless they are encountered during execution,
+ at which time the statement (as input at compilation time)
+ is printed and execution is terminated. This allows for an
+ interesting (and, by necessity, unique) means of including
+ comments in an INTERCAL listing. For example, the statement:
+
+ * PLEASE NOTE THAT THIS LINE HAS NO EFFECT
+
+ will be ignored during execution due to the inclusion of the
+ NOT qualifier. User-supplied error messages are also easy
+ to implement:
+
+ * DO SOMETHING ABOUT OVERFLOW IN ;3
+
+ as are certain simple conditional errors:
+
+ * (123) DON'T YOU REALIZE THIS STATEMENT SHOULD ONLY BE ENCOUNTERED
+ ONCE?
+ PLEASE REINSTATE (123)
+
+ This pair of statements will cause an error exit the second
+ time they are encountered. Caution!! The appearance of a
+
+
+
+
+
+
+
+
+ - 26 -
+
+
+
+ statement identifier in an intended comment will be taken as
+ the beginning of a new statement. Thus, the first comment
+ example above could not have been:
+
+ * PLEASE NOTE THAT THIS LINE DOES NOTHING
+
+ The third example, however, is valid, despite the appearance
+ of two cases of D-space-O, since INTERCAL does not ignore
+ extraneous spaces in statement identifiers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 27 -
+
+
+
+ _\b5_\b. _\bO_\bU_\bT_\bS_\bI_\bD_\bE _\bC_\bO_\bM_\bM_\bU_\bN_\bI_\bC_\bA_\bT_\bI_\bO_\bN
+
+
+ She puzzled over this for some time, but at last a bright
+ thought struck her. "Why, it's a Looking-glass book, of
+ course! And, if I hold it up to a glass, the words will all
+ go the right way again."
+
+
+ In which we try to remedy the fact that, due to I/O
+ limitations, INTERCAL can not even in principle perform the
+ same tasks as other languages. It is hoped that this
+ addition will permit INTERCAL users to waste vast quantities
+ of computer time well into the 21st century.
+
+ _\b5_\b._\b1 _\bM_\bo_\bt_\bi_\bv_\ba_\bt_\bi_\bo_\bn
+
+ One of the goals of INTERCAL was to provide a language
+ which, though different from all other languages, is
+ nevertheless theoretically capable of all the same tasks.
+ INTERCAL-72 failed to accomplish this because its I/O
+ functions could not handle arbitrary streams of bits, or
+ even arbitrary sequences of characters. A language which
+ can't even send its input directly to its output can hardly
+ be considered as capable as other languages.
+
+ _\b5_\b._\b2 _\bT_\bu_\br_\bi_\bn_\bg _\bT_\be_\bx_\bt _\bM_\bo_\bd_\be_\bl
+
+ To remedy this problem, character I/O is now provided in a
+ form based on the "Turing Text" model, originally proposed
+ by Jon Blow. The C-INTERCAL programmer can access this
+ capability by placing a one-dimensional array in the list of
+ items given to a WRITE IN or READ OUT statement. On
+ execution of the statement, the elements of the array will,
+ from first to last, be either loaded from the input or sent
+ to the output, as appropriate, in the manner described
+ below. There is currently no support for I/O involving
+ higher-dimensional arrays, but some form of graphics might
+ be a possible 2-D interpretation.
+
+ The heart of the Turing Text model is the idea of a
+ continuous loop of tape containing, in order, all the
+ characters in the machine's character set. When a character
+ is received by the input routine, the tape is advanced the
+ appropriate number of spaces to bring that character under
+ the tape head, and the number of spaces the tape was moved
+ is the number that is actually seen by the INTERCAL program.
+ Another way to say this is that the number placed in an
+ INTERCAL array is the difference between the character just
+ received and the previous character, modulo the number of
+ characters in the machine character set.
+
+ Output works in just the opposite fashion, except that the
+ characters being output come from the other side of the
+
+
+
+
+
+
+
+
+ - 28 -
+
+
+
+ tape. From this position the characters on the tape appear
+ to be in reverse order, and are individually backwards as
+ well. (We would show you what it looks like, but we don't
+ have a font with backwards letters available. Use your
+ imagination.) The effect is that a number is taken out of an
+ INTERCAL array, subtracted from the last character output --
+ i.e., the result of the last subtraction -- and then sent on
+ down the output channel. The only catch is that the
+ character as seen by the INTERCAL program is the mirror-
+ image of the character as seen by the machine and the user.
+ The bits of the character are therefore taken in reverse
+ order as it is sent to the output. Note that this bit
+ reversal affects only the character seen by the outside
+ world; it does not affect the character stored internally by
+ the program, from which the next output number will be
+ subtracted. All subtractions are done modulo the number of
+ characters in the character set.
+
+ Two different tapes are used for input and output to allow
+ for future expansion of the language to include multiple
+ input and output channels. Both tapes start at character 0
+ when a program begins execution. On input, when an end-of-
+ file marker is reached the number placed in the array is one
+ greater than the highest-numbered character on the tape.
+
+ _\b5_\b._\b3 _\bE_\bx_\ba_\bm_\bp_\bl_\be _\bP_\br_\bo_\bg_\br_\ba_\bm
+
+ If all this seems terribly complicated, it should be made
+ perfectly clear by the following example program, which
+ simply maps its input to its output (like a simplified UNIX
+ "cat"). It assumes that characters are 8 bits long, but
+ that's fine since the current version of C-INTERCAL does
+ too. It uses the standard library routines for addition and
+ subtraction.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 29 -
+
+
+
+ DO ,1 <- #1
+ DO .4 <- #0
+ DO .5 <- #0
+ DO COME FROM (30)
+ DO WRITE IN ,1
+ DO .1 <- ,1SUB#1
+ DO (10) NEXT
+ PLEASE GIVE UP
+ (20) PLEASE RESUME '?.1$#256'~'#256$#256'
+ (10) DO (20) NEXT
+ DO FORGET #1
+ DO .2 <- .4
+ DO (1000) NEXT
+ DO .4 <- .3~#255
+ DO .3 <- !3~#15'$!3~#240'
+ DO .3 <- !3~#15'$!3~#240'
+ DO .2 <- !3~#15'$!3~#240'
+ DO .1 <- .5
+ DO (1010) NEXT
+ DO .5 <- .2
+ DO ,1SUB#1 <- .3
+ (30) PLEASE READ OUT ,1
+
+ For each number received in the input array, the program
+ first tests the #256 bit to see if the end of file has been
+ reached. If not, the previous input character is subtracted
+ off to obtain the current input character. Then the order of
+ the bits is reversed to find out what character should be
+ sent to the output, and the result is subtracted from the
+ last character sent. Finally, the difference is placed in an
+ array and given to a READ OUT statement. See? We told you
+ it was simple!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 30 -
+
+
+
+ _\b6_\b. _\bT_\br_\bi_\bI_\bN_\bT_\bE_\bR_\bC_\bA_\bL
+
+
+ "-- oh dear, how puzzling it all is! I'll try if I know all
+ the things I used to know. Let me see: four times five is
+ twelve, and four times six is thirteen, and four times seven
+ is -- oh dear! I shall never get to twenty at that rate!"
+
+
+ In which it is revealed that bitwise operations are too
+ ordinary for hard-core INTERCAL programmers, and extensions
+ to other bases are discussed. These are not, strictly
+ speaking, extensions to INTERCAL itself, but rather new
+ dialects sharing most of the features of the parent
+ language.
+
+ _\b6_\b._\b1 _\bM_\bo_\bt_\bi_\bv_\ba_\bt_\bi_\bo_\bn
+
+ INTERCAL is really a pretty sissy language. It tries hard to
+ be different, but when you get right down to its roots, what
+ do you find? You find bits, that's what. Plain old ones and
+ zeroes, in groups of 16 and 32, just like every other
+ language you've ever heard of. And what operations can you
+ perform on these bits? The INTERCAL operators may arrange
+ and permute them in weird and wonderful ways, but at the bit
+ level the operators are the same AND, OR and XOR you've seen
+ countless times before.
+
+ Once the prospective INTERCAL programmer masters the unusual
+ syntax, she finds herself working with the familiar Boolean
+ operators on perfectly ordinary unsigned integer words. Even
+ the constants she uses are familiar. After all, who would
+ not immediately recognize #65535 and #32768? It may take a
+ just a moment more to figure out #65280, and #21845 and
+ #43690 could be puzzles until she notices that they sum to
+ #65535, but basically she's still on her home turf. The
+ 16-bit limit on constants actually works in the programmer's
+ favor by insuring that very long anonymous constants cannot
+ appear in INTERCAL programs. And this is in a language that
+ is supposed to be different from any other!
+
+ _\b6_\b._\b2 _\bA_\bb_\ba_\bn_\bd_\bo_\bn _\bA_\bl_\bl _\bH_\bo_\bp_\be_\b._\b._\b.
+
+ Standard INTERCAL is based on variables consisting of
+ ordinary bits and familiar Boolean operations on those bits.
+ In pursuit of uniqueness, it seems appropriate to provide a
+ new dialect, otherwise identical to INTERCAL, which instead
+ uses variables consisting of trits, i.e. ternary digits, and
+ operators based on tritwise logical operations. This is
+ intended to be a separate dialect, rather than an extension
+ to INTERCAL itself, for a number of reasons. Doing it this
+ way avoids word-length conflicts, does not spoil the
+ elegance of the Spartan INTERCAL operator set, and dodges
+ the objections of those who might feel it too great an
+
+
+
+
+
+
+
+
+ - 31 -
+
+
+
+ alteration to the original language. Primarily, though,
+ giving INTERCAL programmers the ability to switch numeric
+ base at will amounts to excessive functionality. So much
+ better that a programmer choose a base at the outset and
+ then be forced to stick with it for the remainder of the
+ program.
+
+ _\b6_\b._\b3 _\bC_\bo_\bm_\bp_\bi_\bl_\be_\br _\bO_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn
+
+ The same compiler, ick, supports both INTERCAL and
+ TriINTERCAL. This has the advantage that future bug fixes
+ and additions to the language not related to arithmetic
+ immediately apply to both versions. The compiler recognizes
+ INTERCAL source files by the extension '.i', and TriINTERCAL
+ source files by the extension '.3i'. It's as simple as that.
+ There is no way to mix INTERCAL and TriINTERCAL source in
+ the same program, and it is not always possible to determine
+ which dialect a program is written in just by looking at the
+ source code.
+
+ _\b6_\b._\b4 _\bD_\ba_\bt_\ba _\bT_\by_\bp_\be_\bs
+
+ The two TriINTERCAL data types are 10-trit unsigned integers
+ and 20-trit unsigned integers. All INTERCAL syntax for
+ distinguishing data types is ported to these new types in
+ the obvious way. Small words may contain numbers from #0 to
+ #59048; large words may contain numbers from #0$#0 to
+ #59048$#59048. Errors are signaled for constants greater
+ than #59048 and for attempts to WRITE IN numbers too large
+ for a given variable or array element to hold.
+
+ Note that though TriINTERCAL considers all numbers to be
+ unsigned, nothing prevents the programmer from implementing
+ arithmetic operations that treat their operands as signed.
+ Three's complement is one obvious choice, but balanced
+ ternary notation is also a possibility. This latter is a
+ very pretty and symmetrical system in which all 2 trits are
+ treated as if they had the value -1.
+
+ _\b6_\b._\b5 _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ The TriINTERCAL operators are designed to inherit the
+ relevant properties of the standard INTERCAL operators, so
+ that both can be considered as merely different aspects of
+ the same Platonic ideal. (Not that the word "ideal" is ever
+ particularly relevant when used in connection with
+ INTERCAL.)
+
+ _\b6_\b._\b5_\b._\b1 _\bB_\bi_\bn_\ba_\br_\by _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs _\bI
+
+ The binary operators carry over from the original language
+ with only minor changes. The mingle operator ($) creates a
+ 20-trit word by alternating trits from its two 10-trit
+ operands. The select operator (~) is a little more
+
+
+
+
+
+
+
+
+ - 32 -
+
+
+
+ complicated, since the ternary tritmask may contain 0, 1,
+ and 2 trits. If we observe that the select operation on
+ binary operands amounts to a bitwise AND and some
+ rearrangement of bits, it seems appropriate to base the
+ select for ternary operands on a tritwise AND in the
+ analogous fashion. We therefore postpone the definition of
+ select until we know what a tritwise AND looks like.
+
+ _\b6_\b._\b5_\b._\b2 _\bU_\bn_\ba_\br_\by _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ The unary operators in INTERCAL are all derived from the
+ familiar Boolean operations on single bits. To extend these
+ operations to trits, we first ask ourselves what the
+ important properties of these operations are that we wish to
+ be preserved, then design the tritwise operators so that
+ they behave in a similar fashion.
+
+ _\b6_\b._\b5_\b._\b2_\b._\b1 _\bU_\bn_\ba_\br_\by _\bL_\bo_\bg_\bi_\bc_\ba_\bl _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ Let's start with AND and OR. To begin with, these can be
+ considered "choice" or "preference" operators, as they
+ always return one of their operands. AND can be described as
+ wanting to return 0, but returning 1 if it is given no other
+ choice, i.e., if both operands are 1. Similarly, OR wants to
+ return 1 but returns 0 if that is its only choice. From this
+ it is immediately apparent that each operator has an
+ identity element that "always loses", and a dominator
+ element that "always wins".
+
+ AND and OR are commutative and associative, and each
+ distributes over the other. They are also symmetric with
+ each other, in the sense that AND looks like OR and OR looks
+ like AND when the roles of 0 and 1 are interchanged (De
+ Morgan's Laws). This symmetry property seems to be a key
+ element to the idea that these are logical, rather than
+ arithmetic, operators. In a three-valued logic we would
+ similarly expect a three-way symmetry among the three values
+ 0, 1 and 2 and the three operators AND, OR and (of course)
+ BUT.
+
+ The following tritwise operations have all the desired
+ properties: OR returns the greater of its two operands. That
+ is, it returns 2 if it can get it, else it tries to return
+ 1, and it returns 0 only if both operands are 0. AND wants
+ to return 0, will return 2 if it can't get 0, and returns 1
+ only if forced. BUT wants 1, will take 0, and tries to avoid
+ 2. The equivalents to De Morgan's Laws apply to rotations of
+ the three elements, e.g., 0 -> 1, 1 -> 2, 2 -> 0. Each
+ operator distributes over exactly one other operator, so the
+ property "X distributes over Y" is not transitive. The
+ question of which way this distributivity ring goes around
+ is left as an exercise for the student.
+
+ In TriINTERCAL programs the whirlpool (@) denotes the unary
+
+
+
+
+
+
+
+
+ - 33 -
+
+
+
+ tritwise BUT operation. You can think of the whirlpool as
+ drawing values preferentially towards the central value 1.
+ Alternatively, you can think of it as drawing your soul and
+ your sanity inexorably down ...
+
+ On the other hand, maybe it's best you _\bn_\bo_\bt think of it that
+ way.
+
+ A few comments about how these operators can be used. OR
+ acts like a tritwise maximum operation. AND can be used with
+ tritmasks. 0's in a mask wipe out the corresponding elements
+ in the other operand, while 1's let the corresponding
+ elements pass through unchanged. 2's in a mask consolidate
+ the values of nonzero elements, as both 1's and 2's in the
+ other operand yield 2's in the output. BUT can be used to
+ create "partial tritmasks". 0's in a mask let BUT eliminate
+ 2's from the other operand while leaving other values
+ unchanged. Of course, the symmetry property guarantees that
+ the operators don't really behave differently from each
+ other in any fundamental way; the apparent differences come
+ from the intuitive view that a 0 trit is "not set" while a 1
+ or 2 trit is "set".
+
+ _\b6_\b._\b5_\b._\b2_\b._\b2 _\bB_\bi_\bn_\ba_\br_\by _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs _\bI_\bI
+
+ At this point we can define select, since we now know what
+ the tritwise AND looks like. Select takes the binary
+ tritwise AND of its two operands. It shifts all the trits of
+ the result corresponding to 2's in the right operand over to
+ the right (low) end of the result, then follows them with
+ all the output trits corresponding to 1's in the right
+ operand. Trits corresponding to 0's in the right operand,
+ which are all 0 anyway, occupy the remaining space at the
+ left end of the output word. Both 10-trit and 20-trit
+ operands are accepted, and are padded with zeroes on the
+ left if necessary. The output type is determined the same
+ way as in standard C-INTERCAL.
+
+ _\b6_\b._\b5_\b._\b2_\b._\b3 _\bU_\bn_\ba_\br_\by _\bA_\br_\bi_\bt_\bh_\bm_\be_\bt_\bi_\bc _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ Now that we've got all that settled, what about XOR? This is
+ easily the most-useful of the three unary INTERCAL
+ operators, because it combines in one package the operations
+ ADD WITHOUT CARRY, SUBTRACT WITHOUT BORROW, BITWISE NOT-
+ EQUAL, and BITWISE NOT. In TriINTERCAL we can't have all of
+ these in the same operator, since addition and subtraction
+ are no longer the same thing. The solution is to split the
+ XOR concept into two operators. The ADD WITHOUT CARRY
+ operation is represented by the new sharkfin (^), while the
+ old what (?) represents SUBTRACT WITHOUT BORROW. The reason
+ for this choice is so that what (?) will also represent the
+ TRITWISE NOT-EQUAL operation.
+
+ Note that what (?), unlike the other four unary operators,
+
+
+
+
+
+
+
+
+ - 34 -
+
+
+
+ is not symmetrical. It should be thought of as rotating its
+ operand one trit to the right (with wraparound) and then
+ subtracting off the trits of the original number. These
+ subtractions are done without borrowing, i.e., trit-by-trit
+ modulo 3.
+
+ _\b6_\b._\b5_\b._\b3 _\bE_\bx_\ba_\bm_\bp_\bl_\be_\bs
+
+ The TriINTERCAL operators really aren't all that bad once
+ you get used to them. Let's look at a few examples to show
+ how they can be used in practice. In all of these examples
+ the input value is contained in the 10-trit variable .3.
+
+ In INTERCAL, single-bit values often have to be converted
+ from {0,1} to {1,2} for use in RESUME statements. Examples
+ of how to do this appear in the original manual. In
+ TriINTERCAL the expression "^.3$#1"~#1 sends 0 -> 1 and 1 ->
+ 2. If the 1-trit input value can take on any of its three
+ possible states, however, we will also have to deal with the
+ 2 case. The expression "V.3$#1"~#1 sends {0,1} -> 1 and 2 ->
+ 2. To test if a trit is set, we can use
+ "V'"&.3$#2"~#1'$#1"~#1, sending 0 -> 1 and {1,2} -> 2. To
+ reverse the test we use "?'"&.3$#2"~#1'$#1"~#1, sending 0 ->
+ 2 and {1,2} -> 1. Note that we have not been taking full
+ advantage of the new select operator. These last two
+ expressions can be simplified into "V!3~#2'$#1"~#1 and
+ "?!3~#2'$#1"~#1, which perform exactly the same mappings.
+ Finally, if we need a 3-way test, we can use
+ "@'"^.3$#7"~#4'$#2"~#10, which obviously sends 0 -> 1, 1 ->
+ 2, and 2 -> 3.
+
+ For an unrelated example, the expression
+ "^.3$.3"~"#0$#29524" converts all of the 1-trits of .3 into
+ 2's and all of the 2-trits into 1's. In balanced ternary,
+ where 2-trits represent -1 values, this is the negation
+ operation.
+
+ _\b6_\b._\b6 _\bB_\be_\by_\bo_\bn_\bd _\bT_\be_\br_\bn_\ba_\br_\by_\b._\b._\b.
+
+ While we're at it, we might as well extend this multiple
+ bases business a little farther. The ick compiler actually
+ recognizes filename suffixes of the form '.Ni', where N is
+ any number from 2 to 7. 2 of course gives standard INTERCAL,
+ while 3 gives TriINTERCAL. We cut off before 8 because
+ octal notation is the smallest base used to facilitate
+ human-to-machine communication, and this seems quite
+ contrary to the basic principles behind INTERCAL. The small
+ data types hold 16 bits, 10 trits, 8 quarts, 6 quints, 6
+ sexts, or 5 septs, and the large types are always twice this
+ size.
+
+ As for operators, ? is always SUBTRACT WITHOUT BORROW, and ^
+ is always ADD WITHOUT CARRY. V is the OR operation and
+ always returns the max of its inputs. & is the AND
+
+
+
+
+
+
+
+
+ - 35 -
+
+
+
+ operation, which chooses 0 if possible but otherwise returns
+ the max of the inputs. @ is BUT, which prefers 1, then 0,
+ then the max of the remaining possibilities. Rather than
+ add more special symbols forever, a numeric modifier may be
+ placed directly before the @ to indicate the operation that
+ prefers one of the digits not already represented. Thus in
+ files ending in '.5i', the permitted unary operators are ?,
+ ^, &, @, 2@, 3@, and V. Use of such barbarisms as 0@ to
+ represent & are not permitted, nor is the use of @ or ^ in
+ files with either of the extensions '.i' or '.2i'. Why not?
+ You just can't, that's why. Don't ask so many questions.
+
+ As a closing example, we note that in balanced quinary
+ notation, where 3 means -2 and 4 means -1, the negation
+ operation can be written as either
+
+ DO .1 <- "^'"^.3$.3"~"#0$#3906"'$'"^.3$.3"~"#0$#3906"'"~"#0$#3906"
+
+ or as
+
+ DO .1 <- "^.3$.3"~"#0$#3906"
+ DO .1 <- "^.1$.1"~"#0$#3906"
+
+ These work because multiplication by -1 is the same as
+ multiplication by 4, modulo 5.
+
+ Now go beat your head against the wall for a while.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 36 -
+
+
+
+ _\b7_\b. _\bS_\bU_\bB_\bR_\bO_\bU_\bT_\bI_\bN_\bE _\bL_\bI_\bB_\bR_\bA_\bR_\bY
+
+
+ "You don't know what you're talking about!" cried Humpty
+ Dumpty. "How many days are there in a year?"
+
+ "Three hundred and sixty-five," said Alice.
+
+ "And how many birthdays have you?"
+
+ "One."
+
+ "And if you take one from three hundred and sixty-five, what
+ remains?"
+
+ "Three hundred and sixty-four, of course."
+
+ Humpty Dumpty looked doubtful. "I'd rather see that done on
+ paper," he said.
+
+
+ INTERCAL provides several built-in subroutines to which
+ control can be transferred to perform various operations.
+ These operations include many useful functions which are not
+ easily representable in INTERCAL, such as addition,
+ subtraction, etc.
+
+ _\b7_\b._\b1 _\bU_\bs_\ba_\bg_\be
+
+ In general, the operands are .1, .2, etc., or :1, :2, etc.,
+ and the result(s) are stored in what would have been the
+ next operand(s). For instance, one routine adds .1 to .2 and
+ stores the sum in .3, with .4 being used to indicate
+ overflow. All variables not used for results are left
+ unchanged.
+
+ _\b7_\b._\b2 _\bA_\bv_\ba_\bi_\bl_\ba_\bb_\bl_\be _\bF_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs
+
+ At the time of this writing, only the most fundamental
+ operations are offered in the library, as a more complete
+ selection would require prohibitive time and core to
+ implement. These functions, along with their corresponding
+ entry points (entered via DO (entry) NEXT) are listed below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 37 -
+
+
+
+ (1000) .3 <- .1 plus .2, error exit on overflow
+ (1009) .3 <- .1 plus .2
+ .4 <- #1 if no overflow, else .4 <- #2
+ (1010) .3 <- .1 minus .2, no action on overflow
+ (1020) .1 <- .1 plus #1, no action on overflow
+ (1030) .3 <- .1 times .2, error exit on overflow
+ (1039) .3 <- .1 times .2
+ .4 <- #1 if no overflow, else .4 <- #2
+ (1040) .3 <- .1 divided by .2
+ .3 <- #0 if .2 is #0
+ (1050) .2 <- :1 divided by .1, error exit on overflow
+ .2 <- #0 if .1 is #0
+
+ (1500) :3 <- :1 plus :2, error exit on overflow
+ (1509) :3 <- :1 plus :2
+ :4 <- #1 if no overflow, else :4 <- #2
+ (1510) :3 <- :1 minus :2, no action on overflow
+ (1520) :1 <- .1 concatenated with .2
+ (1525) This subroutine is intended solely for internal
+ use within the subroutine library and is therefore
+ not described here. Its effect is to shift .3
+ logically 8 bits to the left.
+ (1530) :1 <- .1 times .2
+ (1540) :3 <- :1 times :2, error exit on overflow
+ (1549) :3 <- :1 times :2
+ :4 <- #1 if no overflow, else :4 <- #2
+ (1550) :3 <- :1 divided by :2
+ :3 <- #0 if :2 is #0
+
+ (1900) .1 <- uniform random no. from #0 to #65535
+ (1910) .2 <- normal random no. from #0 to .1, with
+ standard deviation .1 divided by #12
+
+
+ _\b7_\b._\b3 _\bA_\bu_\bt_\bo_\bm_\ba_\bg_\bi_\bc_\ba_\bl _\bI_\bn_\bc_\bl_\bu_\bs_\bi_\bo_\bn _\bO_\bf _\bT_\bh_\be _\bS_\bu_\bb_\br_\bo_\bu_\bt_\bi_\bn_\be _\bL_\bi_\bb_\br_\ba_\br_\by
+
+ The C-INTERCAL compiler will automatically include the
+ system library if a DO (1xxx) NEXT statement is used, and if
+ no (1xxx) labels are defined anywhere, where (1xxx) is a
+ label in the 1000-1999 range, inclusive. This was not an
+ INTERCAL-72 feature.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 38 -
+
+
+
+ _\b8_\b. _\bP_\bR_\bO_\bG_\bR_\bA_\bM_\bM_\bI_\bN_\bG _\bH_\bI_\bN_\bT_\bS
+
+
+ "If any one of them can explain it," said Alice, "I'll give
+ him sixpence. _\bI don't believe there's an atom of meaning in
+ it." The jury all wrote down, on their slates, "_\bS_\bh_\be doesn't
+ believe there's an atom of meaning in it," but none of them
+ attempted to explain the paper.
+
+ "If there's no meaning in it," said the King, "that saves a
+ world of trouble, you know, as we needn't try to find any.
+ And yet, I don't know," he went on, spreading out the verses
+ on one knee, and looking at them with one eye: "I seem to
+ see some meaning in them, after all...."
+
+
+ For the user looking to become more familiar with the
+ INTERCAL language, we present in this section an analysis of
+ a complex program, as well as some suggested projects for
+ the ambitious programmer.
+
+ Considering the effort involved in writing an INTERCAL
+ program, it was decided in putting together this manual to
+ use an already existing program for instructive analysis.
+ Since there was only one such program available, we have
+ proceeded to use it. It is known as the "INTERCAL System
+ Library."
+
+ _\b8_\b._\b1 _\bD_\be_\bs_\bc_\br_\bi_\bp_\bt_\bi_\bo_\bn
+
+ The program listing is in section . It is in the same format
+ as would be produced by the Princeton INTERCAL compiler in
+ FORMAT mode with WIDTH=62 (see section ). For a description
+ of the functions performed by the Library, see section .
+
+ _\b8_\b._\b2 _\bA_\bn_\ba_\bl_\by_\bs_\bi_\bs
+
+ We shall not attempt to discuss here the algorithms used,
+ but rather we shall point out some of the general techniques
+ applicable to a wide range of problems.
+
+ Statements 10, 14, 15, and 26 make up a virtual "computed GO
+ TO". When statement 10 is executed, control passes
+ eventually to statement 16 or 11, depending on whether .5
+ contains #1 or #2, respectively. The value of .5 is
+ determined in statement 9, which demonstrates another handy
+ technique. To turn an expression, exp, with value #0 or #1,
+ into #1 or #2 (for use in a "GO TO"), use "V\b-'exp'c\b/#1"~#3.
+ To reverse the condition (i.e., convert #0 to #2 and leave
+ #1 alone) use "V\b-'exp'c\b/#2"~#3.
+
+ Certain conditions are easily checked. For example, to test
+ for zero, select the value from itself and select the bottom
+ bit (see statement 54). To test for all bits being 1's,
+
+
+
+
+
+
+
+
+ - 39 -
+
+
+
+ select the value from itself and select the top bit. The
+ test for greater than, performed in statements 219 and 220
+ on 32-bit values, employs binary logical operations, which
+ are performed as follows:
+
+ 'V\b-.1c\b/.2'~'#0c\b/#65535'
+
+ for 16-bit values or, for 32-bit values:
+
+ "'V\b-":1~'#65535c\b/30'"c\b/":2~'#65535c\b/#0'"'~'#0
+ c\b/#65535'"c\b/"'V\b-":1~'#0c\b/#65535'"c\b/":2~'#0
+ c\b/#65535'"'~'#0c\b/#65535'"
+
+ (The proofs are left as an exercise to the reader.)
+
+ Testing for greater-than with 16-bit values is somewhat
+ simpler and is done with the pair of statements:
+
+ DO .C <- 'V\b-.Ac\b/.B'~'#0c\b/#65535'
+ DO .C <- '&"'.A~.C'~'"V\b-'V\b-.C~.C'c\b/#32768"
+ ~"#0c\b/#65535"'"c\b/".C~.C"'~#1
+
+ This sets .C (a dummy variable) to #1 if .A > .B, and #0
+ otherwise. The expression may be expanded as described above
+ to instead set .C to #1 or #2.
+
+ Note also in statement 220 the occurrence of
+ ~"#65535c\b/#65535". Although these operations select the
+ entire value, they are not extraneous, as they ensure that
+ the forthcoming V\b-s will be operating on 32-bit values.
+
+ In several virtual computed GO TOs the DO FORGET #1
+ (statement 15 in the earlier example) has been omitted,
+ since the next transfer of control would be a DO RESUME #1.
+ By making this a DO RESUME #2 instead, the FORGET may be
+ forgotten.
+
+ In statement 64, note that .2 is STASHed twice by a single
+ statement. This is perfectly legal.
+
+ Lastly, note in statements 243 and 214 respectively,
+ expressions for shifting 16- and 32-bit variables logically
+ one place to the left. Statement 231 demonstrates right-
+ shifting for 32-bit variables.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 40 -
+
+
+
+ _\b8_\b._\b3 _\bP_\br_\bo_\bg_\br_\ba_\bm _\bL_\bi_\bs_\bt_\bi_\bn_\bg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 41 -
+
+
+
+ 1 (1000) PLEASE IGNORE .4
+ 2 PLEASE ABSTAIN FROM (1005)
+ 3 (1009) DO STASH .1 + .2 + .5 + .6
+ 4 DO .4 <- #1
+ 5 DO (1004) NEXT
+ 6 (1004) PLEASE FORGET #1
+ 7 DO .3 <- 'V\b-.1c\b/.2'~'#0c\b/#65535'
+ 8 DO .6 <- '&.1c\b/.2'~'#0c\b/#65535'
+ 9 PLEASE DO .5 <- "V\b-!6~#32768'c\b/#1"~#3
+ 10 DO (1002) NEXT
+ 11 DO .4 <- #2
+ 12 (1005) DO (1006) NEXT
+ * 13 (1999) DOUBLE OR SINGLE PRECISION OVERFLOW
+ 14 (1002) DO (1001) NEXT
+ 15 (1006) PLEASE FORGET #1
+ 16 DO .5 <- 'V\b-"!6~.6'~#1"c\b/#1'~#3
+ 17 DO (1003) NEXT
+ 18 DO .1 <- .3
+ 19 DO .2 <- !6c\b/#0'~'#32767c\b/#1'
+ 20 DO (1004) NEXT
+ 21 (1003) DO (1001) NEXT
+ 22 DO REINSTATE (1005)
+ 23 (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6
+ 24 DO REMEMBER .4
+ 25 PLEASE RESUME #2
+ 26 (1001) DO RESUME .5
+ 27 (1010) DO STASH .1 + .2 + .4
+ 28 DO .4 <- .1
+ 29 DO .1 <- 'V\b-.2c\b/#65535'~'#0c\b/#65535'
+ 30 DO (1020) NEXT
+ 31 PLEASE DO .2 <- .4
+ 32 PLEASE DO (1009) NEXT
+ 33 DO RETRIEVE .1 + .2 + .4
+ 34 PLEASE RESUME #1
+ 35 (1020) DO STASH .2 + .3
+ 36 DO .2 <- #1
+ 37 PLEASE DO (1021) NEXT
+ 38 (1021) DO FORGET #1
+ 39 DO .3 <- "V\b-!1~.2'c\b/#1"~#3
+ 40 PLEASE DO .1 <- 'V\b-.1c\b/.2'~'#0c\b/#65535'
+ 41 DO (1022) NEXT
+ 42 DO .2 <- !2c\b/#0'~'#32767c\b/#1'
+ 43 DO (1021) NEXT
+ 44 (1023) PLEASE RESUME .3
+ 45 (1022) DO (1023) NEXT
+ 46 PLEASE RETRIEVE .2 + .3
+ 47 PLEASE RESUME #2
+ 48 (1030) DO ABSTAIN FROM (1033)
+ 49 PLEASE ABSTAIN FROM (1032)
+ 50 (1039) DO STASH :1 + .5
+ 51 DO (1530) NEXT
+ 52 DO .3 <- :1~#65535
+ 53 PLEASE DO .5 <- :1~'#65280c\b/#65280'
+ 54 DO .5 <- 'V\b-"!5~.5'~#1"c\b/#1'~#3
+
+
+
+
+
+
+
+
+ - 42 -
+
+
+
+ 55 DO (1031) NEXT
+ 56 (1032) DO (1033) NEXT
+ 57 DO (1999) NEXT
+ 58 (1031) DO (1001) NEXT
+ 59 (1033) DO .4 <- .5
+ 60 DO REINSTATE (1032)
+ 61 PLEASE REINSTATE (1033)
+ 62 DO RETRIEVE :1 + .5
+ 63 PLEASE RESUME #2
+ 64 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3
+ 65 DO .2 <- #0
+ 66 DO (1520) NEXT
+ 67 DO STASH :1
+ 68 PLEASE RETRIEVE .2
+ 69 DO .1 <- .2
+ 70 DO .2 <- #0
+ 71 PLEASE DO (1520) NEXT
+ 72 DO :2 <- :1
+ 73 DO RETRIEVE .1 + .2 + :1
+ 74 DO (1550) NEXT
+ 75 PLEASE DO .3 <- :3
+ 76 DO RETRIEVE :1 + :2 + :3
+ 77 DO RESUME #1
+ 78 (1050) PLEASE STASH :2 + :3 + .5
+ 79 DO :2 <- .1
+ 80 PLEASE DO (1550) NEXT
+ 81 DO .5 <- :3~'#65280c\b/#65280'
+ 82 DO .5 <- 'V\b-"!5~.5'~#1"c\b/#1'~#3
+ 83 DO (1051) NEXT
+ 84 DO (1999) NEXT
+ 85 (1051) DO (1001) NEXT
+ 86 DO .2 <- :3
+ 87 PLEASE RETRIEVE :2 + :3 + .5
+ 88 DO RESUME #2
+ 89 (1500) PLEASE ABSTAIN FROM (1502)
+ 90 PLEASE ABSTAIN FROM (1506)
+ 91 (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6
+ 92 DO .1 <- :1~#65535
+ 93 PLEASE DO .2 <- :2~#65535
+ 94 DO (1009) NEXT
+ 95 DO .5 <- .3
+ 96 PLEASE DO .6 <- .4
+ 97 DO .1 <- :1~'#65280c\b/#65280'
+ 98 DO .2 <- :2~'#65280c\b/#65280'
+ 99 DO (1009) NEXT
+ 100 DO .1 <- .3
+ 101 PLEASE DO (1503) NEXT
+ 102 DO .6 <- .4
+ 103 DO .2 <- #1
+ 104 DO (1009) NEXT
+ 105 DO .1 <- .3
+ 106 DO (1501) NEXT
+ 107 (1504) PLEASE RESUME .6
+ 108 (1503) DO (1504) NEXT
+
+
+
+
+
+
+
+
+ - 43 -
+
+
+
+ 109 (1501) DO .2 <- .5
+ 110 DO .5 <- 'V\b-"'&.6c\b/.4'~#1"c\b/#2'~#3
+ 111 DO (1505) NEXT
+ 112 (1506) DO (1502) NEXT
+ 113 PLEASE DO (1999) NEXT
+ 114 (1505) DO (1001) NEXT
+ 115 (1502) DO :4 <- .5
+ 116 DO (1520) NEXT
+ 117 DO :3 <- :1
+ 118 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6
+ 119 DO REINSTATE (1502)
+ 120 DO REINSTATE (1506)
+ 121 PLEASE RESUME #3
+ 122 (1510) DO STASH :1 + :2 + :4
+ 123 DO :1 <- "'V\b-":2~'#65535c\b/#0'"c\b/#65535'
+ ~'#0c\b/#65535'"c\b/"'V\b-":2~'#0c\b/#65535'
+ "c\b/#65535'~'#0c\b/#65535'"
+ 124 DO :2 <- #1
+ 125 DO (1509) NEXT
+ 126 PLEASE RETRIEVE :1
+ 127 DO :2 <- :3
+ 128 PLEASE DO (1509) NEXT
+ 129 DO RETRIEVE :2 + :4
+ 130 PLEASE RESUME #1
+ 131 (1520) PLEASE STASH .3 + .4
+ 132 DO .3 <- .1~#43690
+ 133 DO (1525) NEXT
+ 134 PLEASE DO .4 <- 'V.3c\b/".2~#43690"'~'#0c\b/#65535'
+ 135 DO .3 <- .1~#21845
+ 136 PLEASE DO (1525) NEXT
+ 137 DO :1 <- .4c\b/"'V.3c\b/".2~#21845"'~'#0c\b/#65535'"
+ 138 PLEASE RETRIEVE .3 + .4
+ 139 DO RESUME #1
+ 140 (1525) DO .3 <- '"'"'"!3c\b/#0'~'#32767c\b/#1'"c\b/#0'
+ ~'#32767c\b/#1'"c\b/#0'~'#16383c\b/#3'"c\b/#0'
+ ~'#4095c\b/#15'
+ 141 PLEASE RESUME #1
+ 142 (1530) DO STASH :2 + :3 + .3 + .5
+ 143 DO :1 <- #0
+ 144 DO :2 <- .2
+ 145 DO .3 <- #1
+ 146 DO (1535) NEXT
+ 147 (1535) PLEASE FORGET #1
+ 148 DO .5 <- "V\b-!1~.3'c\b/#1"~#3
+ 149 DO (1531) NEXT
+ 150 DO (1500) NEXT
+ 151 DO :1 <- :3
+ 152 PLEASE DO (1533) NEXT
+ 153 (1531) PLEASE DO (1001) NEXT
+ 154 (1533) DO FORGET #1
+ 155 DO .3 <- !3c\b/#0'~'#32767c\b/#1'
+ 156 DO :2 <- ":2~'#0c\b/#65535'"c\b/"'":2~'#32767
+ c\b/#0'"c\b/#0'~'#32767c\b/#1'"
+ 157 PLEASE DO .5 <- "V\b-!3~.3'c\b/#1"~#3
+
+
+
+
+
+
+
+
+ - 44 -
+
+
+
+ 158 DO (1532) NEXT
+ 159 DO (1535) NEXT
+ 160 (1532) DO (1001) NEXT
+ 161 PLEASE RETRIEVE :2 + :3 + .3 + .5
+ 162 DO RESUME #2
+ 163 (1540) PLEASE ABSTAIN FROM (1541)
+ 164 DO ABSTAIN FROM (1542)
+ 165 (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5
+ 166 DO .1 <- :1~#65535
+ 167 PLEASE DO .2 <- :2~'#65280c\b/#65280'
+ 168 DO .5 <- :1~'#65280c\b/#65280'
+ 169 DO (1530) NEXT
+ 170 DO :3 <- :1
+ 171 DO .2 <- :2~#65535
+ 172 PLEASE DO (1530) NEXT
+ 173 DO :5 <- :1
+ 174 DO .1 <- .5
+ 175 DO (1530) NEXT
+ 176 DO :4 <- :1
+ 177 PLEASE DO :1 <- ":3~'#65280c\b/#65280'"
+ c\b/":4~'#65280c\b/#65280'"
+ 178 DO .5 <- ':1~:1'~#1
+ 179 DO .2 <- :2~'#65280c\b/#65280'
+ 180 DO (1530) NEXT
+ 181 PLEASE DO .5 <- '"':1~:1'~#1"c\b/.5'~#3
+ 182 DO .1 <- :3~#65535
+ 183 DO .2 <- #0
+ 184 DO (1520) NEXT
+ 185 PLEASE DO :2 <- :1
+ 186 PLEASE DO .1 <- :4~#65535
+ 187 DO (1520) NEXT
+ 188 DO (1509) NEXT
+ 189 DO .5 <- !5c\b/":4~#3"'~#15
+ 190 DO :1 <- :3
+ 191 DO :2 <- :5
+ 192 DO (1509) NEXT
+ 193 PLEASE DO .5 <- !5c\b/":4~#3"'~#172
+ 194 DO .5 <- 'V\b-"!5~.5'~#1"c\b/#1'~#3
+ 195 PLEASE RETRIEVE :4
+ 196 (1541) DO :4 <- .5
+ 197 DO (1543) NEXT
+ 198 (1542) DO (1544) NEXT
+ 199 PLEASE DO (1999) NEXT
+ 200 (1543) DO (1001) NEXT
+ 201 (1544) DO REINSTATE (1541)
+ 202 PLEASE REINSTATE (1542)
+ 203 PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5
+ 204 DO RESUME #2
+ 205 (1550) DO STASH :1 + :4 + :5 + .5
+ 206 DO :3 <- #0
+ 207 DO .5 <- 'V\b-"':2~:2'~#1"c\b/#1'~#3
+ 208 PLEASE DO (1551) NEXT
+ 209 DO :4 <- #1
+ 210 PLEASE DO (1553) NEXT
+
+
+
+
+
+
+
+
+ - 45 -
+
+
+
+ 211 (1553) DO FORGET #1
+ 212 DO .5 <- 'V\b-":2~'#32768c\b/#0'"c\b/#2'~#3
+ 213 DO (1552) NEXT
+ 214 DO :2 <- ":2~'#0c\b/#65535'"c\b/"'":2~'#32767
+ c\b/#0'"c\b/#0'~'#32767c\b/#1'"
+ 215 PLEASE DO :4 <- ":4~'#0c\b/#65535'"c\b/"'":4
+ ~'#32767c\b/#0'"c\b/#0'~'#32767c\b/#1'"
+ 216 DO (1553) NEXT
+ 217 (1552) DO (1001) NEXT
+ 218 (1556) PLEASE FORGET #1
+ 219 DO :5 <- "'V\b-":1~'#65535c\b/#0'"c\b/":2
+ ~'#65535c\b/#0'"'~'#0c\b/#65535'"c\b/"'
+ V\b-":1~'#0c\b/#65535'"c\b/":2~'#0c\b/
+ #65535'"'~'#0c\b/#65535'"
+ 220 DO .5 <- 'V\b-"'&"':2~:5'~'"'V\b-"'V\b-":5~:5
+ "~"#65535c\b/#65535"'~'#65535c\b/#0'"c\b/
+ #32768'~'#0c\b/#65535'"c\b/"'V\b-":5~:5"
+ ~"#65535c\b/#65535"'~'#0c\b/#65535'"'"c\b/"'
+ :5~:5'~#1"'~#1"c\b/#2'~#3
+ 221 DO (1554) NEXT
+ 222 DO :5 <- :3
+ 223 DO (1510) NEXT
+ 224 PLEASE DO :1 <- :3
+ 225 DO :3 <- "'V":4~'#65535c\b/#0'"c\b/":5~'#65535
+ c\b/#0'"'~'#0c\b/#65535'"c\b/"'V":4~'#0
+ c\b/#65535'"c\b/":5~'#0c\b/#65535'"'~'#0
+ c\b/#65535'"
+ 226 DO (1555) NEXT
+ 227 (1554) PLEASE DO (1001) NEXT
+ 228 (1555) DO FORGET #1
+ 229 DO .5 <- "V\b-':4~#1'c\b/#2"~#3
+ 230 DO (1551) NEXT
+ 231 DO :2 <- ":2~'#0c\b/#65534'"c\b/":2~'#65535c\b/#0'"
+ 232 DO :4 <- ":4~'#0c\b/#65534'"c\b/":4~'#65535c\b/#0'"
+ 233 PLEASE DO (1556) NEXT
+ 234 (1551) DO (1001) NEXT
+ 235 PLEASE RETRIEVE :1 + :4 + :5 + .5
+ 236 PLEASE RESUME #2
+ 237 (1900) DO STASH .2 + .3 + .5
+ 238 DO .1 <- #0
+ 239 DO .2 <- #1
+ 240 PLEASE DO (1901) NEXT
+ 241 (1901) DO FORGET #1
+ 242 DO %50 .1 <- 'V.1c\b/.2'~'#0c\b/#65535'
+ 243 DO .2 <- !2c\b/#0'~'#32767c\b/#1'
+ 244 PLEASE DO .5 <- "V\b-!2~.2'c\b/#1"~#3
+ 245 DO (1902) NEXT
+ 246 DO (1901) NEXT
+ 247 (1902) DO (1001) NEXT
+ 248 DO RETRIEVE .2 + .3 + .5
+ 249 PLEASE RESUME #2
+ 250 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3
+ 251 DO .3 <- #65524
+ 252 DO :1 <- #6
+
+
+
+
+
+
+
+
+ - 46 -
+
+
+
+ 253 DO (1911) NEXT
+ * 254 PLEASE NOTE THAT YOU CAN'T GET THERE FROM HERE
+ 255 (1912) DO (1001) NEXT
+ 256 (1911) DO FORGET #1
+ 257 PLEASE DO (1900) NEXT
+ 258 DO :2 <- .1
+ 259 DO (1500) NEXT
+ 260 PLEASE DO :1 <- :3
+ 261 DO .1 <- .3
+ 262 DO (1020) NEXT
+ 263 PLEASE DO .3 <- .1
+ 264 DO .5 <- 'V\b-"!3~.3'~#1"c\b/#2'~#3
+ 265 DO (1912) NEXT
+ 266 DO .1 <- #12
+ 267 PLEASE DO (1050) NEXT
+ 268 DO RETRIEVE .1
+ 269 DO (1530) NEXT
+ 270 DO :2 <- #32768
+ 271 DO (1500) NEXT
+ 272 PLEASE DO .2 <- :3~'#65280c\b/#65280'
+ 273 PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3
+ 274 DO RESUME #1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 47 -
+
+
+
+ _\b8_\b._\b4 _\bP_\br_\bo_\bg_\br_\ba_\bm_\bm_\bi_\bn_\bg _\bS_\bu_\bg_\bg_\be_\bs_\bt_\bi_\bo_\bn_\bs
+
+ For the novice INTERCAL programmer, we provide here a list
+ of suggested INTERCAL programming projects:
+
+ Write an integer exponentiation subroutine. :1 <- .1 raised
+ to the .2 power.
+
+ Write a double-precision sorting subroutine. Given 32-bit
+ array ;1 of size :1, sort the contents into numerically
+ increasing order, leaving the results in ;1.
+
+ Generate a table of prime numbers.
+
+ Put together a floating-point library, using 32-bit
+ variables to represent floating-point numbers (let the upper
+ half be the mantissa and the lower half be the
+ characteristic). The library should be capable of
+ performing floating-point addition, subtraction,
+ multiplication, and division, as well as the natural
+ logarithm function.
+
+ Program a Fast Fourier Transform (FFT). This project would
+ probably entail the writing of the floating-point library as
+ well as sine and cosine functions.
+
+ Calculate, to :1 places, the value of pi.
+
+ (Working programs for each of these projects are included in
+ the C-INTERCAL distribution's pit directory of sample code.)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 48 -
+
+
+
+ _\b9_\b. _\bE_\bR_\bR_\bO_\bR _\bM_\bE_\bS_\bS_\bA_\bG_\bE_\bS
+
+
+ Alice felt dreadfully puzzled. The Hatter's remark seemed to
+ her to have no sort of meaning in it, and yet it was
+ certainly English. "I don't quite understand you," she said,
+ as politely as she could.
+
+
+ Due to INTERCAL's implementation of comment lines (see
+ section 4.5), most error messages are produced during
+ execution instead of during compilation. All errors except
+ those not causing immediate termination of program execution
+ are treated as fatal.
+
+ _\b9_\b._\b1 _\bF_\bo_\br_\bm_\ba_\bt
+
+ All error messages appear in the following form:
+
+ ICLnnnI (error message)
+ ON THE WAY TO STATEMENT nnnn
+ CORRECT SOURCE AND RESUBMIT
+
+ The message varies depending upon the error involved. For
+ undecodable statements the message is the statement itself.
+ The second line tells which statement would have been
+ executed next had the error not occurred. Note that if the
+ error is due to 80 attempted levels of NEXTing, the
+ statement which would have been executed next need not be
+ anywhere near the statement causing the error.
+
+ _\b9_\b._\b2 _\bM_\be_\bs_\bs_\ba_\bg_\be_\bs
+
+ Brief descriptions of the different error types are listed
+ below according to message number.
+
+ 000 An undecodable statement has been encountered in the
+ course of execution. Note that keypunching errors can
+ be slightly disastrous, since if 'FORGET' were
+ misspelled F-O-R-G-E-R, the results would probably not
+ be those desired. Extreme misspellings may have even
+ more surprising consequences. For example, misspelling
+ 'FORGET' R-E-S-U-M-E could have drastic results.
+
+ 017 An expression contains a syntax error.
+
+ 079 Improper use has been made of statement identifiers.
+
+ 099 Improper use has been made of statement identifiers.
+
+ 123 Program has attempted 80 levels of NEXTing.
+
+ 129 Program has attempted to transfer to a non-existent
+ line label.
+
+
+
+
+
+
+
+
+ - 49 -
+
+
+
+ 139 An ABSTAIN or REINSTATE statement references a non-
+ existent line label.
+
+ 182 A line label has been multiply defined.
+
+ 197 An invalid line label has been encountered.
+
+ 200 An expression involves an unidentified variable.
+
+ 240 An attempt has been made to give an array a dimension
+ of zero.
+
+ 241 Invalid dimensioning information was supplied in
+ defining or using an array.
+
+ 275 A 32-bit value has been assigned to a 16-bit variable.
+
+ 436 A retrieval has been attempted for an unSTASHed value.
+
+ 533 A WRITE IN statement or interleave (c\b/) operation has
+ produced a value requiring over 32 bits to represent.
+
+ 562 Insufficient data.
+
+ 579 Input data is invalid.
+
+ 621 The expression of a RESUME statement evaluated to #0.
+
+ 632 Program execution was terminated via a RESUME statement
+ instead of GIVE UP.
+
+ 633 Execution has passed beyond the last statement of the
+ program.
+
+ 774 A compiler error has occurred (see section ).
+
+ 778 An unexplainable compiler error has occurred.
+
+ The following error codes are new in C-INTERCAL:
+
+ 111 You tried to use a C-INTERCAL extension with the
+ `traditional' flag on.
+
+ 127 Can't find syslib.i file when it's needed for magical
+ inclusion.
+
+ 222 Out of stash space, or attempt to stash an undeclared
+ array.
+
+ 333 Too many variables.
+
+ 444 A COME FROM statement references a non-existent line
+ label.
+
+
+
+
+
+
+
+
+
+ - 50 -
+
+
+
+ 555 More than one COME FROM references the same label.
+
+ 666 Too many source lines.
+
+ 777 No such source file.
+
+ 888 Can't open C output file.
+
+ 999 Can't open C skeleton file.
+
+ 998 Source file name with invalid extension (use .i or
+ .[2-7]i).
+
+ 997 Illegal possession of a controlled unary operator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 51 -
+
+
+
+ _\b1_\b0_\b. _\bT_\bh_\be _\bC_\b-_\bI_\bN_\bT_\bE_\bR_\bC_\bA_\bL _\bC_\bo_\bm_\bp_\bi_\bl_\be_\br
+
+
+ "And yet it was a very clever pudding to invent."
+
+ "What did you mean it to be made of?" Alice asked, hoping to
+ cheer him up, for the poor Knight seemed quite low-spirited
+ about it.
+
+ "It began with blotting-paper," the Knight answered with a
+ groan.
+
+ "That wouldn't be very nice, I'm afraid --"
+
+ "Not very nice _\ba_\bl_\bo_\bn_\be," he interrupted, quite eagerly, "but
+ you've no idea what a difference it makes, mixing it with
+ other things -- such as gunpowder and sealing-wax."
+
+
+ This section describes the use of ick, the C-INTERCAL
+ compiler. Information specific to the other known INTERCAL
+ compilers appears in the following sections. These sections
+ are less useful, since the other compilers are no longer
+ available, but they are retained to provide a sense of
+ history, and because any information regarding INTERCAL is
+ really too scarce to discard.
+
+ _\b1_\b0_\b._\b1 _\bC_\bh_\ba_\br_\ba_\bc_\bt_\be_\br _\bS_\be_\bt
+
+ The C-INTERCAL compiler uses ASCII rather than EBCDIC. We
+ follow the Atari implementation (see section ) by (a)
+ replacing the change sign (c\b/) with big money ($) as the
+ mingle operator, and (b) replacing the bookworm (V\b-) symbol
+ with what (?) as the XOR operator.
+
+ Version 0.18 and later versions accept the Latin-1 (ISO
+ 8859-1) character set, which is a superset of ASCII. As a
+ result, 0xA2 (c\b/), 0xA3 (quid), and 0xA4 (zlotnik) are
+ accepted as mingle operators.
+
+ Version 0.20 and later versions also accept UTF-8 as an
+ alternative to Latin-1. The above three currency operators
+ will be accepted in either Latin-1 or UTF-8 format. UTF-8
+ format is required if you wish to use any of EURO-CURRENCY
+ SIGN, COLON SIGN (that's Costa Rican dinero, not the
+ Intercal two-spot), CRUZEIRO SIGN, FRENCH FRANC SIGN, LIRA
+ SIGN, MILL SIGN, NAIRA SIGN, PESETA SIGN, RUPEE SIGN, WON
+ SIGN, NEW SHEQEL SIGN, DONG SIGN, EURO SIGN, BENGALI RUPEE
+ MARK, BENGALI RUPEE SIGN, or THAI CURRENCY SYMBOL BAHT.
+ (Isn't internationalization wonderful?) Furthermore, you
+ can use the Intercal character FOR ALL to represent the what
+ operator.
+
+
+
+
+
+
+
+
+
+
+ - 52 -
+
+
+
+ _\b1_\b0_\b._\b2 _\bU_\bs_\ba_\bg_\be _\ba_\bn_\bd _\bC_\bo_\bm_\bp_\bi_\bl_\ba_\bt_\bi_\bo_\bn _\bO_\bp_\bt_\bi_\bo_\bn_\bs
+
+ To compile an INTERCAL program `foo.i' to executable code,
+ just do
+
+ ick foo.i
+
+ There's a -c option that leaves the generated C code in
+ place for inspection (suppressing compilation to machine
+ code), a -d option that enables verbose parse reporting from
+ the yacc/bison parser, a -t option that requires strict
+ INTERCAL-72 compliance (rejecting COME FROM and the
+ extensions for bases other than two), a -b option that
+ disables the INTERCAL-72 random-bug feature (error 774), and
+ an -O option that enables the (hah!) optimizer. Invoking ick
+ -? prints a usage message.
+
+ Another compilation switch affects C-INTERCAL's runtime
+ behavior. The `-C' option forces output in "clockface" mode,
+ for superstitious users who believe writing "IV" upside-down
+ offends IVPITER and would rather see IIII.
+
+ _\b1_\b0_\b._\b3 _\bR_\bu_\bn_\bt_\bi_\bm_\be _\bO_\bp_\bt_\bi_\bo_\bn_\bs
+
+ Every C-INTERCAL runtime also accepts certain options at
+ runtime. These include [+/-]help, [+/-]traditional, and
+ [+/-]wimpmode. The help option (with either + or -)
+ triggers a 'usage' message. The +traditional option is
+ presently a no-op.
+
+ Steve explains: "The wimpmode option is the most
+ interesting. I found myself always running my test programs
+ with filters on both ends to work around the 'nifty'
+ INTERCAL number representations. This was so painful that I
+ decided it would be _\bl_\be_\bs_\bs painful (and a lot less code) if I
+ added a 'wimp' option. With the +wimpmode option, the user
+ is subjected to a humiliating message about what a wimp he
+ or she is to use this mode, but after that is allowed to use
+ conventional numerical notation. While such a mode doubtless
+ violates to some extent the INTERCAL philosophy, the fact
+ that an 'unbutcher' command has been posted clearly
+ indicates the need for it. Anyway ... if you don't like it,
+ don't use it ... the default is -wimpmode (i.e. _\bn_\bo_\bt wimp
+ mode)."
+
+ _\b1_\b0_\b._\b4 _\bP_\bL_\bE_\bA_\bS_\bE _\bP_\bo_\bl_\bi_\bt_\be_\bs_\bs_\be _\bC_\bh_\be_\bc_\bk_\bi_\bn_\bg
+
+ A feature of INTERCAL-72 not documented in the original
+ manual was that it required a certain level of politesse
+ from the programmer. If fewer than 1/5th of the program
+ statements included the PLEASE qualifier, the program would
+ be rejected as insufficiently polite. If more than 1/3rd of
+ them included PLEASE, the program would be rejected as
+ excessively polite.
+
+
+
+
+
+
+
+
+ - 53 -
+
+
+
+ This check has been implemented in C-INTERCAL. To assist
+ programmers in coping with it, the intercal.el mode included
+ with the distribution randomly expands "do " in entered
+ source to "PLEASE DO" 1/4th of the time.
+
+ _\b1_\b0_\b._\b5 _\bL_\bo_\bc_\ba_\bl_\bi_\bz_\ba_\bt_\bi_\bo_\bn_\b: _\bA_\bn_\bc_\bi_\be_\bn_\bt _\bR_\bo_\bm_\ba_\bn
+
+ Version 0.18 and later versions of C-Intercal have been
+ localized for Ancient Roman as well as English-speaking
+ locales. This means that Latin-language keywords are
+ accepted as equivalents for the English-based ones
+ traditionally used. See src/lexer.l for details, as we do
+ not propose to break Priscian's head (publicly expose our
+ ignorance of Latin) here.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 54 -
+
+
+
+ _\b1_\b1_\b. _\bT_\bh_\be _\bA_\bt_\ba_\br_\bi _\bI_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn
+
+
+ "Perhaps it doesn't understand English," thought Alice. "I
+ daresay it's a French mouse, come over with William the
+ Conqueror." (For, with all her knowledge of history, Alice
+ had no very clear notion how long ago anything had
+ happened.)
+
+
+ The Atari implementation of INTERCAL differs from the
+ original Princeton version primarily in the use of ASCII
+ rather than EBCDIC. Since there is no "change" sign (c\b/) in
+ ASCII, we have substituted the "big money" ($) as the mingle
+ operator. We feel that this correctly represents the
+ increasing cost of software in relation to hardware.
+ (Consider that in 1970 one could get RUNOFF for free, to run
+ on a $20K machine, whereas today a not quite as powerful
+ formatter costs $99 and runs on a $75 machine.) We also feel
+ that there should be no defensible contention that INTERCAL
+ has any sense. Also, since overpunches are difficult to
+ read on the average VDT, the exclusive-or operator may be
+ written ?. This correctly expresses the average person's
+ reaction on first encountering exclusive-or, especially on a
+ PDP-11. Note that in both of these cases, the over-punched
+ symbol may also be used if one is masochistic, or concerned
+ with portability to the Princeton compiler. The correct
+ over-punch for "change" is "c<backspace>/" and the correct
+ over-punch for V\b- is "V<backspace>-". These codes will be
+ properly printed if you have a proper printer, and the
+ corresponding EBCDIC code will be produced by the /IBM
+ option on the LIST command.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 55 -
+
+
+
+ _\b1_\b2_\b. _\bT_\bh_\be _\bP_\br_\bi_\bn_\bc_\be_\bt_\bo_\bn _\bC_\bo_\bm_\bp_\bi_\bl_\be_\br
+
+
+ "My name is Alice, so please your Majesty," said Alice very
+ politely; but she added, to herself, "Why, they're only a
+ pack of cards, after all. I needn't be afraid of them!"
+
+
+ The Princeton compiler, written in SPITBOL (a variant of
+ SNOBOL), performs the compilation in two stages. First the
+ INTERCAL source is converted into SPITBOL source, then the
+ latter is compiled and executed.
+
+ It should be noted that the Princeton compiler fails to
+ properly interpret certain multiply-subscripted expressions,
+ such as:
+
+ ",1SUB",2SUB#1"#2"
+
+
+ This is not a "bug". Being documented, it is merely a
+ "restriction". Such cases may be resolved by alternating
+ sparks and ears in various levels of expression nesting:
+
+ ",1SUB',2SUB#1'#2"
+
+ which is advisable in any case, since INTERCAL expressions
+ are unreadable enough as is.
+
+ Since there is currently no catalogued procedure for
+ invoking the compiler, the user must include the in-line
+ procedure shown in Figure 3 in his job before the
+ compilation step. Copies of this in-line procedure may be
+ obtained at any keypunch if the proper keys are struck.
+
+ The compiler is then executed in the usual manner:
+
+
+ // EXEC INTERCAL[,PARM='parameters']
+ //COMPILE.SYSIN DD *
+ {INTERCAL source deck}
+ /*
+ //EXECUTE.SYSWRITE DD *
+ {input data}
+ /*
+
+
+ The various parameters are described following the in-line
+ procedure. At most one parameter from each set may apply to
+ a given compilation; if more than one are specified, the
+ results are undefined, and may vary depending upon the
+ particular set of options. The default parameters are
+ underlined.
+
+
+
+
+
+
+
+
+
+ - 56 -
+
+
+
+ //INTERCAL PROC
+ //COMPILE EXEC PGM=INTERCAL
+ //STEPLIB DD DSN=U.INTERCAL.LIBRARY,DISP=SHR
+ // DD DSN=SYS1.FORTLIB,DISP=SHR
+ //SYSPRINT DD SYSOUT=A,DCB=(BLKSIZE=992,LRECL=137,RECFM=VBA)
+ //SYSPUNCH DD DUMMY
+ //SCRATCH DD DSN=&COMPSET,UNIT=SYSDA,SPACE=(CYL,(3,1)),DISP=(,PASS)
+ //EXECUTE EXEC PGM=EXECUTE,COND=(4,LT)
+ //SOURCES DD DSN=U.INTERCAL.SOURCES,DISP=SHR 4
+ //STEPLIB DD DSN=U.INTERCAL.LIBRARY,DISP=SHR
+ // DD DSN=SYS5.SPITLIB,DISP=SHR
+ // DD DSN=SYS1.FORTLIB,DISP=SHR
+ //SYSIN DD DSN=&COMPSET,DISP=(OLD,DELETE)
+ //SYSOBJ DD SYSOUT=B,DCB=(BLKSIZE=80,LRECL=80,RECFM=F)
+ //SYSPRINT DD SYSOUT=A,DCB=(BLKSIZE=992,LRECL=137,RECFM=VBA)
+ //SYSPUNCH DD DUMMY
+ // PEND
+
+ Figure 3. Inline procedure for using INTERCAL.
+
+ _\bO_\bP_\bT
+ NOOPT
+ In the default mode, the compiler will print a list of
+ all options in effect, including the defaults for
+ unspecified parameter groups and the effective option
+ for those sets where one was specified. If NOOPT is
+ requested, it causes the default mode to be assumed.
+
+ _\bO_\bP_\bT_\bS_\bU_\bB
+ NOOPTSUB
+ NOSUB
+ Unless 'NOOPTSUB' is requested, the System Library is
+ optimized, resulting in much more rapid processing of
+ function calls. Specifying NOOPTSUB causes the non-
+ optimized INTERCAL code shown in section
+ to be used, whereas NOSUB requests that the System
+ Library be omitted altogether.
+
+ IAMBIC
+ _\bP_\bR_\bO_\bS_\bE
+ The IAMBIC parameter permits the programmer to use
+ poetic license and thus write in verse. If the reader
+ does not believe it possible to write verse in
+
+ ____________________
+
+ 4. Pending acquisition of SPITBOL release 3.0, the SOURCES
+ DD card must be replaced by the five cards:
+
+ //NOOPTPFX DD DSN=U.INTERCAL.SOURCES(NOOPTPFX),DISP=SHR
+ //NOOPTSUB DD DSN=U.INTERCAL.SOURCES(NOOPTSUB),DISP=SHR
+ //OPTPFX DD DSN=U.INTERCAL.SOURCES(OPTPFX),DISP=SHR
+ //OPTSUB DD DSN=U.INTERCAL.SOURCES(OPTSUB),DISP=SHR
+ //PRELIM DD DSN=U.INTERCAL.SOURCES(PRELIM),DISP=SHR
+
+
+
+
+
+
+
+
+ - 57 -
+
+
+
+ INTERCAL, he should send the authors a stamped, self-
+ addressed envelope, along with any INTERCAL program,
+ and they will provide one which is verse.
+
+ _\bF_\bO_\bR_\bM_\bA_\bT
+ NOFORMAT
+ In FORMAT mode, each statement printed is put on a
+ separate line (or lines). In NOFORMAT mode, the free-
+ format source is printed exactly as input. In this
+ latter case, statement numbers are provided only for
+ the first statement on a card, and they may be only
+ approximate. Also, unrecognizable statements are not
+ flagged.
+
+ SEQ
+ _\bN_\bO_\bS_\bE_\bQ
+ If the source deck has sequence numbers in columns 73
+ through 80, specifying 'SEQ' will cause them to be
+ ignored.
+
+ SOURCE
+ _\bN_\bO_\bS_\bO_\bU_\bR_\bC_\bE
+ If NOSOURCE is selected, all source listing is
+ suppressed.
+
+ LIST
+ _\bN_\bO_\bL_\bI_\bS_\bT
+ If LIST is specified, the compiler will provide a list
+ of statement numbers catalogued according to type of
+ statement. The compiler uses this table to perform
+ abstentions by gerund.
+
+ WIDTH=nn
+ This sets the width (in number of characters) of the
+ output line for FORMAT mode output. The default is 1\b13\b32\b2.\b.
+
+ CODE
+ _\bN_\bO_\bC_\bO_\bD_\bE
+ Include 'CODE' in the parameter list to obtain a
+ listing of the SPITBOL code produced for each INTERCAL
+ statement.
+
+ LINES=nn
+ This determines the number of lines per page, during
+ both compilation and execution. The default is 6\b60\b0.\b.
+
+ DECK
+ _\bN_\bO_\bD_\bE_\bC_\bK
+ Selecting 'DECK' will cause the compiler to punch out a
+ SPITBOL object deck which may then be run without
+ reinvoking the INTERCAL (or SPITBOL) compiler.
+
+ _\bK_\bI_\bD_\bD_\bI_\bN_\bG
+
+
+
+
+
+
+
+
+
+ - 58 -
+
+
+
+ NOKIDDING
+ Select NOKIDDING to eliminate the snide remarks which
+ ordinarily accompany INTERCAL error messages.
+
+ _\bG_\bO
+ NOGO
+ Specifying 'NOGO' will cause the program to be
+ compiled but not executed. EXECUTE/NOEXECUTE may be
+ substituted for GO/NOGO, but this will result in an
+ error, and GO will be assumed.
+
+ _\bB_\bU_\bG
+ NOBUG
+ Under the default, there is a fixed probability of a
+ fatal compiler bug being worked at random into the
+ program being compiled. Encountering this bug during
+ execution results in error message 774 (see section ).
+ This probability is reduced to zero under 'NOBUG'. This
+ does not affect the probability (presumably negligible)
+ of error message 778.
+
+ _\b1_\b2_\b._\b1 _\bO_\bt_\bh_\be_\br _\bI_\bN_\bT_\bE_\bR_\bC_\bA_\bL _\bC_\bo_\bm_\bp_\bi_\bl_\be_\br_\bs
+
+ There are no other INTERCAL compilers. 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ____________________
+
+ 5. This assertion in the INTERCAL-72 manual was blatantly
+ contradicted by some notes on an Atari implementation
+ included at the end of the manual. So, you expect
+ compiler manuals to be consistent?
+
+
+
+
+
+
+
+ - 59 -
+
+
+
+ T\bTO\bON\bNS\bSI\bIL\bL A\bA6\b6
+
+
+
+
+
+
+
+
+ "Of course they answer to their names?" the Gnat remarked
+ carelessly.
+
+ "I never knew them to do it."
+
+ "What's the use of their having names," the Gnat said, "if
+ they wo'n't answer to them?"
+ "No use to _\bt_\bh_\be_\bm," said Alice; "but it's useful to the people
+ that name them, I suppose. If not, why do things have names
+ at all?"
+
+ "I ca'n't say," the Gnat replied. "Further on, in the wood
+ down there, they've got no names -- however, go on with your
+ list...."
+
+
+ The Official INTERCAL Character Set
+
+ Tabulated on page 59 are all the characters used in
+ INTERCAL, excepting letters and digits, along with their
+ names and interpretations. Also included are several
+ characters not used in INTERCAL, which are presented for
+ completeness and to allow for future expansion.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ____________________
+
+ 6. Since all other reference manuals have Appendices, it was
+ decided that the INTERCAL manual should contain some
+ other type of removable organ.
+
+ 7. This footnote intentionally unreferenced.
+
+
+
+
+ |
+ |
+ |
+ | - 60 -
+ |
+ |
+ |
+ +\b.\bs\bi\b:\bt\bi\b,\bt\bi\b;\bh\bi\b#\bm\bi\b=\bh\b'\bs\bg\b`\bb\b!\bw\be\b?\bw\b_\bu\b"\br\bg\b"\b.\br\be\b|\bs\b%\bd\bp\b-\bw\bu\b<\ba\bu\b>\br\b(\bw\bp\b)\bw\bf\b[\bU\b]\bU\b{\be\b}\bb\b*\bs\bf\b&\ba\bu\bV\bV\bu\bV\b-\bb\bu\b$\bb\b_\bb\bc\b/\bc\bb\b~\bs\bb\b_\bf\b-\bo\bi\b+\bi\bs\b/\bs\b\\bb\b@\bw\b-\b'\bh\b^\bs\b#\b*\b[\bb\bb\ba\bn\bt\bs\bm\bi\b-\b'\bh\b0\bq\bb\b0\bz\bb-\bC\bN\bU\bp\bd\bw\bd\ba\bd\by\bd\be\bd\ba\bp\br\ba\bo\bq\bh\b_\bn\ba\br\ba\bq\bp\bo\be\bo\bs\bn\bs\bi\ba\br\ba\bo\bm\br\bp\bl\bm\bn\bn\bo\bn\bi\b_\bi\bh\bi\bq\bi\bl\bv\bn\bn\be\bl\ba\bh\bo\bh\b]\bl\bu\bn\bo\be\bw\bi\bn\ba\bx\bu\bi\bx\bl\bi-\bh\ba\bs\bo\be\bo\be\bi\be\bb\be\bs\be\bl\ba\bo\bc\bw\bu\ba\b_\ba\bb\bo\bb\bu\bi\bu\br\br\be\bg\be\bg\bx\be\bn\bl\bt\bt\bb\ba\bl\ba\bp\ba\b(\ba\bo\ba\bg\b_\bn\ba\bn\bi\bn\ba\be\bd\bt\bp\ba\bc\bi\bo\ba\bo\bn\bd\br\bx\ba\bc\bt\bl\bA\bi\bn\bA\bo\bn-\ba\bm\be\bt\bn\b-\bn\bl\bn\br\bn\bh\bn\bf\br\bu\bk\bi\bt\b_\br\bb\bu\bb\bi\bk\bb\bc\bm\bd\bl\bd\bh\bc\be\bl\bu\bu\br\bc\ba\bg\be\br\bo\br\bk\br\b_\ba\bn\ba\bg\ba\bt\br\bi\be\ba\bt\bk\br\bk\br\bt\bg\br\bw\bt\bs\br\be\bf\b3\bd\ba\b4\bt\ba-\br\be\bt\bs\bt\bt\bi\bt\bt\b-\bk\bp\bs\bv\b_\by\bi\bp\bi\bv\be\bl\be\be\bt\be\bo\br\br\ba\be\bt\bs\br\by\br\by\bw\by\bm\b_\br\bg\br\bg\br\bl\bc\br\br\bs\bl\bw\bk\bc\bh\be\be\bh\bo\br\br\bn\br-\ba\b(\bi\bp\bi\bi\bd\bi\bi\bm\be\bp\ba\bt\be\bt\ba\be\bn\bw\bw\bd\bw\bn\bn\bc\bl\bs\bo\bo\b_\by\be\by\bl\by\bw\bi\ba\bs\ba\bl\bp\bo\bh\bo\bw\bg\bg\bs\bw\bt\by\bi\by-\bc\bi\bf\bo\bf\bf\bf\bf\be\br\ba\bl\b_\be\b-\br\bl\b-\bt\bi\bi\ba\be\bs\be\be\bi\ba\bl\bb\bl\br\be\bn\be\bo\bn\bt\be\bt\ba\bo\br\b(\bl\bi\br\bc\bo\bu\bk-\bt\bf\by\bt\by\by\by\by\bs\br\be\b_\bx\be\be\bo\ba\bt\bt\bn\bs\bb\bt\bn\bn\bo\bo\bo\bm\bx\be\b_\bm\bm\bs\br\be\be\bc\be\bt\bo\bm\bo\be\bc\ba\ba\bo\br\br\bm\bm-\be\bh\bk\bn\b_\bl\ba\bn\bh\bg\bh\bh\bg\bl\ba\bv\bd\bg\bo\bg\bc\by\b_\bi\bi\be\bm\bs\bt\bs\bl\br\br\bn\bb\bp\bm\bn\bi\bi-\br\ba\b1\b3\b1\b3\bc\bt\b_\bu\br\bt\b-\be\bl\bl\bi\bc\ba\bi\bk\bi\b(\bl\b_\bn\bn\bl\bi\bn\bo\bb\be\bn\bn-\bn\b6\b2\b6\b2\bo\b_\bs\bs\bs\ba\bw\be\bi\bn\bk\bl\b8\bc\b)\bc\bo\bu\b_\bg\bg\be\b"\bo\bl\bs\ba\bs\bm\be\bg\bg-\by\b-\b-\b-\b-\bn\bt\b_\bi\bt\be\bq\bn\bo\bn\be\bi\ba\ba\br\bs\b_\bl\bl\bc\bt\bn\bi\bi\bm\bs\bi\br\bl\bl-\b)\bb\bb\bb\bb\bs\bo\b_\bv\bo\bv\bu\bg\br\be\bd\bl\bl\bi\b_\be\be\bt\bi\bs\bm\be\bn\be\be-\bi\bi\bi\bi\bt\b_\be\be\ba\bl\bm\bl\bu\bv\bm\bt\bp\bu-\bt\bt\bt\bt\ba\bs\be\bn\bl\be\bs\bl\ba\bs\bA\bO\bn\be\b_\b(\be\bl\bg\bs-\bn\bp\b_\bO\ba\bi\bs\ba\bb\bt\bN\bR\bi\b_\bA\bs\bi\by\br-\bv\bv\ba\ba\bt\ba\b_\bR\br\bf\bb\be\ba\bD\bv\bO\b_\bS\bt\ba-\ba\ba\br\br\br\bs\bi\be\bl\bt\be\bR\b_\bC\b1\be\bs\bb-\br\br\br\br\bk\b_\b(\b-\be\bl\be\br\b_\bI\b0\bm\bh\bb-\bi\bi\ba\ba\b-\b_\bA\bs\br\bm\bs\b_\bI\b0\bs\ba\be-\ba\ba\by\by\bs\b_\bS\bp\be\ba\b_\b)\b0\br\br-\bb\bb\bp\b_\bC\bo\bn\bl\b"\bk-\bl\bl\bo\b_\bI\bt\bt\bf-\be\be\bt\b_\bI\bs\bq\bi-\b_\b)\bu\bn-\ba\b)-\bl-\bi-\bf-\bi-\be-\br-\b)---------------------------------------------+
+ |Character Name Use (if any) |
+ |. spot identify 16-bit variable |
+ |: two-spot identify 32-bit variable |
+ |, tail identify 16-bit array |
+ |; hybrid identify 32-bit array |
+ |# mesh identify constant |
+ |= half-mesh |
+ |' spark grouper |
+ |` backspark |
+ |! wow equivalent to spark-spot |
+ |? what unary logical XOR |
+ |" rabbit-ears grouper |
+ |"\b. rabbit equivalent to ears-spot |
+ || spike |
+ |% double-oh-seven percentage qualifier |
+ |- worm used with angles |
+ |< angle used with worms |
+ |> right angle |
+ |( wax precedes line label |
+ |) wane follows line label |
+ |[ U turn |
+ |] U turn back |
+ |{ embrace |
+ |} bracelet |
+ |* splat flags invalid statements |
+ |& ampersand 10 unary logical AND |
+ |V V (or book) unary logical OR |
+ |V\b- bookworm (universal qualifier) unary logical XOR (INTERCAL-72) |
+ |$ big money binary mingle |
+ |c\b/ change binary mingle (INTERCAL-72) |
+ |~ sqiggle binary select |
+ |_ flat worm |
+ |- overline indicates "times 1000" |
+ |+ intersection separates list items |
+ |/ slat |
+ |\ backslat |
+ |@ whirlpool unary logical BUT (TriINTERCAL) |
+ |-\b' hookworm |
+ |^ shark (or simply sharkfin) unary logical XOR (TriINTERCAL) |
+ |#\b*\b[] blotch |
+ | bunghole |
+ | name grabber |
+ | andrew cross |
+ | norwegian minus |
+ | text grabber |
+ | swash |
+ | microscope |
+ | interworm |
+ |-\b' half turn |
+ |0xA3 quid binary mingle |
+ |0xA4 zlotnik binary mingle |
+ | |
+ +--------\bT-\ba-\bb-\bl-\be--\b2--\b(-\bt-\bo-\bp--\bv-\bi-\be-\bw-\b)-\b.--\bI-\bN-\bT-\bE-\bR-\bC-\bA-\bL--\bc-\bh-\ba-\br-\ba-\bc-\bt-\be-\br--\bs-\be-\bt-\b.---------------------------+
+
+
+
+
+
+
+
+
+ - 61 -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ____________________
+
+ 10.Got any better ideas?
+
+
+
+
--- /dev/null
+
+
+
+
+
+
+ T\bTH\bHE\bE I\bIN\bNT\bTE\bER\bRC\bCA\bAL\bL P\bPR\bRO\bOG\bGR\bRA\bAM\bMM\bMI\bIN\bNG\bG L\bLA\bAN\bNG\bGU\bUA\bAG\bGE\bE
+
+ _\bD_\bo_\bn_\ba_\bl_\bd _\bR_\b. _\bW_\bo_\bo_\bd_\bs
+ _\ba_\bn_\bd
+ _\bJ_\ba_\bm_\be_\bs _\bM_\b. _\bL_\by_\bo_\bn
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 2 -
+
+
+
+ _\b1_\b. _\bI_\bN_\bT_\bR_\bO_\bD_\bU_\bC_\bT_\bI_\bO_\bN
+
+ The names you are about to ignore are true. However, the
+ story has been changed significantly. Any resemblance of the
+ programming language portrayed here to other programming
+ languages, living or dead, is purely coincidental.
+
+ _\b1_\b._\b1 _\bO_\br_\bi_\bg_\bi_\bn _\ba_\bn_\bd _\bP_\bu_\br_\bp_\bo_\bs_\be
+
+ The INTERCAL programming language was designed the morning
+ of May 26, 1972 by Donald R. Woods and James M. Lyon, at
+ Princeton University. Exactly when in the morning will
+ become apparent in the course of this manual. It was
+ inspired by one ambition: to have a compiler language which
+ has nothing at all in common with any other major language.
+ By 'major' was meant anything with which the authors were at
+ all familiar, e.g., FORTRAN, BASIC, COBOL, ALGOL, SNOBOL,
+ SPITBOL, FOCAL, SOLVE, TEACH, APL, LISP, and PL/I. For the
+ most part, INTERCAL has remained true to this goal, sharing
+ only the basic elements such as variables, arrays, and the
+ ability to do I/O, and eschewing all conventional operations
+ other than the assignment statement (FORTRAN "=").
+
+ _\b1_\b._\b2 _\bA_\bc_\br_\bo_\bn_\by_\bm
+
+ The full name of the compiler is "Compiler Language With No
+ Pronounceable Acronym", which is, for obvious reasons,
+ abbreviated "INTERCAL".
+
+ _\b1_\b._\b3 _\bA_\bc_\bk_\bn_\bo_\bw_\bl_\be_\bd_\bg_\bm_\be_\bn_\bt_\bs
+
+ The authors are deeply indebted to Eric M. Van and Daniel J.
+ Warmenhoven, without whose unwitting assistance this manual
+ would still have been possible.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 3 -
+
+
+
+ _\b2_\b. _\bF_\bU_\bN_\bD_\bA_\bM_\bE_\bN_\bT_\bA_\bL _\bC_\bO_\bN_\bC_\bE_\bP_\bT_\bS
+
+ In this section an attempt is made to describe how and why
+ INTERCAL may be used; i.e., what it is like and what it is
+ good for.
+
+ _\b2_\b._\b1 _\bS_\ba_\bm_\bp_\bl_\be _\bP_\br_\bo_\bg_\br_\ba_\bm
+
+ Shown below is a relatively simple INTERCAL program which
+ will read in 32-bit unsigned integers, treat them as signed,
+ 2's-complement numbers, and print out their absolute values.
+ The program exits if the absolute value is zero. Note in
+ particular the inversion routine (statements 6 through 14),
+ which could be greatly simplified if the subroutine library
+ (see section ) were used.
+
+ A more detailed analysis of a program is made in section
+ of this manual.
+
+
+ DO (5) NEXT
+ (5) DO FORGET #1
+ PLEASE WRITE IN :1
+ DO .1 <- 'V\b-":1~'#32768c\b/#0'"c\b/#1'~#3
+ DO (1) NEXT
+ DO :1 <- "'V\b-":1~'#65535c\b/#0'"c\b/#65535'
+ ~'#0c\b/#65535'"c\b/"'V\b-":1~'#0c\b/#65535'"
+ c\b/#65535'~'#0c\b/#65535'"
+ DO :2 <- #1
+ PLEASE DO (4) NEXT
+ (4) DO FORGET #1
+ DO .1 <- "V\b-':1~:2'c\b/#1"~#3
+ DO :1 <- "'V\b-":1~'#65535c\b/#0'"c\b/":2~'#65535
+ c\b/#0'"'~'#0c\b/#65535'"c\b/"'V\b-":1~'#0
+ c\b/#65535'"c\b/":2~'#0c\b/#65535'"'~'#0c\b/#65535'"
+ DO (1) NEXT
+ DO :2 <- ":2~'#0c\b/#65535'"
+ c\b/"'":2~'#65535c\b/#0'"c\b/#0'~'#32767c\b/#1'"
+ DO (4) NEXT
+ (2) DO RESUME .1
+ (1) PLEASE DO (2) NEXT
+ PLEASE FORGET #1
+ DO READ OUT :1
+ PLEASE DO .1 <- 'V\b-"':1~:1'~#1"c\b/#1'~#3
+ DO (3) NEXT
+ PLEASE DO (5) NEXT
+ (3) DO (2) NEXT
+ PLEASE GIVE UP
+
+
+ _\b2_\b._\b2 _\bU_\bs_\be_\bs _\bf_\bo_\br _\bI_\bN_\bT_\bE_\bR_\bC_\bA_\bL
+
+ INTERCAL's main advantage over other programming languages
+ is its strict simplicity. It has few capabilities, and thus
+
+
+
+
+
+
+
+
+ - 4 -
+
+
+
+ there are few restrictions to be kept in mind. Since it is
+ an exceedingly easy language to learn, one might expect it
+ would be a good language for initiating novice programmers.
+ Perhaps surprising, then, is the fact that it would be more
+ likely to initiate a novice into a search for another line
+ of work. As it turns out, INTERCAL is more useful (which
+ isn't saying much) as a challenge to professional
+ programmers. Those who doubt this need only refer back to
+ the sample program in section . This 23-statement program
+ took somewhere from 15 to 30 minutes to write, whereas the
+ same objectives can be achieved by single-statement programs
+ in either SNOBOL;
+
+ PLEASE INPUT POS(0) ('-' ! '')
+ + (SPAN('0123456789') $ OUTPUT)
+ + *NE(OUTPUT) :S(PLEASE)F(END)
+
+ or APL;
+
+ [1] ->0!=[]<-|[]
+
+ Admittedly, neither of these is likely to appear more
+ intelligible to anyone unfamiliar with the languages
+ involved, but they took roughly 60 seconds and 15 seconds,
+ respectively, to write. Such is the overwhelming power of
+ INTERCAL!
+
+ The other major importance of INTERCAL lies in its seemingly
+ inexhaustible capacity for amazing one's fellow programmers,
+ confounding programming shop managers, winning friends, and
+ influencing people. It is a well-known and oft-demonstrated
+ fact that a person whose work is incomprehensible is held in
+ high esteem. For example, if one were to state that the
+ simplest way to store a value of 65536 in a 32-bit INTERCAL
+ variable is:
+
+ DO :1 <- #0c\b/#256
+
+ any sensible programmer would say that that was absurd.
+ Since this is indeed the simplest method, the programmer
+ would be made to look foolish in front of his boss, who
+ would of course happened to turn up, as bosses are wont to
+ do. The effect would be no less devastating for the
+ programmer having been correct.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 5 -
+
+
+
+ _\b3_\b. _\bD_\bE_\bS_\bC_\bR_\bI_\bP_\bT_\bI_\bO_\bN
+
+ The examples of INTERCAL programming which have appeared in
+ the preceding sections of this manual have probably seemed
+ highly esoteric to the reader unfamiliar with the language.
+ With the aim of making them more so, we present here a
+ description of INTERCAL.
+
+ _\b3_\b._\b1 _\bV_\ba_\br_\bi_\ba_\bb_\bl_\be_\bs
+
+ INTERCAL allows only 2 different types of variables, the
+ 1\b16\b6-\b-b\bbi\bit\bt i\bin\bnt\bte\beg\bge\ber\br and the 3\b32\b2-\b-b\bbi\bit\bt i\bin\bnt\bte\beg\bge\ber\br.\b. These are
+ represented by a spot (.) or two-spot (:), respectively,
+ followed by any number between 1 and 65535, inclusive.
+ These variables may contain only non-negative numbers; thus
+ they have the respective ranges of values: 0 to 65535 and 0
+ to 4294967295. Note: .123 and :123 are two distinct
+ variables. On the other hand, .1 and .0001 are identical.
+ Furthermore, the latter may _\bn_\bo_\bt be written as 1E-3.
+
+ _\b3_\b._\b2 _\bC_\bo_\bn_\bs_\bt_\ba_\bn_\bt_\bs
+
+ C\bCo\bon\bns\bst\bta\ban\bnt\bts\bs are 16-bit values only and may range from 0 to
+ 65535. They are prefixed by a mesh (#). Caution! Under no
+ circumstances confuse the mesh with the interleave operator,
+ except under confusing circumstances!
+
+ _\b3_\b._\b3 _\bA_\br_\br_\ba_\by_\bs
+
+ A\bAr\brr\bra\bay\bys\bs are represented by a tail (,) for 16-bit values, or a
+ hybrid (;) for 32-bit values, followed by a number between 1
+ and 65535, inclusive. The number is suffixed by the word
+ SUB, followed by the subscripts, separated optionally by
+ spaces. Subscripts may be any expressions, including those
+ involving subscripted variables. This occasionally leads to
+ ambiguous constructions, which are resolved as discussed in
+ section . Definition of array dimensions will be discussed
+ later in greater detail, since discussing it in less detail
+ would be difficult. As before, ,123 and ;123 are distinct.
+ In summary, .123, :123, #123, ,123, and ;123 are all
+ distinct.
+
+ _\b3_\b._\b4 _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ INTERCAL recognizes 5 operators -- 2 binary and 3 unary 1.
+ Please be kind to our operators: they may not be very
+ intelligent, but they're all we've got. In a sense, all 5
+ operators are binary, as they are all bit-oriented, but it
+ is not our purpose here to quibble about bits of trivia.
+
+ _\b3_\b._\b4_\b._\b1 _\bB_\bi_\bn_\ba_\br_\by _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ The binary operators are i\bin\bnt\bte\ber\brl\ble\bea\bav\bve\be (also called m\bmi\bin\bng\bgl\ble\be) and
+ s\bse\bel\ble\bec\bct\bt, which are represented by a change (c\b/) and a sqiggle
+
+
+
+
+
+
+
+
+ - 6 -
+
+
+
+ [sic] (~), respectively.
+
+ The interleave operator takes two 16-bit values and produces
+ a 32-bit result by alternating the bits of the operands.
+ Thus, #65535c\b/#0 has the 32-bit binary form 101010....10 or
+ 2863311530 decimal, while #0c\b/#65535 = 0101....01 binary =
+ 1431655765 decimal, and #255c\b/#255 is equivalent to #65535.
+
+ The select operator takes from the first operand whichever
+ bits correspond to 1's in the second operand, and packs
+ these bits to the right in the result. Both operands are
+ automatically padded on the left with zeros to 32 bits
+ before the selection takes place, so the variable types are
+ unrestricted. If more than 16 bits are selected, the result
+ is a 32-bit value, otherwise it is a 16-bit value. For
+ example, #179~#201 (binary value 10110011~11001001) selects
+ from the first argument the 8th, 7th, 4th, and 1st from last
+ bits, namely, 1001, which = 9. But #201~#179 selects from
+ binary 11001001 the 8th, 6th, 5th, 2nd, and 1st from last
+ bits, giving 10001 = 17. #179~#179 has the value 31, while
+ #201~#201 has the value 15.
+
+ Perhaps a simpler way of understanding the operation of the
+ select operator would be to examine the logic diagram in
+ Figure 1, which performs the select operation upon two 8-bit
+ values, A and B. The gates used are Warmenhovian logic
+ gates, which means the outputs have four possible values:
+ low, high, undefined (value of an uninitialized flip-flop),
+ and oscillating (output of a NOR gate with one input low and
+ the other input connected to the output). These values are
+ represented symbolically by '0', '1', '?', and 'O\b|'. Note in
+ particular that, while NOT-0 is 1 and NOT-1 is 0 as in two-
+ valued logic, NOT-? is ? and NOT-O\b| is O\b|. The functions of
+ the various gates are listed in Table 1.
+
+ [Warning: The following picture will be garbled or missing.
+ Get a better output device.]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 7 -
+
+
+
+ --+-+---- --+---- +--+---- --+---- +--+----
+ A\b1 | | 1 +-+--+-+ 2 +-++-+ 3 ++-+-+ 3 ++|--+ 1 +--
+ B --+++ | |--+-+ | || | ||||++ |||| | | TO
+ 1 +++------++-+-+------+|-+--- +++++-----++|-+--- ---\bNEW
+ +-------++-+---------+-------+++++-----+ | YORK
+ +-+------++-+-+-----+ | +---- ||| +-----+ | +---- TO
+ A\b2 --+-+ | || +-+ || --+ |+++-+ |+-+-+ | ---\bNEW
+ --+-+ 1 +-++-+-+ 2 +++--+ 7 +-++-+ 3 +--+-+ 2 +-- YO\bTR\bOK
+ B\b2 |-+--- |||+-+--- || -+--- |+-+------++-+------- ---\bNEW
+ +--------+++-+------++---------+--------+|+--------- YORK
+ +-+------+++-++-----++--+-----+| ++-----++--+-----+ TO
+ A --+-+ | +++-++ |++--+ |++-++ ||+--+ || B ---\bNEW
+ 3 | 1 +-+++-+| 2 +-++-+ 3 +-++++ 3 ++++-+ 3 ++- YORK
+ B\b3 --+-+--- ||||+++--- |||-+--- ++|++--- ||+++--- | TO
+ +-------++++++------+++-------++++------++++------+-U ---\bNEW
+ +-+-----+++-+++-----+++-+-----+++|| ++++| | YORK
+ A --+-+----|||| ||+----||++-+----||++++----|+++++----|| S TO
+ 4 | 1 +++++|++ 2 ++++-+ 7 ++++++ 3 ++++-+ 4 ++- ---\bNEW
+ B --+-+--- ||||+-+--- ||+-+--- |||++--- ++--++--- | YO\bTR\bOK
+ 4 | |||+++ ++--+ +---++++++++++|+-+------+ ---\bNEW
+ +-------+++-++-------++++-+--+||+++++++-++++--+ YORK
+ --+-+-----+++-+++-----+++++-+--+++-++++++ +++++-+-- L TO
+ A\b5 | 1 ++++++++ 2 ++++++ 3 +++ ++ 3 +-++++ 5 +-- ---\bNEW
+ B --+-+ |||+++++ | ||| ||| || |++++| | YORK
+ 5 |-+--- |||||++-------|++----+|+--+-----+++++-------I TO
+ +-------+++++--------++------++++ +--- |+++ ---\bNEW
+ +-+-----+++++-+-----+|| +----++++++-----+|||+---- N YORK
+ A\b6 --+-+ |||-++++ |+++-+ |+++++ | ++++ | TO
+ --+-+ 1 +++-++++ 2 ++++-+ 3 +-++++ 4 ++++++ 4 +-- ---\bNEW
+ B\b6 |-+--- +++++++--- +++-+-----+||++-----+++++-------E YORK
+ +--------++++--------++------+||| ++-+ ---TO
+ +-+------++++-+-----+|| +----++++++---- || +---- NEW
+ A --+-+ | -+++-+ |+++-+ |+++++ ||+--+ | YO\bTR\bOK
+ 7 | 1 +--+|+-+ 2 +-++-+ 3 ++|+++ 4 ++-+-+ 5 +-- ---\bNEW
+ B\b7 --+-+--- ||++-+--- ||++--- || ++--- --+++--- YORK
+ +----+---++++--------+++------++ +------+-++------+- TO
+ +-+--+---++++-+-------+|| | || | || | ---\bNEW
+ A --+-+----| |+++-+----|+-+++----|+--++----||+--+----|| YORK
+ 8 | 1 +-+ |+-+ 2 ++ +++ 4 ++ +++ 3 ++++-+ 5 ++-8 TO
+ B --+-+--- +--+--- | ++--- | |++--- | |-+--- | ---\bNEW
+ 8 +----------------+ ++-+ +-++---+ ++-+------+| YORK
+ +--+++--------+|| +-++++------++- TO
+ +---- +-+--+-----+++-+---- ++++----+|++-+----++- ---\bNEW
+ | 6 +-+ +--+ 2 ++-+-+ 7 +-++-+ 3 +++|++ 4 ++- YO\bTR\bOK
+ | | -+--+ |+---+ | | | || ||| || --\bP-\bHILA-
+ -+--- | -+--- -+--- |-+--- +-+++--- | DELPHIA
+ +---------------------+---------+-------+-
+ +---- |+--+---------+------++-+-----+ +----
+ | | ++--+ | +-+ | |--+ ||+--+ |
+ | 6 +--++--+ 1 +-++-+ 1 +-+--+ 1 +++--+ 1 ++
+ -+--- -+--- --++-+--- | -+--- | -+-----+-
+ --- ---
+ FIGURE 1. CIRCUITOUS DIAGRAM
+
+
+
+
+
+
+
+
+
+ - 8 -
+
+
+
+ __________________________________________________________
+ |\ \
+ | \ 1. Logic gate. Inputs A, B. Output O = AB. \
+ | \ \
+ | \ \ 2. Logic gate. Inputs A, B, C. Output O = A+BC. \
+ | |\ \ \
+ | | \ \ 3. Logic gate. Inputs A, B. Output O = A+AB. \
+ | | \ \ \
+ | | |\ \ 4. Logic gate. Inputs A, B. Output O = AB O\b+ -(A+-B) \
+ | | | \ \ \
+ | | | \ \ 5. Logic gate. Inputs A, B. Output O = AO\b+A + AA \
+ | | | \ \ \
+ | | | \ \ 6. Uninitialized flip-flop. Inputs none. Output O = ? \
+ | | | \ \ \
+ | | | \ \ 7. Flip-flop-flap. Inputs A, B, C. Output O = 1 if \
+ | | | \ \ A=0 or B+C=0 and A=1. O = 0 if AC=1, B=0. O = O\b| if \
+ | | | \ \ AB=1, C=0. O = ? if ABC=1. O as yet undetermined \
+ | | | \ \ for other Warmenhovian inputs. See Figure 2. \
+ | | | \ \ \
+ | | | \ \ 8. Bus line. \
+ | | | \ \_________________________________________________________\
+ | | | \ | |
+ | | | | | _____________________________________________________ |
+ | | | | | | | | | | | |
+ | | | | | | | | | | | |
+ | | | | | | | | | | | |
+ | | | | | | | | | | | |
+ | | | | | | | | | | | |
+ \|__| | | | \|__| | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ | | | | | |
+ \|__| \|__|
+
+ Table 1. Logical (and other) functions.
+
+
+
+
+
+
+
+
+
+
+
+
+ - 9 -
+
+
+
+ [Warning: The following picture will be garbled or missing.
+ Get a better output device.]
+
+
+
+
+
+
+
+
+
+
+ -------------------------+----
+ A +---+ |----+------------D
+ | | | |
+ +----
+
+
+
+ | | |
+ +---+---- |
+ B-------------------------+ |----+ |
+ +----| | |
+ | |
+ | |
+ | |
+ | |
+ | | |
+ C-------------------------+----| | |
+ +----------------+ |--+ | |
+ | +---- | | |
+ | | | |
+ | |
+ | |
+ | |
+ | | | | |
+ | | +-+----| |
+ | +---+ +- +-------+
+ | +-+--
+ 1-----+
+
+
+
+
+
+
+
+
+
+
+ FIGURE 2. FLIP FLAP FLOP
+
+
+
+
+
+
+
+
+
+
+
+ - 10 -
+
+
+
+ [Warning: The following picture will be garbled or missing.
+ Get a better output device.]
+
+ -----
+ ----- -----
+ -----
+ ----- -----
+
+ ----- -----
+ -----
+ ----- -----
+ ----- GATE TYPE 9. BLACK BOX
+ ----- 9 ----- INPUTS A1-8, B1-8.
+ ----- OUTPUT O1-8 = A1-8~B1-8
+ ----- -----
+ -----
+ ----- -----
+
+ ----- -----
+ -----
+ ----- -----
+ -----
+
+
+
+
+
+
+
+
+
+
+
+ FIGURE 1 (CONTINUED). NEW YORK
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 11 -
+
+
+
+ _\b3_\b._\b4_\b._\b2 _\bU_\bn_\ba_\br_\by _\bO_\bp_\be_\br_\ba_\bt_\bo_\br_\bs
+
+ The unary operators are & (logical A\bAN\bND\bD), V (logical O\bOR\bR), and
+ V\b- (logical X\bXO\bOR\bR). This last character is obtained by
+ overpunching a worm (-) on a V (V). The operator is
+ inserted between the spot, two-spot, mesh, or what-have-you,
+ and the integer, thus: .&123, #V\b-123. Multiple unary
+ operators may not be concatenated, thus the form #V\b-&123 is
+ invalid. This will be covered later when precedence is
+ discussed. These operators perform their respective logical
+ operations on all pairs of adjacent bits, the result from
+ the first and last bits going into the first bit of the
+ result. The effect is that of rotating the operand one
+ place to the right and ANDing, ORing, or XORing with its
+ initial value. Thus, #&77 (binary = 1001101) is binary
+ 0000000000000100 = 4, #V77 is binary 1000000001101111 =
+ 32879, and #V\b-77 is binary 1000000001101011 = 32875.
+
+ _\b3_\b._\b4_\b._\b3 _\bP_\br_\be_\bc_\be_\bd_\be_\bn_\bc_\be
+
+ Precedence of operators is as follows:
+
+
+
+
+
+
+
+
+
+
+ (The remainder of this page intentionally left blank)2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ____________________
+
+ 2. Keep in mind that the aim in designing INTERCAL was to
+ have no precedents.
+
+
+
+
+
+
+
+ - 12 -
+
+
+
+ This precedence (or lack thereof) may be overruled by
+ grouping expressions between pairs of sparks (') or rabbit-
+ ears ("). Thus '#165c\b/#203'~#358 (binary value
+ '10100101c\b/11001011'~101100110) has the value 15, but
+ #165c\b/'#203~#358' has the value 34915, and #165c\b/#203~#358 is
+ invalid syntax and is completely valueless (except perhaps
+ as an educational tool to the programmer). A unary operator
+ is applied to a sparked or rabbit-eared expression by
+ inserting the operator immediately following the opening
+ spark or ears. Thus, the invalid expression #V\b-&123, which
+ was described earlier, could be coded as 'V\b-#&123' or
+ 'V\b-"{"'. Note: In the interests of simplifying the
+ sometimes overly-complex form of expressions, INTERCAL
+ allows a spark-spot combination ('.) to be replaced with a
+ wow (!). Thus '.1~.2' is equivalent to !1~.2', and 'V.1c\b/.2'
+ is equivalent to "V!1c\b/.2'".
+
+ Combining a rabbit-ears with a spot to form a rabbit ("\b.) is
+ not permitted, although the programmer is free to use it
+ should he find an EBCDIC reader which will properly
+ translate a 12-3-7-8 punch.
+
+ Sparks and/or rabbit-ears must also be used to distinguish
+ among such otherwise ambiguous subscripted and multiply-
+ subscripted expressions as:
+
+ ,1 SUB #1 ~ #2
+ ,1 SUB ,2 SUB #1 #2 #3
+ ,1 SUB " ,2 SUB " ,3 SUB #1 " #2 " " #3 "
+
+ The third case may be isolated into either of its possible
+ interpretations by simply changing some pairs of rabbit-ears
+ to sparks, instead of adding more ears (which would only
+ confuse the issue further). Ambiguous cases are defined as
+ those for which the compiler being used finds a legitimate
+ interpretation which is different from that which the user
+ had in mind. See also section .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 13 -
+
+
+
+ _\b4_\b. _\bS_\bT_\bA_\bT_\bE_\bM_\bE_\bN_\bT_\bS
+
+ In this section is described the format of INTERCAL
+ statements.
+
+ _\b4_\b._\b1 _\bG_\be_\bn_\be_\br_\ba_\bl _\bF_\bo_\br_\bm_\ba_\bt
+
+ Statements may be entered in 'free format'. That is, more
+ than one statement may occur on a single card, and a
+ statement may begin on one card and end on a later one. Note
+ that if this is done, all intervening cards and portions
+ thereof must be part of the same statement. That this
+ restriction is necessary is immediately apparent from the
+ following example of what might occur if statements could be
+ interlaced.
+
+ DO .1 <- ".1c\b/'&:51~"#V\b-1c!12~;&75SUB"V\b-'V.1~
+ DO .2 <- '"!1c\b/"&';V\b-79SUB",&7SUB:173"'~!V\b-9c\b/
+ .2'c\b/,&1SUB:5~#33578"'"'"~'#65535c\b/"V\b-'V#&85'"'
+ #8196'"'~.1"c\b/.2'~'#&5c\b/"'#1279c\b/#4351'~#65535"'
+
+ The above statements are obviously meaningless. (For that
+ matter, so are the statements
+
+ DO .1 <- ".1c\b/"&:51~"#V\b-1c\b/!12~;&75SUB"V\b-'V.1~
+ .2'c\b/,&1SUB:5~#333578"'"'"~#65535c\b/"V\b-'V#&85'"'
+ DO .2 <- '"!1c\b/"&';V\b-79SUB",&7SUB:173"'~!V\b-9c\b/
+ #8196'"'~.1"c\b/.2'~'#&5c\b/"'#1279c\b/#4351'~#65535"'
+
+ but this is not of interest here.)
+
+ Spaces may be used freely to enhance program legibility (or
+ at least reduce program illegibility), with the restriction
+ that no word of a statement identifier (see section ) may
+ contain any spaces.
+
+ _\b4_\b._\b2 _\bL_\ba_\bb_\be_\bl_\bs
+
+ A statement may begin with a l\blo\bog\bgi\bic\bca\bal\bl l\bli\bin\bne\be l\bla\bab\bbe\bel\bl enclosed in
+ wax-wane pairs (()). A statement may not have more than one
+ label, although it is possible to omit the label entirely. A
+ line label is any integer from 1 to 65535, which must be
+ unique within each program. The user is cautioned, however,
+ that many line labels between 1000 and 1999 are used in the
+ INTERCAL System Library functions.
+
+ _\b4_\b._\b3 _\bI_\bd_\be_\bn_\bt_\bi_\bf_\bi_\be_\br_\bs _\ba_\bn_\bd _\bQ_\bu_\ba_\bl_\bi_\bf_\bi_\be_\br_\bs
+
+ After the line label (if any), must follow one of the
+ following statement identifiers: DO, PLEASE, or PLEASE DO.
+ These may be used interchangeably to improve the aesthetics
+ of the program. The identifier is then followed by either,
+ neither, or both of the following optional parameters
+ (qualifiers): (1) either of the character strings NOT or
+
+
+
+
+
+
+
+
+ - 14 -
+
+
+
+ N'T, which causes the statement to be automatically
+ abstained from (see section ) when execution begins, and (2)
+ a number between 0 and 100, preceded by a double-oh-seven
+ (%), which causes the statement to have only the specified
+ percent chance of being executed each time it is encountered
+ in the course of execution.
+
+ _\b4_\b._\b4 _\bS_\bt_\ba_\bt_\be_\bm_\be_\bn_\bt_\bs
+
+ Following the qualifiers (or, if none are used, the
+ identifier) must occur one of the 13 valid operations.
+ (Exception: see section .) These are described individually
+ in sections
+ through .
+
+ _\b4_\b._\b4_\b._\b1 _\bC_\ba_\bl_\bc_\bu_\bl_\ba_\bt_\be
+
+ The INTERCAL equivalent of the half-mesh (=) in FORTRAN,
+ BASIC, PL/I, and others, is represented by an angle (<)
+ followed by a worm (-). This combination is read 'gets'.
+ 32-bit variables may be assigned 16-bit values, which are
+ padded on the left with 16 zero bits. 16-bit variables may
+ be assigned 32-bit values only if the value is less than
+ 65535. Thus, to invert the least significant bit of the
+ first element of 16-bit 2-dimensional array number 1, one
+ could write:
+
+ ,1SUB#1#1 <- 'V\b-",1SUB#1#1"c\b/#1'~'#0c\b/#65535'
+
+ Similarly to SNOBOL and SPITBOL, INTERCAL uses the angle-
+ worm to define the dimensions of arrays. An example will
+ probably best describe the format. To define 32-bit array
+ number 7 as 3-dimensional, the first dimension being seven,
+ the second being the current value of 16-bit variable number
+ seven, and the third being the current value of the seventh
+ element of 16-bit array number seven (which is one-
+ dimensional) mingled with the last three bits of 32-bit
+ variable number seven, one would write (just before they
+ came to take him away):
+
+ ;7 <- #7 BY .7 BY ",7SUB#7"c\b/':7~#7'
+
+ This is, of course, different from the statement:
+
+ ;7 <- #7 BY .7 BY ,7SUB"#7c\b/':7~#7'"
+
+ INTERCAL also permits the redefining of array dimensioning,
+ which is done the same way as is the initial dimensioning.
+ All values of items in an array are lost upon
+ redimensioning, unless they have been STASHed (see section
+ ), in which case restoring them also restores the old
+ dimensions.
+
+
+
+
+
+
+
+
+
+
+ - 15 -
+
+
+
+ _\b4_\b._\b4_\b._\b2 _\bN_\bE_\bX_\bT
+
+ The NEXT statement is used both for subroutine calls and for
+ unconditional transfers. This statement takes the form:
+
+ DO (label) NEXT
+
+ (or, of course,
+
+ PLEASE DO (label) NEXT
+
+ etc.), where (label) represents any logical line label which
+ appears in the program. The effect of such a statement is to
+ transfer control to the statement specified, and to store in
+ a push down list (which is initially empty) the location
+ from which the transfer takes place. Items may be removed
+ from this list and may be discarded or used to return to the
+ statement immediately following the NEXT statement. These
+ operations are described in sections
+ and
+ respectively. The programmer is generally advised to
+ discard any stack entries which he does not intend to
+ utilize, since the stack has a maximum depth of 79 entries.
+ A program's attempting to initiate an 80th level of NEXTing
+ will result in the fatal error message, "PROGRAM HAS
+ DISAPPEARED INTO THE BLACK LAGOON."
+
+ _\b4_\b._\b4_\b._\b3 _\bF_\bO_\bR_\bG_\bE_\bT
+
+ The statement PLEASE FORGET exp, where exp represents any
+ expression (except colloquial and facial expressions),
+ causes the expression to be evaluated, and the specified
+ number of entries to be removed from the NEXTing stack and
+ discarded. An attempt to FORGET more levels of NEXTing than
+ are currently stacked will cause the stack to be emptied,
+ and no error condition is indicated. This is because the
+ condition is not considered to be an error. As described in
+ section , it is good programming practice to execute a DO
+ FORGET #1 after using a NEXT statement as an unconditional
+ transfer, so that the stack does not get cluttered up with
+ unused entries:
+
+ DO (123) NEXT
+ .
+ .
+ (123) DO FORGET #1
+
+
+ _\b4_\b._\b4_\b._\b4 _\bR_\bE_\bS_\bU_\bM_\bE
+
+ The statement PLEASE RESUME exp has the same effect as
+ FORGET, except that program control is returned to the
+ statement immediately following the NEXT statement which
+ stored in the stack the last entry to be removed. Note that
+
+
+
+
+
+
+
+
+ - 16 -
+
+
+
+ a rough equivalent of the FORTRAN computed GO TO and BASIC
+ ON exp GO TO is performed by a sequence of the form:
+
+ DO (1) NEXT
+ .
+ .
+ (1) DO (2) NEXT
+ PLEASE FORGET #1
+ .
+ .
+ (2) DO RESUME .1
+
+ Unlike the FORGET statement, an attempt to RESUME more
+ levels of NEXTing than has been stacked will cause program
+ termination. See also section .
+
+ _\b4_\b._\b4_\b._\b5 _\bS_\bT_\bA_\bS_\bH
+
+ Since subroutines are not explicitly implemented in
+ INTERCAL, the NEXT and RESUME statements must be used to
+ execute common routines. However, as these routines might
+ use the same variables as the main program, it is necessary
+ for them to save the values of any variables whose values
+ they alter, and later restore them. This process is
+ simplified by the STASH statement, which has the form DO
+ STASH list, where list represents a string of one or more
+ variable or array names, separated by intersections (+).
+ Thus
+
+ PLEASE STASH .123+:123+,123
+
+ stashes the values of two variables and one entire array.
+ The values are left intact, and copies thereof are saved for
+ later retrieval by (what else?) the RETRIEVE statement (see
+ section ). It is not possible to STASH single array items.
+
+ _\b4_\b._\b4_\b._\b6 _\bR_\bE_\bT_\bR_\bI_\bE_\bV_\bE
+
+ PLEASE RETRIEVE list restores the previously STASHed values
+ of the variables and arrays named in the list. If a value
+ has been stashed more than once, the most recently STASHed
+ values are RETRIEVEd, and a second RETRIEVE will restore the
+ second most recent values STASHed. Attempting to RETRIEVE a
+ value which has not been STASHed will result in the error
+ message, "THROW STICK BEFORE RETRIEVING."
+
+ _\b4_\b._\b4_\b._\b7 _\bI_\bG_\bN_\bO_\bR_\bE
+
+ The statement DO IGNORE list causes all subsequent
+ statements to have no effect upon variables and/or arrays
+ named in the list. Thus, for example, after the sequence
+
+ DO .1 <- #1
+ PLEASE IGNORE .1
+
+
+
+
+
+
+
+
+ - 17 -
+
+
+
+ DO .1 <- #0
+
+ 16-bit variable number 1 would have the value 1, not 0.
+ Inputting (see section ) into an IGNOREd variable also has
+ no effect. The condition is annulled via the REMEMBER
+ statement (see section ). Note that, when a variable is
+ being IGNOREd, its value, though immutable, is still
+ available for use in expressions and the like.
+
+ _\b4_\b._\b4_\b._\b8 _\bR_\bE_\bM_\bE_\bM_\bB_\bE_\bR
+
+ PLEASE REMEMBER list terminates the effect of the IGNORE
+ statement for all variables and/or arrays named in the list.
+ It does not matter if a variable has been IGNOREd more than
+ once, nor is it an error if the variable has not been
+ IGNOREd at all.
+
+ _\b4_\b._\b4_\b._\b9 _\bA_\bB_\bS_\bT_\bA_\bI_\bN
+
+ INTERCAL contains no simple equivalent to an IF statement or
+ computed GO TO, making it difficult to combine similar
+ sections of code into a single routine which occasionally
+ skips around certain statements. The IGNORE statement (see
+ section ) is helpful in some cases, but a more viable method
+ is often required. In keeping with the goal of INTERCAL
+ having nothing in common with any other language, this is
+ made possible via the ABSTAIN statement.
+
+ This statement takes on one of two forms. It may not take on
+ both at any one time. DO ABSTAIN FROM (label) causes the
+ statement whose logical line label is (label) to be
+ abstained from. PLEASE ABSTAIN FROM gerund list causes all
+ statements of the specified type(s) to be abstained from, as
+ in
+
+ PLEASE ABSTAIN FROM STASHING
+ PLEASE ABSTAIN FROM IGNORING + FORGETTING
+ PLEASE ABSTAIN FROM NEXTING
+ or PLEASE ABSTAIN FROM CALCULATING
+
+ Statements may also be automatically abstained from at the
+ start of execution via the NOT or N'T parameter (see section
+ ).
+
+ If, in the course of execution, a statement is encountered
+ which is being abstained from, it is ignored and control
+ passes to the next statement in the program (unless it, too,
+ is being abstained from).
+
+ The statement DO ABSTAIN FROM ABSTAINING is perfectly valid,
+ as is DO ABSTAIN FROM REINSTATING (although this latter is
+ not usually recommended). However, the statement DO ABSTAIN
+ FROM GIVING UP is not accepted, even though DON'T GIVE UP
+ is.
+
+
+
+
+
+
+
+
+ - 18 -
+
+
+
+ _\b4_\b._\b4_\b._\b1_\b0 _\bR_\bE_\bI_\bN_\bS_\bT_\bA_\bT_\bE
+
+ The REINSTATE statement, like the ABSTAIN, takes as an
+ argument either a line label or a gerund list. No other form
+ of argument is permitted. For example, the following is an
+ invalid argument:
+
+ Given: x!=0, y!=0, Prove: x+y=0
+ Since x!=0, then x+1!=1, x+a!=a, x+y!=y.
+ But what is y? y is anything but 0.
+ Thus x+y != anything but 0.
+ Since x+y cannot equal anything but 0, x+y=0.
+ Q.E.D.
+
+ REINSTATEment nullifies the effects of an abstention. Either
+ form of REINSTATEment can be used to "free" a statement,
+ regardless of whether the statement was abstained from by
+ gerund list, line label, or NOT. Thus, PLEASE REINSTATE
+ REINSTATING is not necessarily an irrelevant statement,
+ since it might free a DON'T REINSTATE command or a REINSTATE
+ the line label of which was abstained from. However, DO
+ REINSTATE GIVING UP is invalid, and attempting to REINSTATE
+ a GIVE UP statement by line label will have no effect. Note
+ that this insures that DON'T GIVE UP will always be a "do-
+ nothing" statement.
+
+ _\b4_\b._\b4_\b._\b1_\b1 _\bG_\bI_\bV_\bE _\bU_\bP
+
+ PLEASE GIVE UP is used to exit from a program. It has the
+ effect of a PLEASE RESUME #80. DON'T GIVE UP, as noted in
+ section , is effectively a null statement.
+
+ _\b4_\b._\b4_\b._\b1_\b2 _\bI_\bn_\bp_\bu_\bt
+
+ Input is accomplished with the statement DO WRITE IN list,
+ where list represents a string of variables and/or elements
+ of arrays, separated by intersections. Numbers are
+ represented on cards, each number on a separate card, by
+ spelling out each digit (in English) and separating the
+ digits with one or more spaces. A zero (0) may be spelled as
+ either ZERO or OH. Thus the range of (32-bit) input values
+ permissible extends from ZERO (or OH) through FOUR TWO NINE
+ FOUR NINE SIX SEVEN TWO NINE FIVE.
+
+ Attempting to write in a value greater than or equal to SIX
+ FIVE FIVE THREE SIX for a 16-bit variable will result in the
+ error message, "DON'T BYTE OFF MORE THAN YOU CAN CHEW."
+
+ _\b4_\b._\b4_\b._\b1_\b3 _\bO_\bu_\bt_\bp_\bu_\bt
+
+ Values may be output to the printer, one value per line, via
+ the statement DO READ OUT list, where the list contains
+ variables, array elements, and/or constants. Output is in
+ the form of "extended" Roman numerals (also called
+
+
+
+
+
+
+
+
+ - 19 -
+
+
+
+ "butchered" Roman numerals), with an overline indicating the
+ value below is "times 1000", and lower-case letters
+ indicating "times 1000000". Zero is indicated by an overline
+ with no character underneath. Thus, the range of (32-bit)
+ output values possible is from
+ _
+
+ through
+ __ ____________
+ ivccxcivCMLXVIICCXCV.
+ Note: For values whose residues modulo 1000000 are less than
+ 4000, M is used to represent 1000; for values whose residues
+ are 4000 or greater,
+ _
+ I
+ is used. Thus #3999 would read out as MMMCMXCIX 3 while
+ #4000 would readout as
+ __
+ IV
+ Similar rules apply to the use of
+ _
+ M
+ and i for 1000000, and to that of m and
+ _
+ i
+ for 1000000000.
+
+ _\b4_\b._\b5 _\bC_\bo_\bm_\bm_\be_\bn_\bt_\bs
+
+ Unrecognizable statements, as noted in section , are flagged
+ with a splat (*) during compilation, and are not considered
+ fatal errors unless they are encountered during execution,
+ at which time the statement (as input at compilation time)
+ is printed and execution is terminated. This allows for an
+ interesting (and, by necessity, unique) means of including
+ comments in an INTERCAL listing. For example, the statement:
+
+ * PLEASE NOTE THAT THIS LINE HAS NO EFFECT
+
+ will be ignored during execution due to the inclusion of the
+ NOT qualifier. User-supplied error messages are also easy
+ to implement:
+
+ * DO SOMETHING ABOUT OVERFLOW IN ;3
+
+ as are certain simple conditional errors:
+
+
+
+ ____________________
+
+ 3. The original INTERCAL-72 manual claimed that #3999 should
+ render as MMMIM, but the C-INTERCAL developers have been
+ unable to find an algorithm that does this and is
+ consistent with the rest of the rules.
+
+
+
+
+
+
+
+ - 20 -
+
+
+
+ * (123) DON'T YOU REALIZE THIS STATEMENT SHOULD ONLY BE ENCOUNTERED
+ ONCE?
+ PLEASE REINSTATE (123)
+
+ This pair of statements will cause an error exit the second
+ time they are encountered. Caution!! The appearance of a
+ statement identifier in an intended comment will be taken as
+ the beginning of a new statement. Thus, the first comment
+ example above could not have been:
+
+ * PLEASE NOTE THAT THIS LINE DOES NOTHING
+
+ The third example, however, is valid, despite the appearance
+ of two cases of D-space-O, since INTERCAL does not ignore
+ extraneous spaces in statement identifiers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 21 -
+
+
+
+ _\b5_\b. _\bS_\bU_\bB_\bR_\bO_\bU_\bT_\bI_\bN_\bE _\bL_\bI_\bB_\bR_\bA_\bR_\bY
+
+ INTERCAL provides several built-in subroutines to which
+ control can be transferred to perform various operations.
+ These operations include many useful functions which are not
+ easily representable in INTERCAL, such as addition,
+ subtraction, etc.
+
+ _\b5_\b._\b1 _\bU_\bs_\ba_\bg_\be
+
+ In general, the operands are .1, .2, etc., or :1, :2, etc.,
+ and the result(s) are stored in what would have been the
+ next operand(s). For instance, one routine adds .1 to .2 and
+ stores the sum in .3, with .4 being used to indicate
+ overflow. All variables not used for results are left
+ unchanged.
+
+ _\b5_\b._\b2 _\bA_\bv_\ba_\bi_\bl_\ba_\bb_\bl_\be _\bF_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs
+
+ At the time of this writing, only the most fundamental
+ operations are offered in the library, as a more complete
+ selection would require prohibitive time and core to
+ implement. These functions, along with their corresponding
+ entry points (entered via DO (entry) NEXT) are listed below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 22 -
+
+
+
+ (1000) .3 <- .1 plus .2, error exit on overflow
+ (1009) .3 <- .1 plus .2
+ .4 <- #1 if no overflow, else .4 <- #2
+ (1010) .3 <- .1 minus .2, no action on overflow
+ (1020) .1 <- .1 plus #1, no action on overflow
+ (1030) .3 <- .1 times .2, error exit on overflow
+ (1039) .3 <- .1 times .2
+ .4 <- #1 if no overflow, else .4 <- #2
+ (1040) .3 <- .1 divided by .2
+ .3 <- #0 if .2 is #0
+ (1050) .2 <- :1 divided by .1, error exit on overflow
+ .2 <- #0 if .1 is #0
+
+ (1500) :3 <- :1 plus :2, error exit on overflow
+ (1509) :3 <- :1 plus :2
+ :4 <- #1 if no overflow, else :4 <- #2
+ (1510) :3 <- :1 minus :2, no action on overflow
+ (1520) :1 <- .1 concatenated with .2
+ (1525) This subroutine is intended solely for internal
+ use within the subroutine library and is therefore
+ not described here. Its effect is to shift .3
+ logically 8 bits to the left.
+ (1530) :1 <- .1 times .2
+ (1540) :3 <- :1 times :2, error exit on overflow
+ (1549) :3 <- :1 times :2
+ :4 <- #1 if no overflow, else :4 <- #2
+ (1550) :3 <- :1 divided by :2
+ :3 <- #0 if :2 is #0
+
+ (1900) .1 <- uniform random no. from #0 to #65535
+ (1910) .2 <- normal random no. from #0 to .1, with
+ standard deviation .1 divided by #12
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 23 -
+
+
+
+ _\b6_\b. _\bP_\bR_\bO_\bG_\bR_\bA_\bM_\bM_\bI_\bN_\bG _\bH_\bI_\bN_\bT_\bS
+
+ For the user looking to become more familiar with the
+ INTERCAL language, we present in this section an analysis of
+ a complex program, as well as some suggested projects for
+ the ambitious programmer.
+
+ Considering the effort involved in writing an INTERCAL
+ program, it was decided in putting together this manual to
+ use an already existing program for instructive analysis.
+ Since there was only one such program available, we have
+ proceeded to use it. It is known as the "INTERCAL System
+ Library."
+
+ _\b6_\b._\b1 _\bD_\be_\bs_\bc_\br_\bi_\bp_\bt_\bi_\bo_\bn
+
+ The program listing is in section . It is in the same format
+ as would be produced by the Princeton INTERCAL compiler in
+ FORMAT mode with WIDTH=62 (see section ). For a description
+ of the functions performed by the Library, see section .
+
+ _\b6_\b._\b2 _\bA_\bn_\ba_\bl_\by_\bs_\bi_\bs
+
+ We shall not attempt to discuss here the algorithms used,
+ but rather we shall point out some of the general techniques
+ applicable to a wide range of problems.
+
+ Statements 10, 14, 15, and 26 make up a virtual "computed GO
+ TO". When statement 10 is executed, control passes
+ eventually to statement 16 or 11, depending on whether .5
+ contains #1 or #2, respectively. The value of .5 is
+ determined in statement 9, which demonstrates another handy
+ technique. To turn an expression, exp, with value #0 or #1,
+ into #1 or #2 (for use in a "GO TO"), use "V\b-'exp'c\b/#1"~#3.
+ To reverse the condition (i.e., convert #0 to #2 and leave
+ #1 alone) use "V\b-'exp'c\b/#2"~#3.
+
+ Certain conditions are easily checked. For example, to test
+ for zero, select the value from itself and select the bottom
+ bit (see statement 54). To test for all bits being 1's,
+ select the value from itself and select the top bit. The
+ test for greater than, performed in statements 219 and 220
+ on 32-bit values, employs binary logical operations, which
+ are performed as follows:
+
+ 'V\b-.1c\b/.2'~'#0c\b/#65535'
+
+ for 16-bit values or, for 32-bit values:
+
+ "'V\b-":1~'#65535c\b/30'"c\b/":2~'#65535c\b/#0'"'~'#0
+ c\b/#65535'"c\b/"'V\b-":1~'#0c\b/#65535'"c\b/":2~'#0
+ c\b/#65535'"'~'#0c\b/#65535'"
+
+ (The proofs are left as an exercise to the reader.)
+
+
+
+
+
+
+
+
+ - 24 -
+
+
+
+ Testing for greater-than with 16-bit values is somewhat
+ simpler and is done with the pair of statements:
+
+ DO .C <- 'V\b-.Ac\b/.B'~'#0c\b/#65535'
+ DO .C <- '&"'.A~.C'~'"V\b-'V\b-.C~.C'c\b/#32768"
+ ~"#0c\b/#65535"'"c\b/".C~.C"'~#1
+
+ This sets .C (a dummy variable) to #1 if .A > .B, and #0
+ otherwise. The expression may be expanded as described above
+ to instead set .C to #1 or #2.
+
+ Note also in statement 220 the occurrence of
+ ~"#65535c\b/#65535". Although these operations select the
+ entire value, they are not extraneous, as they ensure that
+ the forthcoming V\b-s will be operating on 32-bit values.
+
+ In several virtual computed GO TOs the DO FORGET #1
+ (statement 15 in the earlier example) has been omitted,
+ since the next transfer of control would be a DO RESUME #1.
+ By making this a DO RESUME #2 instead, the FORGET may be
+ forgotten.
+
+ In statement 64, note that .2 is STASHed twice by a single
+ statement. This is perfectly legal.
+
+ Lastly, note in statements 243 and 214 respectively,
+ expressions for shifting 16- and 32-bit variables logically
+ one place to the left. Statement 231 demonstrates right-
+ shifting for 32-bit variables.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 25 -
+
+
+
+ _\b6_\b._\b3 _\bP_\br_\bo_\bg_\br_\ba_\bm _\bL_\bi_\bs_\bt_\bi_\bn_\bg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 26 -
+
+
+
+ 1 (1000) PLEASE IGNORE .4
+ 2 PLEASE ABSTAIN FROM (1005)
+ 3 (1009) DO STASH .1 + .2 + .5 + .6
+ 4 DO .4 <- #1
+ 5 DO (1004) NEXT
+ 6 (1004) PLEASE FORGET #1
+ 7 DO .3 <- 'V\b-.1c\b/.2'~'#0c\b/#65535'
+ 8 DO .6 <- '&.1c\b/.2'~'#0c\b/#65535'
+ 9 PLEASE DO .5 <- "V\b-!6~#32768'c\b/#1"~#3
+ 10 DO (1002) NEXT
+ 11 DO .4 <- #2
+ 12 (1005) DO (1006) NEXT
+ * 13 (1999) DOUBLE OR SINGLE PRECISION OVERFLOW
+ 14 (1002) DO (1001) NEXT
+ 15 (1006) PLEASE FORGET #1
+ 16 DO .5 <- 'V\b-"!6~.6'~#1"c\b/#1'~#3
+ 17 DO (1003) NEXT
+ 18 DO .1 <- .3
+ 19 DO .2 <- !6c\b/#0'~'#32767c\b/#1'
+ 20 DO (1004) NEXT
+ 21 (1003) DO (1001) NEXT
+ 22 DO REINSTATE (1005)
+ 23 (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6
+ 24 DO REMEMBER .4
+ 25 PLEASE RESUME #2
+ 26 (1001) DO RESUME .5
+ 27 (1010) DO STASH .1 + .2 + .4
+ 28 DO .4 <- .1
+ 29 DO .1 <- 'V\b-.2c\b/#65535'~'#0c\b/#65535'
+ 30 DO (1020) NEXT
+ 31 PLEASE DO .2 <- .4
+ 32 PLEASE DO (1009) NEXT
+ 33 DO RETRIEVE .1 + .2 + .4
+ 34 PLEASE RESUME #1
+ 35 (1020) DO STASH .2 + .3
+ 36 DO .2 <- #1
+ 37 PLEASE DO (1021) NEXT
+ 38 (1021) DO FORGET #1
+ 39 DO .3 <- "V\b-!1~.2'c\b/#1"~#3
+ 40 PLEASE DO .1 <- 'V\b-.1c\b/.2'~'#0c\b/#65535'
+ 41 DO (1022) NEXT
+ 42 DO .2 <- !2c\b/#0'~'#32767c\b/#1'
+ 43 DO (1021) NEXT
+ 44 (1023) PLEASE RESUME .3
+ 45 (1022) DO (1023) NEXT
+ 46 PLEASE RETRIEVE .2 + .3
+ 47 PLEASE RESUME #2
+ 48 (1030) DO ABSTAIN FROM (1033)
+ 49 PLEASE ABSTAIN FROM (1032)
+ 50 (1039) DO STASH :1 + .5
+ 51 DO (1530) NEXT
+ 52 DO .3 <- :1~#65535
+ 53 PLEASE DO .5 <- :1~'#65280c\b/#65280'
+ 54 DO .5 <- 'V\b-"!5~.5'~#1"c\b/#1'~#3
+
+
+
+
+
+
+
+
+ - 27 -
+
+
+
+ 55 DO (1031) NEXT
+ 56 (1032) DO (1033) NEXT
+ 57 DO (1999) NEXT
+ 58 (1031) DO (1001) NEXT
+ 59 (1033) DO .4 <- .5
+ 60 DO REINSTATE (1032)
+ 61 PLEASE REINSTATE (1033)
+ 62 DO RETRIEVE :1 + .5
+ 63 PLEASE RESUME #2
+ 64 (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3
+ 65 DO .2 <- #0
+ 66 DO (1520) NEXT
+ 67 DO STASH :1
+ 68 PLEASE RETRIEVE .2
+ 69 DO .1 <- .2
+ 70 DO .2 <- #0
+ 71 PLEASE DO (1520) NEXT
+ 72 DO :2 <- :1
+ 73 DO RETRIEVE .1 + .2 + :1
+ 74 DO (1550) NEXT
+ 75 PLEASE DO .3 <- :3
+ 76 DO RETRIEVE :1 + :2 + :3
+ 77 DO RESUME #1
+ 78 (1050) PLEASE STASH :2 + :3 + .5
+ 79 DO :2 <- .1
+ 80 PLEASE DO (1550) NEXT
+ 81 DO .5 <- :3~'#65280c\b/#65280'
+ 82 DO .5 <- 'V\b-"!5~.5'~#1"c\b/#1'~#3
+ 83 DO (1051) NEXT
+ 84 DO (1999) NEXT
+ 85 (1051) DO (1001) NEXT
+ 86 DO .2 <- :3
+ 87 PLEASE RETRIEVE :2 + :3 + .5
+ 88 DO RESUME #2
+ 89 (1500) PLEASE ABSTAIN FROM (1502)
+ 90 PLEASE ABSTAIN FROM (1506)
+ 91 (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6
+ 92 DO .1 <- :1~#65535
+ 93 PLEASE DO .2 <- :2~#65535
+ 94 DO (1009) NEXT
+ 95 DO .5 <- .3
+ 96 PLEASE DO .6 <- .4
+ 97 DO .1 <- :1~'#65280c\b/#65280'
+ 98 DO .2 <- :2~'#65280c\b/#65280'
+ 99 DO (1009) NEXT
+ 100 DO .1 <- .3
+ 101 PLEASE DO (1503) NEXT
+ 102 DO .6 <- .4
+ 103 DO .2 <- #1
+ 104 DO (1009) NEXT
+ 105 DO .1 <- .3
+ 106 DO (1501) NEXT
+ 107 (1504) PLEASE RESUME .6
+ 108 (1503) DO (1504) NEXT
+
+
+
+
+
+
+
+
+ - 28 -
+
+
+
+ 109 (1501) DO .2 <- .5
+ 110 DO .5 <- 'V\b-"'&.6c\b/.4'~#1"c\b/#2'~#3
+ 111 DO (1505) NEXT
+ 112 (1506) DO (1502) NEXT
+ 113 PLEASE DO (1999) NEXT
+ 114 (1505) DO (1001) NEXT
+ 115 (1502) DO :4 <- .5
+ 116 DO (1520) NEXT
+ 117 DO :3 <- :1
+ 118 PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6
+ 119 DO REINSTATE (1502)
+ 120 DO REINSTATE (1506)
+ 121 PLEASE RESUME #3
+ 122 (1510) DO STASH :1 + :2 + :4
+ 123 DO :1 <- "'V\b-":2~'#65535c\b/#0'"c\b/#65535'
+ ~'#0c\b/#65535'"c\b/"'V\b-":2~'#0c\b/#65535'
+ "c\b/#65535'~'#0c\b/#65535'"
+ 124 DO :2 <- #1
+ 125 DO (1509) NEXT
+ 126 PLEASE RETRIEVE :1
+ 127 DO :2 <- :3
+ 128 PLEASE DO (1509) NEXT
+ 129 DO RETRIEVE :2 + :4
+ 130 PLEASE RESUME #1
+ 131 (1520) PLEASE STASH .3 + .4
+ 132 DO .3 <- .1~#43690
+ 133 DO (1525) NEXT
+ 134 PLEASE DO .4 <- 'V.3c\b/".2~#43690"'~'#0c\b/#65535'
+ 135 DO .3 <- .1~#21845
+ 136 PLEASE DO (1525) NEXT
+ 137 DO :1 <- .4c\b/"'V.3c\b/".2~#21845"'~'#0c\b/#65535'"
+ 138 PLEASE RETRIEVE .3 + .4
+ 139 DO RESUME #1
+ 140 (1525) DO .3 <- '"'"'"!3c\b/#0'~'#32767c\b/#1'"c\b/#0'
+ ~'#32767c\b/#1'"c\b/#0'~'#16383c\b/#3'"c\b/#0'
+ ~'#4095c\b/#15'
+ 141 PLEASE RESUME #1
+ 142 (1530) DO STASH :2 + :3 + .3 + .5
+ 143 DO :1 <- #0
+ 144 DO :2 <- .2
+ 145 DO .3 <- #1
+ 146 DO (1535) NEXT
+ 147 (1535) PLEASE FORGET #1
+ 148 DO .5 <- "V\b-!1~.3'c\b/#1"~#3
+ 149 DO (1531) NEXT
+ 150 DO (1500) NEXT
+ 151 DO :1 <- :3
+ 152 PLEASE DO (1533) NEXT
+ 153 (1531) PLEASE DO (1001) NEXT
+ 154 (1533) DO FORGET #1
+ 155 DO .3 <- !3c\b/#0'~'#32767c\b/#1'
+ 156 DO :2 <- ":2~'#0c\b/#65535'"c\b/"'":2~'#32767
+ c\b/#0'"c\b/#0'~'#32767c\b/#1'"
+ 157 PLEASE DO .5 <- "V\b-!3~.3'c\b/#1"~#3
+
+
+
+
+
+
+
+
+ - 29 -
+
+
+
+ 158 DO (1532) NEXT
+ 159 DO (1535) NEXT
+ 160 (1532) DO (1001) NEXT
+ 161 PLEASE RETRIEVE :2 + :3 + .3 + .5
+ 162 DO RESUME #2
+ 163 (1540) PLEASE ABSTAIN FROM (1541)
+ 164 DO ABSTAIN FROM (1542)
+ 165 (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5
+ 166 DO .1 <- :1~#65535
+ 167 PLEASE DO .2 <- :2~'#65280c\b/#65280'
+ 168 DO .5 <- :1~'#65280c\b/#65280'
+ 169 DO (1530) NEXT
+ 170 DO :3 <- :1
+ 171 DO .2 <- :2~#65535
+ 172 PLEASE DO (1530) NEXT
+ 173 DO :5 <- :1
+ 174 DO .1 <- .5
+ 175 DO (1530) NEXT
+ 176 DO :4 <- :1
+ 177 PLEASE DO :1 <- ":3~'#65280c\b/#65280'"
+ c\b/":4~'#65280c\b/#65280'"
+ 178 DO .5 <- ':1~:1'~#1
+ 179 DO .2 <- :2~'#65280c\b/#65280'
+ 180 DO (1530) NEXT
+ 181 PLEASE DO .5 <- '"':1~:1'~#1"c\b/.5'~#3
+ 182 DO .1 <- :3~#65535
+ 183 DO .2 <- #0
+ 184 DO (1520) NEXT
+ 185 PLEASE DO :2 <- :1
+ 186 PLEASE DO .1 <- :4~#65535
+ 187 DO (1520) NEXT
+ 188 DO (1509) NEXT
+ 189 DO .5 <- !5c\b/":4~#3"'~#15
+ 190 DO :1 <- :3
+ 191 DO :2 <- :5
+ 192 DO (1509) NEXT
+ 193 PLEASE DO .5 <- !5c\b/":4~#3"'~#172
+ 194 DO .5 <- 'V\b-"!5~.5'~#1"c\b/#1'~#3
+ 195 PLEASE RETRIEVE :4
+ 196 (1541) DO :4 <- .5
+ 197 DO (1543) NEXT
+ 198 (1542) DO (1544) NEXT
+ 199 PLEASE DO (1999) NEXT
+ 200 (1543) DO (1001) NEXT
+ 201 (1544) DO REINSTATE (1541)
+ 202 PLEASE REINSTATE (1542)
+ 203 PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5
+ 204 DO RESUME #2
+ 205 (1550) DO STASH :1 + :4 + :5 + .5
+ 206 DO :3 <- #0
+ 207 DO .5 <- 'V\b-"':2~:2'~#1"c\b/#1'~#3
+ 208 PLEASE DO (1551) NEXT
+ 209 DO :4 <- #1
+ 210 PLEASE DO (1553) NEXT
+
+
+
+
+
+
+
+
+ - 30 -
+
+
+
+ 211 (1553) DO FORGET #1
+ 212 DO .5 <- 'V\b-":2~'#32768c\b/#0'"c\b/#2'~#3
+ 213 DO (1552) NEXT
+ 214 DO :2 <- ":2~'#0c\b/#65535'"c\b/"'":2~'#32767
+ c\b/#0'"c\b/#0'~'#32767c\b/#1'"
+ 215 PLEASE DO :4 <- ":4~'#0c\b/#65535'"c\b/"'":4
+ ~'#32767c\b/#0'"c\b/#0'~'#32767c\b/#1'"
+ 216 DO (1553) NEXT
+ 217 (1552) DO (1001) NEXT
+ 218 (1556) PLEASE FORGET #1
+ 219 DO :5 <- "'V\b-":1~'#65535c\b/#0'"c\b/":2
+ ~'#65535c\b/#0'"'~'#0c\b/#65535'"c\b/"'
+ V\b-":1~'#0c\b/#65535'"c\b/":2~'#0c\b/
+ #65535'"'~'#0c\b/#65535'"
+ 220 DO .5 <- 'V\b-"'&"':2~:5'~'"'V\b-"'V\b-":5~:5
+ "~"#65535c\b/#65535"'~'#65535c\b/#0'"c\b/
+ #32768'~'#0c\b/#65535'"c\b/"'V\b-":5~:5"
+ ~"#65535c\b/#65535"'~'#0c\b/#65535'"'"c\b/"'
+ :5~:5'~#1"'~#1"c\b/#2'~#3
+ 221 DO (1554) NEXT
+ 222 DO :5 <- :3
+ 223 DO (1510) NEXT
+ 224 PLEASE DO :1 <- :3
+ 225 DO :3 <- "'V":4~'#65535c\b/#0'"c\b/":5~'#65535
+ c\b/#0'"'~'#0c\b/#65535'"c\b/"'V":4~'#0
+ c\b/#65535'"c\b/":5~'#0c\b/#65535'"'~'#0
+ c\b/#65535'"
+ 226 DO (1555) NEXT
+ 227 (1554) PLEASE DO (1001) NEXT
+ 228 (1555) DO FORGET #1
+ 229 DO .5 <- "V\b-':4~#1'c\b/#2"~#3
+ 230 DO (1551) NEXT
+ 231 DO :2 <- ":2~'#0c\b/#65534'"c\b/":2~'#65535c\b/#0'"
+ 232 DO :4 <- ":4~'#0c\b/#65534'"c\b/":4~'#65535c\b/#0'"
+ 233 PLEASE DO (1556) NEXT
+ 234 (1551) DO (1001) NEXT
+ 235 PLEASE RETRIEVE :1 + :4 + :5 + .5
+ 236 PLEASE RESUME #2
+ 237 (1900) DO STASH .2 + .3 + .5
+ 238 DO .1 <- #0
+ 239 DO .2 <- #1
+ 240 PLEASE DO (1901) NEXT
+ 241 (1901) DO FORGET #1
+ 242 DO %50 .1 <- 'V.1c\b/.2'~'#0c\b/#65535'
+ 243 DO .2 <- !2c\b/#0'~'#32767c\b/#1'
+ 244 PLEASE DO .5 <- "V\b-!2~.2'c\b/#1"~#3
+ 245 DO (1902) NEXT
+ 246 DO (1901) NEXT
+ 247 (1902) DO (1001) NEXT
+ 248 DO RETRIEVE .2 + .3 + .5
+ 249 PLEASE RESUME #2
+ 250 (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3
+ 251 DO .3 <- #65524
+ 252 DO :1 <- #6
+
+
+
+
+
+
+
+
+ - 31 -
+
+
+
+ 253 DO (1911) NEXT
+ * 254 PLEASE NOTE THAT YOU CAN'T GET THERE FROM HERE
+ 255 (1912) DO (1001) NEXT
+ 256 (1911) DO FORGET #1
+ 257 PLEASE DO (1900) NEXT
+ 258 DO :2 <- .1
+ 259 DO (1500) NEXT
+ 260 PLEASE DO :1 <- :3
+ 261 DO .1 <- .3
+ 262 DO (1020) NEXT
+ 263 PLEASE DO .3 <- .1
+ 264 DO .5 <- 'V\b-"!3~.3'~#1"c\b/#2'~#3
+ 265 DO (1912) NEXT
+ 266 DO .1 <- #12
+ 267 PLEASE DO (1050) NEXT
+ 268 DO RETRIEVE .1
+ 269 DO (1530) NEXT
+ 270 DO :2 <- #32768
+ 271 DO (1500) NEXT
+ 272 PLEASE DO .2 <- :3~'#65280c\b/#65280'
+ 273 PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3
+ 274 DO RESUME #1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 32 -
+
+
+
+ _\b6_\b._\b4 _\bP_\br_\bo_\bg_\br_\ba_\bm_\bm_\bi_\bn_\bg _\bS_\bu_\bg_\bg_\be_\bs_\bt_\bi_\bo_\bn_\bs
+
+ For the novice INTERCAL programmer, we provide here a list
+ of suggested INTERCAL programming projects:
+
+ Write an integer exponentiation subroutine. :1 <- .1 raised
+ to the .2 power.
+
+ Write a double-precision sorting subroutine. Given 32-bit
+ array ;1 of size :1, sort the contents into numerically
+ increasing order, leaving the results in ;1.
+
+ Generate a table of prime numbers.
+
+ Put together a floating-point library, using 32-bit
+ variables to represent floating-point numbers (let the upper
+ half be the mantissa and the lower half be the
+ characteristic). The library should be capable of
+ performing floating-point addition, subtraction,
+ multiplication, and division, as well as the natural
+ logarithm function.
+
+ Program a Fast Fourier Transform (FFT). This project would
+ probably entail the writing of the floating-point library as
+ well as sine and cosine functions.
+
+ Calculate, to :1 places, the value of pi.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 33 -
+
+
+
+ _\b7_\b. _\bE_\bR_\bR_\bO_\bR _\bM_\bE_\bS_\bS_\bA_\bG_\bE_\bS
+
+ Due to INTERCAL's implementation of comment lines (see
+ section 4.5), most error messages are produced during
+ execution instead of during compilation. All errors except
+ those not causing immediate termination of program execution
+ are treated as fatal.
+
+ _\b7_\b._\b1 _\bF_\bo_\br_\bm_\ba_\bt
+
+ All error messages appear in the following form:
+
+ ICLnnnI (error message)
+ ON THE WAY TO STATEMENT nnnn
+ CORRECT SOURCE AND RESUBMIT
+
+ The message varies depending upon the error involved. For
+ undecodable statements the message is the statement itself.
+ The second line tells which statement would have been
+ executed next had the error not occurred. Note that if the
+ error is due to 80 attempted levels of NEXTing, the
+ statement which would have been executed next need not be
+ anywhere near the statement causing the error.
+
+ _\b7_\b._\b2 _\bM_\be_\bs_\bs_\ba_\bg_\be_\bs
+
+ Brief descriptions of the different error types are listed
+ below according to message number.
+
+ 000 An undecodable statement has been encountered in the
+ course of execution. Note that keypunching errors can
+ be slightly disastrous, since if 'FORGET' were
+ misspelled F-O-R-G-E-R, the results would probably not
+ be those desired. Extreme misspellings may have even
+ more surprising consequences. For example, misspelling
+ 'FORGET' R-E-S-U-M-E could have drastic results.
+
+ 017 An expression contains a syntax error.
+
+ 079 Improper use has been made of statement identifiers.
+
+ 099 Improper use has been made of statement identifiers.
+
+ 123 Program has attempted 80 levels of NEXTing.
+
+ 129 Program has attempted to transfer to a non-existent
+ line label.
+
+ 139 An ABSTAIN or REINSTATE statement references a non-
+ existent line label.
+
+ 182 A line label has been multiply defined.
+
+
+
+
+
+
+
+
+
+
+ - 34 -
+
+
+
+ 197 An invalid line label has been encountered.
+
+ 200 An expression involves an unidentified variable.
+
+ 240 An attempt has been made to give an array a dimension
+ of zero.
+
+ 241 Invalid dimensioning information was supplied in
+ defining or using an array.
+
+ 275 A 32-bit value has been assigned to a 16-bit variable.
+
+ 436 A retrieval has been attempted for an unSTASHed value.
+
+ 533 A WRITE IN statement or interleave (c\b/) operation has
+ produced a value requiring over 32 bits to represent.
+
+ 562 Insufficient data.
+
+ 579 Input data is invalid.
+
+ 621 The expression of a RESUME statement evaluated to #0.
+
+ 632 Program execution was terminated via a RESUME statement
+ instead of GIVE UP.
+
+ 633 Execution has passed beyond the last statement of the
+ program.
+
+ 774 A compiler error has occurred (see section ).
+
+ 778 An unexplainable compiler error has occurred (see J.
+ Lyon or D. Woods).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 35 -
+
+
+
+ _\b8_\b. _\bJ_\bC_\bL
+
+ The information contained in the following section applies
+ only to the Princeton compiler, run under OS/360.
+
+ _\b8_\b._\b1 _\bT_\bh_\be _\bP_\br_\bi_\bn_\bc_\be_\bt_\bo_\bn _\bC_\bo_\bm_\bp_\bi_\bl_\be_\br
+
+ The Princeton compiler, written in SPITBOL (a variant of
+ SNOBOL), performs the compilation in two stages. First the
+ INTERCAL source is converted into SPITBOL source, then the
+ latter is compiled and executed.
+
+ It should be noted that the Princeton compiler fails to
+ properly interpret certain multiply-subscripted expressions,
+ such as:
+
+ ",1SUB",2SUB#1"#2"
+
+
+ This is not a "bug". Being documented, it is merely a
+ "restriction". Such cases may be resolved by alternating
+ sparks and ears in various levels of expression nesting:
+
+ ",1SUB',2SUB#1'#2"
+
+ which is advisable in any case, since INTERCAL expressions
+ are unreadable enough as is.
+
+ Since there is currently no catalogued procedure for
+ invoking the compiler, the user must include the in-line
+ procedure shown in Figure 3 in his job before the
+ compilation step. Copies of this in-line procedure may be
+ obtained at any keypunch if the proper keys are struck.
+
+ The compiler is then executed in the usual manner:
+
+
+ // EXEC INTERCAL[,PARM='parameters']
+ //COMPILE.SYSIN DD *
+ {INTERCAL source deck}
+ /*
+ //EXECUTE.SYSWRITE DD *
+ {input data}
+ /*
+
+
+ The various parameters are described following the in-line
+ procedure. At most one parameter from each set may apply to
+ a given compilation; if more than one are specified, the
+ results are undefined, and may vary depending upon the
+ particular set of options. The default parameters are
+ underlined.
+
+
+
+
+
+
+
+
+
+
+ - 36 -
+
+
+
+ //INTERCAL PROC
+ //COMPILE EXEC PGM=INTERCAL
+ //STEPLIB DD DSN=U.INTERCAL.LIBRARY,DISP=SHR
+ // DD DSN=SYS1.FORTLIB,DISP=SHR
+ //SYSPRINT DD SYSOUT=A,DCB=(BLKSIZE=992,LRECL=137,RECFM=VBA)
+ //SYSPUNCH DD DUMMY
+ //SCRATCH DD DSN=&COMPSET,UNIT=SYSDA,SPACE=(CYL,(3,1)),DISP=(,PASS)
+ //EXECUTE EXEC PGM=EXECUTE,COND=(4,LT)
+ //SOURCES DD DSN=U.INTERCAL.SOURCES,DISP=SHR 4
+ //STEPLIB DD DSN=U.INTERCAL.LIBRARY,DISP=SHR
+ // DD DSN=SYS5.SPITLIB,DISP=SHR
+ // DD DSN=SYS1.FORTLIB,DISP=SHR
+ //SYSIN DD DSN=&COMPSET,DISP=(OLD,DELETE)
+ //SYSOBJ DD SYSOUT=B,DCB=(BLKSIZE=80,LRECL=80,RECFM=F)
+ //SYSPRINT DD SYSOUT=A,DCB=(BLKSIZE=992,LRECL=137,RECFM=VBA)
+ //SYSPUNCH DD DUMMY
+ // PEND
+
+ Figure 3. Inline procedure for using INTERCAL.
+
+ _\bO_\bP_\bT
+ NOOPT
+ In the default mode, the compiler will print a list of
+ all options in effect, including the defaults for
+ unspecified parameter groups and the effective option
+ for those sets where one was specified. If NOOPT is
+ requested, it causes the default mode to be assumed.
+
+ _\bO_\bP_\bT_\bS_\bU_\bB
+ NOOPTSUB
+ NOSUB
+ Unless 'NOOPTSUB' is requested, the System Library is
+ optimized, resulting in much more rapid processing of
+ function calls. Specifying NOOPTSUB causes the non-
+ optimized INTERCAL code shown in section
+ to be used, whereas NOSUB requests that the System
+ Library be omitted altogether.
+
+ IAMBIC
+ _\bP_\bR_\bO_\bS_\bE
+ The IAMBIC parameter permits the programmer to use
+ poetic license and thus write in verse. If the reader
+ does not believe it possible to write verse in
+
+ ____________________
+
+ 4. Pending acquisition of SPITBOL release 3.0, the SOURCES
+ DD card must be replaced by the five cards:
+
+ //NOOPTPFX DD DSN=U.INTERCAL.SOURCES(NOOPTPFX),DISP=SHR
+ //NOOPTSUB DD DSN=U.INTERCAL.SOURCES(NOOPTSUB),DISP=SHR
+ //OPTPFX DD DSN=U.INTERCAL.SOURCES(OPTPFX),DISP=SHR
+ //OPTSUB DD DSN=U.INTERCAL.SOURCES(OPTSUB),DISP=SHR
+ //PRELIM DD DSN=U.INTERCAL.SOURCES(PRELIM),DISP=SHR
+
+
+
+
+
+
+
+
+ - 37 -
+
+
+
+ INTERCAL, he should send the authors a stamped, self-
+ addressed envelope, along with any INTERCAL program,
+ and they will provide one which is verse.
+
+ _\bF_\bO_\bR_\bM_\bA_\bT
+ NOFORMAT
+ In FORMAT mode, each statement printed is put on a
+ separate line (or lines). In NOFORMAT mode, the free-
+ format source is printed exactly as input. In this
+ latter case, statement numbers are provided only for
+ the first statement on a card, and they may be only
+ approximate. Also, unrecognizable statements are not
+ flagged.
+
+ SEQ
+ _\bN_\bO_\bS_\bE_\bQ
+ If the source deck has sequence numbers in columns 73
+ through 80, specifying 'SEQ' will cause them to be
+ ignored.
+
+ SOURCE
+ _\bN_\bO_\bS_\bO_\bU_\bR_\bC_\bE
+ If NOSOURCE is selected, all source listing is
+ suppressed.
+
+ LIST
+ _\bN_\bO_\bL_\bI_\bS_\bT
+ If LIST is specified, the compiler will provide a list
+ of statement numbers catalogued according to type of
+ statement. The compiler uses this table to perform
+ abstentions by gerund.
+
+ WIDTH=nn
+ This sets the width (in number of characters) of the
+ output line for FORMAT mode output. The default is 1\b13\b32\b2.\b.
+
+ CODE
+ _\bN_\bO_\bC_\bO_\bD_\bE
+ Include 'CODE' in the parameter list to obtain a
+ listing of the SPITBOL code produced for each INTERCAL
+ statement.
+
+ LINES=nn
+ This determines the number of lines per page, during
+ both compilation and execution. The default is 6\b60\b0.\b.
+
+ DECK
+ _\bN_\bO_\bD_\bE_\bC_\bK
+ Selecting 'DECK' will cause the compiler to punch out a
+ SPITBOL object deck which may then be run without
+ reinvoking the INTERCAL (or SPITBOL) compiler.
+
+ _\bK_\bI_\bD_\bD_\bI_\bN_\bG
+
+
+
+
+
+
+
+
+
+ - 38 -
+
+
+
+ NOKIDDING
+ Select NOKIDDING to eliminate the snide remarks which
+ ordinarily accompany INTERCAL error messages.
+
+ _\bG_\bO
+ NOGO
+ Specifying 'NOGO' will cause the program to be
+ compiled but not executed. EXECUTE/NOEXECUTE may be
+ substituted for GO/NOGO, but this will result in an
+ error, and GO will be assumed.
+
+ _\bB_\bU_\bG
+ NOBUG
+ Under the default, there is a fixed probability of a
+ fatal compiler bug being worked at random into the
+ program being compiled. Encountering this bug during
+ execution results in error message 774 (see section ).
+ This probability is reduced to zero under 'NOBUG'. This
+ does not affect the probability (presumably negligible)
+ of error message 778.
+
+ _\b8_\b._\b2 _\bO_\bt_\bh_\be_\br _\bI_\bN_\bT_\bE_\bR_\bC_\bA_\bL _\bC_\bo_\bm_\bp_\bi_\bl_\be_\br_\bs
+
+ There are no other INTERCAL compilers. 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ____________________
+
+ 5. This assertion in the INTERCAL-72 manual was blatantly
+ contradicted by some notes on an Atari implementation
+ included at the end of the manual. So, you expect
+ compiler manuals to be consistent?
+
+
+
+
+
+
+
+ - 39 -
+
+
+
+ T\bTO\bON\bNS\bSI\bIL\bL A\bA6\b6
+
+
+
+
+
+
+
+ The Official INTERCAL Character Set
+
+ Tabulated on page 39 are all the characters used in
+ INTERCAL, excepting letters and digits, along with their
+ names and interpretations. Also included are several
+ characters not used in INTERCAL, which are presented for
+ completeness and to allow for future expansion.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ____________________
+
+ 6. Since all other reference manuals have Appendices, it was
+ decided that the INTERCAL manual should contain some
+ other type of removable organ.
+
+ 7. This footnote intentionally unreferenced.
+
+
+
+
+
+
+
+ - 40 -
+
+
+
+ +--------------------------------------------------------------------------+
+ |Character Name Use (if any) |
+ |. spot identify 16-bit variable |
+ |: two-spot identify 32-bit variable |
+ |, tail identify 16-bit array |
+ |; hybrid identify 32-bit array |
+ |# mesh identify constant |
+ |= half-mesh |
+ |' spark grouper |
+ |` backspark |
+ |! wow equivalent to spark-spot |
+ |? what _\bu_\bn_\ba_\br_\by _\be_\bx_\bl_\bu_\bs_\bi_\bv_\be _\bO_\bR _\b(_\bA_\bS_\bC_\bI_\bI_\b) |
+ |" rabbit-ears grouper |
+ |"\b. rabbit equivalent to ears-spot |
+ || spike |
+ |% double-oh-seven percentage qualifier |
+ |- worm used with angles |
+ |< angle used with worms |
+ |> right angle |
+ |( wax precedes line label |
+ |) wane follows line label |
+ |[ U turn |
+ |] U turn back |
+ |{ embrace |
+ |} bracelet |
+ |* splat flags invalid statements |
+ |& ampersand 9 unary logical AND |
+ |V V (or book) unary logical OR |
+ |V\b- bookworm (or universal qualifier) unary exclusive OR |
+ |$ big money _\bb_\bi_\bn_\ba_\br_\by _\bm_\bi_\bn_\bg_\bl_\be _\b(_\bA_\bS_\bC_\bI_\bI_\b) |
+ |c\b/ change binary mingle |
+ |~ sqiggle binary select |
+ |_ flat worm |
+ |- overline indicates "times 1000" |
+ |+ intersection separates list items |
+ |/ slat |
+ |\ backslat |
+ |@ whirlpool |
+ |-\b' hookworm |
+ |^ shark (or simply sharkfin) |
+ |#\b*\b[] blotch |
+ +--------------------------------------------------------------------------+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - 41 -
+
+
+ | |
+ +--------------------------------------------------------------------------+
+ |C\b.haracter spot Name identiU\bfs\bye |
+ |\b(\b1i\b6\b:f\b-ba\bin\bty)\bvariabl\bte\bwo-spot identify |
+ |\b32\b,-bit variabl\bte\bail identify |
+ |\b16\b;-bit array hybrid identify |
+ |\b32\b#-bit array mesh identify |
+ |\bco\b=\b'\b`\b!nstant h\bs\bb\bwa\bp\ba\bol\ba\bc\bwf\br\bk-\bk\bsm\bpe\bas\brh\bk g\ber\bqo\buu\bip\bve\bar\blent |
+ |\bto\b? spark-spotwhat unary |
+ |\blo\b"\b"\b.gical XOR r\bra\bab\bbb\bbi\bit\bt-ears g\ber\bqo\buu\bip\bve\bar\blent |
+ |\bto\b|\b% ears-spot s\bdp\boi\buk\bbe\ble-oh-seven percentage |
+ |\bqu\b-alifier worm used with |
+ |\ban\b<gles angle used with |
+ |\bwo\b>\b(rms r\bwi\bag\bxht angle precedes |
+ |\bli\b)ne label wane follows |
+ |\bli\b[\b]\b{\b}\b*ne label U\bU\be\bb\bsm\br\bpt\bt\bb\ba\blu\bu\br\bc\bar\br\ba\be\btn\bn\bc\ble\beb\btack flags |
+ |\bin\b&valid statem\bae\bmn\bpt\bes\brsand 10 unary |
+ |\blo\bVgical AND V (or book) unary |
+ |\blo\bV\b-gical OR bookworm (universal qualifier) unary |
+ |\blo\b$gical XOR (I\bbN\biT\bgERCA\bmL\bo-\bn7\be2\by) binary |
+ |\bmi\bc\b/ngle change binary |
+ |\bmi\b~ngle (INTERC\bsA\bqL\bi-\bg7\bg2\bl)\be binary |
+ |\bse\b_\b-lect f\bol\bva\bet\brlw\bio\bnr\bem indicates |
+ |\b"t\b+imes 1000" intersection separates |
+ |\bli\b/\b\\b@st items s\bb\bwl\ba\bha\bc\bit\bk\brs\bll\bpa\bot\bol unary |
+ |\blo\b-\b'\b^gical BUT (T\bh\bsr\bo\bhi\bo\baI\bk\brN\bw\bkT\boE\brR\bmC\b(A\boL\br) simply sharkfin) unary |
+ +\bl-\bo\b#\b*\b[-\bg\b]-\bi-\bc-\ba-\bl--\bX\bT-\bO\ba-\bR\bb-\bl-\b(\be-\bT\bb-\br\bl\b2-\bi\bo-\bI\bt\b(-\bN\bc\bt-\bT\bh\bo-\bE\bp-\bR-\bC\bv-\bA\bi-\bL\be-\b)\bw-\b)-\b.--\bI-\bN-\bT-\bE-\bR-\bC-\bA-\bL--\bc-\bh-\ba-\br-\ba-\bc-\bt-\be-\br--\bs-\be-\bt-\b.------------------------+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ____________________
+
+ 10.Got any better ideas?
+
+
+
+
+
+
+
+ - 42 -
+
+
+
+ T\bTO\bON\bNS\bSI\bIL\bL B\bB
+
+
+ N\bNO\bOT\bTE\bES\bS O\bON\bN T\bTH\bHE\bE A\bAT\bTA\bAR\bRI\bI I\bIM\bMP\bPL\bLE\bEM\bME\bEN\bNT\bTA\bAT\bTI\bIO\bON\bN
+
+
+
+
+ The Atari implementation of INTERCAL differs from the
+ original Princeton version primarily in the use of ASCII
+ rather than EBCDIC. Since there is no "change" sign (c\b/) in
+ ASCII, we have substituted the "big money" ($) as the mingle
+ operator. We feel that this correctly represents the
+ increasing cost of software in relation to hardware.
+ (Consider that in 1970 one could get RUNOFF for free, to run
+ on a $20K machine, whereas today a not quite as powerful
+ formatter costs $99 and runs on a $75 machine.) We also feel
+ that there should be no defensible contention that INTERCAL
+ has any sense. Also, since overpunches are difficult to
+ read on the average VDT, the exclusive-or operator may be
+ written ?. This correctly expresses the average person's
+ reaction on first encountering exclusive-or, especially on a
+ PDP-11. Note that in both of these cases, the over-punched
+ symbol may also be used if one is masochistic, or concerned
+ with portability to the Princeton compiler. The correct
+ over-punch for "change" is "c<backspace>/" and the correct
+ over-punch for V\b- is "V<backspace>-". These codes will be
+ properly printed if you have a proper printer, and the
+ corresponding EBCDIC code will be produced by the /IBM
+ option on the LIST command.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+#! /bin/sh
+[ -d ./src ] && cd src
+cd ../src
+echo '-*- compilation -*-' > ../splinttest.out
+splint -bugslimit 99 -redef -usevarargs +boolint +posixlib +voidabstract -I ../include -I ../temp `ls -1 *.c *.h | egrep -v 'wrap|pick|ick_ec'` >> ../splinttest.out
--- /dev/null
+/* abcess.h -- functions used by compiled INTERCAL programs */
+
+/* AIS note: This header file now serves two purposes. For non-multithread
+ programs, it serves as headers to the degenerated code and many support
+ functions. For multithread programs, this header file adds extra functions
+ only when compiling the degenerated code and unravel.c, and holds its
+ previous contents during other files. */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <setjmp.h>
+
+#ifndef ICKBOOL_DEFINED
+/*@-redef@*/
+typedef int ick_bool;
+/*@=redef@*/
+#define ICKBOOL_DEFINED
+#endif
+
+#define ick_TRUE 1
+#define ick_FALSE 0
+
+#define ick_ONESPOT 0
+#define ick_TWOSPOT 1
+#define ick_TAIL 2
+#define ick_HYBRID 3
+
+#define ick_MAXNEXT 80 /* AIS: Moved from cesspool.c */
+
+/* the following two types must both promote to unsigned int in expressions */
+
+typedef unsigned short ick_type16;
+typedef unsigned int ick_type32;
+
+typedef struct ick_array_t
+{
+ unsigned int rank;
+ size_t *dims;
+ union
+ {
+ ick_type16 *tail;
+ ick_type32 *hybrid;
+ } data;
+} ick_array;
+
+
+/* AIS: For operand overloading, a more complicated data type is needed. */
+typedef struct ick_overop_t
+{
+ ick_type32 (*get)(ick_type32);
+ void (*set)(ick_type32, void(*)());
+} ick_overop;
+
+/* AIS: Moved from cesspool.c */
+typedef struct ick_stashbox_t /* this is a save-stack element */
+{
+ unsigned int type; /* variable type */
+ unsigned int index; /* variable's index within the type */
+ union /* the data itself */
+ {
+ ick_type16 onespot;
+ ick_type32 twospot;
+ ick_array *a;
+ } save;
+ /*@null@*/ /*@dependent@*/ struct ick_stashbox_t *ick_next; /* pointer to next-older ick_stashbox */
+ ick_overop overloadinfo; /* AIS: overloading info is stashed too, in a
+ non-overloaded program (ignored otherwise) */
+} ick_stashbox;
+
+/* AIS: files to take input and output from */
+/*@null@*/ extern FILE* ick_cesspoolin;
+/*@null@*/ extern FILE* ick_cesspoolout;
+
+/* defined in cesspool.c */
+extern void ick_pushnext(unsigned n);
+extern unsigned int ick_popnext(unsigned n);
+extern unsigned int ick_resume(unsigned n);
+extern unsigned int ick_pin(void);
+extern void ick_clockface(ick_bool mode);
+extern void ick_setclcsemantics(ick_bool mode); /* AIS */
+extern void ick_pout(unsigned int val);
+extern void ick_binin(unsigned int type, ick_array *a, ick_bool forget);
+extern void ick_binout(unsigned int type, ick_array *a);
+extern unsigned int ick_assign(char *dest, unsigned int type, ick_bool forget,
+ unsigned int value);
+
+/* AIS: yuk, unravel and ick_ec need these */
+extern unsigned* ick_next;
+/*@null@*/ extern jmp_buf* ick_next_jmpbufs;
+extern int ick_nextindex;
+extern /*@null@*/ ick_stashbox *ick_first;
+
+/* AIS: Implement the +ick_mystery command line option. */
+extern unsigned long ick_mysteryc;
+extern int ick_mystery;
+#define ick_MYSTERYLINE if(ick_mystery && ick_mysteryc++ > 4000000000LU) exit(42);
+
+/* AIS: More command-line options */
+extern int ick_wimp_mode;
+
+/* AIS: Handle multiple COME FROMs aiming at the same line */
+extern int ick_multicome0(int errlineno, jmp_buf pc);
+
+#ifdef _POSIX_SOURCE
+/*@dependent@*/ extern void *ick_aref(unsigned int type, ...);
+extern void ick_resize(unsigned int type, ...);
+#else
+/*@dependent@*/ extern void *ick_aref();
+extern void ick_resize();
+#endif
+
+extern void ick_stashinit(void);
+/* AIS: Added mentions of oo. This is set to 0 in a non-overloaded program. */
+extern void ick_stash(unsigned int type, unsigned int index, void *from, ick_overop* oo);
+extern void ick_retrieve(void *to, unsigned int type, unsigned int index,
+ ick_bool forget, ick_overop* oo);
+extern unsigned int ick_roll(unsigned int n);
+
+/* defined in arrgghh.c */
+extern void ick_parseargs(int argc, char **argv);
+extern int ick_printflow;
+
+/* AIS: Multithreading types and defines */
+#if MULTITHREAD != 0
+typedef struct tag_ickthread ickthread;
+/*@refcounted@*/ struct tag_ickthread
+{
+ void* varforget[10]; /* holds all four variable types, and forgetting data */
+ unsigned* nextstack;
+ int nextpointer;
+ jmp_buf pc; /* program counter */
+ ick_stashbox* sb; /* holds all stash data */
+ /*@partial@*/ /*@dependent@*/ ickthread* ick_next;
+ /*@null@*/ /*@partial@*/ /*@dependent@*/ ickthread* choicepoint;
+ /* the top choicepoint available. Used as a next pointer in the choicepoint
+ stack. */
+ int stale; /* if this is a choicepoint, whether it's a stale choicepoint. */
+ int refcount; /* when Threaded INTERCAL and Backtracking INTERCAL are
+ combined, reference-counting on choicepoints is needed
+ so that backtracking past multithreading is possible.
+ This also allows for garbage-collection of choicepoints.
+ (Luckily, choicepoints cannot refer to themselves, so this
+ mechanism works.) This only applies to ickthreads that are
+ acting as choicepoints, not those acting as threads. */
+ int ick_ccfc; /* number of comefroms currently active */
+ unsigned ick_skipto; /* compucome line number */
+ jmp_buf ick_cjb; /* keeps track of compucomes */
+ /*@partial@*/ /*@dependent@*/ ickthread* dsi; /* which thread's varforget and sb to use */
+ /*@null@*/ /*@dependent@*/ ickthread* usesthis; /* for garbage collection purposes */
+};
+/*@partial@*/ /*@dependent@*/ extern ickthread* ickmt_cur; /* current thread */
+/*@partial@*/ /*@dependent@*/ extern ickthread*ickmt_prev; /* previous thread: an optimisation to make
+ thread switching O(1), not O(n), with
+ respect to the number of threads */
+extern int weaving; /* whether to weave newly created threads */
+#define NEXTTHREAD if(ick_printflow) printf("[%d:%lx]",ick_lineno,(unsigned long)\
+ ickmt_cur); \
+ if(setjmp(ick_cjb) == 0) \
+ nextthread(ick_cjb, ick_lineno, 3);
+
+extern void nextthread(jmp_buf pc, int errlineno, int flags);
+extern void killthread(void);
+extern void ickmtinit(void);
+extern int multicome1(int errlineno, jmp_buf pc);
+extern void choicepoint(void);
+extern void choiceahead(void);
+extern void choiceback(void);
+
+/* from ick-wrap.c, declare as extern so they can be accessed by cesspool.c,
+ unravel.c */
+extern int onespotcount;
+extern int twospotcount;
+extern int tailcount;
+extern int hybridcount;
+
+extern int ick_oldabstain;
+extern int gonebackto;
+extern int ick_ccfc;
+extern unsigned ick_skipto;
+extern jmp_buf btjb;
+extern jmp_buf ick_cjb;
+
+#define MULTICOME multicome1
+#else
+#define MULTICOME ick_multicome0
+#endif /* MULTITHREAD */
+
+/* AIS: Used by the debugger, multithread code */
+#if (MULTITHREAD != 0) || (YUKDEBUG != 0)
+extern ick_type16* ick_onespots;
+extern ick_bool* ick_oneforget;
+extern ick_type32* ick_twospots;
+extern ick_bool* ick_twoforget;
+extern ick_array* ick_tails;
+extern ick_bool* ick_tailforget;
+extern ick_array* ick_hybrids;
+extern ick_bool* ick_hyforget;
+#if (MULTITHREAD != 0)
+/*@null@*/ extern ick_overop* ick_oo_onespots;
+/*@null@*/ extern ick_overop* ick_oo_twospots;
+#endif
+#endif
+
+/* abcess.h ends here */
--- /dev/null
+/* fiddle.h -- functions implementing intercal's operators */
+
+/*@-exportlocal@*/ /* these are used, just in generated code */
+extern unsigned int ick_mingle(register unsigned int r, register unsigned int s);
+extern unsigned int ick_iselect(register unsigned int r, register unsigned int s);
+extern unsigned int ick_and16(unsigned int n), ick_or16(unsigned int n),
+ ick_xor16(unsigned int n), ick_fin16(unsigned int n);
+extern unsigned int ick_whirl16(unsigned int p, unsigned int n);
+extern unsigned int ick_and32(unsigned int n), ick_or32(unsigned int n),
+ ick_xor32(unsigned int n), ick_fin32(unsigned int n);
+extern unsigned int ick_whirl32(unsigned int p, unsigned int n);
+/* AIS: Reversed operators */
+extern unsigned int ick_rev_and16(unsigned int n), ick_rev_or16(unsigned int n),
+ ick_rev_xor16(unsigned int n), ick_rev_fin16(unsigned int n);
+extern unsigned int ick_rev_whirl16(unsigned int p, unsigned int n);
+extern unsigned int ick_rev_and32(unsigned int n), ick_rev_or32(unsigned int n),
+ ick_rev_xor32(unsigned int n), ick_rev_fin32(unsigned int n);
+extern unsigned int ick_rev_whirl32(unsigned int p, unsigned int n);
+/* AIS: Optimizer helper operators */
+extern unsigned int ick_xselx(unsigned int x);
+extern unsigned int ick_setbitcount(unsigned int x);
+extern unsigned int ick_smudgeleft(unsigned int x);
+extern unsigned int ick_smudgeright(unsigned int x);
+/*@=exportlocal@*/
+/* fiddle.h ends here */
--- /dev/null
+/*****************************************************************************
+
+NAME
+ ick_ec.h -- external call support between C and C-INTERCAL
+
+LICENSE TERMS
+ Copyright (C) 2008 Alex Smith
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+***************************************************************************/
+
+/* The external calls to C work via ICK_EC_FUNCs; whenever a suckpoint is
+ encountered, all ICK_EC_FUNCs are run with ick_global_checkmode set to 1,
+ and when a NEXT is called but finds no target in the INTERCAL program, all
+ ICK_EC_FUNCs are run with ick_global_checkmode set to 2. COME FROMs and
+ NEXT FROMs don't steal control immediately (they know where to steal
+ control from using ick_global_linelabel), but instead set ick_global_goto
+ to a 'high' line label (one of the internal ones above 65536 which are
+ allocated for this sort of purpose, and inside the preprocessor) or error
+ if it's set nonzero already. After verifying that exactly one COME or NEXT
+ FROM is involved, the INTERCAL program will NEXT to the high line label
+ (whether it leaves a NEXT stack entry will depend on whether COME FROM or
+ NEXT FROM was used, which is communicated by a NEXT FROM setting the
+ checkmode to 3, which is identical to 1 in all other respects).
+
+ To prevent this process running the program out of stack space (which would
+ happen with a naive implementation if there were many COME FROMs from
+ inside the C program back to inside the C program), ick_checksuckpoint will
+ longjmp back to a previous incarnation of itself if doing so eliminates no
+ NEXT stack entries. This trick doesn't work with FORGET, though; instead
+ the stray C stack entries are eliminated at the next RESUME past them;
+ also, all but one of the entries can be eliminated at each line label if
+ there are more than one of them.
+*/
+
+#define ICK_EC_FUNC_START(id) \
+ICK_EC_PP_0(id) \
+void id(void) \
+{ \
+ void* ick_local_rv = 0; \
+ int ick_local_checkmode = ick_global_checkmode; \
+ jmp_buf ick_local_jmpbuf; \
+ setjmp(ick_local_jmpbuf); \
+ if(ick_global_checkmode==2) \
+ { \
+ goto ick_l2_ICK_EC_PP_2; \
+ } \
+ else if(ick_global_checkmode==1 || \
+ ick_global_checkmode==3) \
+ { \
+ goto ick_l1_ICK_EC_PP_1; \
+ } \
+ else
+
+#define ick_linelabel(expr) ick_labeledblock(expr,0)
+
+#define ick_labeledblock(expr,block) \
+ do { \
+ if(ick_forgetamount > 1) \
+ { \
+ ick_global_stackcleanup=1; \
+ ick_donext(expr,-1,1); \
+ } \
+ if(0) \
+ { \
+ ick_l2_ICK_EC_PP_2: ; \
+ if(ick_global_linelabel != (expr) || (expr) > 65535) \
+ goto ick_l2_ICK_EC_PP_2; \
+ ick_global_checkmode = 0; \
+ if(ick_global_stackcleanup) \
+ ick_forget(1); \
+ ick_global_stackcleanup = 0; \
+ } \
+ block ; \
+ ick_checksuckpoint(expr); \
+ } \
+ while(0)
+
+#define ick_comefrom(expr) \
+ if(0) \
+ { \
+ ick_l1_ICK_EC_PP_1: ; \
+ if(ick_global_linelabel == (expr) && (expr) <= 65535) \
+ { \
+ if(ick_global_goto) ick_multicome0(-1,ick_local_jmpbuf); \
+ ick_global_goto = ICK_EC_PP_3; \
+ } \
+ goto ick_l1_ICK_EC_PP_1; \
+ ick_l2_ICK_EC_PP_2: ; \
+ if(ick_global_linelabel != ICK_EC_PP_3) \
+ goto ick_l2_ICK_EC_PP_2; \
+ ick_global_checkmode = 0; \
+ }
+
+#define ick_nextfrom(expr) \
+ if(0) \
+ { \
+ ick_l1_ICK_EC_PP_1: ; \
+ if(ick_global_linelabel == (expr) && (expr) <= 65535) \
+ { \
+ if(ick_global_goto) ick_multicome0(-1,ick_local_jmpbuf); \
+ ick_global_goto = ICK_EC_PP_3; \
+ ick_global_checkmode = 3; \
+ } \
+ goto ick_l1_ICK_EC_PP_1; \
+ ick_l2_ICK_EC_PP_2: ; \
+ if(ick_global_linelabel != ICK_EC_PP_3) \
+ goto ick_l2_ICK_EC_PP_2; \
+ ick_global_checkmode = 0; \
+ }
+
+#define ICK_EC_FUNC_END \
+ if(ick_local_checkmode) ick_resume(1); \
+ick_l1_ICK_EC_PP_1: ; \
+ick_l2_ICK_EC_PP_2: return; \
+}
+
+#define ick_next(label) do{ \
+ if((label)<=65535) \
+ ick_donext((label),-1,0); \
+ } while(0)
+
+#define ick_resume(amount) ick_doresume((amount),-1)
+
+#define ick_return_or_resume() do{ \
+ ick_global_checkmode=5; \
+ return; \
+ } while(0)
+
+/*@maynotreturn@*/ void ick_donext(unsigned long, int, int);
+void ick_forget(unsigned short amount);
+/*@noreturn@*/ void ick_doresume(unsigned short amount, int emitlineno);
+/*@maynortreturn@*/ void ick_checksuckpoint(unsigned long linelabel);
+
+void ick_allecfuncs(void); /* in generated program */
+
+extern int ick_global_checkmode;
+extern int ick_global_stackcleanup;
+extern unsigned long ick_global_linelabel;
+extern unsigned long ick_global_goto;
+extern int ick_forgetamount;
--- /dev/null
+/* ick_lose.h --- error message strings */
+
+/*
+ * Note: these error message texts, with one exception, are direct from
+ * the Princeton compiler (INTERCAL-72) sources (transmitted by Don Woods).
+ * The one exception is IE632, which in INTERCAL-72 had the error message
+ * PROGRAM ATTEMPTED TO EXIT WITHOUT ERROR MESSAGE
+ * 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", ick_first published in
+ * 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. */
+#define IE000 "000 %s\n\
+ ON THE WAY TO %d\n"
+/* An expression contains a syntax error. */
+#define IE017 "017 DO YOU EXPECT ME TO FIGURE THIS OUT?\n\
+ ON THE WAY TO %d\n"
+/* Improper use has been made of statement identifiers. */
+#define IE079 "079 PROGRAMMER IS INSUFFICIENTLY POLITE\n\
+ ON THE WAY TO %d\n"
+/* Improper use has been made of statement identifiers. */
+#define IE099 "099 PROGRAMMER IS OVERLY POLITE\n\
+ ON THE WAY TO %d\n"
+/* Program has attempted 80 levels of NEXTing */
+#define IE123 "123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON\n\
+ ON THE WAY TO %d\n"
+/* Program has attempted to transfer to a non-existent line label */
+#define IE129 "129 PROGRAM HAS GOTTEN LOST\n\
+ ON THE WAY TO WHO KNOWS WHERE\n"
+/* An ABSTAIN or REINSTATE statement references a non-existent line label */
+#define IE139 "139 I WASN'T PLANNING TO GO THERE ANYWAY\n\
+ ON THE WAY TO %d\n"
+/* A line label has been multiply defined. */
+#define IE182 "182 YOU MUST LIKE THIS LABEL A LOT!\n\
+ ON THE WAY TO %d\n"
+/* An invalid line label has been encountered. */
+#define IE197 "197 SO! 65535 LABELS AREN'T ENOUGH FOR YOU?\n\
+ ON THE WAY TO %d\n"
+/* An expression involves an unidentified variable. */
+#define IE200 "200 NOTHING VENTURED, NOTHING GAINED\n\
+ ON THE WAY TO %d\n"
+/* An attempt has been made to give an ick_array a dimension of zero. */
+#define IE240 "240 ERROR HANDLER PRINTED SNIDE REMARK\n\
+ ON THE WAY TO %d\n"
+/* Invalid dimensioning information was supplied
+ * in defining or using an ick_array. */
+#define IE241 "241 VARIABLES MAY NOT BE STORED IN WEST HYPERSPACE\n\
+ ON THE WAY TO %d\n"
+/* A 32-bit value has been assigned to a 16-bit variable. */
+#define IE275 "275 DON'T BYTE OFF MORE THAN YOU CAN CHEW\n\
+ ON THE WAY TO %d\n"
+/* A retrieval has been attempted for an unSTASHed value. */
+#define IE436 "436 THROW STICK BEFORE RETRIEVING!\n\
+ ON THE WAY TO %d\n"
+/* A WRITE IN statement or interleave ($) operation
+ * has produced value requiring over 32 bits to represent. */
+#define IE533 "533 YOU WANT MAYBE WE SHOULD IMPLEMENT 64-BIT VARIABLES?\n\
+ ON THE WAY TO %d\n"
+/* Insufficient data. (raised by reading past EOF) */
+#define IE562 "562 I DO NOT COMPUTE\n\
+ ON THE WAY TO %d\n"
+/* Input data is invalid. */
+#define IE579 "579 WHAT BASE AND/OR LANGUAGE INCLUDES %s?\n\
+ ON THE WAY TO %d\n"
+/* The expression of a RESUME statement evaluated to #0. */
+#define IE621 "621 ERROR TYPE 621 ENCOUNTERED\n\
+ ON THE WAY TO %d\n"
+/* Program execution terminated via a RESUME statement instead of GIVE UP. */
+#define IE632 "632 THE NEXT STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!\n\
+ ON THE WAY TO %d\n"
+/* Execution has passed beyond the last statement of the program. */
+#define IE633 "633 PROGRAM FELL OFF THE EDGE\n\
+ ON THE WAY TO THE NEW WORLD\n"
+/* A compiler error has occurred (see section 8.1). */
+#define IE774 "774 RANDOM COMPILER BUG\n\
+ ON THE WAY TO %d\n"
+/* An unexplainable compiler error has occurred (see J. Lyon or D. Woods). */
+#define IE778 "778 UNEXPLAINED COMPILER BUG\n\
+ ON THE WAY TO %d\n"
+
+/*
+ * These errors are unique to C-INTERCAL.
+ */
+/* You tried to use a C-INTERCAL extension with the `ick_traditional' flag on */
+#define IE111 "111 COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING\n\
+ ON THE WAY TO %d\n"
+/* Cannot find the magically included system library */
+#define IE127 "127 SAYING 'ABRACADABRA' WITHOUT A MAGIC WAND WON'T DO YOU ANY GOOD\n\
+ ON THE WAY TO THE CLOSET\n"
+/* Out of ick_stash space */
+#define IE222 "222 BUMMER, DUDE!\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Out of memory during I/O */
+#define IE252 "252 I'VE FORGOTTEN WHAT I WAS ABOUT TO SAY\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Can't reverse an expression in an assignment. This is the
+ same error number as in CLC-INTERCAL, but the message is different. */
+#define IE277 "277 YOU CAN ONLY DISTORT THE LAWS OF MATHEMATICS SO FAR\n\
+ ON THE WAY TO %d\n"
+/* (AIS) The spark/ears nesting is too deep. */
+#define IE281 "281 THAT MUCH QUOTATION AMOUNTS TO PLAGIARISM\n\
+ ON THE WAY TO %d\n"
+/* Too many variables. */
+#define IE333 "333 YOU CAN'T HAVE EVERYTHING, WHERE WOULD YOU PUT IT?\n\
+ ON THE WAY TO %d\n"
+/* Out of memory during compilation. */
+#define IE345 "345 THAT'S TOO COMPLEX FOR ME TO GRASP\n\
+ ON THE WAY TO SOMEWHERE\n"
+/* (AIS, from the suggestion by Malcom Ryan)
+ GO BACK or GO AHEAD was executed without a choicepoint. */
+#define IE404 "404 I'M ALL OUT OF CHOICES!\n\
+ ON THE WAY TO %d\n"
+/* (AIS) WHILE, MAYBE, GO BACK, or GO AHEAD used without the -m option. */
+#define IE405 "405 PROGRAM REJECTED FOR MENTAL HEALTH REASONS\n\
+ ON THE WAY TO %d\n"
+/* A COME FROM statement references a non-existent line label. */
+#define IE444 "444 IT CAME FROM BEYOND SPACE\n\
+ ON THE WAY TO %d\n"
+/* More than one COME FROM references the same label. */
+#define IE555 "555 FLOW DIAGRAM IS EXCESSIVELY CONNECTED\n\
+ ON THE WAY TO %d\n"
+/* Too many source lines, or too many input files. */
+#define IE666 "666 COMPILER HAS INDIGESTION\n\
+ ON THE WAY TO %d\n"
+/* No such source file. */
+#define IE777 "777 A SOURCE IS A SOURCE, OF COURSE, OF COURSE\n\
+ ON THE WAY TO %d\n"
+/* Can't open C output file */
+#define IE888 "888 I HAVE NO FILE AND I MUST SCREAM\n\
+ ON THE WAY TO %d\n"
+/* Can't open C skeleton file. */
+#define IE999 "999 NO SKELETON IN MY CLOSET, WOE IS ME!\n\
+ ON THE WAY TO %d\n"
+/* Source file name with invalid extension (use .i or .[3-7]i). */
+#define IE998 "998 EXCUSE ME,\n\
+ YOU MUST HAVE ME CONFUSED WITH SOME OTHER COMPILER\n"
+/* Illegal possession of a controlled unary operator. */
+#define IE997 "997 ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR.\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Command found after TRY AGAIN. */
+#define IE993 "993 I GAVE UP LONG AGO\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Memory allocation failure during multithreading */
+#define IE991 "991 YOU HAVE TOO MUCH ROPE TO HANG YOURSELF\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Unimplemented feature used. This should never come up, hopefully. */
+#define IE995 "995 DO YOU REALLY EXPECT ME TO HAVE IMPLEMENTED THAT?\n\
+ ON THE WAY TO %d\n"
+/*
+ * AIS: These errors are specific to PIC-INTERCAL
+ */
+/* (AIS) Attempted to use an unsupported language feature. */
+#define IE256 "256 THAT'S TOO HARD FOR MY TINY BRAIN\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Attempted to use a PIC feature in a non-PIC program. */
+#define IE652 "652 HOW DARE YOU INSULT ME!\n\
+ ON THE WAY TO %d\n"
+
+/*
+ * AIS: These errors are generated by the yuk debugger
+ */
+/* (AIS) fgets' buffer overflowed on debugger comand input. */
+#define IE810 "810 ARE ONE-CHARACTER COMMANDS TOO SHORT FOR YOU?\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Too many breakpoints. */
+#define IE811 "811 PROGRAM IS TOO BADLY BROKEN TO RUN\n\
+ ON THE WAY TO %d\n"
+
+/*
+ * (AIS) Warnings produced by -l.
+ */
+
+/* (AIS) Non-INTERCAL-72 identifier used. */
+#define W112 "112 THAT RELIES ON THE NEW WORLD ORDER\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) That stupid idiom in syslib was used. */
+#define W128 "128 SYSLIB IS OPTIMIZED FOR OBFUSCATION\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Possibly nonportable unary operator. */
+#define W534 "534 KEEP LOOKING AT THE TOP BIT\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Expression still contains INTERCAL operators after
+ optimization. Only in binary, because this nearly always
+ happens in the higher bases. Syslib causes quite a lot of
+ these. This warning is fine on INTERCAL-like lines, but
+ flags a mistake on lines that are meant to be translations
+ of C. */
+#define W018 "018 THAT WAS MEANT TO BE A JOKE\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Possible misplaced unary operator. At the moment, ick -l cannot
+ detect this condition (so it never comes up). It's meant to detect
+ expressions like '?"?.1~#256"$#2'~#3 (from numio.i); in this expression,
+ the second what has no effect (it changes only the msb of the immediately
+ surrounding expression, which is eventually filtered out by the select
+ against #3). But detecting this would probably require code that could
+ check which bits of a result were going to be used elsewhere in an
+ expression, which is something I haven't written yet (but would make
+ a decent optimize_pass3). */
+#define W016 "016 DON'T TYPE THAT SO HASTILY\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Possibly overflowing assignment or ick_mingle. Syslib causes some of
+ these too, in complicated situations where the bugcatcher can't figure
+ out what's happening, and also in a few blatant statements in the mould
+ of DO .3 <- :3, which are quite clearly possible overflows. Strangely
+ enough, there's a commented-out section of code in feh.c that suggests
+ that someone tried to make this an error (using a more general check
+ which would have caught more correct code involving GETS, but none
+ involving $). As a middle ground, I've made it an -l warning. */
+#define W276 "276 YOU CAN'T EXPECT ME TO CHECK BACK THAT FAR\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) A line will inevitably cause an expression-reversal failure. */
+#define W278 "278 FROM A CONTRADICTION, ANYTHING FOLLOWS\n\
+ ON THE WAY TO A HUGE DISASTER\n"
+
+/* (AIS) The two following warnings are both compile-time traps for
+ near-certain runtime errors. As such, they have similar numbers
+ and similar messages. In fact, they're a shameless ripoff of the
+ originals, but should serve as a reminder for anyone aware of the
+ original messages. */
+/* (AIS) Dimension given for an ick_array will come out as #0. */
+#define W239 "239 WARNING HANDLER PRINTED SNIDE REMARK\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) RESUME argument will come out as #0. */
+#define W622 "622 WARNING TYPE 622 ENCOUNTERED\n\
+ ON THE WAY TO %d\n"
+
+extern int ick_lineno;
+
+extern void /*@noreturn@*/ ick_lose(char *m, int n, /*@null@*/ char *s);
+
+extern void ick_lwarn(char *m, int n, /*@null@*/ char *s);
+
+/* ick_lose.h ends here */
--- /dev/null
+ PLEASE KNOCK THREE TIMES BEFORE ENTERING\r
+\r
+ (1000) PLEASE IGNORE .4\r
+ PLEASE ABSTAIN FROM (1005)\r
+ (1009) DO STASH .1 + .2 + .5 + .6\r
+ DO .4 <- #1\r
+ DO (1004) NEXT\r
+ (1004) PLEASE FORGET #1\r
+ DO .3 <- '^.1$.2'~'#0$#29524'\r
+ DO .6 <- '?"'V"'&.1$.2'~'#0$#29524'"$#29524'\r
+ ~'#0$#29524'"$#29524'~'#0$#29524'\r
+ PLEASE DO .5 <- 'V".6~#39366"$#1'~#1\r
+ DO (1002) NEXT\r
+ DO .4 <- #2\r
+ (1005) DO (1006) NEXT\r
+ (1999) DOUBLE OR SINGLE PRECISION OVERFLOW\r
+ (1002) DO (1001) NEXT\r
+ (1006) PLEASE FORGET #1\r
+ DO .5 <- 'V"!6~.6'~#2"$#1'~#1\r
+ DO (1003) NEXT\r
+ DO .1 <- .3\r
+ DO .2 <- !6$#0'~'#9841$#1'\r
+ DO (1004) NEXT\r
+ (1003) DO (1001) NEXT\r
+ DO REINSTATE (1005)\r
+ (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6\r
+ DO REMEMBER .4\r
+ PLEASE RESUME #2\r
+ (1001) DO RESUME .5\r
+ (1010) DO STASH .1 + .2 + .4\r
+ DO .4 <- .1\r
+ DO .1 <- '?#59048$.2'~'#0$#29524'\r
+ DO (1020) NEXT\r
+ PLEASE DO .2 <- .4\r
+ PLEASE DO (1009) NEXT\r
+ DO RETRIEVE .1 + .2 + .4\r
+ PLEASE RESUME #1\r
+ (1020) DO STASH .2 + .3\r
+ DO .2 <- #1\r
+ PLEASE DO (1021) NEXT\r
+ (1021) DO FORGET #1\r
+ DO .3 <- 'V"!1~.2'$#1"'~#1\r
+ PLEASE DO .1 <- '^.1$.2'~'#0$#29524'\r
+ DO (1022) NEXT\r
+ DO .2 <- !2$#0'~'#9841$#1'\r
+ DO (1021) NEXT\r
+ (1023) PLEASE RESUME .3\r
+ (1022) DO (1023) NEXT\r
+ PLEASE RETRIEVE .2 + .3\r
+ PLEASE RESUME #2\r
+ (1030) DO ABSTAIN FROM (1033)\r
+ PLEASE ABSTAIN FROM (1032)\r
+ (1039) DO STASH :1 + .5\r
+ DO (1530) NEXT\r
+ DO .3 <- :1~#29524\r
+ PLEASE DO .5 <- :1~'#29403$#29403'\r
+ DO .5 <- 'V"!5~.5'~#2"$#1'~#1\r
+ DO (1031) NEXT\r
+ (1032) DO (1033) NEXT\r
+ DO (1999) NEXT\r
+ (1031) DO (1001) NEXT\r
+ (1033) DO .4 <- .5\r
+ DO REINSTATE (1032)\r
+ PLEASE REINSTATE (1033)\r
+ DO RETRIEVE :1 + .5\r
+ PLEASE RESUME #2\r
+ (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ DO STASH :1\r
+ PLEASE RETRIEVE .2\r
+ DO .1 <- .2\r
+ DO .2 <- #0\r
+ PLEASE DO (1520) NEXT\r
+ DO :2 <- :1\r
+ DO RETRIEVE .1 + .2 + :1\r
+ DO (1550) NEXT\r
+ PLEASE DO .3 <- :3\r
+ DO RETRIEVE :1 + :2 + :3\r
+ DO RESUME #1\r
+ (1050) PLEASE STASH :2 + :3 + .5\r
+ DO :2 <- .1\r
+ PLEASE DO (1550) NEXT\r
+ DO .5 <- :3~'#29403$#29403'\r
+ DO .5 <- 'V"!5~.5'~#2"$#1'~#1\r
+ DO (1051) NEXT\r
+ DO (1999) NEXT\r
+ (1051) DO (1001) NEXT\r
+ DO .2 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + .5\r
+ DO RESUME #2\r
+ (1500) PLEASE ABSTAIN FROM (1502)\r
+ PLEASE ABSTAIN FROM (1506)\r
+ (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO .1 <- :1~#29524\r
+ PLEASE DO .2 <- :2~#29524\r
+ DO (1009) NEXT\r
+ DO .5 <- .3\r
+ PLEASE DO .6 <- .4\r
+ DO .1 <- :1~'#29403$#29403'\r
+ DO .2 <- :2~'#29403$#29403'\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ PLEASE DO (1503) NEXT\r
+ DO .6 <- .4\r
+ DO .2 <- #1\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ DO (1501) NEXT\r
+ (1504) PLEASE RESUME .6\r
+ (1503) DO (1504) NEXT\r
+ (1501) DO .2 <- .5\r
+ DO .5 <- '&.6$.4'\r
+ DO (1505) NEXT\r
+ (1506) DO (1502) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1505) DO (1001) NEXT\r
+ (1502) DO :4 <- .5\r
+ DO (1520) NEXT\r
+ DO :3 <- :1\r
+ PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO REINSTATE (1502)\r
+ DO REINSTATE (1506)\r
+ PLEASE RESUME #3\r
+ (1510) DO STASH :1 + :2 + :4\r
+ DO :1 <- "'?#59048$":2~'#29524$#0'"'~'#0$#29524'"\r
+ $"'?#59048$":2~'#0$#29524'"'~'#0$#29524'"\r
+ DO :2 <- #1\r
+ DO (1509) NEXT\r
+ PLEASE RETRIEVE :1\r
+ DO :2 <- :3\r
+ PLEASE DO (1509) NEXT\r
+ DO RETRIEVE :2 + :4\r
+ PLEASE RESUME #1\r
+ (1520) PLEASE STASH .3 + .4\r
+ DO .3 <- .1~#22143\r
+ DO (1525) NEXT\r
+ PLEASE DO .4 <- 'V.3$".2~#22143"'~'#0$#29524'\r
+ DO .3 <- .1~#7381\r
+ PLEASE DO (1525) NEXT\r
+ DO :1 <- .4$"'V.3$".2~#7381"'~'#0$#29524'"\r
+ PLEASE RETRIEVE .3 + .4\r
+ DO RESUME #1\r
+ (1525) DO .3 <- '"'"!3$#0'~'#9841$#1'"$#0'~'#3280$#4'"\r
+ $#0'~'#3280$#4'\r
+ PLEASE RESUME #1\r
+ (1530) DO STASH :2 + :3 + .3 + .5\r
+ DO :1 <- #0\r
+ DO :2 <- .2\r
+ DO .3 <- #1\r
+ DO (1535) NEXT\r
+ (1535) PLEASE FORGET #1\r
+ DO .5 <- '@"'^".1~.3"$#7'~#4"$#2'~#10\r
+ DO (1534) NEXT\r
+ DO (1500) NEXT\r
+ DO :1 <- :3\r
+ DO (1536) NEXT\r
+ (1534) DO (1531) NEXT\r
+ (1536) DO (1500) NEXT\r
+ DO :1 <- :3\r
+ PLEASE DO (1533) NEXT\r
+ (1531) PLEASE DO (1001) NEXT\r
+ (1533) DO FORGET #2\r
+ DO .3 <- !3$#0'~'#9841$#1'\r
+ DO :2 <- ":2~'#0$#29524'"$"'":2~'#9841$#0'"$#0'\r
+ ~'#9841$#1'"\r
+ PLEASE DO .5 <- 'V"!3~.3'~#2"$#1'~#1\r
+ DO (1532) NEXT\r
+ DO (1535) NEXT\r
+ (1532) DO (1001) NEXT\r
+ PLEASE RETRIEVE :2 + :3 + .3 + .5\r
+ DO RESUME #2\r
+ (1540) PLEASE ABSTAIN FROM (1541)\r
+ DO ABSTAIN FROM (1542)\r
+ (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5\r
+ DO .1 <- :1~#29524\r
+ PLEASE DO .2 <- :2~'#29403$#29403'\r
+ DO .5 <- :1~'#29403$#29403'\r
+ DO (1530) NEXT\r
+ DO :3 <- :1\r
+ DO .2 <- :2~#29524\r
+ PLEASE DO (1530) NEXT\r
+ DO :5 <- :1\r
+ DO .1 <- .5\r
+ DO (1530) NEXT\r
+ DO :4 <- :1\r
+ PLEASE DO :1 <- ":3~'#29403$#29403'"$":4~'#29403\r
+ $#29403'"\r
+ DO .5 <- ':1~:1'~#2\r
+ DO .2 <- :2~'#29403$#29403'\r
+ DO (1530) NEXT\r
+ PLEASE DO .5 <- '"':1~:1'~#2"$.5'~#4\r
+ DO .1 <- :3~#29524\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ PLEASE DO :2 <- :1\r
+ PLEASE DO .1 <- :4~#29524\r
+ DO (1520) NEXT\r
+ DO (1509) NEXT\r
+ DO .5 <- !5$":4~#1"'~#31\r
+ DO :1 <- :3\r
+ DO :2 <- :5\r
+ DO (1509) NEXT\r
+ PLEASE DO .5 <- !5$":4~#1"'~#274\r
+ DO .5 <- !5~.5'~#1\r
+ PLEASE RETRIEVE :4\r
+ (1541) DO :4 <- .5\r
+ DO (1543) NEXT\r
+ (1542) DO (1544) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1543) DO (1001) NEXT\r
+ (1544) DO REINSTATE (1541)\r
+ PLEASE REINSTATE (1542)\r
+ PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5\r
+ DO RESUME #2\r
+ (1550) DO STASH :1 + :4 + :5 + :6 + .5\r
+ DO :3 <- #0\r
+ DO .5 <- 'V"':2~:2'~#2"$#1'~#1\r
+ PLEASE DO (1551) NEXT\r
+ DO :4 <- #1\r
+ PLEASE DO (1553) NEXT\r
+ (1553) DO FORGET #1\r
+ DO .5 <- '?"':2~"#39366$#0"'"$#1'~#1\r
+ DO (1552) NEXT\r
+ DO :2 <- ":2~'#0$#29524'"$"'":2~'#9841$#0'"$#0'\r
+ ~'#9841$#1'"\r
+ PLEASE DO :4 <- ":4~'#0$#29524'"$"'":4~'#9841\r
+ $#0'"$#0'~'#9841$#1'"\r
+ DO (1553) NEXT\r
+ (1552) DO (1001) NEXT\r
+ (1556) PLEASE FORGET #1\r
+ DO :6 <- "'&":2~'#29524$#0'"$"'?#59048$":1\r
+ ~'#29524$#0'"'~'#0$#29524'"'~'#0$#29524'"$\r
+ "'&":2~'#0$#29524'"$"'?#59048$":1~'#0$\r
+ #29524'"'~'#0$#29524'"'~'#0$#29524'"\r
+ DO :5 <- "'?":1~'#29524$#0'"$":2~'#29524$#0'"'\r
+ ~'#0$#59048'"$"'?":1~'#0$#29524'"$":2~'#0$\r
+ #29524'"'~'#0$#59048'"\r
+ DO .5 <- "?'"':6~:5'~'"'"'&"':5~:5'~'#29524$#0'"$\r
+ #19683'~'#0$#29524'"$"'?:5~:5'~'#9841$#0'"'\r
+ ~'#19683$#9841'"$"'?:5~:5'~'#0$#29524'"'"\r
+ ~#1'$#1"~#1\r
+ DO (1554) NEXT\r
+ DO :5 <- :3\r
+ DO (1510) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO :6 <- "'&":2~'#29524$#0'"$"'?#59048$":1\r
+ ~'#29524$#0'"'~'#0$#29524'"'~'#0$#29524'"$\r
+ "'&":2~'#0$#29524'"$"'?#59048$":1~'#0$\r
+ #29524'"'~'#0$#29524'"'~'#0$#29524'"\r
+ DO :3 <- "'?":1~'#29524$#0'"$":2~'#29524$#0'"'\r
+ ~'#0$#59048'"$"'?":1~'#0$#29524'"$":2~'#0$\r
+ #29524'"'~'#0$#59048'"\r
+ DO .5 <- "?'"':6~:3'~'"'"'&"':3~:3'~'#29524$#0'"$\r
+ #19683'~'#0$#29524'"$"'?:3~:3'~'#9841$#0'"'\r
+ ~'#19683$#9841'"$"'?:3~:3'~'#0$#29524'"'"\r
+ ~#1'$#1"~#1\r
+ DO (1557) NEXT\r
+ DO (1510) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO :3 <- "'V":4~'#59048$#0'"$":5~'#29524$#0'"'\r
+ ~'#0$#29524'"$"'V":4~'#0$#59048'"$":5~'#0$\r
+ #29524'"'~'#0$#29524'"\r
+ PLEASE DO (1555) NEXT\r
+ (1557) PLEASE DO (1001) NEXT\r
+ PLEASE FORGET #1\r
+ DO :3 <- "'V":4~'#29524$#0'"$":5~'#29524$#0'"'\r
+ ~'#0$#29524'"$"'V":4~'#0$#29524'"$":5~'#0$\r
+ #29524'"'~'#0$#29524'"\r
+ PLEASE DO (1555) NEXT\r
+ (1554) PLEASE DO (1001) NEXT\r
+ (1555) PLEASE FORGET #1\r
+ DO .5 <- "?':4~#2'$#1"~#1\r
+ DO (1551) NEXT\r
+ DO :2 <- :2~'#29524$#29523'\r
+ DO :4 <- :4~'#29524$#29523'\r
+ PLEASE DO (1556) NEXT\r
+ (1551) DO (1001) NEXT\r
+ PLEASE RETRIEVE :1 + :4 + :5 + :6 + .5\r
+ PLEASE RESUME #2\r
+ (1900) DO STASH .2 + .5\r
+ DO .1 <- #0\r
+ DO .2 <- #1\r
+ PLEASE DO (1901) NEXT\r
+ (1901) DO FORGET #1\r
+ DO %50 (1904) NEXT\r
+ DO %50 (1901) NEXT\r
+ PLEASE DO (1903) NEXT\r
+ (1904) DO .1 <- '^.1$.2'~'#0$#29524'\r
+ DO %50 .1 <- '^.1$.2'~'#0$#29524'\r
+ (1903) PLEASE FORGET #1\r
+ DO .2 <- !2$#0'~'#9841$#1'\r
+ PLEASE DO .5 <- 'V"!2~.2'~#2"$#1'~#1\r
+ DO (1902) NEXT\r
+ DO (1901) NEXT\r
+ (1902) DO (1001) NEXT\r
+ DO RETRIEVE .2 + .5\r
+ PLEASE RESUME #2\r
+ (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3\r
+ DO .3 <- #59037\r
+ DO :1 <- #6\r
+ DO (1911) NEXT\r
+ PLEASE NOTE THAT YOU CAN'T GET THREE FROM HERE\r
+ (1912) DO (1001) NEXT\r
+ (1911) DO FORGET #1\r
+ PLEASE DO (1900) NEXT\r
+ DO :2 <- .1\r
+ DO (1500) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO .1 <- .3\r
+ DO (1020) NEXT\r
+ PLEASE DO .3 <- .1\r
+ DO .5 <- '?"!3~.3'~#2"$#1'~#1\r
+ DO (1912) NEXT\r
+ DO .1 <- #12\r
+ PLEASE DO (1050) NEXT\r
+ DO RETRIEVE .1\r
+ DO (1530) NEXT\r
+ DO :2 <- #29524\r
+ DO (1500) NEXT\r
+ PLEASE DO .2 <- :3~'#29403$#29403'\r
+ PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3\r
+ DO RESUME #1\r
--- /dev/null
+ PLEASE KNOCK TWICE TWO TIMES BEFORE ENTERING\r
+\r
+ (1000) PLEASE IGNORE .4\r
+ PLEASE ABSTAIN FROM (1005)\r
+ (1009) DO STASH .1 + .2 + .5 + .6\r
+ DO .4 <- #1\r
+ DO (1004) NEXT\r
+ (1004) PLEASE FORGET #1\r
+ DO .3 <- '^.1$.2'~'#0$#21845'\r
+ DO .6 <- '?"'V"'&.1$.2'~'#0$#21845'"$"'^"'@.1$\r
+ .2'~'#0$#21845'"$#21845'~'#0$#43690'"'\r
+ ~'#0$#21845'"$#43690'~'#0$#21845'\r
+ PLEASE DO .5 <- '?".6~#49152"$#4'~#4\r
+ DO (1002) NEXT\r
+ DO .4 <- #2\r
+ (1005) DO (1006) NEXT\r
+ (1999) DOUBLE OR SINGLE PRECISION OVERFLOW\r
+ (1002) DO (1001) NEXT\r
+ (1006) PLEASE FORGET #1\r
+ DO .5 <- '?"!6~.6'~#3"$#4'~#4\r
+ DO (1003) NEXT\r
+ DO .1 <- .3\r
+ DO .2 <- !6$#0'~'#5461$#1'\r
+ DO (1004) NEXT\r
+ (1003) DO (1001) NEXT\r
+ DO REINSTATE (1005)\r
+ (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6\r
+ DO REMEMBER .4\r
+ PLEASE RESUME #2\r
+ (1001) DO RESUME .5\r
+ (1010) DO STASH .1 + .2 + .4\r
+ DO .4 <- .1\r
+ DO .1 <- '?#65535$.2'~'#0$#21845'\r
+ DO (1020) NEXT\r
+ PLEASE DO .2 <- .4\r
+ PLEASE DO (1009) NEXT\r
+ DO RETRIEVE .1 + .2 + .4\r
+ PLEASE RESUME #1\r
+ (1020) DO STASH .2 + .3\r
+ DO .2 <- #1\r
+ PLEASE DO (1021) NEXT\r
+ (1021) DO FORGET #1\r
+ DO .3 <- '?"'V".1~.2"$#2'~#1"$#1'~#1\r
+ PLEASE DO .1 <- '^.1$.2'~'#0$#21845'\r
+ DO (1022) NEXT\r
+ DO .2 <- !2$#0'~'#5461$#1'\r
+ DO (1021) NEXT\r
+ (1023) PLEASE RESUME .3\r
+ (1022) DO (1023) NEXT\r
+ PLEASE RETRIEVE .2 + .3\r
+ PLEASE RESUME #2\r
+ (1030) DO ABSTAIN FROM (1033)\r
+ PLEASE ABSTAIN FROM (1032)\r
+ (1039) DO STASH :1 + .5\r
+ DO (1530) NEXT\r
+ DO .3 <- :1~#21845\r
+ PLEASE DO .5 <- :1~'#21760$#21760'\r
+ DO .5 <- '?"!5~.5'~#3"$#4'~#4\r
+ DO (1031) NEXT\r
+ (1032) DO (1033) NEXT\r
+ DO (1999) NEXT\r
+ (1031) DO (1001) NEXT\r
+ (1033) DO .4 <- .5\r
+ DO REINSTATE (1032)\r
+ PLEASE REINSTATE (1033)\r
+ DO RETRIEVE :1 + .5\r
+ PLEASE RESUME #2\r
+ (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ DO STASH :1\r
+ PLEASE RETRIEVE .2\r
+ DO .1 <- .2\r
+ DO .2 <- #0\r
+ PLEASE DO (1520) NEXT\r
+ DO :2 <- :1\r
+ DO RETRIEVE .1 + .2 + :1\r
+ DO (1550) NEXT\r
+ PLEASE DO .3 <- :3\r
+ DO RETRIEVE :1 + :2 + :3\r
+ DO RESUME #1\r
+ (1050) PLEASE STASH :2 + :3 + .5\r
+ DO :2 <- .1\r
+ PLEASE DO (1550) NEXT\r
+ DO .5 <- :3~'#21760$#21760'\r
+ DO .5 <- '?"!5~.5'~#3"$#4'~#4\r
+ DO (1051) NEXT\r
+ DO (1999) NEXT\r
+ (1051) DO (1001) NEXT\r
+ DO .2 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + .5\r
+ DO RESUME #2\r
+ (1200) DO .2 <- '^.1$.1'~'#0$#21845'\r
+ DO .3 <- '?"'@.1$#0'~'#0$#21845'"$"'@.1$#65535'\r
+ ~'#0$#21845'"'~'#0$#21845'\r
+ DO .2 <- '^.2$"!3$#0'~'#5461$#1'"'~'#0$#21845'\r
+ DO .3 <- .3~#16384\r
+ PLEASE RESUME #1\r
+ (1210) DO .2 <- '?"'@.1$#0'~'#0$#21845'"$"'@.1$#65535'\r
+ ~'#0$#21845'"'~'#0$#21845'\r
+ DO .3 <- '^.1$.1'~'#0$#21845'\r
+ DO .2 <- '^.2$".3~#21844"'~'#0$#21845'\r
+ DO .3 <- .3~#1\r
+ PLEASE RESUME #1\r
+ (1500) PLEASE ABSTAIN FROM (1502)\r
+ PLEASE ABSTAIN FROM (1506)\r
+ (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO .1 <- :1~#21845\r
+ PLEASE DO .2 <- :2~#21845\r
+ DO (1009) NEXT\r
+ DO .5 <- .3\r
+ PLEASE DO .6 <- .4\r
+ DO .1 <- :1~'#21760$#21760'\r
+ DO .2 <- :2~'#21760$#21760'\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ PLEASE DO (1503) NEXT\r
+ DO .6 <- .4\r
+ DO .2 <- #1\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ DO (1501) NEXT\r
+ (1504) PLEASE RESUME .6\r
+ (1503) DO (1504) NEXT\r
+ (1501) DO .2 <- .5\r
+ DO .5 <- '&.6$.4'\r
+ DO (1505) NEXT\r
+ (1506) DO (1502) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1505) DO (1001) NEXT\r
+ (1502) DO :4 <- .5\r
+ DO (1520) NEXT\r
+ DO :3 <- :1\r
+ PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO REINSTATE (1502)\r
+ DO REINSTATE (1506)\r
+ PLEASE RESUME #3\r
+ (1510) DO STASH :1 + :2 + :4\r
+ DO :1 <- "'?#65535$":2~'#21845$#0'"'~'#0$#21845'"$\r
+ "'?#65535$":2~'#0$#21845'"'~'#0$#21845'"\r
+ DO :2 <- #1\r
+ DO (1509) NEXT\r
+ PLEASE RETRIEVE :1\r
+ DO :2 <- :3\r
+ PLEASE DO (1509) NEXT\r
+ DO RETRIEVE :2 + :4\r
+ PLEASE RESUME #1\r
+ (1520) PLEASE STASH .3 + .4\r
+ DO .3 <- .1~#17476\r
+ DO (1525) NEXT\r
+ PLEASE DO .4 <- 'V.3$".2~#17476"'~'#0$#21845'\r
+ DO .3 <- .1~#4369\r
+ PLEASE DO (1525) NEXT\r
+ DO :1 <- .4$"'V.3$".2~#4369"'~'#0$#21845'"\r
+ PLEASE RETRIEVE .3 + .4\r
+ DO RESUME #1\r
+ (1525) DO .3 <- '"'"!3$#0'~'#5461$#1'"$#0'~'#5461$#1'"$\r
+ #0'~'#1365$#5'\r
+ PLEASE RESUME #1\r
+ (1530) DO STASH :2 + :3 + .1 + .2 + .3\r
+ DO :3 <- #0\r
+ DO :2 <- .1\r
+ DO (1535) NEXT\r
+ (1535) PLEASE FORGET #1\r
+ DO .3 <- '?"!2~.2'~#3"$#4'~#4\r
+ DO (1532) NEXT\r
+ DO .1 <- .2\r
+ DO (1210) NEXT\r
+ DO .3 <- 'V.3$#1'~#1\r
+ DO (1531) NEXT\r
+ DO :1 <- :3\r
+ DO (1500) NEXT\r
+ PLEASE DO (1533) NEXT\r
+ (1531) PLEASE DO (1534) NEXT\r
+ (1533) DO FORGET #1\r
+ DO :1 <- :2\r
+ DO (1700) NEXT\r
+ DO (1535) NEXT\r
+ (1534) PLEASE RESUME .3\r
+ (1532) DO (1534) NEXT\r
+ DO :1 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + .1 + .2 + .3\r
+ DO RESUME #2\r
+ (1540) PLEASE ABSTAIN FROM (1541)\r
+ DO ABSTAIN FROM (1542)\r
+ (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5\r
+ DO .1 <- :1~#21845\r
+ PLEASE DO .2 <- :2~'#21760$#21760'\r
+ DO .5 <- :1~'#21760$#21760'\r
+ DO (1530) NEXT\r
+ DO :3 <- :1\r
+ DO .2 <- :2~#21845\r
+ PLEASE DO (1530) NEXT\r
+ DO :5 <- :1\r
+ DO .1 <- .5\r
+ DO (1530) NEXT\r
+ DO :4 <- :1\r
+ PLEASE DO :1 <- ":3~'#21760$#21760'"$":4\r
+ ~'#21760$#21760'"\r
+ DO .5 <- ':1~:1'~#3\r
+ DO .2 <- :2~'#21760$#21760'\r
+ DO (1530) NEXT\r
+ PLEASE DO .5 <- '"':1~:1'~#3"$.5'~#5\r
+ DO .1 <- :3~#21845\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ PLEASE DO :2 <- :1\r
+ PLEASE DO .1 <- :4~#21845\r
+ DO (1520) NEXT\r
+ DO (1509) NEXT\r
+ DO .5 <- !5$"'^":4~#1"$#1'~#1"'~#69\r
+ DO :1 <- :3\r
+ DO :2 <- :5\r
+ DO (1509) NEXT\r
+ PLEASE DO .5 <- !5$"'^":4~#1"$#1'~#1"'~#1093\r
+ DO .5 <- '?"!5~.5'~#1"$#1'~#1\r
+ PLEASE RETRIEVE :4\r
+ (1541) DO :4 <- .5\r
+ DO (1543) NEXT\r
+ (1542) DO (1544) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1543) DO (1001) NEXT\r
+ (1544) DO REINSTATE (1541)\r
+ PLEASE REINSTATE (1542)\r
+ PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5\r
+ DO RESUME #2\r
+ (1550) DO STASH :1 + :1 + :4 + :5 + :6 + .1 + .5\r
+ DO :3 <- #0\r
+ DO .5 <- '?"':2~:2'~#3"$#4'~#4\r
+ PLEASE DO (1551) NEXT\r
+ DO :4 <- #1\r
+ PLEASE DO (1553) NEXT\r
+ (1553) DO FORGET #1\r
+ DO .5 <- '?#0$"'V"'@":2~'#16384$#0'"$#3'~#1"$#2'\r
+ ~#1"'~#1\r
+ DO (1552) NEXT\r
+ DO :5 <- :2\r
+ DO :1 <- :4\r
+ PLEASE DO (1700) NEXT\r
+ DO :4 <- :2\r
+ DO :1 <- :5\r
+ PLEASE DO (1700) NEXT\r
+ DO (1553) NEXT\r
+ (1552) DO (1001) NEXT\r
+ DO RETRIEVE :1\r
+ (1556) PLEASE FORGET #1\r
+ DO :6 <- "'&":2~'#21845$#0'"$"'?#65535$":1\r
+ ~'#21845$#0'"'~'#0$#21845'"'~'#0$#21845'"$\r
+ "'&":2~'#0$#21845'"$"'?#65535$":1~'#0$\r
+ #21845'"'~'#0$#21845'"'~'#0$#21845'"\r
+ DO :6 <- "'?"'V":6~'#21845$#0'"$#21845'~'#0$\r
+ #21845'"$#21845'~'#0$#65535'"$"'?"'V":6\r
+ ~'#0$#21845'"$#21845'~'#0$#21845'"$#21845'\r
+ ~'#0$#65535'"\r
+ DO :5 <- "'?":1~'#21845$#0'"$":2~'#21845$#0'"'\r
+ ~'#0$#65535'"$"'?":1~'#0$#21845'"$":2~'#0$\r
+ #21845'"'~'#0$#65535'"\r
+ DO .5 <- "?'"':6~:5'~'"'"'&"':5~:5'~'#21845$#0'"$\r
+ #16384'~'#0$#21845'"$"'?:5~:5'~'#5461$#0'"'\r
+ ~'#16384$#5461'"$"'?:5~:5'~'#0$#21845'"'"\r
+ ~#1'$#2"~#1\r
+ DO (1554) NEXT\r
+ DO :5 <- :3\r
+ DO (1510) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO :3 <- "'^":4~'#21845$#0'"$":5~'#21845$#0'"'\r
+ ~'#0$#21845'"$"'^":4~'#0$#21845'"$":5~'#0$\r
+ #21845'"'~'#0$#21845'"\r
+ DO (1555) NEXT\r
+ (1554) PLEASE DO (1001) NEXT\r
+ (1555) DO FORGET #1\r
+ DO .5 <- 'V":4~#1"$"'?#2$":4~#1"'~#1"'~#1\r
+ DO (1551) NEXT\r
+ DO :5 <- :1\r
+ DO :1 <- :4\r
+ DO :4 <- :2\r
+ DO (1710) NEXT\r
+ DO :1 <- :4\r
+ DO :4 <- :2\r
+ DO (1710) NEXT\r
+ DO :1 <- :5\r
+ PLEASE DO (1556) NEXT\r
+ (1551) DO (1001) NEXT\r
+ PLEASE RETRIEVE :1 + :4 + :5 + :6 + .1 + .5\r
+ PLEASE RESUME #2\r
+ (1700) PLEASE STASH .2\r
+ DO .1 <- :1~'#0$#21845'\r
+ DO .2 <- :1~'#21845$#0'\r
+ DO :2 <- "'^.2$.2'~'#0$#21845'"$"'^.1$.1'~'#0$\r
+ #21845'"\r
+ DO .1 <- '?"'@.1$#0'~'#0$#21845'"$"'@.1$#65535'\r
+ ~'#0$#21845'"'~'#0$#21845'\r
+ DO .2 <- '?"'@.2$#0'~'#0$#21845'"$"'@.2$#65535'\r
+ ~'#0$#21845'"'~'#0$#21845'\r
+ DO :2 <- "'^":2~'#21845$#0'"$.1'~'#0$#21845'"$\r
+ "'^":2~'#0$#21845'"$"'.2$#0'~'#5461$#1'"'\r
+ ~'#0$#21845'"\r
+ DO .1 <- .2~#16384\r
+ PLEASE RETRIEVE .2\r
+ PLEASE RESUME #1\r
+ (1710) PLEASE STASH :1 + .2\r
+ DO .1 <- :1~'#0$#21845'\r
+ DO .2 <- :1~'#21845$#0'\r
+ DO :2 <- "'^.2$.2'~'#0$#21845'"$"'^.1$.1'~'#0$\r
+ #21845'"\r
+ DO :1 <- "'?"'@.2$#0'~'#0$#21845'"$"'@.2$#65535'\r
+ ~'#0$#21845'"'~'#0$#21845'"$"'?"'@.1$#0'\r
+ ~'#0$#21845'"$"'@.1$#65535'~'#0$#21845'"'\r
+ ~'#0$#21845'"\r
+ DO .1 <- :2~#1\r
+ DO :2 <- "'^":1~'#21845$#0'"$":2~'#0$#21844'"'\r
+ ~'#0$#21845'"$"'^":1~'#0$#21845'"$":2\r
+ ~'#21845$#0'"'~'#0$#21845'"\r
+ PLEASE RETRIEVE :1 + .2\r
+ PLEASE RESUME #1\r
+ (1900) DO STASH .2 + .5\r
+ DO .1 <- #0\r
+ DO .2 <- #1\r
+ PLEASE DO (1901) NEXT\r
+ (1901) PLEASE FORGET #1\r
+ DO %50 .1 <- 'V.1$.2'~'#0$#21845'\r
+ DO %50 .1 <- '^.1$".2~#43690"'~'#0$#21845'\r
+ DO .2 <- !2$#0'~'#5461$#1'\r
+ PLEASE DO .5 <- '^".2~.2"$#1'~#1\r
+ DO (1902) NEXT\r
+ DO (1901) NEXT\r
+ (1902) DO (1001) NEXT\r
+ DO RETRIEVE .2 + .5\r
+ PLEASE RESUME #2\r
+ (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3\r
+ DO .3 <- #65524\r
+ DO :1 <- #6\r
+ DO (1911) NEXT\r
+ PLEASE NOTE THAT YOU CAN'T GET ANYWHERE FROM HERE\r
+ (1912) DO (1001) NEXT\r
+ (1911) DO FORGET #1\r
+ PLEASE DO (1900) NEXT\r
+ DO :2 <- .1\r
+ DO (1500) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO .1 <- .3\r
+ DO (1020) NEXT\r
+ PLEASE DO .3 <- .1\r
+ DO .5 <- '?"!3~.3'~#3"$#2'~#1\r
+ DO (1912) NEXT\r
+ DO .1 <- #12\r
+ PLEASE DO (1050) NEXT\r
+ DO RETRIEVE .1\r
+ DO (1530) NEXT\r
+ DO :2 <- #32768\r
+ DO (1500) NEXT\r
+ PLEASE DO .2 <- :3~'#21760$#21760'\r
+ PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3\r
+ DO RESUME #1\r
--- /dev/null
+ PLEASE KNOCK "SHAVE-AND-A-HAIRCUT" BEFORE ENTERING\r
+\r
+ (1000) PLEASE IGNORE .4\r
+ PLEASE ABSTAIN FROM (1005)\r
+ (1009) DO STASH .1 + .2 + .5 + .6\r
+ DO .4 <- #1\r
+ DO (1004) NEXT\r
+ (1004) PLEASE FORGET #1\r
+ DO .3 <- '^.1$.2'~'#0$#3906'\r
+ DO .6 <- '?"'V"'&.1$.2'~'#0$#3906'"$"'^"'@.1$\r
+ .2'~'#0$#3906'"$#3906'~'#0$#11718'"'\r
+ ~'#0$#3906'"$#11718'~'#0$#3906'\r
+ PLEASE DO .5 <- "?!6~#12500'$#5"~#5\r
+ DO (1002) NEXT\r
+ DO .4 <- #2\r
+ (1005) DO (1006) NEXT\r
+ (1999) DOUBLE OR SINGLE PRECISION OVERFLOW\r
+ (1002) DO (1001) NEXT\r
+ (1006) PLEASE FORGET #1\r
+ DO .5 <- '?"!6~.6'~#4"$#5'~#5\r
+ DO (1003) NEXT\r
+ DO .1 <- .3\r
+ DO .2 <- !6$#0'~'#781$#1'\r
+ DO (1004) NEXT\r
+ (1003) DO (1001) NEXT\r
+ DO REINSTATE (1005)\r
+ (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6\r
+ DO REMEMBER .4\r
+ PLEASE RESUME #2\r
+ (1001) DO RESUME .5\r
+ (1010) DO STASH .1 + .2 + .4\r
+ DO .4 <- .1\r
+ DO .1 <- '?#15624$.2'~'#0$#3906'\r
+ DO (1020) NEXT\r
+ PLEASE DO .2 <- .4\r
+ PLEASE DO (1009) NEXT\r
+ DO RETRIEVE .1 + .2 + .4\r
+ PLEASE RESUME #1\r
+ (1020) DO STASH .2 + .3\r
+ DO .2 <- #1\r
+ PLEASE DO (1021) NEXT\r
+ (1021) DO FORGET #1\r
+ DO .3 <- '?"'V".1~.2"$#3'~#1"$#2'~#1\r
+ PLEASE DO .1 <- '^.1$.2'~'#0$#3906'\r
+ DO (1022) NEXT\r
+ DO .2 <- !2$#0'~'#781$#1'\r
+ DO (1021) NEXT\r
+ (1023) PLEASE RESUME .3\r
+ (1022) DO (1023) NEXT\r
+ PLEASE RETRIEVE .2 + .3\r
+ PLEASE RESUME #2\r
+ (1030) DO ABSTAIN FROM (1033)\r
+ PLEASE ABSTAIN FROM (1032)\r
+ (1039) DO STASH :1 + .5\r
+ DO (1530) NEXT\r
+ DO .3 <- :1~#3906\r
+ PLEASE DO .5 <- :1~'#3875$#3875'\r
+ DO .5 <- '?"!5~.5'~#4"$#5'~#5\r
+ DO (1031) NEXT\r
+ (1032) DO (1033) NEXT\r
+ DO (1999) NEXT\r
+ (1031) DO (1001) NEXT\r
+ (1033) DO .4 <- .5\r
+ DO REINSTATE (1032)\r
+ PLEASE REINSTATE (1033)\r
+ DO RETRIEVE :1 + .5\r
+ PLEASE RESUME #2\r
+ (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ DO STASH :1\r
+ PLEASE RETRIEVE .2\r
+ DO .1 <- .2\r
+ DO .2 <- #0\r
+ PLEASE DO (1520) NEXT\r
+ DO :2 <- :1\r
+ DO RETRIEVE .1 + .2 + :1\r
+ DO (1550) NEXT\r
+ PLEASE DO .3 <- :3\r
+ DO RETRIEVE :1 + :2 + :3\r
+ DO RESUME #1\r
+ (1050) PLEASE STASH :2 + :3 + .5\r
+ DO :2 <- .1\r
+ PLEASE DO (1550) NEXT\r
+ DO .5 <- :3~'#3875$#3875'\r
+ DO .5 <- '?"!5~.5'~#4"$#5'~#5\r
+ DO (1051) NEXT\r
+ DO (1999) NEXT\r
+ (1051) DO (1001) NEXT\r
+ DO .2 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + .5\r
+ DO RESUME #2\r
+ (1500) PLEASE ABSTAIN FROM (1502)\r
+ PLEASE ABSTAIN FROM (1506)\r
+ (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO .1 <- :1~#3906\r
+ PLEASE DO .2 <- :2~#3906\r
+ DO (1009) NEXT\r
+ DO .5 <- .3\r
+ PLEASE DO .6 <- .4\r
+ DO .1 <- :1~'#3875$#3875'\r
+ DO .2 <- :2~'#3875$#3875'\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ PLEASE DO (1503) NEXT\r
+ DO .6 <- .4\r
+ DO .2 <- #1\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ DO (1501) NEXT\r
+ (1504) PLEASE RESUME .6\r
+ (1503) DO (1504) NEXT\r
+ (1501) DO .2 <- .5\r
+ DO .5 <- '&.6$.4'\r
+ DO (1505) NEXT\r
+ (1506) DO (1502) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1505) DO (1001) NEXT\r
+ (1502) DO :4 <- .5\r
+ DO (1520) NEXT\r
+ DO :3 <- :1\r
+ PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO REINSTATE (1502)\r
+ DO REINSTATE (1506)\r
+ PLEASE RESUME #3\r
+ (1510) DO STASH :1 + :2 + :4\r
+ DO :1 <- "'?#15624$":2~'#3906$#0'"'~'#0$#3906'"$\r
+ "'?#15624$":2~'#0$#3906'"'~'#0$#3906'"\r
+ DO :2 <- #1\r
+ DO (1509) NEXT\r
+ PLEASE RETRIEVE :1\r
+ DO :2 <- :3\r
+ PLEASE DO (1509) NEXT\r
+ DO RETRIEVE :2 + :4\r
+ PLEASE RESUME #1\r
+ (1520) PLEASE STASH .3 + .4\r
+ DO .3 <- .1~#3255\r
+ DO (1525) NEXT\r
+ PLEASE DO .4 <- 'V.3$".2~#3255"'~'#0$#3906'\r
+ DO .3 <- .1~#651\r
+ PLEASE DO (1525) NEXT\r
+ DO :1 <- .4$"'V.3$".2~#651"'~'#0$#3906'"\r
+ PLEASE RETRIEVE .3 + .4\r
+ DO RESUME #1\r
+ (1525) DO .3 <- '"!3$#0'~'#781$#1'"$#0'~'#156$#6'\r
+ PLEASE RESUME #1\r
+ (1530) DO STASH :2 + :3 + :4 + .1 + .2 + .5\r
+ DO :3 <- #0\r
+ DO :4 <- .2\r
+ DO (1535) NEXT\r
+ (1535) PLEASE FORGET #1\r
+ DO .5 <- '?".1~#4"$#5'~#5\r
+ DO (1531) NEXT\r
+ DO :1 <- :4\r
+ DO (1720) NEXT\r
+ DO :1 <- :3\r
+ DO (1500) NEXT\r
+ PLEASE DO (1533) NEXT\r
+ (1531) PLEASE DO (1001) NEXT\r
+ (1533) DO FORGET #1\r
+ DO .1 <- .1~#3905\r
+ DO :4 <- ":4~'#0$#3906'"$"'":4~'#781$#0'"$#0'\r
+ ~'#781$#1'"\r
+ PLEASE DO .5 <- '?"!1~.1'~#4"$#5'~#5\r
+ DO (1532) NEXT\r
+ DO (1535) NEXT\r
+ (1532) DO (1001) NEXT\r
+ DO :1 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + :4 + .1 + .2 + .5\r
+ DO RESUME #2\r
+ (1540) PLEASE ABSTAIN FROM (1541)\r
+ DO ABSTAIN FROM (1542)\r
+ (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5\r
+ DO .1 <- :1~#3906\r
+ PLEASE DO .2 <- :2~'#3875$#3875'\r
+ DO .5 <- :1~'#3875$#3875'\r
+ DO (1530) NEXT\r
+ DO :3 <- :1\r
+ DO .2 <- :2~#3906\r
+ PLEASE DO (1530) NEXT\r
+ DO :5 <- :1\r
+ DO .1 <- .5\r
+ DO (1530) NEXT\r
+ DO :4 <- :1\r
+ PLEASE DO :1 <- ":3~'#3875$#3875'"$":4\r
+ ~'#3875$#3875'"\r
+ DO .5 <- ':1~:1'~#4\r
+ DO .2 <- :2~'#3875$#3875'\r
+ DO (1530) NEXT\r
+ PLEASE DO .5 <- '"':1~:1'~#4"$.5'~#6\r
+ DO .1 <- :3~#3906\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ PLEASE DO :2 <- :1\r
+ PLEASE DO .1 <- :4~#3906\r
+ DO (1520) NEXT\r
+ DO (1509) NEXT\r
+ DO .5 <- !5$"'^":4~#1"$#2'~#1"'~#131\r
+ DO :1 <- :3\r
+ DO :2 <- :5\r
+ DO (1509) NEXT\r
+ PLEASE DO .5 <- !5$"'^":4~#1"$#2'~#1"'~#3256\r
+ DO .5 <- '?"!5~.5'~#1"$#2'~#1\r
+ PLEASE RETRIEVE :4\r
+ (1541) DO :4 <- .5\r
+ DO (1543) NEXT\r
+ (1542) DO (1544) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1543) DO (1001) NEXT\r
+ (1544) DO REINSTATE (1541)\r
+ PLEASE REINSTATE (1542)\r
+ PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5\r
+ DO RESUME #2\r
+ (1550) DO STASH :1 + :4 + :5 + :6 + .1 + .5\r
+ DO :5 <- #0\r
+ DO .5 <- '?"':2~:2'~#4"$#5'~#5\r
+ PLEASE DO (1551) NEXT\r
+ DO :4 <- #1\r
+ PLEASE DO (1553) NEXT\r
+ (1553) DO FORGET #1\r
+ DO .5 <- '?"':2~"#12500$#0"'"$#3'~#1\r
+ DO (1552) NEXT\r
+ DO :2 <- ":2~'#0$#3906'"$"'":2~'#781$#0'"$#0'\r
+ ~'#781$#1'"\r
+ PLEASE DO :4 <- ":4~'#0$#3906'"$"'":4~'#781\r
+ $#0'"$#0'~'#781$#1'"\r
+ DO (1553) NEXT\r
+ (1552) DO (1001) NEXT\r
+ DO .1 <- #0\r
+ (1556) PLEASE FORGET #1\r
+ DO :6 <- "'&":2~'#3906$#0'"$"'?#15624$":1\r
+ ~'#3906$#0'"'~'#0$#3906'"'~'#0$#3906'"$\r
+ "'&":2~'#0$#3906'"$"'?#15624$":1~'#0$\r
+ #3906'"'~'#0$#3906'"'~'#0$#3906'"\r
+ DO :6 <- "'?"'V":6~'#3906$#0'"$#7812'~'#0$\r
+ #3906'"$#7812'~'#0$#15624'"$"'?"'V":6\r
+ ~'#0$#3906'"$#7812'~'#0$#3906'"$#7812'\r
+ ~'#0$#15624'"\r
+ DO :3 <- "'?":1~'#3906$#0'"$":2~'#3906$#0'"'\r
+ ~'#0$#15624'"$"'?":1~'#0$#3906'"$":2~'#0$\r
+ #3906'"'~'#0$#15624'"\r
+ DO .5 <- "?'"':6~:3'~'"'"'&"':3~:3'~'#3906$#0'"$\r
+ #3125'~'#0$#3906'"$"'?:3~:3'~'#781$#0'"'\r
+ ~'#3125$#781'"$"'?:3~:3'~'#0$#3906'"'"~#1'$\r
+ #3"~#1\r
+ PLEASE DO (1557) NEXT\r
+ DO (1510) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO .5 <- '?#0$"'V.1$#3'~#1"'~#1\r
+ DO (1557) NEXT\r
+ DO .1 <- '^.1$#3906'~'#0$#3906'\r
+ DO (1556) NEXT\r
+ (1557) PLEASE DO (1001) NEXT\r
+ PLEASE FORGET #1\r
+ DO :5 <- "'V":4~'.1$#0'"$":5~'#3906$#0'"'\r
+ ~'#0$#3906'"$"'V":4~'#0$.1'"$":5~'#0$\r
+ #3906'"'~'#0$#3906'"\r
+ DO .5 <- "?#2$':4~#1'"~#1\r
+ DO (1551) NEXT\r
+ DO :2 <- :2~'#3906$#3905'\r
+ DO :4 <- :4~'#3906$#3905'\r
+ DO .1 <- #0\r
+ PLEASE DO (1556) NEXT\r
+ (1551) DO (1001) NEXT\r
+ DO :3 <- :5\r
+ PLEASE RETRIEVE :1 + :4 + :5 + :6 + .1 + .5\r
+ PLEASE RESUME #2\r
+ (1720) PLEASE STASH :1 + :3 + :4 + .1 + .5\r
+ DO :2 <- #0\r
+ DO .2 <- #0\r
+ DO .5 <- '?".1~#4"$#5'~#5\r
+ DO (1729) NEXT\r
+ DO .5 <- .1~#1\r
+ DO .2 <- :1~'#3906$#0'\r
+ DO .1 <- :1~'#0$#3906'\r
+ PLEASE DO (1724) NEXT\r
+ DO :1 <- '"?#0$.2"~"#0$#3906"'$'"?#0$.1"~"#0$\r
+ #3906"'\r
+ DO :2 <- '"?'"V.2$#3906"~"#0$#3906"'$\r
+ #3906"~"#0$#3906"'$'"?'"V.1$#3906"\r
+ ~"#0$#3906"'$#3906"~"#0$#3906"'\r
+ DO (1728) NEXT\r
+ (1724) PLEASE DO (1723) NEXT\r
+ DO :1 <- '"?#0$'"^.2$.2"~"#0$#3906"'"~"#0$#3906"'$\r
+ '"?#0$'"^.1$.1"~"#0$#3906"'"~"#0$#3906"'\r
+ DO :2 <- '"?'"V'"@.2$#11718"~"#0$#3906"'$#7812"\r
+ ~"#0$#3906"'$#7812"~"#0$#3906"'$'"?'"V'"@.1$\r
+ #11718"~"#0$#3906"'$#7812"~"#0$#3906"'$#7812"\r
+ ~"#0$#3906"'\r
+ (1728) DO .2 <- :2~'#3125$#0'\r
+ DO :2 <- ':2~"#0$#3906"'$'"':2~"#781$#0"'$#0"\r
+ ~"#781$#1"'\r
+ DO (1509) NEXT\r
+ DO :2 <- :3\r
+ DO .2 <- '^.2$"'?":4~#1"$#1'~#1"'~#1\r
+ DO (1721) NEXT\r
+ (1723) PLEASE DO (1722) NEXT\r
+ DO :1 <- '"^.2$.2"~"#0$#3906"'$'"^.1$.1"~"#0$\r
+ #3906"'\r
+ DO :2 <- '"?'"V'"2@.2$#15624"~"#0$#3906"'$\r
+ #11718"~"#0$#3906"'$#11718"~"#0$#3906"'$\r
+ '"?'"V'"2@.1$#15624"~"#0$#3906"'$#11718"\r
+ ~"#0$#3906"'$#11718"~"#0$#3906"'\r
+ PLEASE FORGET #2\r
+ DO (1728) NEXT\r
+ (1729) DO (1001) NEXT\r
+ DO (1721) NEXT\r
+ (1722) PLEASE DO (1001) NEXT\r
+ DO :2 <- :1\r
+ DO .2 <- #0\r
+ DO FORGET #1\r
+ (1721) PLEASE RETRIEVE :1 + :3 + :4 + .1 + .5\r
+ PLEASE RESUME #3\r
+ (1900) DO STASH .2 + .5\r
+ DO .1 <- #0\r
+ DO .2 <- #1\r
+ PLEASE DO (1901) NEXT\r
+ (1901) DO %20 (1903) NEXT\r
+ DO .1 <- 'V.1$.2'~'#0$#3906'\r
+ DO %50 .1 <- '^.1$".2~#7812"'~'#0$#3906'\r
+ DO %50 .1 <- '^.1$.2'~'#0$#3906'\r
+ PLEASE DO (1903) NEXT\r
+ (1903) PLEASE FORGET #2\r
+ DO .2 <- !2$#0'~'#781$#1'\r
+ PLEASE DO .5 <- '^".2~.2"$#1'~#1\r
+ DO (1902) NEXT\r
+ DO (1901) NEXT\r
+ (1902) DO (1001) NEXT\r
+ DO RETRIEVE .2 + .5\r
+ PLEASE RESUME #2\r
+ (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3\r
+ DO .3 <- #15613\r
+ DO :1 <- #6\r
+ DO (1911) NEXT\r
+ PLEASE NOTE THAT YOU CAN'T GET SOMETHING FROM NOTHING\r
+ (1912) DO (1001) NEXT\r
+ (1911) DO FORGET #1\r
+ PLEASE DO (1900) NEXT\r
+ DO :2 <- .1\r
+ DO (1500) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO .1 <- .3\r
+ DO (1020) NEXT\r
+ PLEASE DO .3 <- .1\r
+ DO .5 <- '?"!3~.3'~#4"$#3'~#1\r
+ DO (1912) NEXT\r
+ DO .1 <- #12\r
+ PLEASE DO (1050) NEXT\r
+ DO RETRIEVE .1\r
+ DO (1530) NEXT\r
+ DO :2 <- #7812\r
+ DO (1500) NEXT\r
+ PLEASE DO .2 <- :3~'#3875$#3875'\r
+ PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3\r
+ DO RESUME #1\r
--- /dev/null
+ PLEASE KNOCK THRICE TWO TIMES BEFORE ENTERING\r
+\r
+ (1000) PLEASE IGNORE .4\r
+ PLEASE ABSTAIN FROM (1005)\r
+ (1009) DO STASH .1 + .2 + .5 + .6\r
+ DO .4 <- #1\r
+ DO (1004) NEXT\r
+ (1004) PLEASE FORGET #1\r
+ DO .3 <- '^.1$.2'~'#0$#9331'\r
+ DO .6 <- '?"'V"'V"'&.1$.2'~'#0$#9331'"$"'^"'@.1$\r
+ .2'~'#0$#9331'"$#9331'~'#0$#9331'"'~'#0$\r
+ #9331'"$"'^"'2@.1$.2'~'#0$#9331'"$#18662'\r
+ ~'#0$#9331'"'~'#0$#37324'"$#37324'~'#0$#9331'\r
+ PLEASE DO .5 <- "?!6~#38880'$#6"~#6\r
+ DO (1002) NEXT\r
+ DO .4 <- #2\r
+ (1005) DO (1006) NEXT\r
+ (1999) DOUBLE OR SINGLE PRECISION OVERFLOW\r
+ (1002) DO (1001) NEXT\r
+ (1006) PLEASE FORGET #1\r
+ DO .5 <- '?"!6~.6'~#5"$#6'~#6\r
+ DO (1003) NEXT\r
+ DO .1 <- .3\r
+ DO .2 <- !6$#0'~'#1555$#1'\r
+ DO (1004) NEXT\r
+ (1003) DO (1001) NEXT\r
+ DO REINSTATE (1005)\r
+ (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6\r
+ DO REMEMBER .4\r
+ PLEASE RESUME #2\r
+ (1001) DO RESUME .5\r
+ (1010) DO STASH .1 + .2 + .4\r
+ DO .4 <- .1\r
+ DO .1 <- '?#46655$.2'~'#0$#9331'\r
+ DO (1020) NEXT\r
+ PLEASE DO .2 <- .4\r
+ PLEASE DO (1009) NEXT\r
+ DO RETRIEVE .1 + .2 + .4\r
+ PLEASE RESUME #1\r
+ (1020) DO STASH .2 + .3\r
+ DO .2 <- #1\r
+ PLEASE DO (1021) NEXT\r
+ (1021) DO FORGET #1\r
+ DO .3 <- '?"'V".1~.2"$#4'~#1"$#3'~#1\r
+ PLEASE DO .1 <- '^.1$.2'~'#0$#9331'\r
+ DO (1022) NEXT\r
+ DO .2 <- !2$#0'~'#1555$#1'\r
+ DO (1021) NEXT\r
+ (1023) PLEASE RESUME .3\r
+ (1022) DO (1023) NEXT\r
+ PLEASE RETRIEVE .2 + .3\r
+ PLEASE RESUME #2\r
+ (1030) DO ABSTAIN FROM (1033)\r
+ PLEASE ABSTAIN FROM (1032)\r
+ (1039) DO STASH :1 + .5\r
+ DO (1530) NEXT\r
+ DO .3 <- :1~#9331\r
+ PLEASE DO .5 <- :1~'#9288$#9288'\r
+ DO .5 <- '?"!5~.5'~#5"$#6'~#6\r
+ DO (1031) NEXT\r
+ (1032) DO (1033) NEXT\r
+ DO (1999) NEXT\r
+ (1031) DO (1001) NEXT\r
+ (1033) DO .4 <- .5\r
+ DO REINSTATE (1032)\r
+ PLEASE REINSTATE (1033)\r
+ DO RETRIEVE :1 + .5\r
+ PLEASE RESUME #2\r
+ (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ DO STASH :1\r
+ PLEASE RETRIEVE .2\r
+ DO .1 <- .2\r
+ DO .2 <- #0\r
+ PLEASE DO (1520) NEXT\r
+ DO :2 <- :1\r
+ DO RETRIEVE .1 + .2 + :1\r
+ DO (1550) NEXT\r
+ PLEASE DO .3 <- :3\r
+ DO RETRIEVE :1 + :2 + :3\r
+ DO RESUME #1\r
+ (1050) PLEASE STASH :2 + :3 + .5\r
+ DO :2 <- .1\r
+ PLEASE DO (1550) NEXT\r
+ DO .5 <- :3~'#9288$#9288'\r
+ DO .5 <- '?"!5~.5'~#5"$#6'~#6\r
+ DO (1051) NEXT\r
+ DO (1999) NEXT\r
+ (1051) DO (1001) NEXT\r
+ DO .2 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + .5\r
+ DO RESUME #2\r
+ (1200) DO .2 <- '^.1$.1'~'#0$#9331'\r
+ DO .3 <- '?"'2@.1$#0'~'#0$#9331'"$"'2@.1$#46655'\r
+ ~'#0$#9331'"'~'#0$#9331'\r
+ DO .2 <- '^.2$"!3$#0'~'#1555$#1'"'~'#0$#9331'\r
+ DO .3 <- .3~#7776\r
+ PLEASE RESUME #1\r
+ (1210) DO .2 <- '^"'?"'@.1$#0'~'#0$#9331'"$"'@.1$#46655'\r
+ ~'#0$#9331'"'~'#0$#9331'"$"'?"'3@.1$#0'~'#0$\r
+ #9331'"$"'3@.1$#46655'~'#0$#9331'"'~'#0$\r
+ #9331'"'~'#0$#9331'\r
+ DO .3 <- '^"'^.1$.1'~'#0$#9331'"$.1'~'#0$#9331'\r
+ DO .2 <- '^.2$".3~#9330"'~'#0$#9331'\r
+ DO .3 <- .3~#1\r
+ PLEASE RESUME #1\r
+ (1500) PLEASE ABSTAIN FROM (1502)\r
+ PLEASE ABSTAIN FROM (1506)\r
+ (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO .1 <- :1~#9331\r
+ PLEASE DO .2 <- :2~#9331\r
+ DO (1009) NEXT\r
+ DO .5 <- .3\r
+ PLEASE DO .6 <- .4\r
+ DO .1 <- :1~'#9288$#9288'\r
+ DO .2 <- :2~'#9288$#9288'\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ PLEASE DO (1503) NEXT\r
+ DO .6 <- .4\r
+ DO .2 <- #1\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ DO (1501) NEXT\r
+ (1504) PLEASE RESUME .6\r
+ (1503) DO (1504) NEXT\r
+ (1501) DO .2 <- .5\r
+ DO .5 <- '&.6$.4'\r
+ DO (1505) NEXT\r
+ (1506) DO (1502) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1505) DO (1001) NEXT\r
+ (1502) DO :4 <- .5\r
+ DO (1520) NEXT\r
+ DO :3 <- :1\r
+ PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO REINSTATE (1502)\r
+ DO REINSTATE (1506)\r
+ PLEASE RESUME #3\r
+ (1510) DO STASH :1 + :2 + :4\r
+ DO :1 <- "'?#46655$":2~'#9331$#0'"'~'#0$#9331'"$\r
+ "'?#46655$":2~'#0$#9331'"'~'#0$#9331'"\r
+ DO :2 <- #1\r
+ DO (1509) NEXT\r
+ PLEASE RETRIEVE :1\r
+ DO :2 <- :3\r
+ PLEASE DO (1509) NEXT\r
+ DO RETRIEVE :2 + :4\r
+ PLEASE RESUME #1\r
+ (1520) PLEASE STASH .3 + .4\r
+ DO .3 <- .1~#7998\r
+ DO (1525) NEXT\r
+ PLEASE DO .4 <- 'V.3$".2~#7998"'~'#0$#9331'\r
+ DO .3 <- .1~#1333\r
+ PLEASE DO (1525) NEXT\r
+ DO :1 <- .4$"'V.3$".2~#1333"'~'#0$#9331'"\r
+ PLEASE RETRIEVE .3 + .4\r
+ DO RESUME #1\r
+ (1525) DO .3 <- '"!3$#0'~'#1555$#1'"$#0'~'#259$#7'\r
+ PLEASE RESUME #1\r
+ (1530) DO STASH :2 + :3 + .1 + .2 + .3\r
+ DO :3 <- #0\r
+ DO :2 <- .1\r
+ DO (1535) NEXT\r
+ (1535) PLEASE FORGET #1\r
+ DO .3 <- '?"!2~.2'~#5"$#6'~#6\r
+ DO (1532) NEXT\r
+ DO .1 <- .2\r
+ DO (1210) NEXT\r
+ DO .3 <- '?#1$".3~#5"'~#1\r
+ DO (1531) NEXT\r
+ DO :1 <- :3\r
+ DO (1500) NEXT\r
+ PLEASE DO (1533) NEXT\r
+ (1531) PLEASE DO (1534) NEXT\r
+ (1533) DO FORGET #1\r
+ DO :1 <- :2\r
+ DO (1700) NEXT\r
+ DO (1535) NEXT\r
+ (1534) PLEASE RESUME .3\r
+ (1532) DO (1534) NEXT\r
+ DO :1 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + .1 + .2 + .3\r
+ DO RESUME #2\r
+ (1540) PLEASE ABSTAIN FROM (1541)\r
+ DO ABSTAIN FROM (1542)\r
+ (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5\r
+ DO .1 <- :1~#9331\r
+ PLEASE DO .2 <- :2~'#9288$#9288'\r
+ DO .5 <- :1~'#9288$#9288'\r
+ DO (1530) NEXT\r
+ DO :3 <- :1\r
+ DO .2 <- :2~#9331\r
+ PLEASE DO (1530) NEXT\r
+ DO :5 <- :1\r
+ DO .1 <- .5\r
+ DO (1530) NEXT\r
+ DO :4 <- :1\r
+ PLEASE DO :1 <- ":3~'#9288$#9288'"$":4\r
+ ~'#9288$#9288'"\r
+ DO .5 <- ':1~:1'~#5\r
+ DO .2 <- :2~'#9288$#9288'\r
+ DO (1530) NEXT\r
+ PLEASE DO .5 <- '"':1~:1'~#5"$.5'~#7\r
+ DO .1 <- :3~#9331\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ PLEASE DO :2 <- :1\r
+ PLEASE DO .1 <- :4~#9331\r
+ DO (1520) NEXT\r
+ DO (1509) NEXT\r
+ DO .5 <- !5$"'^":4~#1"$#3'~#1"'~#223\r
+ DO :1 <- :3\r
+ DO :2 <- :5\r
+ DO (1509) NEXT\r
+ PLEASE DO .5 <- !5$"'^":4~#1"$#3'~#1"'~#7999\r
+ DO .5 <- '?"!5~.5'~#1"$#3'~#1\r
+ PLEASE RETRIEVE :4\r
+ (1541) DO :4 <- .5\r
+ DO (1543) NEXT\r
+ (1542) DO (1544) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1543) DO (1001) NEXT\r
+ (1544) DO REINSTATE (1541)\r
+ PLEASE REINSTATE (1542)\r
+ PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5\r
+ DO RESUME #2\r
+ (1550) DO STASH :1 + :1 + :4 + :5 + :6 + .1 + .5\r
+ DO :3 <- #0\r
+ DO .5 <- '?"':2~:2'~#5"$#6'~#6\r
+ PLEASE DO (1551) NEXT\r
+ DO :4 <- #1\r
+ PLEASE DO (1553) NEXT\r
+ (1553) DO FORGET #1\r
+ DO .5 <- '?#0$"'V"'2@":2~'#7776$#0'"$#5'~#1"$#4'\r
+ ~#1"'~#1\r
+ DO (1552) NEXT\r
+ DO :5 <- :2\r
+ DO :1 <- :4\r
+ PLEASE DO (1700) NEXT\r
+ DO :4 <- :2\r
+ DO :1 <- :5\r
+ PLEASE DO (1700) NEXT\r
+ DO (1553) NEXT\r
+ (1552) DO (1001) NEXT\r
+ DO RETRIEVE :1\r
+ (1556) PLEASE FORGET #1\r
+ DO :6 <- "'&":2~'#9331$#0'"$"'?#46655$":1\r
+ ~'#9331$#0'"'~'#0$#9331'"'~'#0$#9331'"$\r
+ "'&":2~'#0$#9331'"$"'?#46655$":1~'#0$\r
+ #9331'"'~'#0$#9331'"'~'#0$#9331'"\r
+ DO :5 <- "'?":1~'#9331$#0'"$":2~'#9331$#0'"'\r
+ ~'#0$#9331'"$"'?":1~'#0$#9331'"$":2~'#0$\r
+ #9331'"'~'#0$#9331'"\r
+ DO :6 <- "'&":6~'#9331$#0'"$":5~'#9331$#0'"'\r
+ ~'#0$#9331'"$"'&":6~'#0$#9331'"$":5~'#0$\r
+ #9331'"'~'#0$#9331'"\r
+ DO :5 <- :5~'#46655$#46655'\r
+ DO :6 <- "'?"'V":6~'#9331$#0'"$#27993'~'#0$\r
+ #9331'"$#27993'~'#0$#46655'"$"'?"'V":6\r
+ ~'#0$#9331'"$#27993'~'#0$#9331'"$#27993'\r
+ ~'#0$#46655'"\r
+ DO .5 <- "?'"':6~:5'~'"'"'&"':5~:5'~'#9331$#0'"$\r
+ #7776'~'#0$#9331'"$"'?:5~:5'~'#1555$#0'"'\r
+ ~'#7776$#1555'"$"'?:5~:5'~'#0$#9331'"'"~#1'$\r
+ #4"~#1\r
+ DO (1554) NEXT\r
+ DO :5 <- :3\r
+ DO (1510) NEXT\r
+ DO :1 <- :4\r
+ DO :4 <- :2\r
+ DO :2 <- :5\r
+ DO :5 <- :3\r
+ DO (1500) NEXT\r
+ DO :2 <- :4\r
+ DO :4 <- :1\r
+ DO :1 <- :5\r
+ DO (1555) NEXT\r
+ (1554) PLEASE DO (1001) NEXT\r
+ (1555) DO FORGET #1\r
+ DO .5 <- '?#2$"'@#0$":4~#1"'~#1"'~#1\r
+ DO (1551) NEXT\r
+ DO :5 <- :1\r
+ DO :1 <- :4\r
+ DO :4 <- :2\r
+ DO (1710) NEXT\r
+ DO :1 <- :4\r
+ DO :4 <- :2\r
+ DO (1710) NEXT\r
+ DO :1 <- :5\r
+ PLEASE DO (1556) NEXT\r
+ (1551) DO (1001) NEXT\r
+ PLEASE RETRIEVE :1 + :4 + :5 + :6 + .1 + .5\r
+ PLEASE RESUME #2\r
+ (1700) PLEASE STASH .2\r
+ DO .1 <- :1~'#0$#9331'\r
+ DO .2 <- :1~'#9331$#0'\r
+ DO :2 <- "'^.2$.2'~'#0$#9331'"$"'^.1$.1'~'#0$\r
+ #9331'"\r
+ DO .1 <- '?"'2@.1$#0'~'#0$#9331'"$"'2@.1$#46655'\r
+ ~'#0$#9331'"'~'#0$#9331'\r
+ DO .2 <- '?"'2@.2$#0'~'#0$#9331'"$"'2@.2$#46655'\r
+ ~'#0$#9331'"'~'#0$#9331'\r
+ DO :2 <- "'^":2~'#9331$#0'"$.1'~'#0$#9331'"$"'^":2\r
+ ~'#0$#9331'"$"'.2$#0'~'#1555$#1'"'~'#0$#9331'"\r
+ DO .1 <- .2~#7776\r
+ PLEASE RETRIEVE .2\r
+ PLEASE RESUME #1\r
+ (1710) PLEASE STASH :1 + .2\r
+ DO .2 <- :1~'#9331$#0'\r
+ DO .1 <- :1~'#0$#9331'\r
+ DO :2 <- "'^"'^.2$.2'~'#0$#9331'"$.2'~'#0$\r
+ #9331'"$"'^"'^.1$.1'~'#0$#9331'"$.1'~'#0$\r
+ #9331'"\r
+ DO .1 <- '^"'?"'@.1$#0'~'#0$#9331'"$"'@.1$#46655'\r
+ ~'#0$#9331'"'~'#0$#9331'"$"'?"'3@.1$#0'~'#0$\r
+ #9331'"$"'3@.1$#46655'~'#0$#9331'"'~'#0$\r
+ #9331'"'~'#0$#9331'\r
+ DO :1 <- "'^"'?"'@.2$#0'~'#0$#9331'"$"'@.2$#46655'\r
+ ~'#0$#9331'"'~'#0$#9331'"$"'?"'3@.2$#0'~'#0$\r
+ #9331'"$"'3@.2$#46655'~'#0$#9331'"'~'#0$\r
+ #9331'"'~'#0$#9331'"$.1\r
+ DO .1 <- :2~#1\r
+ DO :2 <- "'^":1~'#9331$#0'"$":2~'#0$#9330'"'\r
+ ~'#0$#9331'"$"'^":1~'#0$#9331'"$":2~'#9331$\r
+ #0'"'~'#0$#9331'"\r
+ PLEASE RETRIEVE :1 + .2\r
+ PLEASE RESUME #1\r
+ (1900) DO STASH .2 + .5\r
+ DO .1 <- #0\r
+ DO .2 <- #1\r
+ PLEASE DO (1901) NEXT\r
+ (1901) DO FORGET #1\r
+ DO %50 (1904) NEXT\r
+ DO %50 (1901) NEXT\r
+ PLEASE DO (1903) NEXT\r
+ (1904) DO .1 <- '^.1$.2'~'#0$#9331'\r
+ DO %50 .1 <- '^.1$.2'~'#0$#9331'\r
+ (1903) PLEASE FORGET #1\r
+ DO %50 .1 <- '^.1$".2~#27993"'~'#0$#9331'\r
+ DO .2 <- !2$#0'~'#1555$#1'\r
+ PLEASE DO .5 <- '^".2~.2"$#1'~#1\r
+ DO (1902) NEXT\r
+ DO (1901) NEXT\r
+ (1902) DO (1001) NEXT\r
+ DO RETRIEVE .2 + .5\r
+ PLEASE RESUME #2\r
+ (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3\r
+ DO .3 <- #46644\r
+ DO :1 <- #6\r
+ DO (1911) NEXT\r
+ PLEASE NOTE THAT YOU CAN'T GET BLOOD FROM A TURNIP\r
+ (1912) DO (1001) NEXT\r
+ (1911) DO FORGET #1\r
+ PLEASE DO (1900) NEXT\r
+ DO :2 <- .1\r
+ DO (1500) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO .1 <- .3\r
+ DO (1020) NEXT\r
+ PLEASE DO .3 <- .1\r
+ DO .5 <- '?"!3~.3'~#5"$#4'~#1\r
+ DO (1912) NEXT\r
+ DO .1 <- #12\r
+ PLEASE DO (1050) NEXT\r
+ DO RETRIEVE .1\r
+ DO (1530) NEXT\r
+ DO :2 <- #23328\r
+ DO (1500) NEXT\r
+ PLEASE DO .2 <- :3~'#9288$#9288'\r
+ PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3\r
+ DO RESUME #1\r
--- /dev/null
+ PLEASE KNOCK "SHAVE-AND-A-HAIRCUT-TWO-PLEASE" BEFORE ENTERING\r
+\r
+ (1000) PLEASE IGNORE .4\r
+ PLEASE ABSTAIN FROM (1005)\r
+ (1009) DO STASH .1 + .2 + .5 + .6\r
+ DO .4 <- #1\r
+ DO (1004) NEXT\r
+ (1004) PLEASE FORGET #1\r
+ DO .3 <- '^.1$.2'~'#0$#2801'\r
+ DO .6 <- '?"'V"'V"'&.1$.2'~'#0$#2801'"$"'^"'@.1$\r
+ .2'~'#0$#2801'"$#2801'~'#0$#2801'"'~'#0$\r
+ #2801'"$"'^"'2@.1$.2'~'#0$#2801'"$#5602'\r
+ ~'#0$#2801'"'~'#0$#14005'"$#14005'~'#0$#2801'\r
+ PLEASE DO .5 <- "?!6~#14406'$#7"~#7\r
+ DO (1002) NEXT\r
+ DO .4 <- #2\r
+ (1005) DO (1006) NEXT\r
+ (1999) DOUBLE OR SINGLE PRECISION OVERFLOW\r
+ (1002) DO (1001) NEXT\r
+ (1006) PLEASE FORGET #1\r
+ DO .5 <- '?"!6~.6'~#6"$#7'~#7\r
+ DO (1003) NEXT\r
+ DO .1 <- .3\r
+ DO .2 <- !6$#0'~'#400$#1'\r
+ DO (1004) NEXT\r
+ (1003) DO (1001) NEXT\r
+ DO REINSTATE (1005)\r
+ (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6\r
+ DO REMEMBER .4\r
+ PLEASE RESUME #2\r
+ (1001) DO RESUME .5\r
+ (1010) DO STASH .1 + .2 + .4\r
+ DO .4 <- .1\r
+ DO .1 <- '?#16806$.2'~'#0$#2801'\r
+ DO (1020) NEXT\r
+ PLEASE DO .2 <- .4\r
+ PLEASE DO (1009) NEXT\r
+ DO RETRIEVE .1 + .2 + .4\r
+ PLEASE RESUME #1\r
+ (1020) DO STASH .2 + .3\r
+ DO .2 <- #1\r
+ PLEASE DO (1021) NEXT\r
+ (1021) DO FORGET #1\r
+ DO .3 <- '?"'V".1~.2"$#5'~#1"$#4'~#1\r
+ PLEASE DO .1 <- '^.1$.2'~'#0$#2801'\r
+ DO (1022) NEXT\r
+ DO .2 <- !2$#0'~'#400$#1'\r
+ DO (1021) NEXT\r
+ (1023) PLEASE RESUME .3\r
+ (1022) DO (1023) NEXT\r
+ PLEASE RETRIEVE .2 + .3\r
+ PLEASE RESUME #2\r
+ (1030) DO ABSTAIN FROM (1033)\r
+ PLEASE ABSTAIN FROM (1032)\r
+ (1039) DO STASH :1 + .5\r
+ DO (1530) NEXT\r
+ DO .3 <- :1~#2801\r
+ PLEASE DO .5 <- :1~'#2793$#2744'\r
+ DO .5 <- '?"!5~.5'~#6"$#7'~#7\r
+ DO (1031) NEXT\r
+ (1032) DO (1033) NEXT\r
+ DO (1999) NEXT\r
+ (1031) DO (1001) NEXT\r
+ (1033) DO .4 <- .5\r
+ DO REINSTATE (1032)\r
+ PLEASE REINSTATE (1033)\r
+ DO RETRIEVE :1 + .5\r
+ PLEASE RESUME #2\r
+ (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ DO STASH :1\r
+ PLEASE RETRIEVE .2\r
+ DO .1 <- .2\r
+ DO .2 <- #0\r
+ PLEASE DO (1520) NEXT\r
+ DO :2 <- :1\r
+ DO RETRIEVE .1 + .2 + :1\r
+ DO (1550) NEXT\r
+ PLEASE DO .3 <- :3\r
+ DO RETRIEVE :1 + :2 + :3\r
+ DO RESUME #1\r
+ (1050) PLEASE STASH :2 + :3 + .5\r
+ DO :2 <- .1\r
+ PLEASE DO (1550) NEXT\r
+ DO .5 <- :3~'#2793$#2744'\r
+ DO .5 <- '?"!5~.5'~#6"$#7'~#7\r
+ DO (1051) NEXT\r
+ DO (1999) NEXT\r
+ (1051) DO (1001) NEXT\r
+ DO .2 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + .5\r
+ DO RESUME #2\r
+ (1500) PLEASE ABSTAIN FROM (1502)\r
+ PLEASE ABSTAIN FROM (1506)\r
+ (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO .1 <- :1~#2801\r
+ PLEASE DO .2 <- :2~#2801\r
+ DO (1009) NEXT\r
+ DO .5 <- .3\r
+ PLEASE DO .6 <- .4\r
+ DO .1 <- :1~'#2793$#2744'\r
+ DO .2 <- :2~'#2793$#2744'\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ PLEASE DO (1503) NEXT\r
+ DO .6 <- .4\r
+ DO .2 <- #1\r
+ DO (1009) NEXT\r
+ DO .1 <- .3\r
+ DO (1501) NEXT\r
+ (1504) PLEASE RESUME .6\r
+ (1503) DO (1504) NEXT\r
+ (1501) DO .2 <- .5\r
+ DO .5 <- '&.6$.4'\r
+ DO (1505) NEXT\r
+ (1506) DO (1502) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1505) DO (1001) NEXT\r
+ (1502) DO :4 <- .5\r
+ DO (1520) NEXT\r
+ DO :3 <- :1\r
+ PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6\r
+ DO REINSTATE (1502)\r
+ DO REINSTATE (1506)\r
+ PLEASE RESUME #3\r
+ (1510) DO STASH :1 + :2 + :4\r
+ DO :1 <- "'?#16806$":2~'#2801$#0'"'~'#0$#2801'"$\r
+ "'?#16806$":2~'#0$#2801'"'~'#0$#2801'"\r
+ DO :2 <- #1\r
+ DO (1509) NEXT\r
+ PLEASE RETRIEVE :1\r
+ DO :2 <- :3\r
+ PLEASE DO (1509) NEXT\r
+ DO RETRIEVE :2 + :4\r
+ PLEASE RESUME #1\r
+ (1520) PLEASE STASH .3 + .4\r
+ DO .3 <- .1~#2451\r
+ DO (1525) NEXT\r
+ PLEASE DO .4 <- 'V.3$".2~#350"'~'#0$#2801'\r
+ DO .3 <- .1~#350\r
+ PLEASE DO (1526) NEXT\r
+ DO :1 <- .4$"'V.3$".2~#2451"'~'#0$#2801'"\r
+ PLEASE RETRIEVE .3 + .4\r
+ DO RESUME #1\r
+ (1525) DO .3 <- '"!3$#0'~'#400$#1'"$#0'~'#400$#1'\r
+ PLEASE RESUME #1\r
+ (1526) DO .3 <- '"!3$#0'~'#400$#1'"$#0'~'#57$#8'\r
+ PLEASE RESUME #1\r
+ (1530) DO STASH :2 + :3 + :4 + .1 + .2 + .5\r
+ DO :3 <- #0\r
+ DO :4 <- .2\r
+ DO (1535) NEXT\r
+ (1535) PLEASE FORGET #1\r
+ DO .5 <- '?".1~#6"$#7'~#7\r
+ DO (1531) NEXT\r
+ DO :1 <- :4\r
+ DO (1720) NEXT\r
+ DO :1 <- :3\r
+ DO (1500) NEXT\r
+ PLEASE DO (1533) NEXT\r
+ (1531) PLEASE DO (1001) NEXT\r
+ (1533) DO FORGET #1\r
+ DO .1 <- .1~#2800\r
+ DO :4 <- ":4~'#0$#2801'"$"'":4~'#400$#0'"$#0'\r
+ ~'#400$#1'"\r
+ PLEASE DO .5 <- '?"!1~.1'~#6"$#7'~#7\r
+ DO (1532) NEXT\r
+ DO (1535) NEXT\r
+ (1532) DO (1001) NEXT\r
+ DO :1 <- :3\r
+ PLEASE RETRIEVE :2 + :3 + :4 + .1 + .2 + .5\r
+ DO RESUME #2\r
+ (1540) PLEASE ABSTAIN FROM (1541)\r
+ DO ABSTAIN FROM (1542)\r
+ (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5\r
+ DO .1 <- :1~#2801\r
+ PLEASE DO .2 <- :2~'#2793$#2744'\r
+ DO .5 <- :1~'#2793$#2744'\r
+ DO (1530) NEXT\r
+ DO :3 <- :1\r
+ DO .2 <- :2~#2801\r
+ PLEASE DO (1530) NEXT\r
+ DO :5 <- :1\r
+ DO .1 <- .5\r
+ DO (1530) NEXT\r
+ DO :4 <- :1\r
+ PLEASE DO :1 <- ":3~'#2793$#2744'"$":4\r
+ ~'#2793$#2744'"\r
+ DO .5 <- ':1~:1'~#6\r
+ DO .2 <- :2~'#2793$#2744'\r
+ DO (1530) NEXT\r
+ PLEASE DO .5 <- '"':1~:1'~#6"$.5'~#8\r
+ DO .1 <- :3~#2801\r
+ DO .2 <- #0\r
+ DO (1520) NEXT\r
+ PLEASE DO :2 <- :1\r
+ PLEASE DO .1 <- :4~#2801\r
+ DO (1520) NEXT\r
+ DO (1509) NEXT\r
+ DO .5 <- !5$"'^":4~#1"$#4'~#1"'~#351\r
+ DO :1 <- :3\r
+ DO :2 <- :5\r
+ DO (1509) NEXT\r
+ PLEASE DO .5 <- !5$"'^":4~#1"$#4'~#1"'~'#57$#1'\r
+ DO .5 <- '?"!5~.5'~#1"$#4'~#1\r
+ PLEASE RETRIEVE :4\r
+ (1541) DO :4 <- .5\r
+ DO (1543) NEXT\r
+ (1542) DO (1544) NEXT\r
+ PLEASE DO (1999) NEXT\r
+ (1543) DO (1001) NEXT\r
+ (1544) DO REINSTATE (1541)\r
+ PLEASE REINSTATE (1542)\r
+ PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5\r
+ DO RESUME #2\r
+ (1550) DO STASH :1 + :4 + :5 + :6 + .1 + .5\r
+ DO :5 <- #0\r
+ DO .5 <- '?"':2~:2'~#6"$#7'~#7\r
+ PLEASE DO (1551) NEXT\r
+ DO :4 <- #1\r
+ PLEASE DO (1553) NEXT\r
+ (1553) DO FORGET #1\r
+ DO .5 <- '?"':2~"#14406$#0"'"$#5'~#1\r
+ DO (1552) NEXT\r
+ DO :2 <- ":2~'#0$#2801'"$"'":2~'#400$#0'"$#0'\r
+ ~'#400$#1'"\r
+ PLEASE DO :4 <- ":4~'#0$#2801'"$"'":4~'#400\r
+ $#0'"$#0'~'#400$#1'"\r
+ DO (1553) NEXT\r
+ (1552) DO (1001) NEXT\r
+ DO .1 <- #0\r
+ (1556) PLEASE FORGET #1\r
+ DO :6 <- "'&":2~'#2801$#0'"$"'?#16806$":1\r
+ ~'#2801$#0'"'~'#0$#2801'"'~'#0$#2801'"$\r
+ "'&":2~'#0$#2801'"$"'?#16806$":1~'#0$\r
+ #2801'"'~'#0$#2801'"'~'#0$#2801'"\r
+ DO :3 <- "'?":1~'#2801$#0'"$":2~'#2801$#0'"'\r
+ ~'#0$#2801'"$"'?":1~'#0$#2801'"$":2~'#0$\r
+ #2801'"'~'#0$#2801'"\r
+ DO :6 <- "'&":6~'#2801$#0'"$":3~'#2801$#0'"'\r
+ ~'#0$#2801'"$"'&":6~'#0$#2801'"$":3~'#0$\r
+ #2801'"'~'#0$#2801'"\r
+ DO :3 <- :3~'#16806$#16806'\r
+ DO :6 <- "'?"'V":6~'#2801$#0'"$#11204'~'#0$\r
+ #2801'"$#11204'~'#0$#16806'"$"'?"'V":6\r
+ ~'#0$#2801'"$#11204'~'#0$#2801'"$#11204'\r
+ ~'#0$#16806'"\r
+ DO .5 <- "?'"':6~:3'~'"'"'&"':3~:3'~'#2801$#0'"$\r
+ #2401'~'#0$#2801'"$"'?:3~:3'~'#400$#0'"'\r
+ ~'#2401$#400'"$"'?:3~:3'~'#0$#2801'"'"~#1'$\r
+ #5"~#1\r
+ PLEASE DO (1557) NEXT\r
+ DO (1510) NEXT\r
+ DO :1 <- :3\r
+ DO .5 <- '?#0$"'V.1$#5'~#1"'~#1\r
+ DO (1557) NEXT\r
+ DO .1 <- '^.1$#2801'~'#0$#2801'\r
+ DO (1556) NEXT\r
+ (1557) PLEASE DO (1001) NEXT\r
+ PLEASE FORGET #1\r
+ DO :5 <- "'V":4~'.1$#0'"$":5~'#2801$#0'"'\r
+ ~'#0$#2801'"$"'V":4~'#0$.1'"$":5~'#0$\r
+ #2801'"'~'#0$#2801'"\r
+ DO .5 <- "?#2$':4~#1'"~#1\r
+ DO (1551) NEXT\r
+ DO :2 <- :2~'#2801$#2800'\r
+ DO :4 <- :4~'#2801$#2800'\r
+ DO .1 <- #0\r
+ PLEASE DO (1556) NEXT\r
+ (1551) DO (1001) NEXT\r
+ DO :3 <- :5\r
+ PLEASE RETRIEVE :1 + :4 + :5 + :6 + .1 + .5\r
+ PLEASE RESUME #2\r
+ (1720) PLEASE STASH :1 + :3 + :4 + .1 + .5\r
+ DO :2 <- #0\r
+ DO .2 <- #0\r
+ DO .5 <- '?".1~#6"$#7'~#7\r
+ DO (1729) NEXT\r
+ DO .5 <- .1~#1\r
+ DO .2 <- :1~'#2801$#0'\r
+ DO .1 <- :1~'#0$#2801'\r
+ PLEASE DO (1726) NEXT\r
+ DO :1 <- '"?#0$.2"~"#0$#2801"'$'"?#0$.1"~"#0$\r
+ #2801"'\r
+ DO :2 <- '"?'"V.2$#2801"~"#0$#2801"'$#2801"\r
+ ~"#0$#2801"'$'"?'"V.1$#2801"~"#0$#2801"'$\r
+ #2801"~"#0$#2801"'\r
+ DO (1728) NEXT\r
+ (1726) PLEASE DO (1725) NEXT\r
+ DO :1 <- '"?#0$'"^.2$.2"~"#0$#2801"'"~"#0$\r
+ #2801"'$'"?#0$'"^.1$.1"~"#0$#2801"'"~"#0$\r
+ #2801"'\r
+ DO .2 <- "^'"V'"2@.2$#11204"~"#0$#2801"'$\r
+ #5602"~"#0$#2801"'$'"2@.2$#2801"~"#0$\r
+ #2801"'"~"#0$#2801"\r
+ DO .1 <- "^'"V'"2@.1$#11204"~"#0$#2801"'$\r
+ #5602"~"#0$#2801"'$'"2@.1$#2801"~"#0$\r
+ #2801"'"~"#0$#2801"\r
+ DO :2 <- '"?.2$#8403"~"#0$#2801"'$'"?.1$#8403"\r
+ ~"#0$#2801"'\r
+ (1728) DO .2 <- :2~'#2401$#0'\r
+ DO :2 <- ':2~"#0$#2801"'$'"':2~"#400$#0"'$#0"\r
+ ~"#400$#1"'\r
+ DO (1509) NEXT\r
+ DO :2 <- :3\r
+ DO .2 <- '^.2$"'?":4~#1"$#1'~#1"'~#1\r
+ DO (1721) NEXT\r
+ (1725) PLEASE DO (1724) NEXT\r
+ DO :2 <- '"?'"V'"?'"3@.2$#14005"~"#0$#2801"'$\r
+ '"@.2$#0"~"#0$#2801"'"~"#0$#11204"'$#8403"\r
+ ~"#0$#2801"'$#8403"~"#0$#2801"'$\r
+ '"?'"V'"?'"3@.1$#14005"~"#0$#2801"'$'"@.1$\r
+ #0"~"#0$#2801"'"~"#0$#11204"'$#8403"~"#0$\r
+ #2801"'$#8403"~"#0$#2801"'\r
+ DO .2 <- '^.2$.2'~'#0$#2801'\r
+ DO .1 <- '^.1$.1'~'#0$#2801'\r
+ DO :1 <- '"^.2$.2"~"#0$#2801"'$'"^.1$.1"~"#0$\r
+ #2801"'\r
+ PLEASE FORGET #2\r
+ DO (1728) NEXT\r
+ (1724) PLEASE DO (1723) NEXT\r
+ DO :1 <- '"^'"^.2$.2"~"#0$#2801"'$.2"~"#0$\r
+ #2801"'$'"^'"^.1$.1"~"#0$#2801"'$.1"\r
+ ~"#0$#2801"'\r
+ DO .2 <- "^'"V'"2@.2$#16806"~"#0$#2801"'$\r
+ #14005"~"#0$#2801"'$'"V'"4@.2$#16806"\r
+ ~"#0$#2801"'$#14005"~"#0$#2801"'"~"#0$\r
+ #2801"\r
+ DO .1 <- "^'"V'"2@.1$#16806"~"#0$#2801"'$\r
+ #14005"~"#0$#2801"'$'"V'"4@.1$#16806"\r
+ ~"#0$#2801"'$#14005"~"#0$#2801"'"~"#0$\r
+ #2801"\r
+ DO :2 <- '"?.2$#8403"~"#0$#2801"'$'"?.1$#8403"\r
+ ~"#0$#2801"'\r
+ PLEASE FORGET #3\r
+ DO (1728) NEXT\r
+ (1723) PLEASE DO (1722) NEXT\r
+ DO :1 <- '"^.2$.2"~"#0$#2801"'$'"^.1$.1"~"#0$\r
+ #2801"'\r
+ DO :2 <- '"?'"V'"3@.2$#16806"~"#0$#2801"'$\r
+ #14005"~"#0$#2801"'$#14005"~"#0$#2801"'$\r
+ '"?'"V'"3@.1$#16806"~"#0$#2801"'$#14005"\r
+ ~"#0$#2801"'$#14005"~"#0$#2801"'\r
+ PLEASE FORGET #4\r
+ DO (1728) NEXT\r
+ (1729) DO (1001) NEXT\r
+ DO (1721) NEXT\r
+ (1722) PLEASE DO (1001) NEXT\r
+ DO :2 <- :1\r
+ DO .2 <- #0\r
+ DO FORGET #3\r
+ (1721) PLEASE RETRIEVE :1 + :3 + :4 + .1 + .5\r
+ PLEASE RESUME #3\r
+ (1900) DO STASH .2 + .5\r
+ DO .1 <- #0\r
+ DO .2 <- #1\r
+ PLEASE DO (1901) NEXT\r
+ (1901) DO FORGET #1\r
+ DO %50 (1905) NEXT\r
+ DO %50 (1904) NEXT\r
+ DO %50 (1901) NEXT\r
+ PLEASE DO (1903) NEXT\r
+ (1905) DO FORGET #1\r
+ DO .1 <- '^.1$".2~#8403"'~'#0$#2801'\r
+ PLEASE DO %50 .1 <- '^.1$".2~#5602"'~'#0$#2801'\r
+ DO (1906) NEXT\r
+ (1904) DO .1 <- '^.1$.2'~'#0$#2801'\r
+ (1906) DO %50 .1 <- '^.1$.2'~'#0$#2801'\r
+ (1903) PLEASE FORGET #1\r
+ DO .2 <- !2$#0'~'#400$#1'\r
+ PLEASE DO .5 <- '^".2~.2"$#1'~#1\r
+ DO (1902) NEXT\r
+ DO (1901) NEXT\r
+ (1902) DO (1001) NEXT\r
+ DO RETRIEVE .2 + .5\r
+ PLEASE RESUME #2\r
+ (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3\r
+ DO .3 <- #16795\r
+ DO :1 <- #6\r
+ DO (1911) NEXT\r
+ PLEASE NOTE THAT YOU CAN'T GET SENSE FROM INTERCAL\r
+ (1912) DO (1001) NEXT\r
+ (1911) DO FORGET #1\r
+ PLEASE DO (1900) NEXT\r
+ DO :2 <- .1\r
+ DO (1500) NEXT\r
+ PLEASE DO :1 <- :3\r
+ DO .1 <- .3\r
+ DO (1020) NEXT\r
+ PLEASE DO .3 <- .1\r
+ DO .5 <- '?"!3~.3'~#6"$#5'~#1\r
+ DO (1912) NEXT\r
+ DO .1 <- #12\r
+ PLEASE DO (1050) NEXT\r
+ DO RETRIEVE .1\r
+ DO (1530) NEXT\r
+ DO :2 <- #8403\r
+ DO (1500) NEXT\r
+ PLEASE DO .2 <- :3~'#2793$#2744'\r
+ PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3\r
+ DO RESUME #1\r
--- /dev/null
+ PLEASE KNOCK BEFORE ENTERING
+
+ (1000) PLEASE IGNORE .4
+ PLEASE ABSTAIN FROM (1005)
+ (1009) DO STASH .1 + .2 + .5 + .6
+ DO .4 <- #1
+ DO (1004) NEXT
+ (1004) PLEASE FORGET #1
+ DO .3 <- '?.1$.2'~'#0$#65535'
+ DO .6 <- '&.1$.2'~'#0$#65535'
+ PLEASE DO .5 <- "?!6~#32768'$#1"~#3
+ DO (1002) NEXT
+ DO .4 <- #2
+ (1005) DO (1006) NEXT
+ (1999) DOUBLE OR SINGLE PRECISION OVERFLOW
+ (1002) DO (1001) NEXT
+ (1006) PLEASE FORGET #1
+ DO .5 <- '?"!6~.6'~#1"$#1'~#3
+ DO (1003) NEXT
+ DO .1 <- .3
+ DO .2 <- !6$#0'~'#32767$#1'
+ DO (1004) NEXT
+ (1003) DO (1001) NEXT
+ DO REINSTATE (1005)
+ (1007) PLEASE RETRIEVE .1 + .2 + .5 + .6
+ DO REMEMBER .4
+ PLEASE RESUME #2
+ (1001) DO RESUME .5
+ (1010) DO STASH .1 + .2 + .4
+ DO .4 <- .1
+ DO .1 <- '?.2$#65535'~'#0$#65535'
+ DO (1020) NEXT
+ PLEASE DO .2 <- .4
+ PLEASE DO (1009) NEXT
+ DO RETRIEVE .1 + .2 + .4
+ PLEASE RESUME #1
+ (1020) DO STASH .2 + .3
+ DO .2 <- #1
+ PLEASE DO (1021) NEXT
+ (1021) DO FORGET #1
+ DO .3 <- "?!1~.2'$#1"~#3
+ PLEASE DO .1 <- '?.1$.2'~'#0$#65535'
+ DO (1022) NEXT
+ DO .2 <- !2$#0'~'#32767$#1'
+ DO (1021) NEXT
+ (1023) PLEASE RESUME .3
+ (1022) DO (1023) NEXT
+ PLEASE RETRIEVE .2 + .3
+ PLEASE RESUME #2
+ (1030) DO ABSTAIN FROM (1033)
+ PLEASE ABSTAIN FROM (1032)
+ (1039) DO STASH :1 + .5
+ DO (1530) NEXT
+ DO .3 <- :1~#65535
+ PLEASE DO .5 <- :1~'#65280$#65280'
+ DO .5 <- '?"!5~.5'~#1"$#1'~#3
+ DO (1031) NEXT
+ (1032) DO (1033) NEXT
+ DO (1999) NEXT
+ (1031) DO (1001) NEXT
+ (1033) DO .4 <- .5
+ DO REINSTATE (1032)
+ PLEASE REINSTATE (1033)
+ DO RETRIEVE :1 + .5
+ PLEASE RESUME #2
+ (1040) PLEASE STASH .1 + .2 + .2 + :1 + :2 + :3
+ DO .2 <- #0
+ DO (1520) NEXT
+ DO STASH :1
+ PLEASE RETRIEVE .2
+ DO .1 <- .2
+ DO .2 <- #0
+ PLEASE DO (1520) NEXT
+ DO :2 <- :1
+ DO RETRIEVE .1 + .2 + :1
+ DO (1550) NEXT
+ PLEASE DO .3 <- :3
+ DO RETRIEVE :1 + :2 + :3
+ DO RESUME #1
+ (1050) PLEASE STASH :2 + :3 + .5
+ DO :2 <- .1
+ PLEASE DO (1550) NEXT
+ DO .5 <- :3~'#65280$#65280'
+ DO .5 <- '?"!5~.5'~#1"$#1'~#3
+ DO (1051) NEXT
+ DO (1999) NEXT
+ (1051) DO (1001) NEXT
+ DO .2 <- :3
+ PLEASE RETRIEVE :2 + :3 + .5
+ DO RESUME #2
+ (1500) PLEASE ABSTAIN FROM (1502)
+ PLEASE ABSTAIN FROM (1506)
+ (1509) PLEASE STASH :1 + .1 + .2 + .3 + .4 + .5 + .6
+ DO .1 <- :1~#65535
+ PLEASE DO .2 <- :2~#65535
+ DO (1009) NEXT
+ DO .5 <- .3
+ PLEASE DO .6 <- .4
+ DO .1 <- :1~'#65280$#65280'
+ DO .2 <- :2~'#65280$#65280'
+ DO (1009) NEXT
+ DO .1 <- .3
+ PLEASE DO (1503) NEXT
+ DO .6 <- .4
+ DO .2 <- #1
+ DO (1009) NEXT
+ DO .1 <- .3
+ DO (1501) NEXT
+ (1504) PLEASE RESUME .6
+ (1503) DO (1504) NEXT
+ (1501) DO .2 <- .5
+ DO .5 <- '?"'&.6$.4'~#1"$#2'~#3
+ DO (1505) NEXT
+ (1506) DO (1502) NEXT
+ PLEASE DO (1999) NEXT
+ (1505) DO (1001) NEXT
+ (1502) DO :4 <- .5
+ DO (1520) NEXT
+ DO :3 <- :1
+ PLEASE RETRIEVE :1 + .1 + .2 + .3 + .4 + .5 + .6
+ DO REINSTATE (1502)
+ DO REINSTATE (1506)
+ PLEASE RESUME #3
+ (1510) DO STASH :1 + :2 + :4
+ DO :1 <- "'?":2~'#65535$#0'"$#65535'~'#0$#65535'"$
+ "'?":2~'#0$#65535'"$#65535'~'#0$#65535'"
+ DO :2 <- #1
+ DO (1509) NEXT
+ PLEASE RETRIEVE :1
+ DO :2 <- :3
+ PLEASE DO (1509) NEXT
+ DO RETRIEVE :2 + :4
+ PLEASE RESUME #1
+ (1520) PLEASE STASH .3 + .4
+ DO .3 <- .1~#43690
+ DO (1525) NEXT
+ PLEASE DO .4 <- 'V.3$".2~#43690"'~'#0$#65535'
+ DO .3 <- .1~#21845
+ PLEASE DO (1525) NEXT
+ DO :1 <- .4$"'V.3$".2~#21845"'~'#0$#65535'"
+ PLEASE RETRIEVE .3 + .4
+ DO RESUME #1
+ (1525) DO .3 <- '"'"'"!3$#0'~'#32767$#1'"$#0'~'#32767$
+ #1'"$#0'~'#16383$#3'"$#0'~'#4095$#15'
+ PLEASE RESUME #1
+ (1530) DO STASH :2 + :3 + .3 + .5
+ DO :1 <- #0
+ DO :2 <- .2
+ DO .3 <- #1
+ DO (1535) NEXT
+ (1535) PLEASE FORGET #1
+ DO .5 <- "?!1~.3'$#1"~#3
+ DO (1531) NEXT
+ DO (1500) NEXT
+ DO :1 <- :3
+ PLEASE DO (1533) NEXT
+ (1531) PLEASE DO (1001) NEXT
+ (1533) DO FORGET #1
+ DO .3 <- !3$#0'~'#32767$#1'
+ DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$
+ #0'~'#32767$#1'"
+ PLEASE DO .5 <- "?!3~.3'$#1"~#3
+ DO (1532) NEXT
+ DO (1535) NEXT
+ (1532) DO (1001) NEXT
+ PLEASE RETRIEVE :2 + :3 + .3 + .5
+ DO RESUME #2
+ (1540) PLEASE ABSTAIN FROM (1541)
+ DO ABSTAIN FROM (1542)
+ (1549) PLEASE STASH :1 + :2 + :4 + :5 + .1 + .2 + .5
+ DO .1 <- :1~#65535
+ PLEASE DO .2 <- :2~'#65280$#65280'
+ DO .5 <- :1~'#65280$#65280'
+ DO (1530) NEXT
+ DO :3 <- :1
+ DO .2 <- :2~#65535
+ PLEASE DO (1530) NEXT
+ DO :5 <- :1
+ DO .1 <- .5
+ DO (1530) NEXT
+ DO :4 <- :1
+ PLEASE DO :1 <- ":3~'#65280$#65280'"$":4~'#65280$
+ #65280'"
+ DO .5 <- ':1~:1'~#1
+ DO .2 <- :2~'#65280$#65280'
+ DO (1530) NEXT
+ PLEASE DO .5 <- '"':1~:1'~#1"$.5'~#3
+ DO .1 <- :3~#65535
+ DO .2 <- #0
+ DO (1520) NEXT
+ PLEASE DO :2 <- :1
+ PLEASE DO .1 <- :4~#65535
+ DO (1520) NEXT
+ DO (1509) NEXT
+ DO .5 <- !5$":4~#3"'~#15
+ DO :1 <- :3
+ DO :2 <- :5
+ DO (1509) NEXT
+ PLEASE DO .5 <- !5$":4~#3"'~#172
+ DO .5 <- '?"!5~.5'~#1"$#1'~#3
+ PLEASE RETRIEVE :4
+ (1541) DO :4 <- .5
+ DO (1543) NEXT
+ (1542) DO (1544) NEXT
+ PLEASE DO (1999) NEXT
+ (1543) DO (1001) NEXT
+ (1544) DO REINSTATE (1541)
+ PLEASE REINSTATE (1542)
+ PLEASE RETRIEVE :1 + :2 + :5 + .1 + .2 + .5
+ DO RESUME #2
+ (1550) DO STASH :1 + :4 + :5 + .5
+ DO :3 <- #0
+ DO .5 <- '?"':2~:2'~#1"$#1'~#3
+ PLEASE DO (1551) NEXT
+ DO :4 <- #1
+ PLEASE DO (1553) NEXT
+ (1553) DO FORGET #1
+ DO .5 <- '?":2~'#32768$#0'"$#2'~#3
+ DO (1552) NEXT
+ DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$#
+ 0'~'#32767$#1'"
+ PLEASE DO :4 <- ":4~'#0$#65535'"$"'":4~'#32767
+ $#0'"$#0'~'#32767$#1'"
+ DO (1553) NEXT
+ (1552) DO (1001) NEXT
+ (1556) PLEASE FORGET #1
+ DO :5 <- "'?":1~'#65535$#0'"$":2~'#65535$#0'"'
+ ~'#0$#65535'"$"'?":1~'#0$#65535'"$":2~'#0$
+ #65535'"'~'#0$#65535'"
+ DO .5 <- '?"'&"':2~:5'~'"'?"'?":5~:5"~"#65535$
+ #65535"'~'#65535$#0'"$#32768'~'#0$#65535'"
+ $"'?":5~:5"~"#65535$#65535"'~'#0$#65535'"'
+ "$"':5~:5'~#1"'~#1"$#2'~#3
+ DO (1554) NEXT
+ DO :5 <- :3
+ DO (1510) NEXT
+ PLEASE DO :1 <- :3
+ DO :3 <- "'V":4~'#65535$#0'"$":5~'#65535$#0'"'
+ ~'#0$#65535'"$"'V":4~'#0$#65535'"$":5~'#0$
+ #65535'"'~'#0$#65535'"
+ DO (1555) NEXT
+ (1554) PLEASE DO (1001) NEXT
+ (1555) DO FORGET #1
+ DO .5 <- "?':4~#1'$#2"~#3
+ DO (1551) NEXT
+ DO :2 <- ":2~'#0$#65534'"$":2~'#65535$#0'"
+ DO :4 <- ":4~'#0$#65534'"$":4~'#65535$#0'"
+ PLEASE DO (1556) NEXT
+ (1551) DO (1001) NEXT
+ PLEASE RETRIEVE :1 + :4 + :5 + .5
+ PLEASE RESUME #2
+ (1900) DO STASH .2 + .3 + .5
+ DO .1 <- #0
+ DO .2 <- #1
+ PLEASE DO (1901) NEXT
+ (1901) DO FORGET #1
+ DO %50 .1 <- 'V.1$.2'~'#0$#65535'
+ DO .2 <- !2$#0'~'#32767$#1'
+ PLEASE DO .5 <- "?!2~.2'$#1"~#3
+ DO (1902) NEXT
+ DO (1901) NEXT
+ (1902) DO (1001) NEXT
+ DO RETRIEVE .2 + .3 + .5
+ PLEASE RESUME #2
+ (1910) PLEASE STASH .1 + .3 + .5 + :1 + :2 + :3
+ DO .3 <- #65524
+ DO :1 <- #6
+ DO (1911) NEXT
+ PLEASE NOTE THAT YOU CAN'T GET THERE FROM HERE
+ (1912) DO (1001) NEXT
+ (1911) DO FORGET #1
+ PLEASE DO (1900) NEXT
+ DO :2 <- .1
+ DO (1500) NEXT
+ PLEASE DO :1 <- :3
+ DO .1 <- .3
+ DO (1020) NEXT
+ PLEASE DO .3 <- .1
+ DO .5 <- '?"!3~.3'~#1"$#2'~#3
+ DO (1912) NEXT
+ DO .1 <- #12
+ PLEASE DO (1050) NEXT
+ DO RETRIEVE .1
+ DO (1530) NEXT
+ DO :2 <- #32768
+ DO (1500) NEXT
+ PLEASE DO .2 <- :3~'#65280$#65280'
+ PLEASE RETRIEVE .3 + .5 + :1 + :2 + :3
+ DO RESUME #1
--- /dev/null
+/* yuk.h - header file for yuk.c and debugging versions of ick-wrap.c */
+/* Copyright (C) Alex Smith 2006. See yuk.c for copyright conditions.
+ This file is GPL'd, and so can be freely redistributed but has
+ absolutely no warranty. */
+
+#define YUK(t,u) yukline(t,u)
+#define YUKTERM yukterm()
+
+#define YUKEND 5
+
+/*@-exportlocal@*/ /* because these are used by generated programs */
+extern void yukline(int,int);
+extern void yukterm(void);
+
+extern int ick_abstained[];
+extern int yukopts;
+extern int ick_lineno;
+extern int yuklines;
+extern int yukcommands;
+/*@-incondefs@*/ /* because it's a different textlines to the one in ick.h */
+extern char *textlines[];
+/*@=incondefs@*/
+extern int lineofaboff[];
+extern char *yukexplain[];
+
+extern int yukloop;
+/*@=exportlocal@*/
+
+/* Defines that change the functions used for profiling. */
+
+/* Define the following to the timing function you want for profiling, or leave
+ it undef to use the value computed by config.sh. */
+#undef YPTIMERTYPE
+/* 0 to use clock(), 1 to use gettimeofday() and long,
+ 2 to use gettimeofday() and long long, 3 to use gethrtime()
+ 4 to use times() */
+/* Note: On many systems, 0's resolution is too low to produce any output
+ 1 and 2 produce the same output; use 2 if your system can handle
+ long long because the overflow is dealt with more simply.
+ 3 is a system-specific function. If there are more system-specific
+ functions around that return more accurate times than the others
+ used here, it would improve the profiler on those systems.
+ According to the DJGPP documentation, it's impossible to get times
+ with decent accuracy under DOS. DJGPP implements timer types 0, 1,
+ and 2, so it will 'work' with the default value of 2, but the results
+ you get will be basically meaningless as the base information can't
+ be accurately obtained (the resolution is slightly worse than 50ms,
+ which is far too slow for profiling). */
+#ifndef YPTIMERTIME
+# ifdef HAVE_GETHRTIME
+# define YPTIMERTYPE 3
+# else
+# ifdef HAVE_GETTIMEOFDAY
+/* Allow for an erroneous blank value for SIZEOF_LONG_LONG_INT. */
+# if SIZEOF_LONG_LONG_INT + 0 > 0
+# define YPTIMERTYPE 2
+# else
+# define YPTIMERTYPE 1
+# endif
+# else
+# define YPTIMERTYPE 0
+# endif
+# endif
+#endif
+
+
+#if YPTIMERTYPE == 0
+#define YPTIMERTFORMAT "lu"
+#define YPCOUNTERTFORMAT "lu"
+#define YPTIMERTFORMATD "6" YPTIMERTFORMAT
+#define YPTIMERSCALE CLOCKS_PER_SEC
+#define YPGETTIME clock()
+typedef unsigned long yptimer;
+typedef unsigned long ypcounter;
+
+#elif YPTIMERTYPE == 1
+#define YPTIMERTFORMAT "lu"
+#define YPCOUNTERTFORMAT "lu"
+#define YPTIMERTFORMATD "6" YPTIMERTFORMAT
+#define YPTIMERSCALE 1000000LU
+#define YPGETTIME yukgettimeofday()
+typedef unsigned long yptimer;
+typedef unsigned long ypcounter;
+
+#elif YPTIMERTYPE == 2
+#define YPTIMERTFORMAT "llu"
+#define YPCOUNTERTFORMAT "lu"
+#define YPTIMERTFORMATD "6" YPTIMERTFORMAT
+#define YPTIMERSCALE 1000000LU
+#define YPGETTIME yukgettimeofday()
+typedef unsigned long long yptimer;
+typedef unsigned long ypcounter;
+
+#elif YPTIMERTYPE == 3
+#define YPTIMERTFORMAT "llu"
+#define YPCOUNTERTFORMAT "lu"
+#define YPTIMERTFORMATD "9" YPTIMERTFORMAT
+#define YPTIMERSCALE 1000000000LLU
+#define YPGETTIME gethrtime()
+typedef unsigned long long yptimer;
+typedef unsigned long ypcounter;
+
+#elif YPTIMERTYPE == 4
+#define YPTIMERTFORMAT "lu"
+#define YPCOUNTERTFORMAT "lu"
+#define YPTIMERTFORMATD "6" YPTIMERTFORMAT
+#define YPTIMERSCALE CLK_TCK
+#define YPGETTIME yuktimes()
+typedef unsigned long yptimer;
+typedef unsigned long ypcounter;
+
+#else
+#error Invalid YPTIMERTYPE in yuk.h
+
+#endif /* YPTIMERTYPE cases */
+
+extern yptimer ypexectime[];
+extern ypcounter ypexecount[];
+extern ypcounter ypabscount[];
+
+typedef struct yukvar_tag
+{
+ int vartype;
+ int extername;
+ int intername;
+} yukvar;
+
+extern yukvar yukvars[];
+
+/*@-exportlocal@*/ /* this needs to be global */
+extern char** globalargv;
+extern int globalargc;
+/*@=exportlocal@*/
are no doubt full of bugs. Don't complain, you're lucky if anything\r
written in INTERCAL works at all.\r
\r
+Some of these programs are explicitly licenced under the GNU GPL, just\r
+like the C-INTERCAL compiler is; therefore, remember to include\r
+COPYING.txt from the main installation directory if you want to\r
+redistribute these separately from that compiler.\r
+\r
The subdirectory lib contains code fragments that are not complete\r
programs.\r
\r
unlambda.i An Unlambda interpreter in INTERCAL\r
unlambda.doc Better-commented version of the above\r
\r
+by Jeffrey Lee\r
+ interfunge.i A Befunge-93 interpreter in INTERCAL\r
+\r
The subdirectory tests contains some programs written only to test the\r
compiler.\r
\r
--- /dev/null
+ PLEASE DO (600) NEXT
+ PLEASE DON'T PAY ATTENTION TO THE ABOVE LINE IF YOU ARE HUMAN
+
+ INTERFUNGE.I - COPYRIGHT 2008 JEFFREY LEE
+
+ THE BEFUNGE PROGRAM FROM IS FIRST READ FROM INPUT
+ DON'T FORGET TO TERMINATE YOUR FUNGESPACE PROGRAM WITH A BLANK LINE
+
+ VARIABLES AND SUBROUTINES:
+ ;1 IS THE 2D FUNGESPACE ARRAY
+ ;2 IS THE FUNGESPACE STACK
+ .10 AND .11 ARE THE IP
+ .12 AND .13 ARE THE DELTA
+ .14 IS THE STACK DEPTH
+ .15 AND .16 ARE THE IO TAPE POSITIONS
+ ,1 IS THE IO BUFFER
+ ,2 IS THE INSTRUCTION LOOKUP TABLE
+ [500] GETS A CHAR INTO .1 AND [510] OUTPUTS A CHAR FROM .1
+ [530] PUSHES :1 AND [540] POPS :1 FROM THE STACK
+
+ LICENSING:
+ INTERFUNGE.I IS FREE SOFTWARE: YOU CAN REDISTRIBUTE IT AND/OR MODIFY
+ IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
+ THE FREE SOFTWARE FOUNDATION, EITHER VERSION 2 OF THE LICENSE, OR
+ (AT YOUR OPTION) ANY LATER VERSION.
+ INTERFUNGE.I IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
+ BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE
+ GNU GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+ YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+ ALONG WITH INTERFUNGE.I. IF NOT, SEE <HTTP://WWW.GNU.ORG/LICENSES/>.
+
+ PLEASE NOTE THAT THE PROGRAM STARTS HERE
+
+(600) PLEASE DO ;1 <- #80 BY #25
+ DO ;2 <- #10000
+ DO .11 <- #1
+ PLEASE DO .12 <- #1
+ DO .13 <- #0
+ DO .14 <- #0
+ DO .15 <- #0
+ DO .16 <- #0
+ PLEASE DO ,1 <- #1
+ PLEASE DO ,2 <- #127
+ DO .3 <- #127
+ DO .2 <- #1
+(13) DO FORGET #1
+ DO .1 <- .3
+ PLEASE DO ,2SUB.1 <- #1
+ DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (14) NEXT
+ DO (13) NEXT
+(14) PLEASE DO (3) NEXT
+ DON'T FORGET THAT [1] CLEARS THE CALL STACK FOR US
+ DO ,2SUB#32 <- #2
+ DO ,2SUB#33 <- #3
+ PLEASE DO ,2SUB#34 <- #4
+ DO ,2SUB#35 <- #5
+ DO ,2SUB#36 <- #6
+ DO ,2SUB#37 <- #7
+ PLEASE DO ,2SUB#38 <- #8
+ DO ,2SUB#42 <- #9
+ DO ,2SUB#43 <- #10
+ DO ,2SUB#44 <- #11
+ PLEASE DO ,2SUB#45 <- #12
+ DO ,2SUB#46 <- #13
+ DO ,2SUB#47 <- #14
+ DO ,2SUB#48 <- #15
+ PLEASE DO ,2SUB#49 <- #16
+ DO ,2SUB#50 <- #17
+ DO ,2SUB#51 <- #18
+ DO ,2SUB#52 <- #19
+ PLEASE DO ,2SUB#53 <- #20
+ DO ,2SUB#54 <- #21
+ DO ,2SUB#55 <- #22
+ DO ,2SUB#56 <- #23
+ PLEASE DO ,2SUB#57 <- #24
+ DO ,2SUB#58 <- #25
+ DO ,2SUB#60 <- #26
+ DO ,2SUB#62 <- #27
+ PLEASE DO ,2SUB#63 <- #28
+ DO ,2SUB#64 <- #29
+ DO ,2SUB#92 <- #30
+ DO ,2SUB#94 <- #31
+ PLEASE DO ,2SUB#95 <- #32
+ DO ,2SUB#96 <- #33
+ DO ,2SUB#103 <- #34
+ DO ,2SUB#112 <- #35
+ PLEASE DO ,2SUB#118 <- #36
+ DO ,2SUB#124 <- #37
+ DO ,2SUB#126 <- #38
+(5) DO .10 <- #1
+(1) PLEASE FORGET #1
+(10) DO (500) NEXT
+(11) DON'T .1 <- #10
+ DO .5 <- .1
+ DO .2 <- #10
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ DO (2) NEXT
+ DO .1 <- .10
+ DO .2 <- #81
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ DO (18) NEXT
+ DO ;1SUB.10.11 <- .5
+ PLEASE ABSTAIN FROM (18)
+(18) DO (3) NEXT
+ PLEASE REINSTATE (18)
+ PLEASE FORGET #1
+ DO .1 <- .10
+ PLEASE DO (1020) NEXT
+ DO .10 <- .1
+ PLEASE DO (1) NEXT
+(2) DO (3) NEXT
+ DO FORGET #1
+ DO .1 <- .10
+ DO .2 <- #1
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ DO (4) NEXT
+(7) PLEASE FORGET #1
+ DO .1 <- .10
+ DO .2 <- #81
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ DO (6) NEXT
+ DO ;1SUB.10.11 <- #32
+ DO .1 <- .10
+ DO .2 <- #1
+ PLEASE DO (1000) NEXT
+ DO .10 <- .3
+ DO (7) NEXT
+(6) DO (3) NEXT
+ PLEASE FORGET #1
+ DO .1 <- .11
+ PLEASE DO (1020) NEXT
+ DO .11 <- .1
+ DO .2 <- #26
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ DO (8) NEXT
+ DO (5) NEXT
+(8) PLEASE DO (3) NEXT
+ PLEASE FORGET #1
+ PLEASE DO (9) NEXT
+(4) DO (3) NEXT
+ PLEASE FORGET #1
+ DO ABSTAIN FROM (10)
+ PLEASE REINSTATE (11)
+ PLEASE DO (7) NEXT
+(3) PLEASE RESUME .1
+(9) DO .10 <- #1
+ DO .11 <- #1
+(12) DO :9 <- ;1SUB.10.11
+ DO .1 <- '?"':9~:9'~#1"$#1'~#3
+ PLEASE DO (15) NEXT
+ DO .1 <- :9~'#65528$#65520'
+ DO .1 <- '?"!1~.1'~#1"$#1'~#3
+ PLEASE DO (16) NEXT
+ PLEASE DO (17) NEXT
+(16) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .1 <- ,2SUB:9
+ PLEASE DO (390) NEXT
+(15) PLEASE DO (3) NEXT
+(17) DO FORGET #80
+ DON'T IMPLEMENT REFLECT HERE
+ DO .1 <- #0
+ DO .2 <- .12
+ PLEASE DO (1010) NEXT
+ DO .12 <- .3
+ DO .2 <- .13
+ PLEASE DO (1010) NEXT
+ DO .13 <- .3
+ DO (20) NEXT
+(30) PLEASE DO (15) NEXT
+(20) DON'T IMPLEMENT SPACE HERE
+ DO FORGET #80
+ DO .1 <- '?".12~#1"$#1'~#3
+ PLEASE DO (33) NEXT
+ DO .1 <- .10
+ DO .2 <- .12
+ PLEASE DO (1009) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (31) NEXT
+ DO .10 <- .3
+ DO .1 <- .3
+ DO .2 <- #81
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (32) NEXT
+ DO (12) NEXT
+(31) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .10 <- #80
+ DO (12) NEXT
+(32) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .10 <- #1
+ DO (12) NEXT
+(33) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .1 <- .11
+ DO .2 <- .13
+ PLEASE DO (1009) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (34) NEXT
+ DO .11 <- .3
+ DO .1 <- .3
+ DO .2 <- #26
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (35) NEXT
+ DO (12) NEXT
+(34) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .11 <- #25
+ DO (12) NEXT
+(35) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .11 <- #1
+ DO (12) NEXT
+(40) PLEASE DO (30) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT NOT HERE
+ DO (540) NEXT
+ DO :1 <- '?"':1~:1'~#1"$#1'~#1
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(50) PLEASE DO (40) NEXT
+(58) DON'T IMPLEMENT STRINGMODE HERE
+ DO FORGET #80
+ DO .1 <- '?".12~#1"$#1'~#3
+ PLEASE DO (53) NEXT
+ DO .1 <- .10
+ DO .2 <- .12
+ PLEASE DO (1009) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (51) NEXT
+ DO .10 <- .3
+ DO .1 <- .3
+ DO .2 <- #81
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (52) NEXT
+ DO (56) NEXT
+(51) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .10 <- #80
+ DO (56) NEXT
+(52) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .10 <- #1
+ DO (56) NEXT
+(53) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .1 <- .11
+ DO .2 <- .13
+ PLEASE DO (1009) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (54) NEXT
+ DO .11 <- .3
+ DO .1 <- .3
+ DO .2 <- #26
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (55) NEXT
+ DO (56) NEXT
+(54) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .11 <- #25
+ DO (56) NEXT
+(55) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .11 <- #1
+(56) DO FORGET #1
+ DO :1 <- ;1SUB.10.11
+ DO :2 <- #34
+ PLEASE DO (1510) NEXT
+ DO .1 <- '?"':3~:3'~#1"$#1'~#3
+ DO (57) NEXT
+ DO (530) NEXT
+ DO (58) NEXT
+(57) DO (3) NEXT
+ PLEASE DO (20) NEXT
+(60) PLEASE DO (50) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT TRAMPOLINE HERE
+ DO .1 <- '?".12~#1"$#1'~#3
+ PLEASE DO (63) NEXT
+ DO .1 <- .10
+ DO .2 <- .12
+ PLEASE DO (1009) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (31) NEXT
+ DO .10 <- .3
+ DO .1 <- .3
+ DO .2 <- #81
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (62) NEXT
+ DO (20) NEXT
+(61) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .10 <- #80
+ DO (20) NEXT
+(62) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .10 <- #1
+ DO (20) NEXT
+(63) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .1 <- .11
+ DO .2 <- .13
+ PLEASE DO (1009) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (64) NEXT
+ DO .11 <- .3
+ DO .1 <- .3
+ DO .2 <- #26
+ PLEASE DO (1010) NEXT
+ DO .1 <- '?"!3~.3'~#1"$#1'~#3
+ PLEASE DO (65) NEXT
+ DO (20) NEXT
+(64) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .11 <- #25
+ DO (20) NEXT
+(65) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .11 <- #1
+ DO (20) NEXT
+(70) PLEASE DO (60) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT POP HERE
+ DO (540) NEXT
+ PLEASE DO (20) NEXT
+(80) PLEASE DO (70) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT REMAINDER HERE
+ DO (540) NEXT
+ DO :2 <- :1
+ DO (540) NEXT
+ PLEASE DO (2530) NEXT
+ DO :1 <- :4
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(90) PLEASE DO (80) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT INPUT INTEGER HERE
+ DO WRITE IN :1
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(100) PLEASE DO (90) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT MULTIPLY HERE
+ DO (540) NEXT
+ DO :2 <- :1
+ DO (540) NEXT
+ PLEASE DO (1549) NEXT
+ DO :1 <- :3
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(110) PLEASE DO (100) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT ADD HERE
+ DO (540) NEXT
+ DO :2 <- :1
+ DO (540) NEXT
+ PLEASE DO (1509) NEXT
+ DO :1 <- :3
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(120) PLEASE DO (110) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT OUTPUT CHAR HERE
+ DO (540) NEXT
+ DO .1 <- :1~#255
+ DO (510) NEXT
+ PLEASE DO (20) NEXT
+(130) PLEASE DO (120) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT SUBTRACT HERE
+ DO (540) NEXT
+ DO :2 <- :1
+ DO (540) NEXT
+ PLEASE DO (1510) NEXT
+ DO :1 <- :3
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(140) PLEASE DO (130) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT OUTPUT INTEGER HERE
+ DO (540) NEXT
+ DO READ OUT :1
+ PLEASE DO (20) NEXT
+(150) PLEASE DO (140) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT DIVIDE HERE
+ DO (540) NEXT
+ DO :2 <- :1
+ DO (540) NEXT
+ PLEASE DO (1550) NEXT
+ DO :1 <- :3
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(160) PLEASE DO (150) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH ZERO HERE
+ DO :1 <- #0
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(170) PLEASE DO (160) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH ONE HERE
+ DO :1 <- #1
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(180) PLEASE DO (170) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH TWO HERE
+ DO :1 <- #2
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(190) PLEASE DO (180) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH THREE HERE
+ DO :1 <- #3
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(200) PLEASE DO (190) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH FOUR HERE
+ DO :1 <- #4
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(210) PLEASE DO (200) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH FIVE HERE
+ DO :1 <- #5
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(220) PLEASE DO (210) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH SIX HERE
+ DO :1 <- #6
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(230) PLEASE DO (220) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH SEVEN HERE
+ DO :1 <- #7
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(240) PLEASE DO (230) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH EIGHT HERE
+ DO :1 <- #8
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(250) PLEASE DO (240) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUSH NINE HERE
+ DO :1 <- #9
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(260) PLEASE DO (250) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT DUPLICATE HERE
+ DO (540) NEXT
+ DO (530) NEXT
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(270) PLEASE DO (260) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT GO WEST HERE
+ DO .12 <- #65535
+ DO .13 <- #0
+ PLEASE DO (20) NEXT
+(280) PLEASE DO (270) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT GO EAST HERE
+ DO .12 <- #1
+ DO .13 <- #0
+ PLEASE DO (20) NEXT
+(290) PLEASE DO (280) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT GO AWAY HERE
+ DO 50% DO (291) NEXT
+ DO .13 <- #0
+ DO .12 <- #65535
+ DO 50% .12 <- .12~#1
+ PLEASE DO (20) NEXT
+(291) DO .12 <- #0
+ DO .13 <- #65535
+ DO 50% .13 <- .13~#1
+ PLEASE DO (20) NEXT
+(300) PLEASE DO (290) NEXT
+ PLEASE GIVE UP
+(310) PLEASE DO (300) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT SWAP HERE
+ DO (540) NEXT
+ DO :2 <- :1
+ DO (540) NEXT
+ DO :3 <- :1
+ DO :1 <- :2
+ DO (530) NEXT
+ DO :1 <- :3
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(320) PLEASE DO (310) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT GO NORTH HERE
+ DO .12 <- #0
+ DO .13 <- #65535
+ PLEASE DO (20) NEXT
+(330) PLEASE DO (320) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT EAST-WEST IF HERE
+ DO .13 <- #0
+ DO (540) NEXT
+ DO .1 <- '?"':1~:1'~#1"$#1'~#3
+ DO (331) NEXT
+ DO .12 <- #65535
+ PLEASE DO (20) NEXT
+(331) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .12 <- #1
+ PLEASE DO (20) NEXT
+(340) PLEASE DO (330) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT GREATER THAN HERE
+ DO (540) NEXT
+ DO :2 <- :1
+ DO (540) NEXT
+ DO (1510) NEXT
+ DO :1 <- :3~'#32767$#65535'
+ DO :1 <- ':1~:1'~"'?":3~'#32768$#0'"$#1'~#1"
+ PLEASE DO (530) NEXT
+ PLEASE DO (20) NEXT
+(350) PLEASE DO (340) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT GET HERE
+ DO (540) NEXT
+ DO :4 <- :1
+ DO .1 <- '?":1~'#32768$#0'"$#1'~#1
+ DO :2 <- #25
+ PLEASE DO (1510) NEXT
+ DO (540) NEXT
+ DO .1 <- .1~"':3~"#32768$#0"'~"'?":1~'#32768$#0'"$#1'~#1""
+ DO :2 <- #80
+ PLEASE DO (1510) NEXT
+ DO .1 <- '?".1~':3~"#32768$#0"'"$#1'~#3
+ PLEASE DO (351) NEXT
+ DO .1 <- :4
+ PLEASE DO (1020) NEXT
+ DO .2 <- .1
+ DO .1 <- :1
+ PLEASE DO (1020) NEXT
+ DO :1 <- ;1SUB.1.2
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(351) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO :1 <- #32
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+(360) PLEASE DO (350) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT PUT HERE
+ DO (540) NEXT
+ DO :4 <- :1
+ DO .1 <- '?":1~'#32768$#0'"$#1'~#1
+ DO :2 <- #25
+ PLEASE DO (1510) NEXT
+ DO (540) NEXT
+ DO .1 <- .1~"':3~"#32768$#0"'~"'?":1~'#32768$#0'"$#1'~#1""
+ DO :2 <- #80
+ PLEASE DO (1510) NEXT
+ DO .1 <- '?".1~':3~"#32768$#0"'"$#1'~#3
+ PLEASE DO (361) NEXT
+ DO .1 <- :4
+ PLEASE DO (1020) NEXT
+ DO .2 <- .1
+ DO .1 <- :1
+ PLEASE DO (1020) NEXT
+ DO (540) NEXT
+ DO ;1SUB.1.2 <- :1
+ PLEASE DO (20) NEXT
+(361) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO (540) NEXT
+ PLEASE DO (20) NEXT
+(370) PLEASE DO (360) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT GO SOUTH HERE
+ DO .12 <- #0
+ DO .13 <- #1
+ PLEASE DO (20) NEXT
+(380) PLEASE DO (370) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT NORTH-SOUTH IF HERE
+ DO .12 <- #0
+ DO (540) NEXT
+ DO .1 <- '?"':1~:1'~#1"$#1'~#3
+ DO (381) NEXT
+ DO .13 <- #65535
+ PLEASE DO (20) NEXT
+(381) PLEASE DO (3) NEXT
+ DO FORGET #1
+ DO .13 <- #1
+ PLEASE DO (20) NEXT
+(390) PLEASE DO (380) NEXT
+ DO FORGET #80
+ DON'T IMPLEMENT INPUT CHAR HERE
+ DO (500) NEXT
+ DO :1 <- .1
+ DO (530) NEXT
+ PLEASE DO (20) NEXT
+
+(500) PLEASE STASH .2 + .3 + .4
+ PLEASE WRITE IN ,1
+ DO .1 <- ,1SUB#1
+ DO .2 <- .15
+ DO (1000) NEXT
+ DO .15 <- .3~#255
+ DO .1 <- .15
+ PLEASE RETRIEVE .2 + .3 + .4
+ PLEASE RESUME #1
+(510) PLEASE STASH .1 + .2 + .3 + .4
+ DO .2 <- !1~#15'$!1~#240'
+ DO .2 <- !2~#15'$!2~#240'
+ DO .2 <- !2~#15'$!2~#240'
+ DO .1 <- .16
+ DO (1010) NEXT
+ DO .16 <- .2
+ DO ,1SUB#1 <- .3
+ PLEASE READ OUT ,1
+ PLEASE RETRIEVE .1 + .2 + .3 + .4
+ PLEASE RESUME #1
+(520) DON'T EXPECT THIS TO DO MUCH
+(530) PLEASE STASH .1
+ DO .1 <- .14
+ PLEASE DO (1020) NEXT
+ DO .14 <- .1
+ DO ;2SUB.14 <- :1
+ PLEASE RETRIEVE .1
+ PLEASE RESUME #1
+(540) PLEASE STASH .1 + .2 + .3
+ DO .1 <- '?"!14~.14'~#1"$#1'~#3
+ DO (541) NEXT
+ DO :1 <- ;2SUB.14
+ DO .1 <- .14
+ DO .2 <- #1
+ PLEASE DO (1010) NEXT
+ DO .14 <- .3
+ PLEASE RETRIEVE .1 + .2 + .3
+ PLEASE RESUME #1
+(541) PLEASE DO (3) NEXT
+ DO :1 <- #0
+ PLEASE RETRIEVE .1 + .2 + .3
+ PLEASE RESUME #2
+
+PLEASE ACKNOWLEDGE 32BIT DIVISION WITH REMAINDER FROM NUMIO.I
+
+(2530) DO STASH :1 + :5 + .5
+ DO :3 <- #0
+ DO .5 <- '?"':2~:2'~#1"$#1'~#3
+ PLEASE DO (2531) NEXT
+ DO :4 <- #1
+ PLEASE DO (2533) NEXT
+(2533) DO FORGET #1
+ DO .5 <- '?":2~'#32768$#0'"$#2'~#3
+ DO (2532) NEXT
+ DO :2 <- ":2~'#0$#65535'"$"'":2~'#32767$#0'"$#
+ 0'~'#32767$#1'"
+ PLEASE DO :4 <- ":4~'#0$#65535'"$"'":4~'#32767
+ $#0'"$#0'~'#32767$#1'"
+ DO (2533) NEXT
+(2532) DO (1001) NEXT
+(2536) PLEASE FORGET #1
+ DO :5 <- "'?":1~'#65535$#0'"$":2~'#65535$#0'"'
+ ~'#0$#65535'"$"'?":1~'#0$#65535'"$":2~'#0$
+ #65535'"'~'#0$#65535'"
+ DO .5 <- '?"'&"':2~:5'~'"'?"'?":5~:5"~"#65535$
+ #65535"'~'#65535$#0'"$#32768'~'#0$#65535'"
+ $"'?":5~:5"~"#65535$#65535"'~'#0$#65535'"'
+ "$"':5~:5'~#1"'~#1"$#2'~#3
+ DO (2534) NEXT
+ DO :5 <- :3
+ DO (1510) NEXT
+ PLEASE DO :1 <- :3
+ DO :3 <- "'V":4~'#65535$#0'"$":5~'#65535$#0'"'
+ ~'#0$#65535'"$"'V":4~'#0$#65535'"$":5~'#0$
+ #65535'"'~'#0$#65535'"
+ DO (2535) NEXT
+(2534) PLEASE DO (1001) NEXT
+(2535) DO FORGET #1
+ DO .5 <- "?':4~#1'$#2"~#3
+ DO (2531) NEXT
+ DO :2 <- ":2~'#0$#65534'"$":2~'#65535$#0'"
+ DO :4 <- ":4~'#0$#65534'"$":4~'#65535$#0'"
+ PLEASE DO (2536) NEXT
+(2531) DO (1001) NEXT
+ DO :4 <- :1
+ PLEASE RETRIEVE :1 + :5 + .5
+ PLEASE RESUME #2
+
+PLEASE REMEMBER TO APPEND STANDARD LIBRARY
--- /dev/null
+src/splinttest.out
\ No newline at end of file
only when compiling the degenerated code and unravel.c, and holds its
previous contents during other files. */
-typedef int bool;
-#define TRUE 1
-#define FALSE 0
+#include <stdlib.h>
+#include <stdio.h>
+#include <setjmp.h>
+
+#ifndef ICKBOOL_DEFINED
+/*@-redef@*/
+typedef int ick_bool;
+/*@=redef@*/
+#define ICKBOOL_DEFINED
+#endif
+
+#define ick_TRUE 1
+#define ick_FALSE 0
-#define ONESPOT 0
-#define TWOSPOT 1
-#define TAIL 2
-#define HYBRID 3
+#define ick_ONESPOT 0
+#define ick_TWOSPOT 1
+#define ick_TAIL 2
+#define ick_HYBRID 3
-#define MAXNEXT 80 /* AIS: Moved from cesspool.c */
+#define ick_MAXNEXT 80 /* AIS: Moved from cesspool.c */
/* the following two types must both promote to unsigned int in expressions */
-typedef unsigned short type16;
-typedef unsigned int type32;
+typedef unsigned short ick_type16;
+typedef unsigned int ick_type32;
-typedef struct array_t
+typedef struct ick_array_t
{
unsigned int rank;
- unsigned int *dims;
+ size_t *dims;
union
{
- type16 *tail;
- type32 *hybrid;
+ ick_type16 *tail;
+ ick_type32 *hybrid;
} data;
-} array;
+} ick_array;
/* AIS: For operand overloading, a more complicated data type is needed. */
-typedef struct overop_t
+typedef struct ick_overop_t
{
- type32 (*get)(type32);
- void (*set)(type32, void(*)());
-} overop;
+ ick_type32 (*get)(ick_type32);
+ void (*set)(ick_type32, void(*)());
+} ick_overop;
/* AIS: Moved from cesspool.c */
-typedef struct stashbox_t /* this is a save-stack element */
+typedef struct ick_stashbox_t /* this is a save-stack element */
{
unsigned int type; /* variable type */
unsigned int index; /* variable's index within the type */
union /* the data itself */
{
- type16 onespot;
- type32 twospot;
- array *a;
+ ick_type16 onespot;
+ ick_type32 twospot;
+ ick_array *a;
} save;
- struct stashbox_t *next; /* pointer to next-older stashbox */
- overop overloadinfo; /* AIS: overloading info is stashed too, in a
+ /*@null@*/ /*@dependent@*/ struct ick_stashbox_t *ick_next; /* pointer to next-older ick_stashbox */
+ ick_overop overloadinfo; /* AIS: overloading info is stashed too, in a
non-overloaded program (ignored otherwise) */
-} stashbox;
+} ick_stashbox;
/* AIS: files to take input and output from */
-extern FILE* cesspoolin;
-extern FILE* cesspoolout;
+/*@null@*/ extern FILE* ick_cesspoolin;
+/*@null@*/ extern FILE* ick_cesspoolout;
/* defined in cesspool.c */
-extern void pushnext(int n);
-extern unsigned int popnext(int n);
-extern unsigned int resume(unsigned int n);
-extern unsigned int pin(void);
-extern void clockface(bool mode);
-extern void clcsemantics(bool mode); /* AIS */
-extern void pout(unsigned int val);
-extern void binin(unsigned int type, array *a, bool forget);
-extern void binout(unsigned int type, array *a);
-extern unsigned int assign(char *dest, unsigned int type, bool forget,
+extern void ick_pushnext(unsigned n);
+extern unsigned int ick_popnext(unsigned n);
+extern unsigned int ick_resume(unsigned n);
+extern unsigned int ick_pin(void);
+extern void ick_clockface(ick_bool mode);
+extern void ick_setclcsemantics(ick_bool mode); /* AIS */
+extern void ick_pout(unsigned int val);
+extern void ick_binin(unsigned int type, ick_array *a, ick_bool forget);
+extern void ick_binout(unsigned int type, ick_array *a);
+extern unsigned int ick_assign(char *dest, unsigned int type, ick_bool forget,
unsigned int value);
-/* AIS: yuk and unravel need these */
-extern int* next;
-extern int nextindex;
-extern stashbox* first;
+/* AIS: yuk, unravel and ick_ec need these */
+extern unsigned* ick_next;
+/*@null@*/ extern jmp_buf* ick_next_jmpbufs;
+extern int ick_nextindex;
+extern /*@null@*/ ick_stashbox *ick_first;
+
+/* AIS: Implement the +ick_mystery command line option. */
+extern unsigned long ick_mysteryc;
+extern int ick_mystery;
+#define ick_MYSTERYLINE if(ick_mystery && ick_mysteryc++ > 4000000000LU) exit(42);
-/* AIS: Implement the +mystery command line option. */
-extern unsigned long mysteryc;
-extern int mystery;
-#define MYSTERYLINE if(mystery && mysteryc++ > 4000000000LU) exit(42);
+/* AIS: More command-line options */
+extern int ick_wimp_mode;
/* AIS: Handle multiple COME FROMs aiming at the same line */
-extern int multicome0(int errlineno, jmp_buf pc);
+extern int ick_multicome0(int errlineno, jmp_buf pc);
#ifdef _POSIX_SOURCE
-extern char *aref(unsigned int type, ...);
-extern void resize(unsigned int type, ...);
+/*@dependent@*/ extern void *ick_aref(unsigned int type, ...);
+extern void ick_resize(unsigned int type, ...);
#else
-extern char *aref();
-extern void resize();
+/*@dependent@*/ extern void *ick_aref();
+extern void ick_resize();
#endif
-extern void stashinit(void);
+extern void ick_stashinit(void);
/* AIS: Added mentions of oo. This is set to 0 in a non-overloaded program. */
-extern void stash(unsigned int type, unsigned int index, void *from, overop* oo);
-extern void retrieve(void *to, int type, unsigned int index, bool forget,
- overop* oo);
-extern unsigned int roll(unsigned int n);
+extern void ick_stash(unsigned int type, unsigned int index, void *from, ick_overop* oo);
+extern void ick_retrieve(void *to, unsigned int type, unsigned int index,
+ ick_bool forget, ick_overop* oo);
+extern unsigned int ick_roll(unsigned int n);
/* defined in arrgghh.c */
-extern void parseargs(int argc, char **argv);
+extern void ick_parseargs(int argc, char **argv);
+extern int ick_printflow;
/* AIS: Multithreading types and defines */
#if MULTITHREAD != 0
typedef struct tag_ickthread ickthread;
-struct tag_ickthread
+/*@refcounted@*/ struct tag_ickthread
{
void* varforget[10]; /* holds all four variable types, and forgetting data */
- int* nextstack;
+ unsigned* nextstack;
int nextpointer;
jmp_buf pc; /* program counter */
- stashbox* sb; /* holds all stash data */
- ickthread* next;
- ickthread* choicepoint; /* the top choicepoint available. Used as a next
- pointer in the choicepoint stack. */
+ ick_stashbox* sb; /* holds all stash data */
+ /*@partial@*/ /*@dependent@*/ ickthread* ick_next;
+ /*@null@*/ /*@partial@*/ /*@dependent@*/ ickthread* choicepoint;
+ /* the top choicepoint available. Used as a next pointer in the choicepoint
+ stack. */
int stale; /* if this is a choicepoint, whether it's a stale choicepoint. */
int refcount; /* when Threaded INTERCAL and Backtracking INTERCAL are
combined, reference-counting on choicepoints is needed
(Luckily, choicepoints cannot refer to themselves, so this
mechanism works.) This only applies to ickthreads that are
acting as choicepoints, not those acting as threads. */
- int ccfc; /* number of comefroms currently active */
- unsigned skipto; /* compucome line number */
- jmp_buf cjb; /* keeps track of compucomes */
- ickthread* dsi; /* which thread's varforget and sb to use */
- ickthread* usesthis; /* for garbage collection purposes */
+ int ick_ccfc; /* number of comefroms currently active */
+ unsigned ick_skipto; /* compucome line number */
+ jmp_buf ick_cjb; /* keeps track of compucomes */
+ /*@partial@*/ /*@dependent@*/ ickthread* dsi; /* which thread's varforget and sb to use */
+ /*@null@*/ /*@dependent@*/ ickthread* usesthis; /* for garbage collection purposes */
};
-extern ickthread* ickmt_cur; /* current thread */
-extern ickthread* ickmt_prev; /* previous thread: an optimisation to make
- thread switching O(1), not O(n), with
- respect to the number of threads */
+/*@partial@*/ /*@dependent@*/ extern ickthread* ickmt_cur; /* current thread */
+/*@partial@*/ /*@dependent@*/ extern ickthread*ickmt_prev; /* previous thread: an optimisation to make
+ thread switching O(1), not O(n), with
+ respect to the number of threads */
extern int weaving; /* whether to weave newly created threads */
-#define NEXTTHREAD if(printflow) printf("[%d:%lx]",lineno,(unsigned long)\
+#define NEXTTHREAD if(ick_printflow) printf("[%d:%lx]",ick_lineno,(unsigned long)\
ickmt_cur); \
- if(setjmp(cjb) == 0) \
- nextthread(cjb, lineno, 3);
+ if(setjmp(ick_cjb) == 0) \
+ nextthread(ick_cjb, ick_lineno, 3);
extern void nextthread(jmp_buf pc, int errlineno, int flags);
extern void killthread(void);
extern int tailcount;
extern int hybridcount;
-extern int oldabstain;
+extern int ick_oldabstain;
extern int gonebackto;
-extern int ccfc;
-extern unsigned skipto;
+extern int ick_ccfc;
+extern unsigned ick_skipto;
extern jmp_buf btjb;
-extern jmp_buf cjb;
+extern jmp_buf ick_cjb;
#define MULTICOME multicome1
#else
-#define MULTICOME multicome0
+#define MULTICOME ick_multicome0
#endif /* MULTITHREAD */
/* AIS: Used by the debugger, multithread code */
#if (MULTITHREAD != 0) || (YUKDEBUG != 0)
-extern type16* onespots;
-extern bool* oneforget;
-extern type32* twospots;
-extern bool* twoforget;
-extern array* tails;
-extern bool* tailforget;
-extern array* hybrids;
-extern bool* hyforget;
+extern ick_type16* ick_onespots;
+extern ick_bool* ick_oneforget;
+extern ick_type32* ick_twospots;
+extern ick_bool* ick_twoforget;
+extern ick_array* ick_tails;
+extern ick_bool* ick_tailforget;
+extern ick_array* ick_hybrids;
+extern ick_bool* ick_hyforget;
#if (MULTITHREAD != 0)
-extern overop* oo_onespots;
-extern overop* oo_twospots;
+/*@null@*/ extern ick_overop* ick_oo_onespots;
+/*@null@*/ extern ick_overop* ick_oo_twospots;
#endif
#endif
/*
- * SYNOPSIS: parseargs(argc,argv)
- * FILE : parseargs.c
+ * SYNOPSIS: ick_parseargs(argc,argv)
+ * FILE : ick_parseargs.c
* AUTHOR : Steve Swales
* DATE: October 7, 1990
* PURPOSE: Parse arguments for INTERCAL programs.
#include <string.h>
#include <setjmp.h>
#include "abcess.h"
-#include "lose.h"
+#include "ick_lose.h"
-int traditional = 0;
-int wimp_mode = 0;
-int printflow = 0; /* AIS */
-int mystery = 0; /* AIS */
+/*@-redef@*/ /* it's never the case that both are used at once */
+int ick_traditional = 0;
+/*@=redef@*/
+int ick_wimp_mode = 0;
+int ick_printflow = 0; /* AIS */
+int ick_mystery = 0; /* AIS */
-unsigned long mysteryc = 0; /* AIS */
+unsigned long ick_mysteryc = 0; /* AIS */
void
-parseargs(int argc, char **argv)
+ick_parseargs(int argc, char **argv)
{
register int i, j;
static int helpflag = -1;
};
static int *bools[] = {
&helpflag,
- &wimp_mode,
- &traditional,
- &printflow, /* AIS */
- &mystery, /* AIS */
+ &ick_wimp_mode,
+ &ick_traditional,
+ &ick_printflow, /* AIS */
+ &ick_mystery, /* AIS */
};
static int nflags = (int)(sizeof(flags)/sizeof(flags[0]));
fprintf(stderr," but not always, and not all of them currently\n");
fprintf(stderr," do anything, but you can switch them on or off\n");
fprintf(stderr," if you like anyway. Isn't this helpful?\n\n");
- fflush(stderr);
- lose(E778, 0, (char *)NULL);
+ (void) fflush(stderr);
+ ick_lose(IE778, 0, (char *)NULL);
}
- if(wimp_mode) {
+ if(ick_wimp_mode) {
fprintf(stderr,"How sad... you have selected to run an INTERCAL\n");
fprintf(stderr,"program in WIMP MODE.\n\n");
fprintf(stderr,"This means that:\n");
fprintf(stderr," you will have to settle for plain old number\n");
fprintf(stderr," representations like 1972063; and,\n");
fprintf(stderr," B) You are a WIMP!\n\n");
- fflush(stderr);
+ (void) fflush(stderr);
}
}
fprintf(stderr,"Usage: bin2c varname < infile > outfile\n");
return 0;
}
- puts("/* This file is automatically generated; to modify it,");
- puts(" modify the source file, not this file. */");
+ (void) puts("/* This file is automatically generated; to modify it,");
+ (void) puts(" modify the source file, not this file. */");
printf("char* %s=\"\\\n",argv[1]);
colno=0;
while((c=getchar())!=EOF)
{
- printf("\\x%02x",c);
+ printf("\\x%02x",(unsigned)c);
colno+=4;
- if(colno>70) {puts("\\"); colno=0;}
+ if(colno>70) {(void) puts("\\"); colno=0;}
}
- puts("\";");
+ (void) puts("\";");
return 0;
}
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
+#include <limits.h>
+#include <assert.h>
/* AIS: Make this work with DJGPP's stdarg.h */
#ifdef __DJGPP__
#define MULTITHREAD 0
#define OVEROPUSED 1
#include "abcess.h"
-#include "lose.h"
+#include "ick_lose.h"
#include "numerals.c"
+/* AIS: because BUFSIZ could theoretically be too large for an int... */
+#if BUFSIZ < INT_MAX
+#define INTBUFSIZ (int)BUFSIZ
+#else
+#define INTBUFSIZ (int)INT_MAX
+#endif
+
+/* and likewise, so that we can compare things to INT_MAX */
+#ifndef min
+#define min(x,y) ((x)>(y)?(y):(x))
+#endif
+
+/* and likewise, define SIZE_MAX */
+#ifndef SIZE_MAX
+#ifdef ULLONG_MAX
+#define SIZE_MAX (sizeof(unsigned short )==sizeof(size_t)?(size_t) USHRT_MAX : \
+ sizeof(unsigned int )==sizeof(size_t)?(size_t) UINT_MAX : \
+ sizeof(unsigned long )==sizeof(size_t)?(size_t) ULONG_MAX : \
+ sizeof(unsigned long long)==sizeof(size_t)?(size_t)ULLONG_MAX : 0)
+#else
+#define SIZE_MAX (sizeof(unsigned short )==sizeof(size_t)?(size_t) USHRT_MAX : \
+ sizeof(unsigned int )==sizeof(size_t)?(size_t) UINT_MAX : \
+ sizeof(unsigned long )==sizeof(size_t)?(size_t) ULONG_MAX : 0)
+#endif
+#endif
+
/* AIS: These will be set to stdin/stdout at the first opportunity,
- which is not necessarily here. */
-FILE* cesspoolin=0;
-FILE* cesspoolout=0;
+ which is not necessarily here. The annotations are to tell splint
+ that we know what we're doing here with the assignments; the
+ set to stdin/stdout will be done whenever it's necessary.
+*/
+/*@null@*/ FILE* ick_cesspoolin =0;
+/*@null@*/ FILE* ick_cesspoolout=0;
/* AIS: To keep ld happy. This shouldn't ever actually get used, but
* give it a sane value just in case it does. (This is referenced by
* clc-cset.c, but due to the linking-in of the character sets
* themselves the reference should never be used.) */
-char* datadir=".";
+/*@observer@*/ /*@dependent@*/ char* ick_datadir=".";
/**********************************************************************
*
*
*********************************************************************/
-int* next; /* AIS: now allocated by ick-wrap.c */
-int nextindex = 0;
+unsigned* ick_next; /* AIS: now allocated by ick-wrap.c */
+/*@null@*/ jmp_buf* ick_next_jmpbufs = NULL; /* AIS: for ick_ec, if needed */
+int ick_nextindex = 0;
-static int clcsem = 0; /* AIS */
+static int ick_clcsem = 0; /* AIS */
-void pushnext(int n)
+void ick_pushnext(unsigned n)
{
- if (nextindex < MAXNEXT)
- next[nextindex++] = n;
+ if (ick_nextindex < ick_MAXNEXT)
+ ick_next[ick_nextindex++] = n;
else
- lose(E123, lineno, (char *)NULL);
+ ick_lose(IE123, ick_lineno, (char *)NULL);
}
-unsigned int popnext(int n)
+unsigned int ick_popnext(unsigned int n)
{
- nextindex -= n;
- if (nextindex < 0) {
- nextindex = 0;
+ ick_nextindex -= n;
+ if (ick_nextindex < 0) {
+ ick_nextindex = 0;
return (unsigned int)-1;
}
- return(next[nextindex]);
+ return ick_next[ick_nextindex];
}
-unsigned int resume(unsigned int n)
+/* AIS: This is not the ick_resume in ick_ec.h, which is a macro and therefore
+ technically speaking doesn't clash with this function as the header file
+ ick_ec.h isn't included. */
+unsigned int ick_resume(unsigned int n)
{
if (n == 0)
{
- lose(E621, lineno, (char *)NULL);
- return 0;
+ ick_lose(IE621, ick_lineno, (char *)NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
- else if ((n = popnext(n)) == (unsigned int)-1)
+ else if ((n = ick_popnext(n)) == (unsigned int)-1)
{
- lose(E632, lineno, (char *)NULL);
- return 0;
+ ick_lose(IE632, ick_lineno, (char *)NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
return(n);
}
*
*********************************************************************/
-unsigned int pin(void)
+unsigned int ick_pin(void)
{
- char buf[BUFSIZ], *cp, *strtok();
+ char buf[INTBUFSIZ], *cp;
unsigned int result = 0;
- int n;
- extern int wimp_mode;
+ size_t n;
+
+ assert(buf != NULL); /* AIS: splint seems unable of figuring this
+ out for itself */
- if(!cesspoolin) cesspoolin=stdin; /* AIS */
+ if(!ick_cesspoolin) ick_cesspoolin=stdin; /* AIS */
- if (fgets(buf, BUFSIZ, cesspoolin) == (char *)NULL)
- lose(E562, lineno, (char *)NULL);
+ if (fgets(buf, INTBUFSIZ, ick_cesspoolin) == (char *)NULL)
+ ick_lose(IE562, ick_lineno, (char *)NULL);
n = strlen(buf) - 1;
if (n > 0 && buf[n-1] == '\r')
--n;
buf[n] = '\0';
- if(wimp_mode) {
+ if(ick_wimp_mode) {
result = (unsigned int)strtoul(buf, (char **)NULL, 10);
n = 1;
}
int digit = -1;
numeral *np;
- for (np = numerals; np < numerals + sizeof(numerals)/sizeof(numeral); np++)
+ for (np = ick_numerals; np < ick_numerals + sizeof(ick_numerals)/sizeof(numeral); np++)
if (strcmp(np->name, cp) == 0)
{
digit = np->value;
}
if (digit == -1)
- lose(E579, lineno, cp);
+ ick_lose(IE579, ick_lineno, cp);
if (result < 429496729 || (result == 429496729 && digit < 6))
result = result * 10 + digit;
else
- lose(E533, lineno, (char *)NULL);
+ ick_lose(IE533, ick_lineno, (char *)NULL);
}
}
if (!n)
- lose(E562, lineno, (char *)NULL);
- if (result > (unsigned int)Max_large)
- lose(E533, lineno, (char *)NULL);
+ ick_lose(IE562, ick_lineno, (char *)NULL);
+ if (result > (unsigned int)ick_Max_large)
+ ick_lose(IE533, ick_lineno, (char *)NULL);
return(result);
}
/**********************************************************************
*
- * Butchered Roman numerals implemented by
+ * Butchered Roman ick_numerals implemented by
* Michael Ernst, mernst@theory.lcs.mit.edu. May 7, 1990
*
* The INTERCAL manual hints that 3999 should translate to MMMIM
#define MAXROMANS (MAXDIGITS*4+1) /* max chars in translation */
/*
- * The first column tells how many of the succeeding columns are used.
+ * The ick_first column tells how many of the succeeding columns are used.
* The other columns refer to the columns of br_equiv and br_overbar.
*/
-static int br_trans[10][5] =
+static int ick_br_trans[10][5] =
{
{0, 0, 0, 0, 0},
{1, 0, 0, 0, 0},
* 11/24/91 LHH: Removed unnecessary final newline.
*/
-static void butcher(unsigned long val, char *result)
+static void butcher(unsigned long val, /*@out@*/ char *result)
{
int i, j;
int digitsig, digitval;
(void) strcpy(result, "_\n");
else
{
- res[MAXROMANS-1] = 0;
- ovb[MAXROMANS-1] = 0;
+ res[MAXROMANS-1] = '\0';
+ ovb[MAXROMANS-1] = '\0';
i = MAXROMANS-1;
/* the significance of the current digit is 10 ** digitsig */
for (digitsig = 0; (digitsig < MAXDIGITS) && (val > 0); digitsig++)
{
- digitval = val % 10;
- for (j = br_trans[digitval][0]; j > 0; j--)
+ digitval = (int)(val % 10);
+ for (j = ick_br_trans[digitval][0]; j > 0; j--)
{
/* printf("In j loop: %d %d\n", j, i); */
- res[--i] = br_equiv[digitsig][br_trans[digitval][j]];
- ovb[i] = br_overbar[digitsig][br_trans[digitval][j]];
+ res[--i] = br_equiv[digitsig][ick_br_trans[digitval][j]];
+ ovb[i] = br_overbar[digitsig][ick_br_trans[digitval][j]];
}
val = val / 10;
}
j = i;
- while ((*result++ = ovb[j++]))
+ while ((*result++ = ovb[j++]) != '\0')
continue;
*--result = '\n';
j = i;
- while ((*++result = res[j++]))
+ while ((*++result = res[j++]) != '\0')
continue;
/* Final newline will be added by puts.
*result++ = '\n';
}
}
-void clockface(bool mode)
-/* enable or disable clockface mode (output IIII instead of IV) */
+void ick_clockface(ick_bool mode)
+/* enable or disable ick_clockface mode (output IIII instead of IV) */
{
if (mode)
{
- /* clockface mode */
- br_trans[4][0] = 4;
- br_trans[4][1] = 0;
- br_trans[4][2] = 0;
+ /* ick_clockface mode */
+ ick_br_trans[4][0] = 4;
+ ick_br_trans[4][1] = 0;
+ ick_br_trans[4][2] = 0;
}
else
{
/* normal mode */
- br_trans[4][0] = 2;
- br_trans[4][1] = 1;
- br_trans[4][2] = 2;
+ ick_br_trans[4][0] = 2;
+ ick_br_trans[4][1] = 1;
+ ick_br_trans[4][2] = 2;
}
}
-void clcsemantics(bool mode) /* AIS: CLC-INTERCAL semantics mode? */
+void ick_setclcsemantics(ick_bool mode) /* AIS: CLC-INTERCAL semantics mode? */
{
- clcsem=mode;
+ ick_clcsem=mode;
}
-void pout(unsigned int val)
-/* output in `butchered' Roman numerals; see manual, part 4.4.13 */
+void ick_pout(unsigned int val)
+/* output in `butchered' Roman ick_numerals; see manual, part 4.4.13 */
{
char result[2*MAXROMANS+1];
- extern int wimp_mode;
- if(!cesspoolout) cesspoolout=stdout; /* AIS */
+ if(!ick_cesspoolout) ick_cesspoolout=stdout; /* AIS */
- if(wimp_mode) {
- (void) fprintf(cesspoolout,"%u\n",val);
+ if(ick_wimp_mode) {
+ (void) fprintf(ick_cesspoolout,"%u\n",val);
}
else {
butcher(val, result);
- (void) fprintf(cesspoolout,"%s\n",result);
+ (void) fprintf(ick_cesspoolout,"%s\n",result);
}
- fflush(cesspoolout);
+ (void) fflush(ick_cesspoolout);
}
/**********************************************************************
*
* AIS: CLC-INTERCAL bitwise I/O, only used in CLC-INTERCAL semantics
- * mode. The I/O is done in extended Baudot for a tail array, or in
- * mingled form for a hybrid array; for the Baudot, we rely on
+ * mode. The I/O is done in extended Baudot for a tail ick_array, or in
+ * mingled form for a hybrid ick_array; for the Baudot, we rely on
* clc-cset.c and on the Baudot and Latin-1 character sets that are
* linked to libick.a (or libickmt.a), so the final executable doesn't
* reference the compiler's libraries. clc-cset.c is designed to
**********************************************************************/
/* AIS: From clc-cset.c */
-extern int clc_cset_convert(char* in, char* out, char* incset,
- char* outcset, int padstyle, int outsize,
- FILE* errsto);
+extern int ick_clc_cset_convert(char* in, /*@partial@*/ char* out, char* incset,
+ char* outcset, int padstyle, size_t outsize,
+ /*@null@*/ FILE* errsto);
-static void clcbinin(unsigned int type, array *a, bool forget)
+static void clcbinin(unsigned int type, ick_array *a, ick_bool forget)
{
- int i;
+ size_t i;
+ int ti;
char* buf, *tempcp;
- /* Allocating one byte per element in the array must be enough,
+ /* Allocating one byte per element in the ick_array must be enough,
* because the Baudot version cannot possibly be shorter than the
- * original Latin-1, plus one for the terminating NUL. */
+ * original Latin-1, plus one for the terminating NUL. There is one
+ * potential problem, which is that fgets takes an int for the
+ * number of bytes to read, so we cap the number of bytes to read
+ * at INT_MAX and hope that's enough. */
i=a->dims[0]; /* we already know that there's 1 dim only */
+ if(SIZE_MAX/6-2<=a->dims[0])
+ ick_lose(IE252, ick_lineno, (char*)NULL); /* size is too large */
if(!i) i=1;
buf=malloc(i+1);
- if(!buf) lose(E252, lineno, (char*)NULL);
- if(!fgets(buf,a->dims[0],cesspoolin))
+ if(!buf) ick_lose(IE252, ick_lineno, (char*)NULL);
+ if(!ick_cesspoolin) ick_cesspoolin=stdin;
+ if(!fgets(buf,(int)(min(a->dims[0],(size_t)INT_MAX)),ick_cesspoolin))
strcpy(buf,"\n"); /* EOF inputs the null string in CLC-INTERCAL */
tempcp=strrchr(buf,'\n'); /* still working in ASCII at this point */
- if(!tempcp) /* input too long for the array is an error */
+ if(!tempcp) /* input too long for the ick_array is an error */
{
free(buf);
- lose(E241, lineno, (char*)NULL);
+ ick_lose(IE241, ick_lineno, (char*)NULL);
}
*tempcp='\0'; /* chomp the final newline */
tempcp=malloc(6*i+12); /* to be on the safe side, even though
* Baudot doesn't use 16-byte chars */
- if(!tempcp) lose(E252, lineno, (char*)NULL);
- /* Zero the array now. */
+ if(!tempcp) ick_lose(IE252, ick_lineno, (char*)NULL);
+ /* Zero the ick_array now. */
i=a->dims[0];
if(!forget) while(i--)
- if(type==TAIL)
+ if(type==ick_TAIL)
a->data.tail[i]=0;
else
a->data.hybrid[i]=0;
- i=clc_cset_convert(buf,tempcp,"latin1","baudot",2,6*a->dims[0]+12,0);
- /* Negative i ought to be impossible here; check anyway, and cause
+ ti=ick_clc_cset_convert(buf,tempcp,"latin1","baudot",2,6*a->dims[0]+12,(FILE*)0);
+ /* Negative ti ought to be impossible here; check anyway, and cause
* an internal error if it has happened. */
- if(i<0) lose(E778, lineno, (char*)NULL);
- if((unsigned)i>a->dims[0]) lose(E241, lineno, (char*)NULL);
+ if(ti<0) ick_lose(IE778, ick_lineno, (char*)NULL);
+ i=(size_t)ti;
+ if(i>a->dims[0]) ick_lose(IE241, ick_lineno, (char*)0);
if(!forget) while(i--)
- if(type==TAIL)
- a->data.tail[i]=tempcp[i]+(rand()/(RAND_MAX/256))*256;
+ if(type==ick_TAIL)
+ a->data.tail[i]=(ick_type16)tempcp[i]+
+ (ick_type16)((rand()/(RAND_MAX/256))*256);
else
- a->data.hybrid[i]=tempcp[i]+(rand()/(RAND_MAX/256))*256;
+ a->data.hybrid[i]=(ick_type32)tempcp[i]+
+ (ick_type32)((rand()/(RAND_MAX/256))*256);
free(tempcp);
free(buf);
}
-static void clcbinout(unsigned int type, array* a)
+static void clcbinout(unsigned int type, ick_array* a)
{
- int i;
+ size_t i;
+ int ti;
char* buf, *tempcp;
+ if(SIZE_MAX/6-2<=a->dims[0])
+ ick_lose(IE252, ick_lineno, (char*)NULL); /* size is too large */
buf=malloc(a->dims[0]+1);
- if(!buf) lose(E252, lineno, (char*) NULL);
+ if(!buf) ick_lose(IE252, ick_lineno, (char*) NULL);
i=0; tempcp=buf;
- while((unsigned)i<a->dims[0])
+ while(i<a->dims[0])
{
- if(type==TAIL)
- *tempcp=a->data.tail[i];
+ /* Values above 31 are invalid in Baudot, so cap them at 33 to
+ avoid integer wraparound trouble. */
+ if(type==ick_TAIL)
+ *tempcp=(char)min(33,a->data.tail[i]);
else
- *tempcp=a->data.hybrid[i];
+ *tempcp=(char)min(33,a->data.hybrid[i]);
i++;
- if(*tempcp) tempcp++; /* NULs are ignored for some reason, but
- * that's the behaviour the CLC-INTERCAL
- * specs specify */
+ if(*tempcp!='\0')
+ tempcp++; /* NULs are ignored for some reason, but
+ * that's the behaviour the CLC-INTERCAL
+ * specs specify */
}
- *tempcp=0;
+ *tempcp='\0';
/* tempcp is definitely overkill here, but the *6+6 rule is being
* obeyed because that way the code is robust against any future
* changes in character sets. */
tempcp=malloc(a->dims[0]*6+12);
- if(!tempcp) lose(E252, lineno, (char*) NULL);
- i=clc_cset_convert(buf,tempcp,"baudot","latin1",0,6*a->dims[0]+12,0);
- tempcp[i]=0;
+ if(!tempcp) ick_lose(IE252, ick_lineno, (char*) NULL);
+ ti=ick_clc_cset_convert(buf,tempcp,"baudot","latin1",0,6*a->dims[0]+12,(FILE*)0);
+ if(ti<0) ick_lose(IE778, ick_lineno, (char*)NULL);
+ i=(size_t)ti;
+ tempcp[i]='\0';
/* CLC-INTERCAL bails out on invalid characters. C-INTERCAL uses
* instead the behaviour of replacing them with character code 26.
* (This is actually the purpose of character code 26 in ASCII, I
* think, although this is derived from memory; I don't know of any
* other system that uses it for this purpose, though, and the
* ability to confuse Windows with it is worth what might be lost
- * through standards compliance.) */
- while(i--) if(!tempcp[i]) tempcp[i]=26;
- fprintf(cesspoolout,"%s\n",tempcp);
+ * through standards compliance, because Windows nonstandardly
+ * treats it as an EOF character.) */
+ while(i--) if(tempcp[i] == '\0') tempcp[i]='\x1a';
+ if(!ick_cesspoolout) ick_cesspoolout=stdout;
+ fprintf(ick_cesspoolout,"%s\n",tempcp);
free(tempcp);
free(buf);
}
*
*********************************************************************/
-void binin(unsigned int type, array *a, bool forget)
+void ick_binin(unsigned int type, ick_array *a, ick_bool forget)
{
- static unsigned int lastin = 0;
+ static int lastin = 0;
int c, v;
- unsigned int i;
+ size_t i;
if (a->rank != 1)
- lose(E241, lineno, (char *)NULL);
+ ick_lose(IE241, ick_lineno, (char *)NULL);
- if(!cesspoolin) cesspoolin=stdin; /* AIS */
+ if(!ick_cesspoolin) ick_cesspoolin=stdin; /* AIS */
- if(clcsem) {clcbinin(type, a, forget); return;} /* AIS */
+ if(ick_clcsem) {clcbinin(type, a, forget); return;} /* AIS */
for (i = 0 ; i < a->dims[0] ; i++) {
- v = ((c=fgetc(cesspoolin)) == EOF) ? 256 : (c - lastin) % 256;
+ v = ((c=fgetc(ick_cesspoolin)) == EOF) ? 256 : (c - lastin) % 256;
lastin = c;
if (!forget) {
- if (type == TAIL)
- a->data.tail[i] = v;
+ if (type == ick_TAIL)
+ a->data.tail[i] = (ick_type16) v;
else
- a->data.hybrid[i] = v;
+ a->data.hybrid[i] = (ick_type32) v;
}
}
}
-void binout(unsigned int type, array *a)
+void ick_binout(unsigned int type, ick_array *a)
{
static unsigned int lastout = 0;
- unsigned int i, c;
+ unsigned int c;
+ size_t i;
if (a->rank != 1)
- lose(E241, lineno, (char *)NULL);
+ ick_lose(IE241, ick_lineno, (char *)NULL);
- if(!cesspoolout) cesspoolout=stdout; /* AIS */
+ if(!ick_cesspoolout) ick_cesspoolout=stdout; /* AIS */
- if(clcsem) {clcbinout(type, a); return;} /* AIS */
+ if(ick_clcsem) {clcbinout(type, a); return;} /* AIS */
for (i = 0 ; i < a->dims[0] ; i++) {
- if (type == TAIL)
+ if (type == ick_TAIL)
c = lastout - a->data.tail[i];
else
c = lastout - a->data.hybrid[i];
c = (c & 0x0f) << 4 | (c & 0xf0) >> 4;
c = (c & 0x33) << 2 | (c & 0xcc) >> 2;
c = (c & 0x55) << 1 | (c & 0xaa) >> 1;
- fputc(c,cesspoolout);
- if (c == '\n')
- fflush(cesspoolout);
+ (void) fputc((int)c,ick_cesspoolout);
+ if (c == 10 /* \n in INTERCAL */)
+ (void) fflush(ick_cesspoolout);
}
}
*
*********************************************************************/
-unsigned int assign(char *dest, unsigned int type, bool forget,
+unsigned int ick_assign(char *dest, unsigned int type, ick_bool forget,
unsigned int value)
{
unsigned int retval = 0;
- if (type == ONESPOT || type == TAIL) {
- if (value > (unsigned int)Max_small)
- lose(E275, lineno, (char *)NULL);
+ if (type == ick_ONESPOT || type == ick_TAIL) {
+ if (value > (unsigned int)ick_Max_small)
+ ick_lose(IE275, ick_lineno, (char *)NULL);
if (forget)
retval = value;
else {
- retval = *(type16*)dest;
- *(type16*)dest = value;
+ retval = *(ick_type16*)dest;
+ *(ick_type16*)dest = (ick_type16) value;
}
}
- else if (type == TWOSPOT || type == HYBRID) {
+ else if (type == ick_TWOSPOT || type == ick_HYBRID) {
if (forget)
retval = value;
else {
- retval = *(type32*)dest;
- *(type32*)dest = value;
+ retval = *(ick_type32*)dest;
+ *(ick_type32*)dest = value;
}
}
return retval;
/**********************************************************************
*
- * The following functions implement the INTERCAL array model
+ * The following functions implement the INTERCAL ick_array model
* If _POSIX_SOURCE is defined, stdarg is used, otherwise varargs.
*
*********************************************************************/
#ifdef _POSIX_SOURCE
-char *aref(unsigned int type, ...)
+/*@dependent@*/ void *ick_aref(unsigned int type, ...)
#else
-char *aref(va_alist) va_dcl
+/*@dependent@*/ void *ick_aref(va_alist) va_dcl
#endif
-/* return a pointer to the array location specified by args */
+/* return a pointer to the ick_array location specified by args */
{
#ifndef _POSIX_SOURCE
unsigned int type;
#endif
- array *a;
+ ick_array *a;
unsigned int v;
va_list ap;
- int address = 0;
+ size_t address = 0;
unsigned int i;
#ifdef _POSIX_SOURCE
va_start(ap);
type = va_arg(ap, unsigned int);
#endif
- a = va_arg(ap, array*);
+ a = va_arg(ap, ick_array*);
if (va_arg(ap, unsigned int) != a->rank)
- lose(E241, lineno, (char *)NULL);
+ ick_lose(IE241, ick_lineno, (char *)NULL);
for (i = 0 ; i < a->rank ; i++) {
v = va_arg(ap, unsigned int);
- if (v == 0 || v > a->dims[i])
- lose(E241, lineno, (char *)NULL);
+ if (v == 0 || (size_t)v > a->dims[i])
+ ick_lose(IE241, ick_lineno, (char *)NULL);
address = address * a->dims[i] + v - 1;
}
va_end(ap);
- if (type == TAIL)
- return (char*)&a->data.tail[address];
+ if (type == ick_TAIL)
+ return (void*)&(a->data.tail[address]);
else
- return (char*)&a->data.hybrid[address];
+ return (void*)&(a->data.hybrid[address]);
}
#ifdef _POSIX_SOURCE
-void resize(unsigned int type, ...)
+void ick_resize(unsigned int type, ...)
#else
-void resize(va_alist) va_dcl
+void ick_resize(va_alist) va_dcl
#endif
-/* resize an array to the given shape */
+/* ick_resize an ick_array to the given shape */
{
#ifndef _POSIX_SOURCE
unsigned int type;
#endif
- array *a;
- bool forget;
- unsigned int i, r, v;
+ ick_array *a;
+ ick_bool forget;
+ unsigned int i, r;
+ size_t v;
va_list ap;
int prod = 1;
va_start(ap);
type = va_arg(ap, unsigned int);
#endif
- a = va_arg(ap, array*);
- forget = va_arg(ap, bool);
+ a = va_arg(ap, ick_array*);
+ forget = va_arg(ap, ick_bool);
- if (!a->rank) a->dims = 0; /* AIS: a->dims no longer initialised */
+ /* AIS: a->dims is no longer initialised. So initialise it here if
+ it isn't already initialised, with an annotation to explain that
+ we aren't freeing the old pointer (because it was never malloced in
+ the first place and is probably invalid anyway.) */
+ /*@-mustfreeonly@*/
+ if (!a->rank) a->dims = 0;
+ /*@-mustfreeonly@*/
r = va_arg(ap, unsigned int);
if (!forget) {
a->rank = r;
if (a->dims)
free((char*)a->dims);
- a->dims = (unsigned int*) malloc(a->rank * sizeof(unsigned int));
+ a->dims = malloc(a->rank * sizeof(*(a->dims)));
if (a->dims == NULL)
- lose(E241, lineno, (char *)NULL);
+ ick_lose(IE241, ick_lineno, (char *)NULL);
}
for (i = 0 ; i < r ; i++) {
- v = va_arg(ap, unsigned int);
+ v = va_arg(ap, size_t);
if (v == 0)
- lose(E240, lineno, (char *)NULL);
+ ick_lose(IE240, ick_lineno, (char *)NULL);
if (!forget) {
+ assert(a->dims != NULL); /* AIS: it isn't, because !forget, but
+ splint doesn't know that */
a->dims[i] = v;
prod *= v;
}
}
if (!forget) {
- if (type == TAIL) {
+ if (type == ick_TAIL) {
if (a->data.tail)
free((char *)a->data.tail);
- a->data.tail = (type16*)malloc(prod * sizeof(type16));
+ a->data.tail = (ick_type16*)malloc(prod * sizeof(ick_type16));
if (a->data.tail == NULL)
- lose(E241, lineno, (char *)NULL);
+ ick_lose(IE241, ick_lineno, (char *)NULL);
}
else {
if (a->data.hybrid)
free((char *)a->data.hybrid);
- a->data.hybrid = (type32*)malloc(prod * sizeof(type32));
+ a->data.hybrid = (ick_type32*)malloc(prod * sizeof(ick_type32));
if (a->data.hybrid == NULL)
- lose(E241, lineno, (char *)NULL);
+ ick_lose(IE241, ick_lineno, (char *)NULL);
}
}
*
*********************************************************************/
-stashbox *first; /* AIS: made non-static so it can be seen by unravel.c */
+/*@null@*/ ick_stashbox *ick_first; /* AIS: made non-static so it can be seen by unravel.c */
-void stashinit(void)
+void ick_stashinit(void)
{
- first = NULL;
+ ick_first = NULL;
}
-static stashbox *fetch(unsigned int type, unsigned int index)
+static /*@null@*/ ick_stashbox *fetch(unsigned int type, unsigned int index)
/* find a stashed variable in the save stack and extract it */
{
- stashbox **pp = &first, *sp = first;
+ ick_stashbox **pp = &ick_first, *sp = ick_first;
- while (sp && (sp->type != type || sp->index != index)) {
- pp = &sp->next;
- sp = sp->next;
+ while (sp != NULL && (sp->type != type || sp->index != index)) {
+ pp = &sp->ick_next;
+ sp = sp->ick_next;
}
if (sp)
- *pp = sp->next;
+ *pp = sp->ick_next;
+ /* The annotation here is because Splint can't figure out that
+ ick_first can be modified via pp, and because this function
+ is the place where storage marked 'dependent' is initialised
+ and deinitialised. */
+ /*@-globstate@*/ /*@-dependenttrans@*/
return (sp);
+ /*@=globstate@*/ /*@=dependenttrans@*/
}
-void stash(unsigned int type, unsigned int index, void *from, overop* oo)
+void ick_stash(unsigned int type, unsigned int index, void *from, ick_overop* oo)
/* stash away the variable's value */
{
- /* create a new stashbox and push it onto the stack */
- stashbox *sp = (stashbox*)malloc(sizeof(stashbox));
- if (sp == NULL) lose(E222, lineno, (char *)NULL);
- sp->next = first;
- first = sp;
+ /*@-nullassign@*/
+ ick_overop dummyoo = {NULL, NULL};
+ /*@=nullassign@*/
+ /* create a new ick_stashbox and push it onto the stack */
+ ick_stashbox *sp = (ick_stashbox*)malloc(sizeof(ick_stashbox));
+ if (sp == NULL) ick_lose(IE222, ick_lineno, (char *)NULL);
+ sp->ick_next = ick_first;
+ ick_first = sp;
/* store the variable in it */
- sp->type = type;
- sp->index = index;
- if(oo) sp->overloadinfo=oo[index]; /* AIS */
- if (type == ONESPOT)
+ ick_first->type = type;
+ ick_first->index = index;
+ if(oo) ick_first->overloadinfo=oo[index]; /* AIS */
+ else ick_first->overloadinfo=dummyoo; /* AIS */
+ if (type == ick_ONESPOT)
{
- memcpy((char *)&sp->save.onespot, from, sizeof(type16));
+ memcpy(&ick_first->save.onespot, from, sizeof(ick_type16));
}
- else if (type == TWOSPOT)
- memcpy((char *)&sp->save.twospot, from, sizeof(type32));
- else if (type == TAIL || type == HYBRID) {
- array *a = (array*)from;
+ else if (type == ick_TWOSPOT)
+ memcpy(&ick_first->save.twospot, from, sizeof(ick_type32));
+ else if (type == ick_TAIL || type == ick_HYBRID) {
+ ick_array *a = (ick_array*)from;
int prod;
unsigned int i;
- sp->save.a = (array*)malloc(sizeof(array));
- if (sp->save.a == NULL) lose(E222, lineno, (char *)NULL);
- sp->save.a->rank = a->rank;
- sp->save.a->dims = (unsigned int*)malloc(a->rank * sizeof(unsigned int));
- if (sp->save.a->dims == NULL) lose(E222, lineno, (char *)NULL);
- memcpy((char*)sp->save.a->dims, (char*)a->dims,
- a->rank * sizeof(unsigned int));
+ ick_first->save.a = (ick_array*)malloc(sizeof(ick_array));
+ if (ick_first->save.a == NULL) ick_lose(IE222, ick_lineno, (char *)NULL);
+ ick_first->save.a->rank = a->rank;
+ ick_first->save.a->dims = malloc(a->rank * sizeof(*(ick_first->save.a->dims)));
+ if (ick_first->save.a->dims == NULL) ick_lose(IE222, ick_lineno, (char *)NULL);
+ memcpy(ick_first->save.a->dims, a->dims,
+ a->rank * sizeof(*(a->dims)));
prod = a->rank ? 1 : 0;
for (i = 0 ; i < a->rank ; i++) {
prod *= a->dims[i];
}
- if (type == TAIL) {
- sp->save.a->data.tail =
- (type16*)malloc(prod * sizeof(type16));
- if (sp->save.a->data.tail == NULL) lose(E222, lineno, (char *)NULL);
- memcpy((char *)sp->save.a->data.tail,
- (char*)a->data.tail, prod * sizeof(type16));
+ if (type == ick_TAIL) {
+ ick_first->save.a->data.tail =
+ (ick_type16*)malloc(prod * sizeof(ick_type16));
+ if (ick_first->save.a->data.tail == NULL) ick_lose(IE222, ick_lineno, (char *)NULL);
+ memcpy(ick_first->save.a->data.tail,
+ a->data.tail, prod * sizeof(ick_type16));
}
else {
- sp->save.a->data.hybrid =
- (type32*)malloc(prod * sizeof(type32));
- if (sp->save.a->data.hybrid == NULL) lose(E222, lineno, (char *)NULL);
- memcpy((char *)sp->save.a->data.hybrid,
- (char*)a->data.hybrid, prod * sizeof(type32));
+ ick_first->save.a->data.hybrid =
+ (ick_type32*)malloc(prod * sizeof(ick_type32));
+ if (ick_first->save.a->data.hybrid == NULL) ick_lose(IE222, ick_lineno, (char *)NULL);
+ memcpy(ick_first->save.a->data.hybrid,
+ a->data.hybrid, prod * sizeof(ick_type32));
}
}
return;
}
-void retrieve(void *to, int type, unsigned int index, bool forget, overop* oo)
+void ick_retrieve(void *to, unsigned int type, unsigned int index,
+ ick_bool forget, ick_overop* oo)
/* restore the value of a variable from the save stack */
{
- stashbox *sp;
+ ick_stashbox *sp;
- if ((sp = fetch(type, index)) == (stashbox *)NULL)
- lose(E436, lineno, (char *)NULL);
+ if ((sp = fetch(type, index)) == (ick_stashbox *)NULL)
+ ick_lose(IE436, ick_lineno, (char *)NULL);
else if (!forget) {
if(oo) oo[index]=sp->overloadinfo; /* AIS */
- if (type == ONESPOT)
- memcpy(to, (char *)&sp->save.onespot, sizeof(type16));
- else if (type == TWOSPOT)
- memcpy(to, (char *)&sp->save.twospot, sizeof(type32));
- else if (type == TAIL || type == HYBRID) {
- array *a = (array*)to;
+ if (type == ick_ONESPOT)
+ memcpy(to, (char *)&sp->save.onespot, sizeof(ick_type16));
+ else if (type == ick_TWOSPOT)
+ memcpy(to, (char *)&sp->save.twospot, sizeof(ick_type32));
+ else if (type == ick_TAIL || type == ick_HYBRID) {
+ ick_array *a = (ick_array*)to;
+ /*@-branchstate@*/ /* it's a union, so one valid is correct */
+
if (a->rank) {
free(a->dims);
- if (type == TAIL)
+ if (type == ick_TAIL)
free(a->data.tail);
else
free(a->data.hybrid);
- memcpy(to, (char*)sp->save.a, sizeof(array));
+ memcpy(to, (char*)sp->save.a, sizeof(ick_array));
}
+ /*@=branchstate@*/
+ /* AIS: there isn't a memory leak here, because we memcpyd the
+ pointers elsewhere and so they are yet accessible. You can't
+ expect Splint to figure out what's going on there, though, thus
+ the annotations. */
+ /*@-compdestroy@*/
free(sp->save.a);
+ /*@=compdestroy@*/
}
}
- else if (type == TAIL || type == HYBRID) {
+ else if (type == ick_TAIL || type == ick_HYBRID) {
free(sp->save.a->dims);
- if (type == TAIL)
+ if (type == ick_TAIL)
free(sp->save.a->data.tail);
else
free(sp->save.a->data.hybrid);
*
*********************************************************************/
-unsigned int roll(unsigned int n)
-/* return TRUE on n% chance, FALSE otherwise */
+unsigned int ick_roll(unsigned int n)
+/* return ick_TRUE on n% chance, ick_FALSE otherwise */
{
#ifdef USG
return((unsigned int)(lrand48() % 100) < n);
/**********************************************************************
*
* AIS: This function is called when two COME FROMs reference the same
- * line at runtime. multicome0 is used in a non-multithread
+ * line at runtime. ick_multicome0 is used in a non-multithread
* program; it produces an error. For multicome1, see unravel.c.
*
*********************************************************************/
-int multicome0(int errlineno, jmp_buf pc)
+int ick_multicome0(int errlineno, jmp_buf pc)
{
+ /*@-noeffect@*/
(void) pc; /* it's ignored by this function */
- lose(E555, errlineno, (char *) NULL);
+ /*@=noeffect@*/
+ ick_lose(IE555, errlineno, (char *) NULL);
/* this line number is quite possibly going to be wildly inaccurate */
+ /*@-unreachable@*/
return 0;
+ /*@=unreachable@*/
}
/* cesspool.c ends here */
the character set (number of characters in each shift state), the
number of shift states, and the bit order of the input. The bit
order can either be 8 characters long (msb down to lsb) or 16 (the
- first byte in a pair, followed by the second); each bit of the input
+ ick_first byte in a pair, followed by the second); each bit of the input
is transferred to the corresponding bit in a binary table that
follows (a for the lsb, b for the second least significant bit, up
to l for the 12th least significant bit; at most 12 significant bits
* rather than reading them from disk; in this case, these extern
* variables will be set non-null by object files invented
* specifically for the purpose. */
-extern char* clc_cset_atari;
-extern char* clc_cset_baudot;
-extern char* clc_cset_ebcdic;
-extern char* clc_cset_latin1;
+extern /*@null@*/ char* ick_clc_cset_atari;
+extern /*@null@*/ char* ick_clc_cset_baudot;
+extern /*@null@*/ char* ick_clc_cset_ebcdic;
+extern /*@null@*/ char* ick_clc_cset_latin1;
-static char* clc_cset_ptr=0;
+static /*@null@*/ char* ick_clc_cset_ptr=0;
/* Fake that we're reading hardcoded characters from a file. This
* method of doing it is obviously not thread-safe. */
-int clc_cset_hardcoderead(FILE* ignored)
+static int ick_clc_cset_hardcoderead(FILE* ignored)
{
+ /*@-noeffect@*/
(void) ignored;
- return *clc_cset_ptr++;
+ /*@=noeffect@*/
+ return (int)*ick_clc_cset_ptr++;
}
struct cset
{
unsigned char set[4096]; /* allow up to 12 bits of data+shifts */
- int setlen;
+ unsigned short setlen;
int shifts;
char setname[9]; /* 8.3 filenames are enforced! */
char bitorder[16];
/* In particular, this initialises the setnames to the null string,
* and clears nbytes. Both of these are used to determine whether a
* cset is valid or not. */
-static struct cset cset_recent[NCSETRECENT]={{{0},0,0,{0},{0},0}};
-static int csetow=0; /* which cset to overwrite next */
+/*@-initallelements@*/ /*@-type@*/
+static struct cset ick_cset_recent[NCSETRECENT]={{{0},0,0,{0},{0},0}};
+/*@=initallelements@*/ /*@=type@*/
+static int ick_csetow=0; /* which cset to overwrite ick_next */
/* For help finding files */
-extern char* globalargv0;
-extern char* datadir;
+/*@observer@*/ extern char* ick_globalargv0;
+/*@observer@*/ extern char* ick_datadir;
-static void clc_cset_load(struct cset* cs, char* fname)
+/*@-mustfreefresh@*/
+/* because Splint doesn't understand how findandfopen works */
+static void ick_clc_cset_load(/*@unique@*/ struct cset* cs, /*@unique@*/ char* fname)
{
FILE* in;
char buf[13]; /* enough for an 8.3 filename */
int (*ipf)(FILE*);
/* Avoid buffer-overflow attacks. */
if(strlen(fname)>8) return;
- /* If clc_cset_atari is non-null, then don't read from disk. */
- if(clc_cset_atari)
+ /* If ick_clc_cset_atari is non-null, then don't read from disk. */
+ if(ick_clc_cset_atari)
{
/* If the character sets have been hardcoded, only accept
* hardcoded chararacter sets. */
- clc_cset_ptr=0;
- if(!strcmp(fname,"atari")) clc_cset_ptr=clc_cset_atari;
- if(!strcmp(fname,"baudot")) clc_cset_ptr=clc_cset_baudot;
- if(!strcmp(fname,"ebcdic")) clc_cset_ptr=clc_cset_ebcdic;
- if(!strcmp(fname,"latin1")) clc_cset_ptr=clc_cset_latin1;
- if(!clc_cset_ptr) return; /* not a hardcoded charset */
- in=0;
- ipf=clc_cset_hardcoderead;
+ ick_clc_cset_ptr=0;
+ if(!strcmp(fname,"atari")) ick_clc_cset_ptr=ick_clc_cset_atari;
+ if(!strcmp(fname,"baudot")) ick_clc_cset_ptr=ick_clc_cset_baudot;
+ if(!strcmp(fname,"ebcdic")) ick_clc_cset_ptr=ick_clc_cset_ebcdic;
+ if(!strcmp(fname,"latin1")) ick_clc_cset_ptr=ick_clc_cset_latin1;
+ if(!ick_clc_cset_ptr) return; /* not a hardcoded charset */
+ in=(FILE*)0;
+ ipf=ick_clc_cset_hardcoderead;
}
else
{
+ /* We already checked above that this isn't a buffer overflow. */
+ /*@-bufferoverflowhigh@*/
sprintf(buf,"%s.bin",fname);
- if(!(in=findandfopen(buf,datadir,"rb",globalargv0))) return;
+ /*@=bufferoverflowhigh@*/
+ if(!(in=ick_findandfopen(buf,ick_datadir,"rb",ick_globalargv0))) return;
ipf=fgetc;
}
/* First row: setlen */
cs->setlen=0;
- for(;;)
+ do
{
/* The input is definitely in ASCII, even if the C program isn't,
which is why numeric codes are used. */
+ /* Here, ipf allows NULL input iff in is actually NULL; this situation
+ is impossible to explain with an annotation, so instead just disable
+ the warning. */
+ /*@-nullpass@*/
c=ipf(in);
- if(c==EOF) {if(in) fclose(in); return;} /* error or EOF */
+ /*@=nullpass@*/
+ if(c==EOF) {if(in) (void)fclose(in); return;}
if(c<48||c>57) break;
cs->setlen*=10;
cs->setlen+=c-48;
- }
- if(c!=10) {if(in) fclose(in); return;}
+ } while(1);
+ if(c!=10) {if(in) (void)fclose(in); return;}
/* Second row: shifts. This can be from 1 to 9. */
+ /*@-nullpass@*/
c=ipf(in);
- if(c<49||c>57) {if(in) fclose(in); return;}
+ /*@=nullpass@*/
+ if(c<49||c>57) {if(in) (void)fclose(in); return;}
cs->shifts=c-48;
- if(ipf(in)!=10) {if(in) fclose(in); return;}
+ /*@-nullpass@*/
+ if(ipf(in)!=10) {if(in) (void)fclose(in); return;}
+ /*@=nullpass@*/
/* Third row: byte order. */
i=0;
- while(((c=ipf(in)))>96&&i<16) cs->bitorder[i++]=c;
+ /*@-nullpass@*/
+ while(((c=ipf(in)))>96&&i<16) cs->bitorder[i++]=(char)c;
+ /*@=nullpass@*/
/* Sanity check; that it is a whole number of bytes, that the input
* format is correct, and that there are at most 4096 bytes of data
* total. */
* there's an error later. */
/* Rest of file: the bytes themselves. */
j=0;
+ /*@-nullpass@*/
while(j<cs->setlen*cs->shifts)
- if((cs->set[j++]=c=ipf(in)),c==EOF&&in) {if(in) fclose(in); return;}
- if(in) fclose(in);
+ if((cs->set[j++]=(unsigned char)(c=ipf(in))),c==EOF && in != NULL)
+ {if(in) (void)fclose(in); return;}
+ /*@=nullpass@*/
+ if(in) (void) fclose(in);
/* Now set the name and number of bytes, indicating a successful
* load. */
cs->nbytes=i/8;
strcpy(cs->setname,fname);
}
+/*@=mustfreefresh@*/
/* Helper function for fixing bit order in output. */
-static void bitencout(char** pop, struct cset* co,
+static void ick_bitencout(char** pop, struct cset* co,
unsigned short val, int padstyle)
{
unsigned short outword=0;
int i=co->nbytes*8;
+ /*@-shiftnegative@*/ /* i can't go above it's initial value here */
while(i--)
- /* 108 is 'l' in Latin-1 */
- if(co->bitorder[i]>108)
+ if(co->bitorder[i]>'l')
{
- if((padstyle==1&&(i==1||i==9)&&!(outword&(1<<(co->nbytes*8-i))))||
+ if((padstyle==1&&(i==1||i==9) && !(outword&(1<<(co->nbytes*8-i)))) ||
(padstyle==2&&(rand()>RAND_MAX/2||!outword)))
outword |= 1<<(co->nbytes*8-i-1);
}
/* Copy the appropriate bit from val to outword. */
- else outword |= ((val>>(co->bitorder[i]-97))&1)<<(co->nbytes*8-i-1);
- if(co->nbytes==2) *(*pop)++=outword/256;
- *(*pop)++=outword%256;
+ else outword |= (unsigned short)((val>>(co->bitorder[i]-'a'))&1)
+ << (co->nbytes*8-i-1);
+ /*@=shiftnegative@*/
+ if(co->nbytes==2) *(*pop)++=(char)(outword/256);
+ *(*pop)++=(char)(outword%256);
}
/* padstyle is 0 to pad with zeros, 1 to pad to make the output
* outsize-1 characters and a NUL will be written to out. The code is
* conservative about this; to be safe, make outsize six times as long
* as the in is (including in's terminal NUL), plus 6. */
-int clc_cset_convert(char* in, char* out, char* incset, char* outcset,
- int padstyle, int outsize, FILE* errsto)
+int ick_clc_cset_convert(char* in, /*@partial@*/ char* out, char* incset,
+ char* outcset, int padstyle, size_t outsize,
+ /*@null@*/ FILE* errsto)
{
int ic=-1, oc=-1;
int i;
i=NCSETRECENT;
while(i--)
{
- (void)(strcmp(incset,cset_recent[i].setname) || (ic=i));
- (void)(strcmp(outcset,cset_recent[i].setname) || (oc=i));
+ (void)(strcmp(incset,ick_cset_recent[i].setname) || (ic=i));
+ (void)(strcmp(outcset,ick_cset_recent[i].setname) || (oc=i));
}
/* Find a blank entry to load on top of. */
- if(ic==-1) for(i=NCSETRECENT;i--;) if(!cset_recent[i].nbytes) ic=i;
- if(oc==-1) for(i=NCSETRECENT;i--;) if(!cset_recent[i].nbytes&&i!=ic) oc=i;
+ if(ic==-1) for(i=NCSETRECENT;i--;) if(!ick_cset_recent[i].nbytes) ic=i;
+ if(oc==-1) for(i=NCSETRECENT;i--;) if(!ick_cset_recent[i].nbytes&&i!=ic) oc=i;
/* Failing that, find any entry to load on top of. */
- (void)(ic==-1 && (cset_recent[ic=csetow++].nbytes=0));
- if(csetow==ic) csetow++;
- csetow%=NCSETRECENT;
- (void)(oc==-1 && (cset_recent[oc=csetow++].nbytes=0));
- csetow%=NCSETRECENT;
+ (void)(ic==-1 && (ick_cset_recent[ic=ick_csetow++].nbytes=0));
+ if(ick_csetow==ic) ick_csetow++;
+ ick_csetow%=NCSETRECENT;
+ (void)(oc==-1 && (ick_cset_recent[oc=ick_csetow++].nbytes=0));
+ ick_csetow%=NCSETRECENT;
/* If the character set hasn't been loaded, load it now. */
- cset_recent[ic].nbytes || (clc_cset_load(cset_recent+ic,incset),0);
- cset_recent[oc].nbytes || (clc_cset_load(cset_recent+oc,outcset),0);
- csri=cset_recent+ic;
- csro=cset_recent+oc;
+ ick_cset_recent[ic].nbytes || (ick_clc_cset_load(ick_cset_recent+ic,incset),0);
+ ick_cset_recent[oc].nbytes || (ick_clc_cset_load(ick_cset_recent+oc,outcset),0);
+ csri=ick_cset_recent+ic;
+ csro=ick_cset_recent+oc;
/* If a character set failed to load, bail out. */
if(!csri->nbytes)
{
csri->shifts==1 && (ssi=1);
csro->shifts==1 && (sso=1);
ip=in; op=out;
- while(*ip&&(op-out)<outsize-6)
+ while(*ip != '\0' && (size_t)(op-out)<outsize-6)
{
- tus=(unsigned char)*ip++;
+ tus=(unsigned short)(unsigned char)*ip++;
if(csri->nbytes==2)
{
tus*=256;
- tus+=(unsigned char)*ip++;
+ tus+=(unsigned short)(unsigned char)*ip++;
}
i=csri->nbytes*8;
csi=0;
while(i--)
{
- /* 108 is 'l' in Latin-1 */
- if(csri->bitorder[i]>108) continue;
+ if(csri->bitorder[i]>'l') continue;
/* Copy the appropriate bit from tus to csi. */
- csi |= ((tus>>(csri->nbytes*8-i-1))&1)<<(csri->bitorder[i]-97);
+ /*@-shiftnegative@*/
+ csi |= (unsigned short)((tus>>(csri->nbytes*8-i-1))&1)
+ << (csri->bitorder[i]-'a');
+ /*@=shiftnegative@*/
}
if(csi>csri->setlen)
{
- bitencout(&op,csro,0,padstyle); /* not in the charset */
- if(!noconvwarn&&errsto)
+ ick_bitencout(&op,csro,0,padstyle); /* not in the charset */
+ if(!noconvwarn && errsto != NULL)
fprintf(errsto,"Warning: some characters could not be translated,"
" they were replaced with NUL.\n");
noconvwarn=1;
state in turn, choose the option that takes the longest
until it ends up not changing shift state, then perform one
shift from that option. */
- int sstesting, ssbestsf, ssrecord, j;
+ int sstesting, ssbestsf, ssrecord, j, k;
sstesting=csri->shifts+1; ssbestsf=ssrecord=0;
while(--sstesting)
{
- i=sstesting; j=0;
- while(csri->set[csi+i-1]&&
- csri->set[csi+i-1]!=i&&
- csri->set[csi+i-1]<=csri->shifts)
- {i=csri->set[csi+i-1]; j++;}
+ k=sstesting; j=0;
+ while(csri->set[csi+i-1] != (unsigned char)0 &&
+ (int)csri->set[csi+i-1]!=k &&
+ (int)csri->set[csi+i-1]<=csri->shifts)
+ {k=(int)csri->set[csi+i-1]; j++;}
if(ssbestsf<j) {ssbestsf=sstesting; ssrecord=j;}
}
ssi=ssbestsf;
}
csi+=ssi-1;
- tus=csri->set[csi]; /* we now have the Latin-1 conversion! */
- if(tus>=1&&tus<=csri->shifts&&csri->shifts>1)
+ tus=(unsigned short)csri->set[csi]; /* we now have the Latin-1 conversion! */
+ if(tus>=1&&tus<=(unsigned short)csri->shifts&&csri->shifts>1)
{
/* That wasn't a character, but a shift command. */
- ssi=tus;
+ ssi=(int)tus;
continue;
}
/* Look for the character in the output's character
i=csro->shifts*csro->setlen;
csi=10000;
while(i--)
- (void)(csro->set[i]==tus && (csi==10000||csi%csro->shifts!=sso-1)
- && (csi=i));
+ (void)((unsigned short)csro->set[i]==tus &&
+ (csi==10000 || (int)csi%csro->shifts!=sso-1) &&
+ (csi=(unsigned short)i));
if(csi==10000&&tus==9 /* latin-1 tab */)
{
- if(!substwarn&&errsto)
+ if(!substwarn && errsto != NULL)
fprintf(errsto,"Warning: no tab in output character set,"
" space was used instead.\n");
substwarn=1;
}
if(csi==10000)
{
- bitencout(&op,csro,0,padstyle); /* not in the charset */
- if(!noconvwarn&&errsto)
+ ick_bitencout(&op,csro,0,padstyle); /* not in the charset */
+ if(!noconvwarn && errsto != NULL)
fprintf(errsto,"Warning: some characters could not be translated,"
" they were replaced with NUL.\n");
noconvwarn=1;
}
- else if(csi%csro->shifts==sso-1)
+ else if((int)(csi%csro->shifts)==(int)sso-1)
/* in the right shift state already */
- bitencout(&op,csro,csi/csro->shifts,padstyle);
+ ick_bitencout(&op,csro,(unsigned short)(csi/csro->shifts),padstyle);
else
{
int tempi;
int j=csro->shifts+1;
while(--j>0)
{
- if(j-1==csi%csro->shifts) continue;
- i=csro->setlen;
+ if(j-1==(int)(csi%csro->shifts)) continue;
+ i=(int)csro->setlen;
while(i--)
- if(csro->set[i*csro->shifts+j-1]==csi%csro->shifts+1)
+ if((int)csro->set[i*csro->shifts+j-1]==csi%csro->shifts+1)
{j=-j; break; /* there is one in this set */};
j=-j;
if(j<0) break;
}
/* Pick the worst-case if we found one, or otherwise just
* any state we aren't in at the moment. */
- sso=(j<0?-j:csi%csro->shifts);
+ sso=(j<0?-j:(int)(csi%csro->shifts));
if(!sso) sso=csro->shifts;
}
/* Look for the shift code, if there is one. */
- i=csro->setlen;
+ i=(int)csro->setlen;
while(i--)
- if(csro->set[i*csro->shifts+sso-1]==csi%csro->shifts+1) break;
+ if((int)csro->set[i*csro->shifts+sso-1]==csi%csro->shifts+1) break;
tempi=i*csro->shifts+sso-1;
if(i==-1)
{
retry:
i=csro->setlen*csro->shifts;
while(i--)
- if(csro->set[i]==csi%csro->shifts+1&&
- i%csro->shifts!=csi%csro->shifts&&
+ if((int)csro->set[i]==csi%csro->shifts+1&&
+ i%csro->shifts!=(int)(csi%csro->shifts)&&
i%csro->shifts+1!=intershift) break;
if(i==-1) return -1; /* no way to get into the right state */
intershift=i%csro->shifts+1;
tempi=i;
- i=csro->setlen;
+ i=(int)csro->setlen;
while(i--)
- if(csro->set[i*csro->shifts+sso-1]==intershift) break;
+ if((int)csro->set[i*csro->shifts+sso-1]==intershift) break;
if(i==-1) goto retry; /* try once more */
- bitencout(&op,csro,i,padstyle);
+ ick_bitencout(&op,csro,(unsigned short)i,padstyle);
/* sso=intershift here but we're going to overwrite it
* immediately anyway, so no point in the assignment */
}
- bitencout(&op,csro,tempi/csro->shifts,padstyle);
- bitencout(&op,csro,csi/csro->shifts,padstyle);
+ ick_bitencout(&op,csro,(unsigned short)(tempi/csro->shifts),padstyle);
+ ick_bitencout(&op,csro,(unsigned short)(csi/csro->shifts),padstyle);
sso=csi%csro->shifts+1;
}
}
}
- *op=0;
+ *op='\0';
return op-out;
}
/* Define if you have the strtoul function. */
#undef HAVE_STRTOUL
+/* Define if you have the snprintf function. */
+#undef HAVE_SNPRINTF
+
+/* Define if you have the asprintf function. */
+#undef HAVE_ASPRINTF
+
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
#include <string.h>
#include <unistd.h>
-int clc_cset_convert(char* in, char* out, char* incset, char* outcset,
- int padstyle, int outsize, FILE* errsto);
+int ick_clc_cset_convert(char* in, /*@partial@*/ char* out, char* incset,
+ char* outcset, int padstyle, size_t outsize,
+ /*@null@*/ FILE* errsto);
/* For communication with clc_cset.c */
-char* globalargv0;
-char* datadir;
+/*@observer@*/ char* ick_globalargv0;
+/*@-redef@*/ /* it's never the case that both definitions are used at once */
+/*@observer@*/ /*@dependent@*/ char* ick_datadir;
+/*@=redef@*/
/* We want to read the latest versions of the character sets from disk. */
-char* clc_cset_atari=0;
-char* clc_cset_baudot=0;
-char* clc_cset_ebcdic=0;
-char* clc_cset_latin1=0;
+/*@null@*/ char* ick_clc_cset_atari=0;
+/*@null@*/ char* ick_clc_cset_baudot=0;
+/*@null@*/ char* ick_clc_cset_ebcdic=0;
+/*@null@*/ char* ick_clc_cset_latin1=0;
#ifndef ICKDATADIR
#define ICKDATADIR "/usr/local/share/ick-0.27"
#endif
+/*@-redef@*/ /* because only one main is used at a time */
int main(int argc, char** argv)
+/*@=redef@*/
{
- int allocsize=100;
+ size_t allocsize=100;
char* in;
char* out;
- int i=0;
+ size_t i=0;
+ int ti;
int c;
int padding=-1;
- globalargv0=argv[0];
- srand(time(NULL));
+ ick_globalargv0=argv[0];
+ srand((unsigned)time(NULL));
if(argc!=3&&argc!=4)
{
fprintf(stderr,"Usage: convickt informat outformat [padding]\n");
fprintf(stderr,"Error: padding value not recognized.\n");
return 1;
}
- if(!(datadir=getenv("ICKDATADIR")))
- datadir=ICKDATADIR;
+ if(!(ick_datadir=getenv("ICKDATADIR")))
+ ick_datadir=ICKDATADIR;
in=malloc(allocsize);
if(!in) {perror("Error: Memory allocation failure"); return 0;}
while((c=getchar())!=EOF)
{
- in[i++]=c;
+ in[i++]=(char)c;
if(i+1>=allocsize)
{
char* temp=in;
if(!in)
{
perror("Error: Memory allocation failure");
- free(temp);
+ /* Annotation, because in hasn't been freed here; that's what the
+ error return from realloc means. */
+ /*@-usereleased@*/
+ if(temp) free(temp);
+ /*@=usereleased@*/
return 0;
}
}
}
- in[i]=0;
+ in[i]='\0';
out=malloc(allocsize*6+6);
if(!out)
{
free(in);
return 0;
}
- i=clc_cset_convert(in,out,argv[1],argv[2],padding,allocsize*6+6,stderr);
- if(i>=0) fwrite(out,1,i,stdout);
+ ti=ick_clc_cset_convert(in,out,argv[1],argv[2],padding,allocsize*6+6,stderr);
+ if(ti>=0) (void) fwrite(out,1,(size_t)ti,stdout);
free(in);
free(out);
- return i<0;
+ return ti<0;
}
# DESCRIPTION
# This optimizer is only run on noninteractive code that takes no
# output. (It's designed to run on executables produced by INTERCAL
-# code, but will run on other executables that support the +mystery
+# code, but will run on other executables that support the +ick_mystery
# option). It optimizes the file by replacing it by one that simply
# produces the required output! Therefore, it creates fast but
# inefficient code. If the file to be optimized hits an error or
-# is terminated by +mystery, then no changes are made.
+# is terminated by +ick_mystery, then no changes are made.
#
# LICENSE TERMS
# Copyright (C) 2006 Alex Smith
###########################################################################
rm icktemp.out >/dev/null 2>/dev/null
-if $1@EXEEXT@ +mystery >icktemp.out 2>/dev/null ; then : ; else
+if $1@EXEEXT@ +ick_mystery >icktemp.out 2>/dev/null ; then : ; else
rm icktemp.out ; exit 0 ; fi
if grep 'ickoutTERM???!' icktemp.out ; then rm icktemp.out ; exit 0 ; fi
echo 'ickoutTERM???!' >> icktemp.out
#include "ick.h"
#include "parser.h"
#include "fiddle.h"
-#include "lose.h"
+#include "ick_lose.h"
#include "feh.h"
extern int emitlineno; /* AIS: From feh2.c */
extern void prexpr(node *np, FILE* fp, int freenode); /* AIS */
/* By AIS. This function looks remarkably like a C++ copy-constructor to me,
- just with extra arrows in. */
-node *nodecopy(node* n)
+ just with extra arrows in. The annotations here show that nulls are allowed
+ when called recursively, but not otherwise. */
+/*@-incondefs@*/
+/*@null@*/ node *nodecopy(/*@null@*/ node* n)
+/*@=incondefs@*/
{
node* np;
if(!n) return 0;
/* This function by AIS. Compares expressions. In C++, I'd call this
node::operator== . */
-bool nodessame(node* n1, node* n2)
+ick_bool nodessame(node* n1, node* n2)
{
if(!n1) return !n2;
if(!n2) return 0;
if(!nodessame(n1->rval,n2->rval)) return 0;
switch(n1->opcode)
{
- case ONESPOT:
- case TWOSPOT:
- case HYBRID:
- case TAIL:
+ case ick_ONESPOT:
+ case ick_TWOSPOT:
+ case ick_HYBRID:
+ case ick_TAIL:
case MESH:
case MESH32:
return n1->constant == n2->constant;
if(tptype == ENABLE) return 1;
if(npconstant == GETS)
if(tptype == RESIZE) return 1;
+ if(npconstant == UNKNOWN) /* JH */
+ if(tptype == SPLATTERED) return 1;
return 0;
}
* this information into account, producing faster and shorter source code.
* In an ideal world, we'd end up with the produced INTERCAL looking like
* proper C code, but somehow I think that's unlikely to happen.
- * At the moment, it just checks for unused !abstained[] guards on
+ * At the moment, it just checks for unused !ick_abstained[] guards on
* statements and removes them (possibly removing comments altogether).
* This is minor, but should clear up degenerated code substantially.
- * It also allows the code for gets to replace assign() with the faster =
+ * It also allows the code for gets to replace ick_assign() with the faster =
* in cases where this doesn't affect the behaviour of the program.
* See the function itself for what I did to NEXT.
*
tuple* tp, *tpa, *tpb;
atom* op;
node* np;
- if(!flowoptimize) lose(E778, iyylineno, (char *) NULL);
- for (tp = tuples; tp < tuples + lineno; tp++) tp->abstainable = 0;
+ if(!flowoptimize) ick_lose(IE778, iyylineno, (char *) NULL);
+ for (tp = tuples; tp < tuples + ick_lineno; tp++) tp->abstainable = 0;
/* abstainable holds whether a line's abstention status can change */
- for (op = oblist; op < obdex; op++) op->ignorable = 0;
+ for (op = oblist; op != NULL && op < obdex; op++) op->ignorable = 0;
/* ignorable holds whether a variable's ignorance status can change */
- for (tp = tuples; tp < tuples + lineno; tp++)
+ for (tp = tuples; tp < tuples + ick_lineno; tp++)
{
/* allow for warnings to be generated during flow optimisations */
- optuple = tp; /* Patch by Joris Huizer */
+ /* AIS: I marked tuples as only deliberately, so that it produced warnings
+ when aliased in an unsafe way. However, tuples isn't realloced during
+ optimisation, so we can safely ignore the warning for it produced
+ here. */
+ /*@-onlytrans@*/
+ optuple = tp;
+ /*@=onlytrans@*/
if(tp->maybe) tp->abstainable = 1;
if(tp->exechance < 0) tp->initabstain = 1;
if(tp->exechance != 100 && tp->exechance != -100) tp->abstainable = 1;
}
if(tp->type == DISABLE || tp->type == MANYFROM)
{
- for (tpa = tuples; tpa < tuples + lineno; tpa++)
+ for (tpa = tuples; tpa < tuples + ick_lineno; tpa++)
{
np = tp->u.node;
if(tp->type == MANYFROM) np = np->rval;
for(; np; np = np -> rval)
- if(abstainmatch(np->constant, tpa->type))
+ if(abstainmatch((int)np->constant, (int)tpa->type))
if(tpa->exechance >= 0) tpa->abstainable = 1;
}
}
if(tp->type == ENABLE)
{
- for (tpa = tuples; tpa < tuples + lineno; tpa++)
+ for (tpa = tuples; tpa < tuples + ick_lineno; tpa++)
{
np = tp->u.node;
for(; np; np = np -> rval)
- if(abstainmatch(np->constant, tpa->type))
+ if(abstainmatch((int)np->constant, (int)tpa->type))
if(tpa->exechance < 0) tpa->abstainable = 1;
}
}
- if(tp->type == GETS && Base == 2 && !opoverused)
+ if(tp->type == GETS && ick_Base == 2 && !opoverused)
checknodeactbits(tp->u.node->rval);
/* If optdata shows that the value must always fit in the variable,
- and the variable cannot be ignored, assign can be replaced by the
+ and the variable cannot be ignored, ick_assign can be replaced by the
cheaper =. */
if(tp->type == IGNORE)
{
for (np = tp->u.node; np; np = np->rval)
{
- for (op = oblist; op < obdex; op++)
+ for (op = oblist; op != NULL && op < obdex; op++)
{
- if(op->type == np->opcode && (unsigned)op->intindex == np->constant)
+ if(op->type == np->opcode && (unsigned long)op->intindex == np->constant)
op->ignorable = 1;
}
}
problems and common variations.
First, the FORGET might be placed elsewhere, or replaced with a higher
FORGET later or a higher RESUME later. If there is, in fact, a RESUME #1
- as the next NEXT-control statement, the idiom won't quite work properly.
+ as the ick_next NEXT-control statement, the idiom won't quite work properly.
So to handle this, we need to push the original return address on the
- NEXT stack if block 1 is taken, unless the next statement is a FORGET #1.
+ NEXT stack if block 1 is taken, unless the ick_next statement is a FORGET #1.
Second, there may be abstentions or COME FROMs messing with control flow
in the area. The flow optimizer ought to be able to detect this and not
optimize the statement if true. (This means that a program which uses
relevant variable needs to be checked for also. The checks are done partly
in optimizef() and partly in emit().
*/
- if(compucomesused||Base!=2||opoverused) return;
+ if(compucomesused||ick_Base!=2||opoverused) return;
np = (node*) NULL;
- for (tp = tuples; tp < tuples + lineno; tp++)
+ for (tp = tuples; tp < tuples + ick_lineno; tp++)
{
if(tp->type == GETS)
{
most of them. */
if(tp->u.node->lval->opcode != SUB) np = tp->u.node->lval;
}
- else if(np&&nodessame(np, tp->u.node->lval)) np = (node*) NULL;
+ else if(np != NULL && nodessame(np, tp->u.node->lval)) np = (node*) NULL;
if(tp->nextable) np = (node*) NULL;
if(tp->maybe||tp->abstainable) np = (node*) NULL;
if(tp->ncomefrom&&multithread) np = (node*) NULL;
if(np)
{ /* IGNORING np might prevent it getting its <1-or-2-value>. */
- atom* op;
+ atom* op2;
int ignorable = 1;
- for(op = oblist; op < obdex; op++)
+ for(op2 = oblist; op2 != NULL && op2 < obdex; op2++)
{
- if(op->type == np->opcode &&
- (unsigned)op->intindex == np->constant)
+ if(op2->type == np->opcode &&
+ (unsigned long)op2->intindex == np->constant)
{
- ignorable &= op->ignorable;
+ ignorable &= op2->ignorable;
}
}
if(ignorable) np = (node*) NULL;
((tpb->u.node->opcode == C_1PLUS ||
tpb->u.node->opcode == C_2MINUS) &&
tpb->u.node->rval->optdata == 1)) ||*/
- (np&&nodessame(tpb->u.node,np))) &&
+ (np != NULL && nodessame(tpb->u.node,np))) &&
!tpb->abstainable)
/* No COMING FROM a nonabstainable RESUME line! */
{
- tp->optversion = TRUE;
+ tp->optversion = ick_TRUE;
+ free(tp->u.node);
tp->u.node = nodecopy(tpb->u.node);
/* If tp->u.node is 2, then the statement should translate to a
no-op (NEXT...NEXT...RESUME #2). However, if tp->u.node is 1,
np = (node*) NULL;
}
}
+ /*@-nullstate@*/ /* no tuples->u.node can't be null */
}
+/*@=nullstate@*/
/*************************************************************************
*
{
int optflag;
if(opoverused) return; /* what chance do we have of optimizing this? */
- if(Base==2)
+ if(ick_Base==2)
{
checknodeactbits(np);
checkW534(np); /* This must be done before optimization, and depends on
if(optdebug == 1) explexpr(np,stderr);
if(optdebug == 1) fprintf(stderr," becomes ");
if(optdebug >= 2) optdebugnode = np;
- if(Base==2) optimize_pass1(np); /* Optimize idioms; from idiotism.oil */
- if(Base!=2)
+ if(ick_Base==2) (void) optimize_pass1(np); /* Optimize idioms; from idiotism.oil */
+ if(ick_Base!=2)
{
if(optdebug && optdebug != 3) explexpr(np,stderr);
if(optdebug == 3) prexpr(np,stderr,0);
if(optuple->type == RESUME && !np->optdata) optuple->warn622 = 1;
}
-/* By AIS. This relies on free'd pointers being NULLed. */
-void nodefree(node *np)
+/* By AIS. This relies on free'd pointers being NULLed. The annotations
+ are basically trying to describe how the function operates. */
+void nodefree(/*@keep@*/ /*@null@*/ node *np)
{
if(!np) return;
+ /*@-mustfreeonly@*/
if(np->opcode==SLAT) return; /* mustn't be freed yet */
+ /*@=mustfreeonly@*/
+ /*@-keeptrans@*/
nodefree(np->lval);
nodefree(np->rval);
free(np);
+ /*@=keeptrans@*/
}
/* By AIS. This checks W534. */
{ /* This only comes up in binary. */
case AND: case OR: case XOR: case MINGLE: case SELECT:
optuple->warn018 = 1;
+ break;
default:
checkforintercaloperators(np->lval);
checkforintercaloperators(np->rval);
switch (np->opcode)
{
case MINGLE:
+ /*@-nullderef@*/ /* mingle has two nonnull arguments */
if(np->lval->optdata & 0xffff0000LU) optuple->warn276 = 1;
if(np->rval->optdata & 0xffff0000LU) optuple->warn276 = 1;
- np->optdata = mingle(np->lval->optdata & 0xffff,
- np->rval->optdata & 0xffff);
+ np->optdata = ick_mingle((unsigned)(np->lval->optdata & 0xffff),
+ (unsigned)(np->rval->optdata & 0xffff));
+ /*@=nullderef@*/
/* The bitmask is needed because the output of ~ might always be 16-bit
at runtime, but appear 32-bit at compile-time. But this is somewhat
suspicious, so we can at least give a warning (W276) if -l is used. */
/* The result could be the selected optdata, or have a 1 anywhere to the
right of a 1 in the resulting selection if there are 0s in rval where
there could have been 1s */
- np->optdata = iselect(np->lval->optdata, np->rval->optdata);
+ /*@-nullderef@*/
+ np->optdata = ick_iselect((unsigned)np->lval->optdata, (unsigned)np->rval->optdata);
+ /*@=nullderef@*/
temp=16;
while(temp--) np->optdata|=(np->optdata>>1); /* fill in gaps in optdata */
break;
case AND:
- np->optdata = (np->width==16?and16:and32)(np->rval->optdata);
+ if(np->width==16)
+ np->optdata = ick_and16((unsigned)np->rval->optdata);
+ else
+ np->optdata = ick_and32((unsigned)np->rval->optdata);
break;
case OR:
case XOR:
- np->optdata = (np->width==16?or16:or32)(np->rval->optdata);
+ if(np->width==16)
+ np->optdata = ick_or16((unsigned)np->rval->optdata);
+ else
+ np->optdata = ick_or32((unsigned)np->rval->optdata);
/* This is or in both cases. */
break;
case WHIRL3:
case WHIRL4:
case WHIRL5: /* We must be in binary to reach this point, so: */
- lose(E997, emitlineno, (char*) NULL);
+ ick_lose(IE997, emitlineno, (char*) NULL);
+ /*@-unreachable@*/
break;
+ /*@=unreachable@*/
case MESH:
case MESH32:
can be nonzero! */
break;
- case ONESPOT:
- case TWOSPOT:
- case TAIL:
- case HYBRID:
+ case ick_ONESPOT:
+ case ick_TWOSPOT:
+ case ick_TAIL:
+ case ick_HYBRID:
case SUB:
- np->optdata = np->width == 16 ? 0xffff : 0xffffffffLU;
+ np->optdata = np->width == 16 ? 0xffffLU : 0xffffffffLU;
break;
/* cases from here down are generated by optimize_pass1 */
case C_AND:
+ /*@-nullderef@*/
np->optdata = np->lval->optdata & np->rval->optdata;
+ /*@=nullderef@*/
break;
case C_OR:
case C_XOR:
+ /*@-nullderef@*/
np->optdata = np->lval->optdata | np->rval->optdata;
+ /*@=nullderef@*/
/* bitwise-or is correct in both cases */
break;
case C_NOT:
- np->optdata = np->width == 16 ? 0xffff : 0xffffffffLU;
+ np->optdata = np->width == 16 ? 0xffffLU : 0xffffffffLU;
break;
case C_A:
break;
case C_RSHIFTBY:
+ /*@-nullderef@*/
if(np->rval->opcode == MESH || np->rval->opcode == MESH32)
np->optdata = np->lval->optdata >> np->rval->constant;
- else np->optdata = (np->width == 16 ? 0xffff : 0xffffffffLU);
+ else np->optdata = (np->width == 16 ? 0xffffLU : 0xffffffffLU);
+ /*@=nullderef@*/
/* Play safe if the RHS isn't a constant */
break;
case C_LSHIFTBY:
+ /*@-nullderef@*/
if(np->rval->opcode == MESH || np->rval->opcode == MESH32)
np->optdata = np->lval->optdata << np->rval->constant;
- else np->optdata = (np->width == 16 ? 0xffff : 0xffffffffLU);
+ else np->optdata = (np->width == 16 ? 0xffffLU : 0xffffffffLU);
+ /*@=nullderef@*/
/* Play safe if the RHS isn't a constant */
break;
case C_PLUS:
/* A bit could be set if it's set in either of the numbers, or if it's set
by a carry; so OR together the two numbers and their sum. */
+ /*@-nullderef@*/
np->optdata = np->lval->optdata | np->rval->optdata |
(np->lval->optdata + np->rval->optdata);
+ /*@=nullderef@*/
break;
case C_MINUS:
case C_DIVIDEBY:
/* The optimizer shouldn't be able to generate negative answers or
divisions by 0, so just fill in all bits from lval rightwards */
+ /*@-nullderef@*/
np->optdata = np->lval->optdata;
np->optdata |= np->optdata >> 1;
np->optdata |= np->optdata >> 2;
np->optdata |= np->optdata >> 4;
np->optdata |= np->optdata >> 8;
np->optdata |= np->optdata >> 16;
+ /*@=nullderef@*/
break;
case C_MODULUS:
/* The answer must be smaller than both inputs, but we can't tell anything
else */
+ /*@-nullderef@*/
np->optdata = np->lval->optdata;
if(np->rval->optdata < np->optdata) np->optdata = np->rval->optdata;
np->optdata |= np->optdata >> 1;
np->optdata |= np->optdata >> 4;
np->optdata |= np->optdata >> 8;
np->optdata |= np->optdata >> 16;
+ /*@=nullderef@*/
break;
case C_TIMES:
/* Convolve one set of active bits with the other, ORadding the results */
np->optdata=0;
temp=32;
+ /*@-nullderef@*/ /*@-shiftnegative@*/
while(temp--)
if(np->lval->optdata & (1LU << temp))
np->optdata = np->optdata | (np->rval->optdata << temp) |
((np->rval->optdata << temp) + np->optdata);
+ /*@=nullderef@*/ /*@=shiftnegative@*/
+ break;
case GETS:
/* Of course, this doesn't return a value. So this uses the default
code just below it, which is why it doesn't end in break;. This
has its own case so that W276 can be given on an assignment. */
+ /*@-nullderef@*/
if(np->lval->optdata == 0xffff &&
np->rval->optdata & 0xffff0000lu) optuple->warn276 = 1;
- /* no break;! */
+ /*@=nullderef@*/
+ /*@fallthrough@*/
default:
+ /*@-nullderef@*/
if(np->opcode == BY && !np->lval->optdata) optuple->warn239 = 1;
- np->optdata = (np->width == 16 ? 0xffff : 0xffffffffLU);
+ /*@=nullderef@*/
+ np->optdata = (np->width == 16 ? 0xffffLU : 0xffffffffLU);
/* Some values of opcode are used as placeholders, to save more than 1
piece of information in a node. The optdata for these is probably
irrelevant, but just in case, we mark all possible bits as active. */
/* feh.h -- compilation functions used by perpetrate.c and ick.y */
-extern node *newnode(void);
-extern node *cons(int type, node *car, node *cdr);
-extern unsigned int intern(int type, unsigned int index);
+/*@partial@*/ extern node *newnode(void);
+/*@partial@*/ extern node *cons(int type, /*@null@*/ /*@keep@*/ node *car, /*@null@*/ /*@keep@*/ node *cdr);
+extern unsigned long intern(int type, unsigned long index);
extern void checklabel(int label);
extern void treset(void);
-extern tuple *newtuple(void);
+/*@out@*/ /*@dependent@*/ extern tuple *newtuple(void);
extern void tupleswap(int,int); /* AIS */
extern void ppinit(int); /* AIS */
extern void typecast(node *np);
extern void codecheck(void);
extern void optimize(node *np);
-extern char *nameof(int value, assoc table[]);
+/*@observer@*/ extern char *nameof(int value, assoc table[]);
extern void emit(tuple *tn, FILE *fp);
extern void emittextlines(FILE *fp);
extern void emitslatproto(FILE *fp); /* AIS: emit prototypes for /-functions */
extern void prexpr(node *np, FILE* fp, int freenode); /* AIS: destaticed */
extern void checknodeactbits(node *np); /* AIS */
extern void optimizef(); /* AIS */
-extern void nodefree(node* np); /* AIS */
+extern void nodefree(/*@keep@*/ /*@null@*/ node* np); /* AIS */
extern unsigned long varextern(unsigned long intern, int vartype); /* AIS */
extern node *nodecopy(node*); /* AIS */
-extern bool nodessame(node*, node*); /* AIS */
+extern ick_bool nodessame(node*, node*); /* AIS */
extern node *optdebugnode; /* AIS */
extern char **enablers; /* AIS: so that there can be an element before the
- first element of the array (UNKNOWN is element
+ ick_first element of the ick_array (UNKNOWN is element
-1, just to cause a bit more confusion) */
extern assoc vartypes[];
were split into dekludge.c.
LICENSE TERMS
- Copyright (C) 1996 Eric S. Raymond
+ Copyright (C) 1996 Eric S. Raymond
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#include "sizes.h"
#include "ick.h"
#include "parser.h"
#include "fiddle.h"
-#include "lose.h"
+#include "ick_lose.h"
#include "feh.h"
/* AIS: Destaticed for dekludge.c */
int emitlineno; /* line number for errors encountered during emit */
-int mark112 = 0; /* AIS: Mark the next generated tuple for W112 */
+/*@-exportlocal@*/ /* the parser uses this */
+int mark112 = 0; /* AIS: Mark the ick_next generated tuple for W112 */
+/*@=exportlocal@*/
/* AIS: From perpet.c */
extern int pickcompile;
-extern int clclex;
+extern int ick_clcsemantics;
/*************************************************************************
*
*
**************************************************************************/
-node *newnode(void)
+/*@partial@*/ node *newnode(void)
/* allocate and zero out a new expression node */
{
- return((node *)calloc(sizeof(node), 1));
+ node* temp;
+ temp=calloc(sizeof(node), 1);
+ if(!temp) ick_lose(IE345, 0, (char*) NULL);
+ return temp;
}
-node *cons(int type, node *car, node *cdr)
+/*@partial@*/ node *cons(int type, /*@null@*/ /*@keep@*/ node *car, /*@null@*/ /*@keep@*/ node *cdr)
{
node *np = newnode();
*
**************************************************************************/
-unsigned int intern(int type, unsigned int index)
+unsigned long intern(int type, unsigned long index)
{
atom *x;
- /* AIS: Allow use of a modifiable constant 0. */
- if ((index < 1 || index > 65535) && type!=MESH)
- lose(E200, iyylineno, (char *)NULL);
+ /* AIS: Allow use of a modifiable constant 0 or >65535. */
+ if ((index < 1LU || index > 65535LU) && type!=MESH)
+ ick_lose(IE200, iyylineno, (char *)NULL);
+ /*@-branchstate@*/
if (!oblist)
{
/* initialize oblist and obdex */
oblist = malloc(ALLOC_CHUNK * sizeof(atom));
if (!oblist)
- lose(E778, iyylineno, (char *)NULL);
+ ick_lose(IE345, iyylineno, (char *)NULL);
obdex = oblist;
obcount = ALLOC_CHUNK;
}
-
- /* if it's already on the oblist, return its intindex */
- for (x = oblist; x < obdex; x++)
+ else
+ {
+ /* if it's already on the oblist, return its intindex */
+ for (x = oblist; x < obdex; x++)
if (x->type == type && x->extindex == index)
- return(x->intindex);
+ return(x->intindex);
+ }
+ /*@=branchstate@*/
+ assert(oblist != NULL);
/* else we must intern a new symbol */
+ /* AIS: Splint doesn't understand what's going on here at all. Disabling
+ the warnings; I've checked this and think it's correct. */
+ /*@-usedef@*/ /*@-usereleased@*/ /*@-branchstate@*/
if (obdex >= oblist + obcount)
{
obcount += ALLOC_CHUNK;
x = realloc(oblist, obcount * sizeof(atom));
if (!x)
- lose(E333, iyylineno, (char *)NULL);
+ ick_lose(IE333, iyylineno, (char *)NULL);
obdex = x + (obdex - oblist);
oblist = x;
}
+ /*@=branchstate@*/ /*@=usereleased@*/ /*@=usedef@*/
obdex->type = type;
obdex->extindex = index;
obdex->memloc = 0; /* AIS: not placed in memory yet */
- if (type == ONESPOT)
- obdex->intindex = nonespots++;
- if (type == TWOSPOT)
- obdex->intindex = ntwospots++;
- if (type == TAIL)
- obdex->intindex = ntails++;
- if (type == HYBRID)
- obdex->intindex = nhybrids++;
+ if (type == ick_ONESPOT)
+ obdex->intindex = (unsigned)nonespots++;
+ if (type == ick_TWOSPOT)
+ obdex->intindex = (unsigned)ntwospots++;
+ if (type == ick_TAIL)
+ obdex->intindex = (unsigned)ntails++;
+ if (type == ick_HYBRID)
+ obdex->intindex = (unsigned)nhybrids++;
if (type == MESH) /* AIS: count meshes too */
- obdex->intindex = nmeshes++;
+ obdex->intindex = (unsigned)nmeshes++;
++obdex;
+ /*@-usedef@*/
return(obdex[-1].intindex);
+ /*@=usedef@*/
}
/*************************************************************************
void checklabel(int label)
{
if (label < 1 || label > 65535)
- lose(E197, iyylineno, (char *)NULL);
+ ick_lose(IE197, iyylineno, (char *)NULL);
}
/*************************************************************************
int comefromsearch(tuple* tn, unsigned int index)
{
tuple* tp;
- for (tp = tuples; tp < tuples + lineno; tp++)
+ for (tp = tuples; tp < tuples + ick_lineno; tp++)
{
if((tp->type == COME_FROM || tp->type == NEXTFROMLABEL)
&& tp->u.target == (unsigned)(tn-tuples+1))
tuplecount = 0;
if (tuples)
{
- free(tuples);
- tuples = NULL;
+ /* AIS: Splint doesn't understand lazy allocation, which is why it
+ thinks I'm treating an unqualified as an only (I am, but a lazy
+ list doesn't fit any of Splint's storage classes); also, I am
+ completely destroying the tuples, because any nodes in them ought
+ to have been deallocated in prexpr. */
+ /*@-unqualifiedtrans@*/ /*@-compdestroy@*/
+ free(tuples);
+ tuples = NULL;
+ /*@=unqualifiedtrans@*/ /*@=compdestroy@*/
}
- nonespots = ntwospots = ntails = nhybrids = 0;
+ nmeshes = nonespots = ntwospots = ntails = nhybrids = 0;
obdex = oblist;
- lineno = 0;
+ ick_lineno = 0;
+ /* AIS: It's easier to mark tuples as 'always allocated', because
+ it usually is, and just supress the warnings. Maybe the 'proper'
+ way to do it would be to assert that tuples was non-null everywhere,
+ but again this is just problems with Splint not understanding how
+ lazy allocation works. So I tell Splint that it's allocated everywhere
+ and just supress the warnings it produces when it isn't. */
+ /*@-globstate@*/
}
+/*@=globstate@*/
-tuple *newtuple(void)
+/*@out@*/ /*@dependent@*/ tuple *newtuple(void)
/* allocate and zero out a new expression tuple */
{
- if (lineno >= tuplecount - 1) /* Patch by Joris Huizer: must leave 1 empty */
+ /* Patch by Joris Huizer: must leave at least 1 tuple empty */
+ if (ick_lineno >= tuplecount - 1 || tuples == NULL)
{
tuplecount += ALLOC_CHUNK;
if (tuples)
else
tuples = malloc(tuplecount * sizeof(tuple));
if (!tuples)
- {
- lose(E666, iyylineno, (char *)NULL);
- return NULL;
- }
- memset(tuples + lineno, 0, (tuplecount - lineno) * sizeof(tuple));
+ ick_lose(IE666, iyylineno, (char *)NULL);
+ memset(tuples + ick_lineno, 0, (tuplecount - ick_lineno) * sizeof(tuple));
}
- if(mark112) tuples[lineno].warn112 = 1; mark112 = 0; /* AIS */
- return(tuples + lineno++);
+ if(mark112) tuples[ick_lineno].warn112 = 1; mark112 = 0; /* AIS */
+ /* Yes, tuples is strictly speaking 'partial' at this point, but it's going
+ to be filled in later, and isn't marked as partial due to it not being
+ partial through most of the code, and you can't write out on a global.
+ So instead I'm just suppressing the warning, because it doesn't lead to
+ a problem long-term. */
+ /*@-compdef@*/
+ return(tuples + ick_lineno++);
+ /*@=compdef@*/
}
void tupleswap(int distback1, int distback2)
{
tuple temp;
- memcpy(&temp, &tuples[lineno-distback1], sizeof(tuple));
- memcpy(&tuples[lineno-distback1], &tuples[lineno-distback2], sizeof(tuple));
- memcpy(&tuples[lineno-distback2], &temp, sizeof(tuple));
+ memcpy(&temp, &tuples[ick_lineno-distback1], sizeof(tuple));
+ memcpy(&tuples[ick_lineno-distback1], &tuples[ick_lineno-distback2], sizeof(tuple));
+ memcpy(&tuples[ick_lineno-distback2], &temp, sizeof(tuple));
+ /* Splint doesn't understand memcpy, and so falsely things this is a memory leak. */
+ /*@-compdestroy@*/
}
+/*@=compdestroy@*/
void ppinit(int tuplecount)
{
while(tuplecount)
{
/* 0 is an impossible exechance; make sure it's set for tuple elements. */
- if(!tuples[lineno-tuplecount].exechance)
- tuples[lineno-tuplecount].exechance=100;
+ if(!tuples[ick_lineno-tuplecount].exechance)
+ tuples[ick_lineno-tuplecount].exechance=100;
/* The onceagainflag also needs to be set. */
- tuples[lineno-tuplecount].onceagainflag=onceagain_NORMAL;
+ tuples[ick_lineno-tuplecount].onceagainflag=onceagain_NORMAL;
tuplecount--;
}
}
/*
* This is an entire set of type-deducing machinery right here.
*/
- if (np->opcode == MESH || np->opcode == ONESPOT || np->opcode == TAIL)
+ /*@-nullderef@*/ /* AIS: because the opcode defines whether lval or rval are nonnull */
+ if (np->opcode == MESH || np->opcode == ick_ONESPOT || np->opcode == ick_TAIL)
np->width = 16;
- else if (np->opcode == TWOSPOT || np->opcode == HYBRID
+ else if (np->opcode == ick_TWOSPOT || np->opcode == ick_HYBRID
|| np->opcode == MINGLE || np->opcode == MESH32)
np->width = 32;
else if (np->opcode == AND || np->opcode == OR || np->opcode == XOR ||
else if (np->opcode == SELECT)
np->width = np->rval->width; /* n-bit select has an n-bit result */
else if (np->opcode == SUB)
- np->width = np->lval->width; /* type of the array */
+ np->width = np->lval->width; /* type of the ick_array */
else if (np->opcode == SLAT || np->opcode == BACKSLAT)
np->width = np->lval->width; /* AIS: \ and / return their left arg */
+ /*@=nullderef@*/
}
/*************************************************************************
/* check for assignment type mismatches */
/* This check can't be done at compile time---RTFM. [LHH] */
/*
- for (tp = tuples; tp < tuples + lineno; tp++)
+ for (tp = tuples; tp < tuples + ick_lineno; tp++)
if (tp->type == GETS)
if (tp->u.node->lval->width == 16 && tp->u.node->rval->width == 32)
- lose(E275, tp - tuples + 1, (char *)NULL);
+ ick_lose(IE275, tp - tuples + 1, (char *)NULL);
*/
/* check for duplicate labels */
- for (tp = tuples; tp < tuples + lineno; tp++)
+ for (tp = tuples; tp < tuples + ick_lineno; tp++)
if (tp->label)
- for (up = tuples; up < tuples + lineno; up++)
+ for (up = tuples; up < tuples + ick_lineno; up++)
if (tp != up && tp->label == up->label)
- lose(E182, tp - tuples + 1, (char *)NULL);
+ ick_lose(IE182, tp - tuples + 1, (char *)NULL);
/*
* Check that every NEXT, ABSTAIN, REINSTATE and COME_FROM actually has a
* legitimate target label.
*/
- notpast1900 = TRUE;
- for (tp = tuples; tp < tuples + lineno; tp++)
+ notpast1900 = ick_TRUE;
+ for (tp = tuples; tp < tuples + ick_lineno; tp++)
{
- if (tp->label == 1900) notpast1900 = FALSE; /* AIS */
+ if (tp->label == 1900) notpast1900 = ick_FALSE; /* AIS */
if (tp->type == NEXT
|| tp->type == ABSTAIN || tp->type == REINSTATE
|| tp->type == COME_FROM || tp->type == FROM
|| tp->type == NEXTFROMLABEL) /* AIS: added FROM, NEXTFROMLABEL. */
{
- bool foundit = FALSE;
+ ick_bool foundit = ick_FALSE;
if (tp->u.target >= 1900 && tp->u.target <= 1998)
{
we in syslib already? */
if(notpast1900) coopt = 0;
}
-
- for (up = tuples; up < tuples + lineno; up++)
+
+ for (up = tuples; up < tuples + ick_lineno; up++)
if (tp->u.target == up->label)
{
- foundit = TRUE;
+ foundit = ick_TRUE;
break;
}
in it will appear in the program. */
if (tp->type == NEXT &&
(!pickcompile||tp->u.target<1000||tp->u.target>1999))
- lose(E129, tp - tuples + 1, (char *)NULL);
+ ick_lose(IE129, tp - tuples + 1, (char *)NULL);
else if (tp->type == NEXT) /* AIS */
{tp->nexttarget=0; continue;}
/* AIS: NEXTFROMLABEL's basically identical to COME_FROM */
else if (tp->type == COME_FROM || tp->type == NEXTFROMLABEL)
- lose(E444, tp - tuples + 1, (char *)NULL);
+ ick_lose(IE444, tp - tuples + 1, (char *)NULL);
else
- lose(E139, tp - tuples + 1, (char *)NULL);
+ ick_lose(IE139, tp - tuples + 1, (char *)NULL);
}
/* tell the other tuple if it is a COME FROM target */
/* AIS: NEXTFROMLABEL again */
else if (tp->type == COME_FROM || tp->type == NEXTFROMLABEL)
{
if (up->ncomefrom && !multithread) /* AIS: multithread check */
- lose(E555, iyylineno, (char *)NULL);
+ ick_lose(IE555, iyylineno, (char *)NULL);
else
up->ncomefrom++; /* AIS: to handle multiple COME FROMs */
}
/* this substitutes line numbers for label numbers
AIS: COME FROM now uses this too. This changes the logic
slightly so that an !foundit condition would fall through,
- but as long as lose doesn't return, it's not a problem.
+ but as long as ick_lose doesn't return, it's not a problem.
(I removed the else before the if.) */
if (tp->type != NEXT)
{
- tp->u.target = up - tuples + 1;
+ /* AIS: added this useickec condition. */
+ if(!useickec || (tp->type!=NEXTFROMLABEL && tp->type!=COME_FROM))
+ tp->u.target = (unsigned)(up - tuples + 1);
}
else /* AIS */
{
- tp->nexttarget = up - tuples + 1;
- up->nextable = TRUE;
+ tp->nexttarget = (unsigned)(up - tuples + 1);
+ up->nextable = ick_TRUE;
}
}
}
assoc vartypes[] =
{
- { ONESPOT, "ONESPOT" },
- { TWOSPOT, "TWOSPOT" },
- { TAIL, "TAIL" },
- { HYBRID, "HYBRID" },
+ { ick_ONESPOT, "ick_ONESPOT" },
+ { ick_TWOSPOT, "ick_TWOSPOT" },
+ { ick_TAIL, "ick_TAIL" },
+ { ick_HYBRID, "ick_HYBRID" },
{ 0, (char *)NULL }
};
static assoc forgetbits[] =
{
- { ONESPOT, "oneforget" },
- { TWOSPOT, "twoforget" },
- { TAIL, "tailforget" },
- { HYBRID, "hyforget" },
+ { ick_ONESPOT, "ick_oneforget" },
+ { ick_TWOSPOT, "ick_twoforget" },
+ { ick_TAIL, "ick_tailforget" },
+ { ick_HYBRID, "ick_hyforget" },
{ 0, (char *)NULL }
};
/* AIS: Destatic. This is now needed in perpet.c. */
assoc varstores[] =
{
- { ONESPOT, "onespots" },
- { TWOSPOT, "twospots" },
- { TAIL, "tails" },
- { HYBRID, "hybrids" },
+ { ick_ONESPOT, "ick_onespots" },
+ { ick_TWOSPOT, "ick_twospots" },
+ { ick_TAIL, "ick_tails" },
+ { ick_HYBRID, "ick_hybrids" },
{ 0, (char *)NULL }
};
static assoc typedefs[] =
{
- { ONESPOT, "type16" },
- { TWOSPOT, "type32" },
- { TAIL, "type16" },
- { HYBRID, "type32" },
+ { ick_ONESPOT, "ick_type16" },
+ { ick_TWOSPOT, "ick_type32" },
+ { ick_TAIL, "ick_type16" },
+ { ick_HYBRID, "ick_type32" },
{ 0, (char *)NULL }
};
-char *nameof(int value, assoc table[])
+/*@observer@*/ char *nameof(int value, assoc table[])
/* return string corresponding to value in table */
{
assoc *ap;
unsigned long varextern(unsigned long intern, int vartype)
{
atom *x;
- if(!oblist) lose(E778, emitlineno, (char*) NULL);
+ if(!oblist) ick_lose(IE778, emitlineno, (char*) NULL);
for (x = oblist; x < obdex; x++)
- if (x->type == vartype && (unsigned)x->intindex == intern)
+ if (x->type == vartype && (unsigned long)x->intindex == intern)
return(x->extindex);
if(vartype==MESH) return 0; /* the mesh wasn't used after all */
- lose(E778, emitlineno, (char*) NULL);
- return 0; /* never reached */
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-void explvar(node* np, FILE* fp)
+static void explvar(node* np, FILE* fp)
{
node *sp;
switch(np->opcode)
{
- case ONESPOT:
- (void) fprintf(fp, ".%lu", varextern(np->constant,ONESPOT));
+ case ick_ONESPOT:
+ (void) fprintf(fp, ".%lu", varextern(np->constant,ick_ONESPOT));
break;
- case TWOSPOT:
- (void) fprintf(fp, ":%lu", varextern(np->constant,TWOSPOT));
+ case ick_TWOSPOT:
+ (void) fprintf(fp, ":%lu", varextern(np->constant,ick_TWOSPOT));
break;
- case TAIL:
- (void) fprintf(fp, ",%lu", varextern(np->constant,TAIL));
+ case ick_TAIL:
+ (void) fprintf(fp, ",%lu", varextern(np->constant,ick_TAIL));
break;
- case HYBRID:
- (void) fprintf(fp, ";%lu", varextern(np->constant,HYBRID));
+ case ick_HYBRID:
+ (void) fprintf(fp, ";%lu", varextern(np->constant,ick_HYBRID));
break;
case SUB:
(void) fprintf(fp, "(");
(void) fprintf(fp, ")");
break;
default:
- lose(E778, emitlineno, (char*) NULL);
+ ick_lose(IE778, emitlineno, (char*) NULL);
}
}
break;
case FIN:
- if (Base < 3)
- lose(E997, emitlineno, (char *)NULL);
+ if (ick_Base < 3)
+ ick_lose(IE997, emitlineno, (char *)NULL);
(void) fprintf(fp, "(^ ");
explexpr(np->rval, fp);
(void) fprintf(fp, ")");
case WHIRL3:
case WHIRL4:
case WHIRL5:
- if (np->opcode - WHIRL + 3 > Base)
- lose(E997, emitlineno, (char *)NULL);
+ if (np->opcode - WHIRL + 3 > ick_Base)
+ ick_lose(IE997, emitlineno, (char *)NULL);
if(np->opcode == WHIRL)
(void) fprintf(fp, "(@ ");
else
(void) fprintf(fp, "0x%lx", np->constant);
break;
- case ONESPOT:
- case TWOSPOT:
- case TAIL:
- case HYBRID:
+ case ick_ONESPOT:
+ case ick_TWOSPOT:
+ case ick_TAIL:
+ case ick_HYBRID:
case SUB:
explvar(np, fp);
break;
break;
default:
- lose(E778, emitlineno, (char*) NULL);
- break;
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
}
}
/* AIS: I moved prexpr's prototype higher in the file.
Destaticed so the optimizer can access it. */
-void prvar(node *np, FILE *fp, int freenode)
+static void prvar(node *np, FILE *fp, int freenode)
/* print out args to pass to storage manager for reference */
{
node *sp;
switch (np->opcode)
{
- case ONESPOT:
- (void) fprintf(fp, "onespots[%lu]", np->constant);
+ case ick_ONESPOT:
+ (void) fprintf(fp, "ick_onespots[%lu]", np->constant);
break;
- case TWOSPOT:
- (void) fprintf(fp, "twospots[%lu]", np->constant);
+ case ick_TWOSPOT:
+ (void) fprintf(fp, "ick_twospots[%lu]", np->constant);
break;
- case TAIL:
- (void) fprintf(fp, "TAIL, &tails[%lu]", np->constant);
+ case ick_TAIL:
+ (void) fprintf(fp, "ick_TAIL, &ick_tails[%lu]", np->constant);
break;
- case HYBRID:
- (void) fprintf(fp, "HYBRID, &hybrids[%lu]", np->constant);
+ case ick_HYBRID:
+ (void) fprintf(fp, "ick_HYBRID, &ick_hybrids[%lu]", np->constant);
break;
case SUB:
{
- (void) fprintf(fp, "aref(");
+ (void) fprintf(fp, "ick_aref(");
prvar(np->lval, fp, freenode);
dim = 0;
}
break;
default: /* Added by AIS */
- lose(E778, emitlineno, (char*) NULL);
- break;
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
}
}
-void ooprvar(node *np, FILE *fp, int freenode)
+static void ooprvar(node *np, FILE *fp, int freenode)
/* AIS: Print out the overloaded version */
{
node *sp;
switch (np->opcode)
{
- case ONESPOT:
- (void) fprintf(fp, "oo_onespots[%lu]", np->constant);
+ case ick_ONESPOT:
+ (void) fprintf(fp, "ick_oo_onespots[%lu]", np->constant);
break;
- case TWOSPOT:
- (void) fprintf(fp, "oo_twospots[%lu]", np->constant);
+ case ick_TWOSPOT:
+ (void) fprintf(fp, "ick_oo_twospots[%lu]", np->constant);
break;
- case TAIL:
- case HYBRID:
+ case ick_TAIL:
+ case ick_HYBRID:
/* This should never be reached */
- lose(E778, emitlineno, (char*) NULL);
- break;
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
case SUB:
{
- (void) fprintf(fp, "aref(");
+ (void) fprintf(fp, "ick_aref(");
prvar(np->lval, fp, freenode);
dim = 0;
}
break;
default:
- lose(E778, emitlineno, (char*) NULL);
- break;
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
}
}
/* AIS: This is the reverse of prexpr, in a way.
It degenerates an expression that causes *np to become equal to *target.
If this is impossible at any point, it degenerates code that causes
- error 277 (and itself causes error 278 if the situation is inevitable). */
-void revprexpr(node *np, FILE *fp, node *target)
+ error 277 (and itself causes error 278 if the situation is inevitable).
+ As for the annotations; there quite possibly are memory allocation mistakes
+ here, but just about every line is a false positive (because we're operating
+ at the subobject level in terms of copy/free/allocate) for Splint, and so
+ disabling the warnings doesn't make the output any less useful. (When there
+ are so many false positives, disabling the true positives doesn't make them
+ any harder to find by eye. */
+/*@-temptrans@*/ /*@-kepttrans@*/ /*@-compdestroy@*/ /*@-branchstate@*/
+static void revprexpr(node *np, FILE *fp, node *target)
{
node* temp;
switch (np->opcode)
case MINGLE:
/* We can use select to determine what np->lval and np->rval have
to become equal to, as long as we're in base 2. */
- if(Base!=2)
+ if(ick_Base!=2)
{
- fprintf(fp, " lose(E277, lineno, (char*) NULL);\n");
- lwarn(W278, emitlineno, (char*) NULL);
+ fprintf(fp, " ick_lose(IE277, ick_lineno, (char*) NULL);\n");
+ ick_lwarn(W278, emitlineno, (char*) NULL);
break;
}
temp=cons(MESH,0,0);
case SELECT:
/* Set the left of the select to the target, and the right
to 0xffffffff or 0xffff. This only works in base 2. */
- if(Base!=2)
+ if(ick_Base!=2)
{
- fprintf(fp, " lose(E277, lineno, (char*) NULL);\n");
- lwarn(W278, emitlineno, (char*) NULL);
+ fprintf(fp, " ick_lose(IE277, ick_lineno, (char*) NULL);\n");
+ ick_lwarn(W278, emitlineno, (char*) NULL);
break;
}
temp=cons(MESH,0,0);
case BACKSLAT:
/* Unimplemented. This isn't even in the parser yet, so it's a
- mystery how we got here. */
- lose(E778, emitlineno, (char*) NULL);
- break;
+ ick_mystery how we got here. */
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
case SLAT:
/* We need to set the true value of the LHS... */
/* Copied and modified from the GETS code */
if(!pickcompile)
{
- (void) fprintf(fp," (void) assign((char*)&");
+ (void) fprintf(fp," (void) ick_assign((char*)&");
prvar(np->lval, fp, 0);
(void) fprintf(fp,", %s", nameof(np->lval->opcode, vartypes));
(void) fprintf(fp,", %s[%lu], ", nameof(np->lval->opcode, forgetbits),
}
else /* AIS: Added this case for the simpler PIC assignment rules */
{
- (void) fprintf(fp,"\tif(ignore%s%lu) ",
+ (void) fprintf(fp,"\t""if(ignore%s%lu) ",
nameof(np->lval->opcode,varstores),
np->lval->constant);
prexpr(np->lval, fp, 0);
Technically speaking, np->rval could be casted to anything; but
all implementations I've ever seen cast unique pointers to unique
numbers, which is good enough for our purposes. */
- (void) fprintf(fp, ".get=og%lx;\n ", (unsigned long)np);
+ (void) fprintf(fp, ".get=ick_og%lx;\n ", (unsigned long)np);
ooprvar(np->lval, fp, 0);
- (void) fprintf(fp, ".set=os%lx;\n", (unsigned long)np);
+ (void) fprintf(fp, ".set=ick_os%lx;\n", (unsigned long)np);
break;
case AND:
if(!variableconstants)
{
/* Can't set a mesh in this case */
- fprintf(fp, " lose(E277, lineno, (char*) NULL);\n");
- lwarn(W278, emitlineno, (char*) NULL);
+ fprintf(fp, " ick_lose(IE277, ick_lineno, (char*) NULL);\n");
+ ick_lwarn(W278, emitlineno, (char*) NULL);
break;
}
(void) fprintf(fp," meshes[%lu] = ",np->constant);
(void) fprintf(fp,";\n");
break;
- case ONESPOT:
- case TWOSPOT:
- case TAIL:
- case HYBRID:
+ case ick_ONESPOT:
+ case ick_TWOSPOT:
+ case ick_TAIL:
+ case ick_HYBRID:
case SUB:
/* Copy the code for the GETS statement; this is almost the same
thing. Modified because we're assigning target to np, not
np->lval to np->rval, and to not free(). */
if(opoverused&&
- (np->opcode==ONESPOT||np->opcode==TWOSPOT)) /* AIS */
+ (np->opcode==ick_ONESPOT||np->opcode==ick_TWOSPOT)) /* AIS */
{
(void) fprintf(fp," ");
ooprvar(np, fp, 0);
(void) fprintf(fp,".set(");
prexpr(target, fp, 0);
(void) fprintf(fp,",os%dspot%lu);\n",
- (np->opcode==TWOSPOT)+1, np->constant);
+ (np->opcode==ick_TWOSPOT)+1, np->constant);
}
else if(!pickcompile)
{
if (np->opcode != SUB) {
sp = np;
- (void) fprintf(fp," (void) assign((char*)&");
+ (void) fprintf(fp," (void) ick_assign((char*)&");
}
else {
sp = np->lval;
- (void) fprintf(fp," (void) assign(");
+ (void) fprintf(fp," (void) ick_assign(");
}
prvar(np, fp, 0);
(void) fprintf(fp,", %s", nameof(sp->opcode, vartypes));
case C_LOGICALOR:
case GETS: /* should never come up */
default:
- lose(E778, emitlineno, (char*) NULL);
- break;
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
}
}
+/*@=temptrans@*/ /*@=kepttrans@*/ /*@=compdestroy@*/ /*@=branchstate@*/
/* AIS: Destaticed */
+/* Splint doesn't understand the concept of a function which might or might
+ not free its argument. That's a pity, because its checking would come in
+ useful here, but as it is we have to annotate memory checking off for this
+ function. */
+/*@-temptrans@*/ /*@-onlytrans@*/ /*@-compdestroy@*/ /*@-branchstate@*/
void prexpr(node *np, FILE *fp, int freenode)
/* print out C-function equivalent of an expression */
{
switch (np->opcode)
{
case MINGLE:
- (void) fprintf(fp, "mingle(");
+ (void) fprintf(fp, "ick_mingle(");
prexpr(np->lval, fp, freenode);
(void) fprintf(fp, ", ");
prexpr(np->rval, fp, freenode);
break;
case SELECT:
- (void) fprintf(fp, "iselect(");
+ (void) fprintf(fp, "ick_iselect(");
prexpr(np->lval, fp, freenode);
(void) fprintf(fp, ", ");
prexpr(np->rval, fp, freenode);
case BACKSLAT: /* AIS */
/* Unimplemented. This isn't even in the parser yet, so it's a
- mystery how we got here. */
- lose(E778, emitlineno, (char*) NULL);
- break;
+ ick_mystery how we got here. */
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
case SLAT: /* AIS */
(void) fprintf(fp,"((");
Technically speaking, np->rval could be casted to anything; but
all implementations I've ever seen cast unique pointers to unique
numbers, which is good enough for our purposes. */
- (void) fprintf(fp, ".get=og%lx),(", (unsigned long)np);
+ (void) fprintf(fp, ".get=ick_og%lx),(", (unsigned long)np);
ooprvar(np->lval, fp, 0);
- (void) fprintf(fp, ".set=os%lx),(", (unsigned long)np);
+ (void) fprintf(fp, ".set=ick_os%lx),(", (unsigned long)np);
prvar(np->lval, fp, freenode);
/* np->rval will be freed later, when its expression is printed */
(void) fprintf(fp, "))");
return; /* mustn't be freed */
case AND:
- (void) fprintf(fp, "and%d(", np->width);
+ (void) fprintf(fp, "ick_and%d(", np->width);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
break;
case OR:
- (void) fprintf(fp, "or%d(", np->width);
+ (void) fprintf(fp, "ick_or%d(", np->width);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
break;
case XOR:
- (void) fprintf(fp, "xor%d(", np->width);
+ (void) fprintf(fp, "ick_xor%d(", np->width);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
break;
case FIN:
- if (Base < 3)
- lose(E997, emitlineno, (char *)NULL);
- (void) fprintf(fp, "fin%d(", np->width);
+ if (ick_Base < 3)
+ ick_lose(IE997, emitlineno, (char *)NULL);
+ (void) fprintf(fp, "ick_fin%d(", np->width);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
break;
case WHIRL3:
case WHIRL4:
case WHIRL5:
- if (np->opcode - WHIRL + 3 > Base)
- lose(E997, emitlineno, (char *)NULL);
- (void) fprintf(fp, "whirl%d(%d, ", np->width, np->opcode - WHIRL + 1);
+ if (np->opcode - WHIRL + 3 > ick_Base)
+ ick_lose(IE997, emitlineno, (char *)NULL);
+ (void) fprintf(fp, "ick_whirl%d(%d, ", np->width, np->opcode - WHIRL + 1);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
break;
/* AIS: Reversed operations */
case REV_AND:
- (void) fprintf(fp, "rev_and%d(", np->width);
+ (void) fprintf(fp, "ick_rev_and%d(", np->width);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
break;
case REV_OR:
- (void) fprintf(fp, "rev_or%d(", np->width);
+ (void) fprintf(fp, "ick_rev_or%d(", np->width);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
break;
case REV_XOR:
- (void) fprintf(fp, "rev_xor%d(", np->width);
+ (void) fprintf(fp, "ick_rev_xor%d(", np->width);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
break;
case REV_FIN:
- if (Base < 3)
- lose(E997, emitlineno, (char *)NULL);
+ if (ick_Base < 3)
+ ick_lose(IE997, emitlineno, (char *)NULL);
(void) fprintf(fp, "rev_fin%d(", np->width);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, ")");
case REV_WHIRL3:
case REV_WHIRL4:
case REV_WHIRL5:
- if (np->opcode - WHIRL + 3 > Base)
- lose(E997, emitlineno, (char *)NULL);
+ if (np->opcode - WHIRL + 3 > ick_Base)
+ ick_lose(IE997, emitlineno, (char *)NULL);
(void) fprintf(fp,
"rev_whirl%d(%d, ", np->width, np->opcode - WHIRL + 1);
prexpr(np->rval, fp, freenode);
(void) fprintf(fp, "0x%lx", np->constant);
break;
- case ONESPOT:
- case TWOSPOT:
- case TAIL:
- case HYBRID:
- if(!opoverused||np->opcode==TAIL||np->opcode==HYBRID)
+ case ick_ONESPOT:
+ case ick_TWOSPOT:
+ case ick_TAIL:
+ case ick_HYBRID:
+ if(!opoverused||np->opcode==ick_TAIL||np->opcode==ick_HYBRID)
prvar(np, fp, freenode);
else /* AIS */
{
(void) fprintf(fp, "(~");
tempint=np->rval->width; /* AIS */
prexpr(np->rval, fp, freenode);
- if (tempint == Small_digits)
- (void) fprintf(fp, " & Max_small)");
+ if (tempint == ick_Small_digits)
+ (void) fprintf(fp, " & ick_Max_small)");
else
- (void) fprintf(fp, " & Max_large)");
+ (void) fprintf(fp, " & ick_Max_large)");
break;
/* AIS: I added the rest of the cases */
break;
case GETS: /* AIS: this is used only if freenode == 0 */
- if(freenode) lose(E778, emitlineno, (char*) NULL);
+ if(freenode) ick_lose(IE778, emitlineno, (char*) NULL);
prexpr(np->lval, fp, freenode);
(void) fprintf(fp, " = ");
prexpr(np->rval, fp, freenode);
if(!freenode) break; /* Be less careful when not freeing, because
this is used by -hH to print out its
intermediate optimization stages */
- lose(E778, emitlineno, (char*) NULL);
- break;
+ ick_lose(IE778, emitlineno, (char*) NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
}
if(freenode) (void) free(np);
}
+/*@=temptrans@*/ /*@=onlytrans@*/ /*@=compdestroy@*/ /*@=branchstate@*/
-static char *nice_text(char *texts[], int lines)
+/*@dependent@*/ static char *nice_text(char *texts[], int lines)
{
#define MAXNICEBUF 512
static char buf[MAXNICEBUF];
if (lines < 1)
lines = 1;
for (cp = buf, i = 0 ; i < lines ; ++i) {
- if (cp>buf+MAXNICEBUF-10) goto abort;
+ if (cp>buf+MAXNICEBUF-10)
+ {
+ (*cp++) = '.';
+ (*cp++) = '.';
+ (*cp++) = '.';
+ *cp = '\0';
+ return buf;
+ }
if (i) {
(*cp++) = '\\';
(*cp++) = 'n';
(*cp++) = '\n';
(*cp++) = '\t';
}
- for (text = texts[i] ; text&&*text ; cp++, text++) {
- if (cp>buf+MAXNICEBUF-10) goto abort;
+ for (text = texts[i] ; text != NULL && *text != '\0'; cp++, text++) {
+ if (cp>buf+MAXNICEBUF-10)
+ {
+ (*cp++) = '.';
+ (*cp++) = '.';
+ (*cp++) = '.';
+ *cp = '\0';
+ return buf;
+ }
if(*text == '"' || *text == '\\') {
(*cp++) = '\\';
}
+ if(*text == 'K') /* AIS: break the string so that the ick_ec
+ preprocessor doesn't trigger on the string
+ ICKNUMBERPAIR */
+ {
+ (*cp++) = '"';
+ (*cp++) = '"';
+ }
*cp = *text;
}
}
*cp = '\0';
return buf;
-abort: (*cp++) = '.';
- (*cp++) = '.';
- (*cp++) = '.';
- *cp = '\0';
- return buf;
}
static void emit_guard(tuple *tn, FILE *fp)
{
if(tn->maybe) /* AIS */
{
- if(!multithread) lose(E405, emitlineno, (char *)NULL);
+ if(!multithread) ick_lose(IE405, emitlineno, (char *)NULL);
(void) fprintf(fp, " gonebackto = setjmp(btjb); choicepoint();\n");
}
if(!flowoptimize || tn->abstainable) /* This condition by AIS */
if (tn->maybe) /* AIS */
(void) fprintf(fp, "gonebackto == !(");
if (tn->exechance < 100)
- (void) fprintf(fp, "roll(%d) && ", tn->exechance);
+ (void) fprintf(fp, "ick_roll(%d) && ", tn->exechance);
if ((tn->type != NEXT && tn->type != GO_BACK && tn->type != COME_FROM
&& /* AIS */ tn->type != NEXTFROMLABEL)
|| tn->onceagainflag == onceagain_NORMAL)
/* AIS */ tn->maybe?")":"");
else /* AIS: [NEXT, GO_BACK, COME_FROM] ONCE needs specially
handled abstentions */
- (void) fprintf(fp, "!oldabstain)%s {\n",
+ (void) fprintf(fp, "!ick_oldabstain)%s {\n",
/* AIS */ tn->maybe?")":"");
}
else
{ /* AIS */
- if(tn->maybe) lose(E778, emitlineno, (char*) NULL);
+ if(tn->maybe) ick_lose(IE778, emitlineno, (char*) NULL);
if(!tn->initabstain)
{
if(tn->type != COMPUCOME && tn->type != GERUCOME
/* grind out label and source dump */
if (yydebug || compile_only)
- (void) fprintf(fp, " /* line %03d */\n", tn->lineno);
+ (void) fprintf(fp, " /* line %03d */\n", tn->ick_lineno);
if (tn->label)
- (void) fprintf(fp, "L%d:", tn->label);
+ {
+ if(!useickec) /* AIS */
+ (void) fprintf(fp, "L%u:", tn->label);
+ else
+ /* AIS: start one of ick_ec's labeled blocks. */
+ (void) fprintf(fp, "ick_labeledblock(%uU,({",tn->label);
+ }
if (yydebug || compile_only)
{
- (void) fprintf(fp, "\t/* %s */", textlines[tn->lineno]);
+ (void) fprintf(fp, "\t""/* %s */", textlines[tn->ick_lineno]);
/* AIS: grind out an expression explanation */
if (tn->type == GETS || tn->type == FORGET || tn->type == RESUME
|| tn->type == FROM || tn->type == COMPUCOME
/* set up the "next" lexical line number for error messages */
if (tn->type == NEXT) {
tuple *up;
- for (up = tuples; up < tuples + lineno; up++)
+ for (up = tuples; up < tuples + ick_lineno; up++)
if (tn->u.target == up->label) {
- emitlineno = up->lineno;
+ emitlineno = up->ick_lineno;
break;
}
} else if (tn->ncomefrom)
emitlineno = comefromsearch(tn,1); /* AIS: For multithreading.
Return the 1st if we're forking. */
- else if (tn < tuples + lineno - 1)
- emitlineno = tn[1].lineno;
+ else if (tn < tuples + ick_lineno - 1)
+ emitlineno = tn[1].ick_lineno;
else
emitlineno = iyylineno;
- if(!pickcompile) /* AIS: PICs can't report errors, so don't bother with lineno */
- (void) fprintf(fp, " lineno = %d;\n", emitlineno);
+ if(!pickcompile) /* AIS: PICs can't report errors, so don't bother with ick_lineno */
+ (void) fprintf(fp, " ick_lineno = %d;\n", emitlineno);
/* AIS: set weaving status if necessary */
if(tn->setweave)
(void) fprintf(fp, " weaving = %d;\n", tn->setweave>0);
/* AIS: print warnings on -l */
- if(checkforbugs)
+ if(ick_checkforbugs)
{
- if(tn->warn112) lwarn(W112, emitlineno, (char*) NULL);
- if(tn->warn128) lwarn(W128, emitlineno, (char*) NULL);
- if(tn->warn534) lwarn(W534, emitlineno, (char*) NULL);
- if(tn->warn018) lwarn(W018, emitlineno, (char*) NULL);
- if(tn->warn016) lwarn(W016, emitlineno, (char*) NULL);
- if(tn->warn276) lwarn(W276, emitlineno, (char*) NULL);
- if(tn->warn239) lwarn(W239, emitlineno, (char*) NULL);
- if(tn->warn622) lwarn(W622, emitlineno, (char*) NULL);
+ if(tn->warn112) ick_lwarn(W112, emitlineno, (char*) NULL);
+ if(tn->warn128) ick_lwarn(W128, emitlineno, (char*) NULL);
+ if(tn->warn534) ick_lwarn(W534, emitlineno, (char*) NULL);
+ if(tn->warn018) ick_lwarn(W018, emitlineno, (char*) NULL);
+ if(tn->warn016) ick_lwarn(W016, emitlineno, (char*) NULL);
+ if(tn->warn276) ick_lwarn(W276, emitlineno, (char*) NULL);
+ if(tn->warn239) ick_lwarn(W239, emitlineno, (char*) NULL);
+ if(tn->warn622) ick_lwarn(W622, emitlineno, (char*) NULL);
}
-
+
/* AIS: emit debugging information */
if (yukdebug||yukprofile)
{
preventing an infinite loop. Of course, it will enhance the fun
if we don't tell the user that. (This is necessary for the
constant-output optimizer to work properly.) */
- if(coopt) (void) fprintf(fp, " MYSTERYLINE;\n");
-
+ if(coopt) (void) fprintf(fp, " ick_MYSTERYLINE;\n");
+
/* AIS: If the tuple is ONCE/AGAIN flagged, we need a delayed-action
set of its abstention status to the AGAIN-flagged status. The
problem is that some statements, like COME FROM, need to set after
if ((tn->type == NEXT || tn->type == GO_BACK) &&
tn->onceagainflag != onceagain_NORMAL)
{
- /* ONCE/AGAIN has already been swapped by perpetrate.c in the case
- of a preabstained statement ('DO NOT'...). So if currently have
+ /* ONCE/AGAIN has already been swapped by perpet.c in the case
+ of a preabstained statement ('DO NOT'...). So if we currently have
a ONCE, it means that being abstained is the attractive state,
and if we currently have an AGAIN, it means that being
reinstated is the attractive state. Semantics with computed
ABSTAIN: Don't change the abstention count unless necessary, in
which case change it to 0 or 1. */
- fprintf(fp," oldabstain = ICKABSTAINED(%d);\n", (int)(tn - tuples));
+ fprintf(fp," ick_oldabstain = ICKABSTAINED(%d);\n", (int)(tn - tuples));
fprintf(fp," ICKABSTAINED(%d) = %s;\n",
(int)(tn - tuples),
- tn->onceagainflag==onceagain_ONCE ? "oldabstain ? oldabstain : 1"
+ tn->onceagainflag==onceagain_ONCE ? "ick_oldabstain ? ick_oldabstain : 1"
: "0");
/* This test-and-set must be atomic. As all statements are atomic anyway
in the current version of ick, that isn't a problem, but if anyone
wants to try using POSIX's multithreading features, the above two
lines need to be a critical section. */
}
-
- /* in the case of COMPUCOME, we need an extra guard */
- if (tn->type == COMPUCOME || tn->type == GERUCOME
- || tn->type == NEXTFROMEXPR || tn->type == NEXTFROMGERUND)
+
+ /* AIS: in the case of COMPUCOME, we need an extra guard unless useickec. */
+ if ((!useickec && (tn->type == COMPUCOME || tn->type == NEXTFROMEXPR))
+ || tn->type == GERUCOME || tn->type == NEXTFROMGERUND)
{
fprintf(fp," if(0)\n {\n");
fprintf(fp,"CCF%d:\n",compucomecount++);
if(tn->type == COMPUCOME || tn->type == NEXTFROMEXPR)
{
- fprintf(fp," if(skipto&&skipto==");
+ fprintf(fp," if(ick_skipto&&ick_skipto==");
prexpr(tn->u.node, fp, 1);
}
else if(tn->type == GERUCOME || tn->type == NEXTFROMGERUND)
to be undesirable behaviour. */
if(pasttryagain) /* AIS */
{
- lose(E993, emitlineno, (char*)NULL);
+ ick_lose(IE993, emitlineno, (char*)NULL);
}
if(flowoptimize && tn->initabstain && !tn->abstainable
code in its place). The COMPUCOME condition is
because it is so weird. COME_FROM and NEXT are
exempted so labels are generated. */
-
+
/* emit conditional-execution prefixes */
- if (tn->type != COME_FROM && tn->type != NEXTFROMLABEL)
+ /* AIS: added the useickec condition */
+ if ((tn->type != COME_FROM && tn->type != NEXTFROMLABEL) || useickec)
emit_guard(tn, fp);
/* now emit the code for the statement body */
nodefree(tn->u.node);
break;
}
-
+
/* Start of AIS optimization */
np = tn->u.node;
if(np->lval->opcode == SUB) np = np->lval;
- if(flowoptimize && Base == 2 && !opoverused && !variableconstants &&
- (np->lval->opcode == TWOSPOT
- || np->lval->opcode == HYBRID
- || !(tn->u.node->lval->optdata & ~0xffffLU)))
+ if(flowoptimize && ick_Base == 2 && !opoverused && !variableconstants &&
+ (np->lval->opcode == ick_TWOSPOT
+ || np->lval->opcode == ick_HYBRID
+ || !(tn->u.node->rval->optdata & ~0xffffLU)))
{
atom* op;
int ignorable = 1;
+ assert(oblist != NULL);
for(op = oblist; op < obdex; op++)
{
if(op->type == np->lval->opcode &&
- (unsigned)op->intindex == np->lval->constant)
+ (unsigned long)op->intindex == np->lval->constant)
{
ignorable &= op->ignorable;
}
}
if(!ignorable)
{ /* Variable can't be ignored, and expression must be in range */
- (void) fprintf(fp,"\t");
+ (void) fprintf(fp,"\t""");
prexpr(tn->u.node->lval, fp, 1);
(void) fprintf(fp, " = ");
prexpr(tn->u.node->rval, fp, 1);
}
/* End of AIS optimization */
if(opoverused&&
- (tn->u.node->lval->opcode==ONESPOT||
- tn->u.node->lval->opcode==TWOSPOT)) /* AIS */
+ (tn->u.node->lval->opcode==ick_ONESPOT||
+ tn->u.node->lval->opcode==ick_TWOSPOT)) /* AIS */
{
- (void) fprintf(fp,"\t");
+ (void) fprintf(fp,"\t""");
ooprvar(tn->u.node->lval, fp, 1);
(void) fprintf(fp,".set(");
prexpr(tn->u.node->rval, fp, 1);
(void) fprintf(fp,",os%dspot%lu);\n",
- (tn->u.node->lval->opcode==TWOSPOT)+1,
+ (tn->u.node->lval->opcode==ick_TWOSPOT)+1,
tn->u.node->lval->constant);
}
else if(!pickcompile)
{
np = tn->u.node;
-
+
if (np->lval->opcode != SUB) {
sp = np->lval;
- (void) fprintf(fp,"\t(void) assign((char*)&");
+ (void) fprintf(fp,"\t""(void) ick_assign((char*)&");
}
else {
sp = np->lval->lval;
- (void) fprintf(fp,"\t(void) assign(");
+ (void) fprintf(fp,"\t""(void) ick_assign(");
}
prvar(np->lval, fp, 1);
(void) fprintf(fp,", %s", nameof(sp->opcode, vartypes));
}
else /* AIS: Added this case for the simpler PIC assignment rules */
{
- (void) fprintf(fp,"\tif(ignore%s%lu) ",
+ (void) fprintf(fp,"\t""if(ignore%s%lu) ",
nameof(tn->u.node->lval->opcode,varstores),
tn->u.node->lval->constant);
prexpr(tn->u.node->lval, fp, 1);
break;
case RESIZE:
- if(pickcompile) lose(E256, emitlineno, (char*) NULL); /* AIS */
+ if(pickcompile) ick_lose(IE256, emitlineno, (char*) NULL); /* AIS */
np = tn->u.node;
dim = 0;
for (sp = np->rval; sp; sp = sp->rval)
dim++;
- (void) fprintf(fp, "\tresize(");
+ (void) fprintf(fp, "\t""ick_resize(");
prvar(np->lval, fp, 1);
(void) fprintf(fp, ", %s[%lu]", nameof(np->lval->opcode, forgetbits),
np->lval->constant);
(void) fprintf(fp, ", %d", dim);
for (sp = np->rval; sp; sp = sp->rval) {
- (void) fprintf(fp, ", ");
+ (void) fprintf(fp, ", (size_t)");
prexpr(sp->lval, fp, 1);
}
(void) fprintf(fp, ");\n");
break;
case NEXT:
+ /* AIS: if using ickec, use its features for the next */
+ if(useickec)
+ {
+ (void) fprintf(fp,"\t""ick_donext(%uU,ick_lineno,0);\n",tn->u.target);
+ break;
+ }
/* Start of AIS optimization */
if(tn->u.target>=1000 && tn->u.target<=1999 && pickcompile)
{
/* optimize syslib call on a PIC */
- (void) fprintf(fp, "\tsyslibopt%d();\n", tn->u.target);
+ (void) fprintf(fp, "\t""syslibopt%u();\n", tn->u.target);
break;
}
if(tn->optversion)
{ /* optimizef has checked that this is a valid optimization */
- (void) fprintf(fp, "\tif(1 == ");
+ (void) fprintf(fp, "\t""if(1 == ");
prexpr(tn->u.node, fp, 1); /* frees optimizef's nodecopy */
/* AIS: Everything now in one giant switch(), with some very strange
constructs (including ;{;} as a null statement; this makes
degenerating the code slightly easier) */
- (void) fprintf(fp, ") {pushnext(%d); skipto=%d; goto top;}} case %d:;{;\n",
+ (void) fprintf(fp, ") {ick_pushnext(%d); ick_skipto=%uU; goto top;}} case %d:;{;\n",
(int)(tn - tuples + 1), tn->nexttarget, (int)(tn - tuples + 1));
break;
}
/* End of AIS optimization */
(void) fprintf(fp, /* same change as above (case rather than a label) */
- "\tpushnext(%d); goto L%d;} case %d:;{;\n",
+ "\t""ick_pushnext(%d); goto L%u;} case %d:;{;\n",
(int)(tn - tuples + 1), tn->u.target, (int)(tn - tuples + 1));
break;
case GO_BACK: /* By AIS */
- if(!multithread) lose(E405, emitlineno, (char*) NULL);
- (void) fprintf(fp, "\tchoiceback();\n");
+ if(!multithread) ick_lose(IE405, emitlineno, (char*) NULL);
+ (void) fprintf(fp, "\t""choiceback();\n");
break;
case GO_AHEAD: /* By AIS */
- if(!multithread) lose(E405, emitlineno, (char*) NULL);
- (void) fprintf(fp, "\tchoiceahead();\n");
+ if(!multithread) ick_lose(IE405, emitlineno, (char*) NULL);
+ (void) fprintf(fp, "\t""choiceahead();\n");
break;
case RESUME:
- (void) fprintf(fp, "\tskipto = resume(");
+ if(useickec) /* AIS */
+ {
+ (void) fprintf(fp, "\t""ick_doresume(");
+ prexpr(tn->u.node, fp, 1);
+ (void) fprintf(fp, ", ick_lineno);\n");
+ break;
+ }
+ (void) fprintf(fp, "\t""ick_skipto = ick_resume(");
prexpr(tn->u.node, fp, 1);
(void) fprintf(fp, "); goto top;\n");
break;
case FORGET:
- (void) fprintf(fp, "\tpopnext(");
+ if(useickec) /* AIS */
+ {
+ (void) fprintf(fp, "\t""ick_forget(");
+ prexpr(tn->u.node, fp, 1);
+ (void) fprintf(fp, ");\n");
+ break;
+ }
+
+ (void) fprintf(fp, "\t""ick_popnext(");
prexpr(tn->u.node, fp, 1);
(void) fprintf(fp, ");\n");
break;
case STASH:
for (np = tn->u.node; np; np = np->rval)
- (void) fprintf(fp, "\tICKSTASH(%s, %lu, %s, %s%s);\n",
+ (void) fprintf(fp, "\t""ICKSTASH(%s, %lu, %s, %s%s);\n",
nameof(np->opcode, vartypes),
np->constant,
nameof(np->opcode, varstores),
- /* AIS */(opoverused&&(np->opcode==ONESPOT||
- np->opcode==TWOSPOT)?
+ /* AIS */(opoverused&&(np->opcode==ick_ONESPOT||
+ np->opcode==ick_TWOSPOT)?
"oo_":"0"),
- /* AIS */(opoverused&&(np->opcode==ONESPOT||
- np->opcode==TWOSPOT)?
+ /* AIS */(opoverused&&(np->opcode==ick_ONESPOT||
+ np->opcode==ick_TWOSPOT)?
nameof(np->opcode, varstores):"0"));
break;
case RETRIEVE:
for (np = tn->u.node; np; np = np->rval)
- (void) fprintf(fp, "\tICKRETRIEVE(%s, %lu, %s, %s, %s%s);\n",
+ (void) fprintf(fp, "\t""ICKRETRIEVE(%s, %lu, %s, %s, %s%s);\n",
nameof(np->opcode, varstores), np->constant,
nameof(np->opcode, vartypes),
nameof(np->opcode, forgetbits),
- /* AIS */(opoverused&&(np->opcode==ONESPOT||
- np->opcode==TWOSPOT)?
+ /* AIS */(opoverused&&(np->opcode==ick_ONESPOT||
+ np->opcode==ick_TWOSPOT)?
"oo_":"0"),
- /* AIS */(opoverused&&(np->opcode==ONESPOT||
- np->opcode==TWOSPOT)?
+ /* AIS */(opoverused&&(np->opcode==ick_ONESPOT||
+ np->opcode==ick_TWOSPOT)?
nameof(np->opcode, varstores):"0"));
break;
case IGNORE:
for (np = tn->u.node; np; np = np->rval)
- (void) fprintf(fp,"\tICKIGNORE(%s,%lu,%s) = TRUE;\n",
+ (void) fprintf(fp,"\t""ICKIGNORE(%s,%lu,%s) = ick_TRUE;\n",
nameof(np->opcode, forgetbits),
np->constant,
nameof(np->opcode, varstores));
case REMEMBER:
for (np = tn->u.node; np; np = np->rval)
- (void) fprintf(fp,"\tICKIGNORE(%s,%lu,%s) = FALSE;\n",
+ (void) fprintf(fp,"\t""ICKIGNORE(%s,%lu,%s) = ick_FALSE;\n",
nameof(np->opcode, forgetbits),
np->constant,
nameof(np->opcode, varstores));
case ABSTAIN:
/* AIS: In CLC-INTERCAL, you can't abstain a GIVE UP line, so I copied
a modified version of Joris's REINSTATE patch here as well */
- if (!clclex || (tuples + tn->u.target - 1)->type != GIVE_UP)
+ if (!ick_clcsemantics || (tuples + tn->u.target - 1)->type != GIVE_UP)
{
if(!pickcompile)
- (void) fprintf(fp, "\tif(!ICKABSTAINED(%d)) ICKABSTAINED(%d) = 1;\n", tn->u.target - 1, tn->u.target-1);
+ (void) fprintf(fp, "\t""if(!ICKABSTAINED(%u)) ICKABSTAINED(%u) = 1;\n", tn->u.target - 1, tn->u.target-1);
else
- (void) fprintf(fp, "ICKABSTAINED(%d) = 1;\n", tn->u.target-1);
+ (void) fprintf(fp, "ICKABSTAINED(%u) = 1;\n", tn->u.target-1);
}
else
- (void) fprintf(fp, "\t/* not abstaining from a GIVE UP line */\n");;
+ (void) fprintf(fp, "\t""/* not abstaining from a GIVE UP line */\n");;
break;
case FROM:
- if(pickcompile) lose(E256, emitlineno, (char*) NULL);
- (void) fprintf(fp, "\tICKABSTAINED(%d)+=", tn->u.target-1);
+ if(pickcompile) ick_lose(IE256, emitlineno, (char*) NULL);
+ (void) fprintf(fp, "\t""ICKABSTAINED(%u)+=", tn->u.target-1);
tn->u.node->width = 32;
prexpr(tn->u.node,fp, 1);
(void) fprintf(fp, ";\n");
if ((tuples + tn->u.target - 1)->type != GIVE_UP)
{
if(!pickcompile)
- (void) fprintf(fp, "\tif(ICKABSTAINED(%d)) ICKABSTAINED(%d)--;\n", tn->u.target - 1, tn->u.target-1);
+ (void) fprintf(fp, "\t""if(ICKABSTAINED(%u)) ICKABSTAINED(%u)--;\n", tn->u.target - 1, tn->u.target-1);
else
- (void) fprintf(fp, "\tICKABSTAINED(%d)=0;\n", tn->u.target - 1);
+ (void) fprintf(fp, "\t""ICKABSTAINED(%u)=0;\n", tn->u.target - 1);
}
else
- (void) fprintf(fp, "\t/* not reinstating a GIVE UP line */\n");
+ (void) fprintf(fp, "\t""/* not reinstating a GIVE UP line */\n");
break;
case ENABLE:
- if(pickcompile) lose(E256, emitlineno, (char*) NULL); /* AIS */
+ if(pickcompile) ick_lose(IE256, emitlineno, (char*) NULL); /* AIS */
(void) fprintf(fp,
- "\tint i;\n");
+ "\t""int i;\n");
for (np = tn->u.node; np; np = np->rval)
{
(void) fprintf(fp,
"\n\tfor (i = 0; i < (int)(sizeof(linetype)/sizeof(int)); i++)\n");
if (np->constant == ABSTAIN) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2], enablers[FROM-GETS], enablers[MANYFROM-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2], enablers[FROM-GETS], enablers[MANYFROM-GETS]);
} else if (np->constant == REINSTATE) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
} else if (np->constant == GETS) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s)\n", enablers[GETS-GETS], enablers[RESIZE-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s)\n", enablers[GETS-GETS], enablers[RESIZE-GETS]);
} else if (np->constant == COME_FROM) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[COME_FROM-GETS], enablers[COMPUCOME-GETS], enablers[GERUCOME-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[COME_FROM-GETS], enablers[COMPUCOME-GETS], enablers[GERUCOME-GETS]);
} else if (np->constant == NEXTFROMLABEL) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[NEXTFROMLABEL-GETS], enablers[NEXTFROMGERUND-GETS], enablers[NEXTFROMEXPR-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[NEXTFROMLABEL-GETS], enablers[NEXTFROMGERUND-GETS], enablers[NEXTFROMEXPR-GETS]);
} else {
(void) fprintf(fp,
- "\t if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+ "\t"" if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
}
(void) fprintf(fp,
- "\t\tif(abstained[i]) abstained[i]--;\n");
+ "\t""\tif(ick_abstained[i]) ick_abstained[i]--;\n");
}
break;
case DISABLE:
- if(pickcompile) lose(E256, emitlineno, (char*) NULL); /* AIS */
+ if(pickcompile) ick_lose(IE256, emitlineno, (char*) NULL); /* AIS */
(void) fprintf(fp,
- "\tint i;\n");
+ "\t""int i;\n");
for (np = tn->u.node; np; np = np->rval)
{
(void) fprintf(fp,
"\n\tfor (i = 0; i < (int)(sizeof(linetype)/sizeof(int)); i++)\n");
if (np->constant == ABSTAIN) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2], enablers[FROM-GETS], enablers[MANYFROM-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2], enablers[FROM-GETS], enablers[MANYFROM-GETS]);
} else if (np->constant == REINSTATE) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
} else if (np->constant == GETS) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s)\n", enablers[GETS-GETS], enablers[RESIZE-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s)\n", enablers[GETS-GETS], enablers[RESIZE-GETS]);
} else if (np->constant == COME_FROM) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[COME_FROM-GETS], enablers[COMPUCOME-GETS], enablers[GERUCOME-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[COME_FROM-GETS], enablers[COMPUCOME-GETS], enablers[GERUCOME-GETS]);
} else if (np->constant == NEXTFROMLABEL) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[NEXTFROMLABEL-GETS], enablers[NEXTFROMGERUND-GETS], enablers[NEXTFROMEXPR-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[NEXTFROMLABEL-GETS], enablers[NEXTFROMGERUND-GETS], enablers[NEXTFROMEXPR-GETS]);
} else {
(void) fprintf(fp,
- "\t if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+ "\t"" if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
}
(void) fprintf(fp,
- "\t\tif(!abstained[i]) abstained[i] = 1;\n");
+ "\t""\tif(!ick_abstained[i]) ick_abstained[i] = 1;\n");
}
break;
case MANYFROM:
- if(pickcompile) lose(E256, emitlineno, (char*) NULL); /* AIS */
+ if(pickcompile) ick_lose(IE256, emitlineno, (char*) NULL); /* AIS */
(void) fprintf(fp,
- "\tint i;\n\tint j;\n\tj=");
+ "\t""int i;\n\tint j;\n\tj=");
tn->u.node->lval->width=32;
prexpr(tn->u.node->lval,fp, 1);
(void) fprintf(fp,
"\n\tfor (i = 0; i < (int)(sizeof(linetype)/sizeof(int)); i++)\n");
if (np->constant == ABSTAIN) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2], enablers[FROM-GETS], enablers[MANYFROM-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2], enablers[FROM-GETS], enablers[MANYFROM-GETS]);
} else if (np->constant == REINSTATE) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
} else if (np->constant == GETS) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s)\n", enablers[GETS-GETS], enablers[RESIZE-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s)\n", enablers[GETS-GETS], enablers[RESIZE-GETS]);
} else if (np->constant == COME_FROM) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[COME_FROM-GETS], enablers[COMPUCOME-GETS], enablers[GERUCOME-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[COME_FROM-GETS], enablers[COMPUCOME-GETS], enablers[GERUCOME-GETS]);
} else if (np->constant == NEXTFROMLABEL) {
(void) fprintf(fp,
- "\t if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[NEXTFROMLABEL-GETS], enablers[NEXTFROMGERUND-GETS], enablers[NEXTFROMEXPR-GETS]);
+ "\t"" if (linetype[i] == %s || linetype[i] == %s || linetype[i] == %s)\n", enablers[NEXTFROMLABEL-GETS], enablers[NEXTFROMGERUND-GETS], enablers[NEXTFROMEXPR-GETS]);
} else {
(void) fprintf(fp,
- "\t if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+ "\t"" if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
}
(void) fprintf(fp,
- "\t\tabstained[i] += j;\n");
+ "\t""\tabstained[i] += j;\n");
}
break;
case COMPUCOME: /* By AIS. Note that this doesn't even have balanced
braces; it's designed to work with COMPUCOME's
crazy guarding arrangements */
- if(pickcompile) lose(E256, emitlineno, (char*) NULL); /* AIS */
- fprintf(fp,"\t%s;} else goto CCF%d;\n",multithread?"NEXTTHREAD":"",
+ if(pickcompile) ick_lose(IE256, emitlineno, (char*) NULL); /* AIS */
+ if(useickec) /* use ick_ec's features for next from and come from*/
+ {
+ if(tn->type == COMPUCOME)
+ {
+ fprintf(fp,"\t""ick_comefrom(");
+ prexpr(tn->u.node, fp, 1);
+ fprintf(fp,");\n");
+ break;
+ }
+ else if(tn->type == NEXTFROMEXPR)
+ {
+ fprintf(fp,"\t""ick_nextfrom(");
+ prexpr(tn->u.node, fp, 1);
+ fprintf(fp,");\n");
+ break;
+ }
+ }
+ fprintf(fp,"\t""%s;} else goto CCF%d;\n",
+ multithread?"NEXTTHREAD":
+ "if(ick_printflow) printf(\"[%d]\",ick_lineno)",
compucomecount);
break;
case GIVE_UP: /* AIS: Edited to allow for yuk */
- if(yukprofile||yukdebug) fprintf(fp, "\tYUKTERM;\n");
- if(multithread) fprintf(fp, "\tkillthread();\n");
+ if(yukprofile||yukdebug) fprintf(fp, "\t""YUKTERM;\n");
+ if(multithread) fprintf(fp, "\t""killthread();\n");
else
{
if(nonespots||opoverused)
- fprintf(fp,"\tif(onespots) free(onespots);\n");
+ fprintf(fp,"\t""if(ick_onespots) free(ick_onespots);\n");
if(ntwospots||opoverused)
- fprintf(fp,"\tif(twospots) free(twospots);\n");
- if(ntails) fprintf(fp,"\tif(tails) free(tails);\n");
- if(nhybrids) fprintf(fp,"\tif(hybrids) free(hybrids);\n");
+ fprintf(fp,"\t""if(ick_twospots) free(ick_twospots);\n");
+ if(ntails) fprintf(fp,"\t""if(ick_tails) free(ick_tails);\n");
+ if(nhybrids) fprintf(fp,"\t""if(ick_hybrids) free(ick_hybrids);\n");
if(nonespots||opoverused)
- fprintf(fp,"\tif(oneforget) free(oneforget);\n");
+ fprintf(fp,"\t""if(ick_oneforget) free(ick_oneforget);\n");
if(ntwospots||opoverused)
- fprintf(fp,"\tif(twoforget) free(twoforget);\n");
- if(ntails) fprintf(fp,"\tif(tailforget) free(tailforget);\n");
- if(nhybrids) fprintf(fp,"\tif(hyforget) free(hyforget);\n");
+ fprintf(fp,"\t""if(ick_twoforget) free(ick_twoforget);\n");
+ if(ntails) fprintf(fp,"\t""if(ick_tailforget) free(ick_tailforget);\n");
+ if(nhybrids) fprintf(fp,"\t""if(ick_hyforget) free(ick_hyforget);\n");
if(opoverused)
{
- fprintf(fp,"\tif(oo_onespots) free(oo_onespots);\n");
- fprintf(fp,"\tif(oo_twospots) free(oo_twospots);\n");
+ fprintf(fp,"\t""if(ick_oo_onespots) free(ick_oo_onespots);\n");
+ fprintf(fp,"\t""if(ick_oo_twospots) free(ick_oo_twospots);\n");
}
}
- (void) fprintf(fp, "\treturn(0);\n");
+ (void) fprintf(fp, "\t""exit(0);\n");
break;
case TRY_AGAIN: /* By AIS */
- (void) fprintf(fp, "\tgoto ick_restart;\n }\n");
+ (void) fprintf(fp, "\t""goto ick_restart;\n }\n");
if(yukprofile||yukdebug) fprintf(fp, " if(yukloop) goto ick_restart;\n");
if(yukprofile||yukdebug) fprintf(fp, " YUKTERM;\n");
- if(multithread) fprintf(fp, "\tkillthread();\n");
+ if(multithread) fprintf(fp, "\t""killthread();\n");
else
{
if(nonespots||opoverused)
- fprintf(fp,"\tif(onespots) free(onespots);\n");
+ fprintf(fp,"\t""if(ick_onespots) free(ick_onespots);\n");
if(ntwospots||opoverused)
- fprintf(fp,"\tif(twospots) free(twospots);\n");
- if(ntails) fprintf(fp,"\tif(tails) free(tails);\n");
- if(nhybrids) fprintf(fp,"\tif(hybrids) free(hybrids);\n");
+ fprintf(fp,"\t""if(ick_twospots) free(ick_twospots);\n");
+ if(ntails) fprintf(fp,"\t""if(ick_tails) free(ick_tails);\n");
+ if(nhybrids) fprintf(fp,"\t""if(ick_hybrids) free(ick_hybrids);\n");
if(nonespots||opoverused)
- fprintf(fp,"\tif(oneforget) free(oneforget);\n");
+ fprintf(fp,"\t""if(ick_oneforget) free(ick_oneforget);\n");
if(ntwospots||opoverused)
- fprintf(fp,"\tif(twoforget) free(twoforget);\n");
- if(ntails) fprintf(fp,"\tif(tailforget) free(tailforget);\n");
- if(nhybrids) fprintf(fp,"\tif(hyforget) free(hyforget);\n");
+ fprintf(fp,"\t""if(ick_twoforget) free(ick_twoforget);\n");
+ if(ntails) fprintf(fp,"\t""if(ick_tailforget) free(ick_tailforget);\n");
+ if(nhybrids) fprintf(fp,"\t""if(ick_hyforget) free(ick_hyforget);\n");
if(opoverused)
{
- fprintf(fp,"\tif(oo_onespots) free(oo_onespots);\n");
- fprintf(fp,"\tif(oo_twospots) free(oo_twospots);\n");
+ fprintf(fp,"\t""if(ick_oo_onespots) free(ick_oo_onespots);\n");
+ fprintf(fp,"\t""if(ick_oo_twospots) free(ick_oo_twospots);\n");
}
}
(void) fprintf(fp, " {\n\treturn(0);\n");
break;
case WRITE_IN:
- if(pickcompile) lose(E256, emitlineno, (char*) NULL); /* AIS */
+ if(pickcompile) ick_lose(IE256, emitlineno, (char*) NULL); /* AIS */
for (np = tn->u.node; np; np = np->rval) {
- if (np->lval->opcode == TAIL || np->lval->opcode == HYBRID) {
- (void) fprintf(fp,"\tbinin(");
+ if (np->lval->opcode == ick_TAIL || np->lval->opcode == ick_HYBRID) {
+ (void) fprintf(fp,"\t""ick_binin(");
prvar(np->lval, fp, 1);
(void) fprintf(fp, ", %s[%lu]",
nameof(np->lval->opcode, forgetbits),
else {
if (np->lval->opcode != SUB) {
sp = np->lval;
- (void) fprintf(fp,"\t(void) assign((char*)&");
+ (void) fprintf(fp,"\t""(void) ick_assign((char*)&");
}
else {
sp = np->lval->lval;
- (void) fprintf(fp,"\t(void) assign(");
+ (void) fprintf(fp,"\t""(void) ick_assign(");
}
prvar(np->lval, fp, 1);
(void) fprintf(fp,", %s", nameof(sp->opcode, vartypes));
(void) fprintf(fp,", %s[%lu]", nameof(sp->opcode, forgetbits),
sp->constant);
- (void) fprintf(fp,", pin());\n");
+ (void) fprintf(fp,", ick_pin());\n");
}
}
break;
case READ_OUT:
- if(pickcompile) lose(E256, emitlineno, (char*) NULL); /* AIS */
+ if(pickcompile) ick_lose(IE256, emitlineno, (char*) NULL); /* AIS */
for (np = tn->u.node; np; np = np->rval)
{
- if (np->lval->opcode == TAIL || np->lval->opcode == HYBRID) {
- (void) fprintf(fp,"\tbinout(");
+ if (np->lval->opcode == ick_TAIL || np->lval->opcode == ick_HYBRID) {
+ (void) fprintf(fp,"\t""ick_binout(");
prvar(np->lval, fp, 1);
(void) fprintf(fp,");\n");
}
else {
- (void) fprintf(fp, "\tpout(");
+ (void) fprintf(fp, "\t""ick_pout(");
prexpr(np->lval, fp, 1);
(void) fprintf(fp, ");\n");
}
case PIN: /* AIS, with some code borrowed from the GETS code */
np = tn->u.node;
- (void) fprintf(fp, "\tTRISA = seq(~((");
+ (void) fprintf(fp, "\t""TRISA = seq(~((");
prexpr(np, fp, 0);
(void) fprintf(fp, " >> 16) & 255));\n");
- (void) fprintf(fp, "\tTRISB = seq(~(");
+ (void) fprintf(fp, "\t""TRISB = seq(~(");
prexpr(np, fp, 0);
(void) fprintf(fp, " >> 24));\n");
- (void) fprintf(fp, "\tPORTA = seq(~(");
+ (void) fprintf(fp, "\t""PORTA = seq(~(");
prexpr(np, fp, 0);
(void) fprintf(fp, " & 255));\n");
- (void) fprintf(fp, "\tPORTB = seq(~((");
+ (void) fprintf(fp, "\t""PORTB = seq(~((");
prexpr(np, fp, 0);
(void) fprintf(fp, " >> 8) & 255));\n");
{
atom* op;
int ignorable = 1;
+ assert(oblist != NULL);
for(op = oblist; op < obdex; op++)
{
if(op->type == np->opcode &&
- (unsigned)op->intindex == np->constant)
+ (unsigned long)op->intindex == np->constant)
{
ignorable &= op->ignorable;
}
}
if(!ignorable)
{ /* Variable can't be ignored, and expression must be in range */
- (void) fprintf(fp,"\t");
+ (void) fprintf(fp,"\t""");
prexpr(np, fp, 1);
(void) fprintf(fp, " = ");
}
else
{
np = tn->u.node;
- (void) fprintf(fp,"\tif(ignore%s%lu) ",
+ (void) fprintf(fp,"\t""if(ignore%s%lu) ",
nameof(np->opcode,varstores),
np->constant);
prexpr(np, fp, 1);
this one, but not always, and in this case the line after this one is
always what we want, so I copied the relevant part of the emitlineno
logic here to fix the bug. */
- if (tn < tuples + lineno - 1)
- dim = tn[1].lineno - tn->lineno;
+ if (tn < tuples + ick_lineno - 1)
+ dim = tn[1].ick_lineno - tn->ick_lineno;
else
- dim = iyylineno - tn->lineno;
+ dim = iyylineno - tn->ick_lineno;
if (tn->sharedline)
++dim;
- (void) fprintf(fp, "\tlose(E000, %d, \"%s\");\n",
- emitlineno, nice_text(textlines + tn->lineno, dim));
+ (void) fprintf(fp, "\t""ick_lose(IE000, %d, \"%s\");\n",
+ emitlineno, nice_text(textlines + tn->ick_lineno, dim));
break;
case PREPROC: /* AIS: 'DO NOTHING', but not enterable into a program. This
is generated by the preprocessor. */
- fprintf(fp,"\t; /* do nothing */\n");
+ fprintf(fp,"\t""; /* do nothing */\n");
+ break;
case COME_FROM:
case NEXTFROMLABEL: /* AIS */
+ if(useickec) /* AIS */
+ {
+ if(tn->type == COME_FROM)
+ fprintf(fp, "\t""ick_comefrom(%u);\n", tn->u.target);
+ else
+ fprintf(fp, "\t""ick_nextfrom(%u);\n", tn->u.target);
+ break;
+ }
(void) fprintf(fp, "if(0) {C%ld: %s;%s}\n", (long)(tn-tuples+1),
- tn->type==NEXTFROMLABEL ? "pushnext(truelineno+1)":"",
- multithread?" NEXTTHREAD;":"");
+ tn->type==NEXTFROMLABEL ? "ick_pushnext(truelineno+1)":"",
+ multithread?" NEXTTHREAD;":" if(ick_printflow) printf(\"[%d]\",ick_lineno);");
/* AIS: Changed so all COME_FROMs have unique labels even if two
of them aim at the same line, and added the NEXT FROM case (which
involves hiding COME FROM labels in an unreachable if()). */
case WHILE: /* AIS: fall through to the error, because this shouldn't
come up yet. */
default:
- lose(E778, emitlineno, (char *)NULL);
- break;
+ ick_lose(IE778, emitlineno, (char *)NULL);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
}
- if (tn->type != COME_FROM && tn->type != NEXTFROMLABEL)
+ if ((tn->type != COME_FROM && tn->type != NEXTFROMLABEL)
+ || /*AIS*/ useickec)
(void) fprintf(fp, " }\n");
skipcomment:
-
- if (tn->type == COMPUCOME || tn->type == GERUCOME ||
- tn->type == NEXTFROMEXPR || tn->type == NEXTFROMGERUND)
+
+ if ((!useickec && (tn->type == COMPUCOME || tn->type == NEXTFROMEXPR))
+ || tn->type == NEXTFROMGERUND || tn->type == GERUCOME )
{ /* By AIS */
(void) fprintf(fp," else goto CCF%d;\n",compucomecount);
- (void) fprintf(fp," ccfc++;\n");
+ (void) fprintf(fp," ick_ccfc++;\n");
/* Note that due to the semantics of setjmp, this has to be written as 2
separate ifs. The MULTICOME macro expands to a non-multithreaded or
multithreaded function for handling a COME FROM clash. */
- (void) fprintf(fp," if(ccfc==1||MULTICOME(%d,cjb))\n"
- "\tif(setjmp(cjb) == 0) goto CCF%d;\n",
+ (void) fprintf(fp," if(ick_ccfc==1||MULTICOME(%d,ick_cjb))\n"
+ "\t""if(setjmp(ick_cjb) == 0) goto CCF%d;\n",
emitlineno, compucomecount);
/* Of course, emitlineno is unlikely to be helpful! */
if(tn->type == NEXTFROMEXPR || tn->type == NEXTFROMGERUND)
{
/* Stack up the statement we've NEXTed from */
- (void) fprintf(fp," pushnext(truelineno+1);\n");
+ (void) fprintf(fp," ick_pushnext(truelineno+1);\n");
}
(void) fprintf(fp," }\n");
}
COME FROM is also excluded because it acts at the suckpoint, not
at the place it's written in the program. */
if (tn->onceagainflag != onceagain_NORMAL &&
- (tn->type != NEXT && tn->type != GO_BACK && tn->type != COME_FROM &&
- tn->type != NEXTFROMLABEL))
+ (tn->type != NEXT && tn->type != GO_BACK &&
+ (tn->type != COME_FROM || useickec) && tn->type != NEXTFROMLABEL))
{
/* See my comments against the NEXT code for more information.
This code is placed here so COME FROM ... ONCE constructs work
- properly (the line is abstained if the COME FROM is reached in
+ properly (the line is ick_abstained if the COME FROM is reached in
execution, or its suckpoint is reached in execution). */
- fprintf(fp," oldabstain = ICKABSTAINED(%d);\n", (int)(tn - tuples));
+ fprintf(fp," ick_oldabstain = ICKABSTAINED(%d);\n", (int)(tn - tuples));
fprintf(fp," ICKABSTAINED(%d) = %s;\n",
(int)(tn - tuples),
- tn->onceagainflag==onceagain_ONCE ? "oldabstain ? oldabstain : 1"
+ tn->onceagainflag==onceagain_ONCE ? "ick_oldabstain ? ick_oldabstain : 1"
: "0");
}
/* AIS: This is where we start the COME FROM suckpoint code. */
+ /* AIS: The ickec version is very simple! We just finish the labeled
+ block started at the start of the command. */
+ if(tn->label && useickec)
+ (void) fprintf(fp, "}));\n");
+
/* AIS: We need to keep track of how many COME FROMs are aiming here
at runtime, if we don't have the very simple situation of no
COMPUCOMEs and a single-thread program (in which case the check
this can change in a multithread program due to abstentions. */
if((tn->ncomefrom && multithread) || (tn->label && compucomesused)
|| gerucomesused)
- (void) fprintf(fp, " ccfc = 0;\n");
+ (void) fprintf(fp, " ick_ccfc = 0;\n");
/* AIS: For NEXTING FROM this line */
if(nextfromsused && tn->ncomefrom)
{
* emit the code for the jump to the COME FROM.
* AIS: Changed most of this to allow for multithreading.
*/
- while(tn->ncomefrom) /* acts as an if if singlethreading */
+ while(tn->ncomefrom && !useickec) /* acts as an if if singlethreading */
{
tuple* cf; /* local to this block */
- if(multithread || compucomesused) generatecfjump = 1;
+ if(multithread || compucomesused) generatecfjump = 1;
cf = tuples+comefromsearch(tn,tn->ncomefrom)-1;
if (yydebug || compile_only)
(void) fprintf(fp,
" /* line %03d is a suck point for the COME FROM "
- "at line %03d */\n", tn->lineno, cf->lineno);
+ "at line %03d */\n", tn->ick_lineno, cf->ick_lineno);
if (cf->onceagainflag != onceagain_NORMAL)
{ /* Calculate ONCE/AGAIN when the suckpoint is passed */
- fprintf(fp," oldabstain = ICKABSTAINED(%d);\n", (int)(cf - tuples));
+ fprintf(fp," ick_oldabstain = ICKABSTAINED(%d);\n", (int)(cf - tuples));
fprintf(fp," ICKABSTAINED(%d) = %s;\n",
(int)(cf - tuples),
- cf->onceagainflag==onceagain_ONCE ? "oldabstain ? oldabstain : 1"
+ cf->onceagainflag==onceagain_ONCE ? "ick_oldabstain ? ick_oldabstain : 1"
: "0");
}
emit_guard(cf, fp);
if(multithread || compucomesused)
(void) fprintf(fp,
- "\tccfc++;\tif(ccfc==1||MULTICOME(%d,cjb)) "
- "if(setjmp(cjb) == 1) goto C%ld;\n }\n",
+ "\t""ick_ccfc++;\tif(ick_ccfc==1||MULTICOME(%d,ick_cjb)) "
+ "if(setjmp(ick_cjb) == 1) goto C%ld;\n }\n",
emitlineno, (long)(cf-tuples+1));
else /* optimize for the simple case */
- (void) fprintf(fp, "\tgoto C%ld;\n }\n", (long)(cf-tuples+1));
+ (void) fprintf(fp, "\t""goto C%ld;\n }\n", (long)(cf-tuples+1));
tn->ncomefrom--;
}
/* AIS: If the statement has a label, it might be a
computed COME FROM target. Also check the flag that says this
code is needed in a multithread non-COMPUCOME program.
- If (at runtime) ccfc is nonzero, we know cjb has already been set;
+ If (at runtime) ick_ccfc is nonzero, we know ick_cjb has already been set;
otherwise, set it now. In the case of a multithread non-COMPUCOME
program, the goto will just jump to a longjmp, switching to the
one and only one COME FROM that hasn't been given its own thread.
However, skip all the compucomes and gerucomes if preproc is set,
- because COMING FROM a preproc
- should only ever be done by label. */
+ because COMING FROM a preproc should only ever be done by label. */
if (((tn->label && compucomesused) || generatecfjump || gerucomesused) &&
- (!tn->preproc || generatecfjump))
+ (!tn->preproc || generatecfjump) && (!useickec || gerucomesused))
{
if(compucomesused)
{
- (void) fprintf(fp, " skipto = %d;\n", tn->label);
+ (void) fprintf(fp, " ick_skipto = %u;\n", tn->label);
}
if(gerucomesused || nextfromsused)
{
(void) fprintf(fp, " truelineno = %d;\n", (int)(tn-tuples));
}
- if(generatecfjump) (void) fprintf(fp, " if(ccfc) goto CCF%s;\n",
+ if(generatecfjump) (void) fprintf(fp, " if(ick_ccfc) goto CCF%s;\n",
tn->preproc?"L":"0");
if((compucomesused || gerucomesused) && !tn->preproc)
{ /* check all the COMPUCOMES */
- (void) fprintf(fp, " %sif(setjmp(cjb) == 0) goto CCF0;\n",
+ (void) fprintf(fp, " %sif(setjmp(ick_cjb) == 0) goto CCF0;\n",
generatecfjump?"else ":"");
}
generatecfjump = 0;
/* AIS: Now we've finished the statement, let's switch to the next
thread in a multithread program. */
if(multithread) (void) fputs(" NEXTTHREAD;\n", fp);
+ else
+ (void) fputs(" if(ick_printflow) printf(\"[%d]\",ick_lineno);\n",fp);
}
/* AIS: Generate prototypes for slat expressions */
void emitslatproto(FILE* fp)
{
node* np=firstslat;
- char* t="type32";
+ char* t="ick_type32";
while(np)
{
- fprintf(fp,"%s og%lx(%s);\nvoid os%lx(%s, void(*)());\n",
+ fprintf(fp,"%s ick_og%lx(%s);\nvoid ick_os%lx(%s, void(*)());\n",
t,(unsigned long)np,t,(unsigned long)np,t);
np=np->nextslat;
}
{
node* np=firstslat;
node* temp, *temp2;
- char* t="type32";
+ char* t="ick_type32";
while(np)
{
fprintf(fp,
- "void os%lx(%s a, void(*f)())\n{\n static int l=0;\n"
- " if(l)\n {\n if(!f) lose(E778, lineno, (char *)NULL);\n"
+ "void ick_os%lx(%s a, void(*f)())\n{\n static int l=0;\n"
+ " if(l)\n {\n if(!f) ick_lose(IE778, ick_lineno, (char *)NULL);\n"
" f(a,0);\n return;\n }\n l=1;\n",
(unsigned long)np,t);
temp=cons(C_A, 0, 0);
revprexpr(np->rval, fp, temp); /* revprexpr can't free */
fprintf(fp," l=0;\n}\n");
- fprintf(fp,"%s og%lx(%s t)\n{\n %s a;\n static int l=0;\n"
+ fprintf(fp,"%s ick_og%lx(%s t)\n{\n %s a;\n static int l=0;\n"
" if(l) return t;\n l=1;\n a=",
t,(unsigned long)np,t,t);
prexpr(np->rval, fp, 0);
free(np);
np=temp;
}
+ /* JH: clear firstslat */
+ firstslat = 0;
}
/* feh.c ends here */
#include "fiddle.h"
#include "sizes.h"
-#include "lose.h"
+#include "ick_lose.h"
#include <stdio.h>
-unsigned int mingle(register unsigned int r, register unsigned int s)
+unsigned int ick_mingle(register unsigned int r, register unsigned int s)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
if (r>0xffff || s>0xffff)
- lose(E533, lineno, (char *)NULL);
+ ick_lose(IE533, ick_lineno, (char *)NULL);
r = ((r & 0x0000ff00) << 8) | (r & 0x000000ff);
r = ((r & 0x00f000f0) << 4) | (r & 0x000f000f);
r = ((r & 0x0c0c0c0c) << 2) | (r & 0x03030303);
else {
unsigned int result = 0, fac = 1;
int i;
- for (i = 0 ; i < Small_digits ; i++) {
- result += fac * (s % Base);
- s /= Base;
- fac *= Base;
- result += fac * (r % Base);
- r /= Base;
- fac *= Base;
+ for (i = 0 ; i < ick_Small_digits ; i++) {
+ result += fac * (s % ick_Base);
+ s /= ick_Base;
+ fac *= ick_Base;
+ result += fac * (r % ick_Base);
+ r /= ick_Base;
+ fac *= ick_Base;
}
return result;
}
}
-unsigned int iselect(register unsigned int r, register unsigned int s)
+unsigned int ick_iselect(register unsigned int r, register unsigned int s)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
register unsigned int i = 1, t = 0;
while (s) {
if (s & i) {
}
else {
unsigned int j, result = 0, fac, digit, ofac = 1;
- for (j = Base - 1 ; j > 0 ; j--) {
+ for (j = (unsigned)ick_Base - 1 ; j > 0 ; j--) {
int i;
fac = 1;
- for (i = 0; i < Large_digits ; i++) {
- if ((s / fac) % Base == j) {
- digit = (r / fac) % Base;
+ for (i = 0; i < ick_Large_digits ; i++) {
+ if ((s / fac) % ick_Base == j) {
+ digit = (r / fac) % ick_Base;
if (digit)
result += ofac * (digit > j ? digit : j);
- ofac *= Base;
+ ofac *= ick_Base;
}
- fac *= Base;
+ fac *= ick_Base;
}
}
return result;
}
}
-static unsigned int whirl(unsigned int len, unsigned int p, unsigned int n)
+static unsigned int ick_whirl(unsigned int len, unsigned int p, unsigned int n)
{
unsigned int i, fac = 1, result = 0, d1, d2, dsave;
- d1 = n % Base;
+ d1 = n % ick_Base;
dsave = d1;
for (i = 1 ; i <= len ; i++) {
d2 = d1;
- d1 = (i < len) ? (n /= Base, n % Base) : dsave;
+ d1 = (i < len) ? (n /= ick_Base, n % ick_Base) : dsave;
if (d1 <= p)
result += fac * ((d2 < d1 || d2 > p) ? d1 : d2);
else
result += fac * ((d2 < d1 && d2 > p) ? d1 : d2);
- fac *= Base;
+ fac *= ick_Base;
}
return result;
}
-unsigned int and16(unsigned int n)
+unsigned int ick_and16(unsigned int n)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
unsigned int m = (n >> 1);
if (n & 1)
m |= 0x8000;
return(m & n);
}
else {
- return whirl(Small_digits,0,n);
+ return ick_whirl((unsigned)ick_Small_digits,0,n);
}
}
-unsigned int or16(unsigned int n)
+unsigned int ick_or16(unsigned int n)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
unsigned int m = (n >> 1);
if (n & 1)
m |= 0x8000;
return(m | n);
}
else {
- return whirl(Small_digits,Base-1,n);
+ return ick_whirl((unsigned)ick_Small_digits,(unsigned)ick_Base-1,n);
}
}
-unsigned int whirl16(unsigned int p, unsigned int n)
+unsigned int ick_whirl16(unsigned int p, unsigned int n)
{
- return whirl(Small_digits,p,n);
+ return ick_whirl((unsigned)ick_Small_digits,p,n);
}
-unsigned int and32(unsigned int n)
+unsigned int ick_and32(unsigned int n)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
unsigned int m = (n >> 1);
if (n & 1)
m |= 0x80000000;
return(m & n);
}
else {
- return whirl(Large_digits,0,n);
+ return ick_whirl((unsigned)ick_Large_digits,0,n);
}
}
-unsigned int or32(unsigned int n)
+unsigned int ick_or32(unsigned int n)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
unsigned int m = (n >> 1);
if (n & 1)
m |= 0x80000000;
return(m | n);
}
else {
- return whirl(Large_digits,Base-1,n);
+ return ick_whirl((unsigned)ick_Large_digits,(unsigned)ick_Base-1,n);
}
}
-unsigned int whirl32(unsigned int p, unsigned int n)
+unsigned int ick_whirl32(unsigned int p, unsigned int n)
{
- return whirl(Large_digits,p,n);
+ return ick_whirl((unsigned)ick_Large_digits,p,n);
}
-unsigned int xor(unsigned int len, unsigned int n)
+static unsigned int ick_xor(unsigned int len, unsigned int n)
{
unsigned int i, fac = 1, result = 0, d1, d2, dsave;
- d1 = n % Base;
+ d1 = n % ick_Base;
dsave = d1;
for (i = 1 ; i <= len ; i++) {
d2 = d1;
- d1 = (i < len) ? (n /= Base, n % Base) : dsave;
- result += fac * ((Base + d1 - d2) % Base);
- fac *= Base;
+ d1 = (i < len) ? (n /= ick_Base, n % ick_Base) : dsave;
+ result += fac * ((ick_Base + d1 - d2) % ick_Base);
+ fac *= ick_Base;
}
return result;
}
-unsigned int xor16(unsigned int n)
+unsigned int ick_xor16(unsigned int n)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
unsigned int m = (n >> 1);
if (n & 1)
m |= 0x8000;
return(m ^ n);
}
else {
- return xor(Small_digits,n);
+ return ick_xor((unsigned)ick_Small_digits,n);
}
}
-unsigned int xor32(unsigned int n)
+unsigned int ick_xor32(unsigned int n)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
unsigned int m = (n >> 1);
if (n & 1)
m |= 0x80000000;
return(m ^ n);
}
else {
- return xor(Large_digits,n);
+ return ick_xor((unsigned)ick_Large_digits,n);
}
}
-static unsigned int fin(unsigned int len, unsigned int n)
+static unsigned int ick_fin(unsigned int len, unsigned int n)
{
unsigned int i, fac = 1, result = 0, d1, d2, dsave;
- d1 = n % Base;
+ d1 = n % ick_Base;
dsave = d1;
for (i = 1 ; i <= len ; i++) {
d2 = d1;
- d1 = (i < len) ? (n /= Base, n % Base) : dsave;
- result += fac * ((d1 + d2) % Base);
- fac *= Base;
+ d1 = (i < len) ? (n /= ick_Base, n % ick_Base) : dsave;
+ result += fac * ((d1 + d2) % ick_Base);
+ fac *= ick_Base;
}
return result;
}
-unsigned int fin16(unsigned int n)
+unsigned int ick_fin16(unsigned int n)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
unsigned int m = (n >> 1);
if (n & 1)
m |= 0x8000;
return(m ^ n);
}
else {
- return fin(Small_digits,n);
+ return ick_fin((unsigned)ick_Small_digits,n);
}
}
-unsigned int fin32(unsigned int n)
+unsigned int ick_fin32(unsigned int n)
{
- if (Base == 2) {
+ if (ick_Base == 2) {
unsigned int m = (n >> 1);
if (n & 1)
m |= 0x80000000;
return(m ^ n);
}
else {
- return fin(Large_digits,n);
+ return ick_fin((unsigned)ick_Large_digits,n);
}
}
/* AIS: Reversed operations, for operand overloading */
-static unsigned int rotleft16(unsigned int n)
+static unsigned int ick_rotleft16(unsigned int n)
{
return !!(n&0x8000)|((n&0x7FFF)<<1);
}
-static unsigned int rotleft32(unsigned int n)
+static unsigned int ick_rotleft32(unsigned int n)
{
return !!(n&0x80000000)|((n&0x7FFFFFFF)<<1);
}
/* For the time being, just work out the answer in binary, and test using
the base-whatever operation. This means that there'll nearly always be
a failure in reversing in bases other than 2. */
-unsigned int rev_or16(unsigned int n)
+unsigned int ick_rev_or16(unsigned int n)
{
- if(or16(rotleft16(and16(n)))==n) return rotleft16(and16(n));
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_or16(ick_rotleft16(ick_and16(n)))==n) return ick_rotleft16(ick_and16(n));
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_or32(unsigned int n)
+unsigned int ick_rev_or32(unsigned int n)
{
- if(or32(rotleft32(and32(n)))==n) return rotleft32(and32(n));
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_or32(ick_rotleft32(ick_and32(n)))==n) return ick_rotleft32(ick_and32(n));
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_and16(unsigned int n)
+unsigned int ick_rev_and16(unsigned int n)
{
- if(and16(rotleft16(or16(n)))==n) return rotleft16(or16(n));
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_and16(ick_rotleft16(ick_or16(n)))==n) return ick_rotleft16(ick_or16(n));
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_and32(unsigned int n)
+unsigned int ick_rev_and32(unsigned int n)
{
- if(and32(rotleft32(or32(n)))==n) return rotleft32(or32(n));
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_and32(ick_rotleft32(ick_or32(n)))==n) return ick_rotleft32(ick_or32(n));
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_xor16(unsigned int n)
+unsigned int ick_rev_xor16(unsigned int n)
{
unsigned int a=0, l=1, t=0;
while(l<=0x4000)
a+=l*2;
l*=2;
}
- if(xor16(a)==n) return a;
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_xor16(a)==n) return a;
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_xor32(unsigned int n)
+unsigned int ick_rev_xor32(unsigned int n)
{
unsigned int a=0, l=1, t=0;
while(l<=0x4000000)
a+=l*2;
l*=2;
}
- if(xor32(a)==n) return a;
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_xor32(a)==n) return a;
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_fin16(unsigned int n)
+unsigned int ick_rev_fin16(unsigned int n)
{
unsigned int a=0, l=1, t=0;
while(l<=0x4000)
a+=l*2;
l*=2;
}
- if(fin16(a)==n) return a;
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_fin16(a)==n) return a;
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_fin32(unsigned int n)
+unsigned int ick_rev_fin32(unsigned int n)
{
unsigned int a=0, l=1, t=0;
while(l<=0x4000000)
a+=l*2;
l*=2;
}
- if(fin32(a)==n) return a;
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_fin32(a)==n) return a;
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_whirl16(unsigned int p, unsigned int n)
+unsigned int ick_rev_whirl16(unsigned int p, unsigned int n)
{
/* Only reverse if all digits are the same. */
- if(whirl16(p,n)==n) return n;
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_whirl16(p,n)==n) return n;
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
-unsigned int rev_whirl32(unsigned int p, unsigned int n)
+unsigned int ick_rev_whirl32(unsigned int p, unsigned int n)
{
/* Only reverse if all digits are the same. */
- if(whirl32(p,n)==n) return n;
- lose(E277, lineno, (char*) NULL);
- return 0;
+ if(ick_whirl32(p,n)==n) return n;
+ ick_lose(IE277, ick_lineno, (char*) NULL);
+ /*@-unreachable@*/ return 0; /*@=unreachable@*/
}
/* AIS: Some helper functions for the optimizer, only working in base 2 */
-unsigned int xselx(unsigned int x)
+unsigned int ick_xselx(unsigned int x)
{
- register int r=0;
- if(Base != 2) lose(E778, lineno, (char*) NULL);
+ register unsigned int r=0;
+ if(ick_Base != 2) ick_lose(IE778, ick_lineno, (char*) NULL);
while(x) {if(x&1) r=(r<<1)|1; x>>=1;}
return r;
}
-unsigned int setbitcount(unsigned int x)
+unsigned int ick_setbitcount(unsigned int x)
{
- register int r=0;
+ register unsigned int r=0;
while(x) {if(x&1) r++; x>>=1;}
return r;
}
-unsigned int smudgeright(unsigned int x)
+unsigned int ick_smudgeright(unsigned int x)
{
x=x|(x>>1);
x=x|(x>>2);
return x;
}
-unsigned int smudgeleft(unsigned int x)
+unsigned int ick_smudgeleft(unsigned int x)
{
x=x|(x<<1);
x=x|(x<<2);
/* fiddle.h -- functions implementing intercal's operators */
-extern unsigned int mingle(register unsigned int r, register unsigned int s);
-extern unsigned int iselect(register unsigned int r, register unsigned int s);
-extern unsigned int and16(unsigned int n), or16(unsigned int n),
- xor16(unsigned int n), fin16(unsigned int n);
-extern unsigned int whirl16(unsigned int p, unsigned int n);
-extern unsigned int and32(unsigned int n), or32(unsigned int n),
- xor32(unsigned int n), fin32(unsigned int n);
-extern unsigned int whirl32(unsigned int p, unsigned int n);
+/*@-exportlocal@*/ /* these are used, just in generated code */
+extern unsigned int ick_mingle(register unsigned int r, register unsigned int s);
+extern unsigned int ick_iselect(register unsigned int r, register unsigned int s);
+extern unsigned int ick_and16(unsigned int n), ick_or16(unsigned int n),
+ ick_xor16(unsigned int n), ick_fin16(unsigned int n);
+extern unsigned int ick_whirl16(unsigned int p, unsigned int n);
+extern unsigned int ick_and32(unsigned int n), ick_or32(unsigned int n),
+ ick_xor32(unsigned int n), ick_fin32(unsigned int n);
+extern unsigned int ick_whirl32(unsigned int p, unsigned int n);
/* AIS: Reversed operators */
-extern unsigned int rev_and16(unsigned int n), rev_or16(unsigned int n),
- rev_xor16(unsigned int n), rev_fin16(unsigned int n);
-extern unsigned int rev_whirl16(unsigned int p, unsigned int n);
-extern unsigned int rev_and32(unsigned int n), rev_or32(unsigned int n),
- rev_xor32(unsigned int n), rev_fin32(unsigned int n);
-extern unsigned int rev_whirl32(unsigned int p, unsigned int n);
+extern unsigned int ick_rev_and16(unsigned int n), ick_rev_or16(unsigned int n),
+ ick_rev_xor16(unsigned int n), ick_rev_fin16(unsigned int n);
+extern unsigned int ick_rev_whirl16(unsigned int p, unsigned int n);
+extern unsigned int ick_rev_and32(unsigned int n), ick_rev_or32(unsigned int n),
+ ick_rev_xor32(unsigned int n), ick_rev_fin32(unsigned int n);
+extern unsigned int ick_rev_whirl32(unsigned int p, unsigned int n);
/* AIS: Optimizer helper operators */
-extern unsigned int xselx(unsigned int x);
-extern unsigned int setbitcount(unsigned int x);
-extern unsigned int smudgeleft(unsigned int x);
-extern unsigned int smudgeright(unsigned int x);
+extern unsigned int ick_xselx(unsigned int x);
+extern unsigned int ick_setbitcount(unsigned int x);
+extern unsigned int ick_smudgeleft(unsigned int x);
+extern unsigned int ick_smudgeright(unsigned int x);
+/*@=exportlocal@*/
/* fiddle.h ends here */
$M
#include "fiddle.h"
#include "abcess.h"
-#include "lose.h"
+#include "ick_lose.h"
$K
-#define ICKABSTAINED(d) abstained[d]
-#define ICKSTASH(a,b,c,d) stash(a, b, c+b, d)
-#define ICKRETRIEVE(a,b,c,d,e) retrieve(a+b, c, b, d[b], e)
+#ifdef ICK_EC
+#include "ick_ec.h"
+void ick_main(void);
+#endif
+
+#define ICKABSTAINED(d) ick_abstained[d]
+#define ICKSTASH(a,b,c,d) ick_stash(a, b, c+b, d)
+#define ICKRETRIEVE(a,b,c,d,e) ick_retrieve(a+b, c, b, d[b], e)
#define ICKIGNORE(a,b,c) a[b]
-extern int printflow;
+extern int ick_printflow;
-int lineno;
+int ick_lineno;
-jmp_buf cjb;
-int ccfc;
-unsigned skipto=0;
+jmp_buf ick_cjb;
+int ick_ccfc;
+unsigned ick_skipto=0;
$O
-char* globalargv0;
-int oldabstain;
-int abstained[$B]$C;
+char* ick_globalargv0;
+int ick_oldabstain;
+int ick_abstained[$B]$C;
$D
$E
$P
int main(int argc, char *argv[])
{
#ifndef YUK
- parseargs(argc,argv);
+ ick_parseargs(argc,argv);
#endif
- skipto = 0;
+ ick_skipto = 0;
- next = calloc(80, sizeof *next);
+ ick_next = calloc(80, sizeof *ick_next);
+#ifdef ICK_EC
+ ick_next_jmpbufs = malloc(80 * sizeof *ick_next_jmpbufs);
+#endif
$N
- globalargv0=argv[0];
+ ick_globalargv0=argv[0];
#ifdef YUK
yuklines = $J;
yukcommands = $B;
#endif
/* set up stash storage */
- stashinit();
+ ick_stashinit();
$F
-
+
/* degenerated code */
- ick_restart:
+#ifdef ICK_EC
+ ick_main();
+}
+
+ICK_EC_FUNC_START(ick_main)
+{
+#endif
+ ick_restart:
top:
- switch(skipto)
+ switch(ick_skipto)
{
case 0:
$G
}
-
+
#ifdef YUK
- if(yukloop) goto ick_restart;
+ if(yukloop) goto ick_restart;
#endif
- lose(E633, $J, (char *)0);
+ ick_lose(IE633, $J, (char *)0);
$H
-
+#ifndef ICK_EC
return 0;
+#else
+ return;
+#endif
}
+#ifdef ICK_EC
+ICK_EC_FUNC_END
+#endif
$Q
/* Generated code for $A.i ends here */
#define YY_NO_UNPUT
-typedef int bool;
-#define TRUE 1
-#define FALSE 0
+#ifndef ICKBOOL_DEFINED
+/*@-redef@*/
+typedef int ick_bool;
+/*@=redef@*/
+#define ICKBOOL_DEFINED
+#endif
+
+#define ick_TRUE 1
+#define ick_FALSE 0
#define ALLOC_CHUNK 256
unsigned long optdata; /* AIS: Temp used by the optimizer */
int width; /* is this 32-bit data? */
struct node_t *lval, *rval; /* attached expression nodes */
- struct node_t *nextslat; /* AIS: The next node with a slat */
+ struct node_t *nextslat; /* AIS: The ick_next node with a slat */
} node;
typedef struct tuple_t
have this line as a suck-point */
int exechance; /* chance of execution, initial abstain,
(AIS) MAYBE details */
- bool maybe; /* AIS: Where MAYBE details go when
+ ick_bool maybe; /* AIS: Where MAYBE details go when
exechance has been parsed */
- bool abstainable; /* AIS: Is it possible for this line to
- be abstained from? */
- bool initabstain; /* AIS: Is this line initially
- abstained from? */
- bool nextable; /* AIS: Can this line be a NEXT
+ ick_bool abstainable; /* AIS: Is it possible for this line to
+ be ick_abstained from? */
+ ick_bool initabstain; /* AIS: Is this line initially
+ ick_abstained from? */
+ ick_bool nextable; /* AIS: Can this line be a NEXT
target? */
- bool optversion; /* AIS: Use an optimized version? (Only
+ ick_bool optversion; /* AIS: Use an optimized version? (Only
set if the optimizer thinks that
it's safe.) */
- bool preproc; /* AIS: Is this line a nonexistent one
+ ick_bool preproc; /* AIS: Is this line a nonexistent one
that was added to implement a
command in the parser? */
- bool warn112:1; /* AIS: Should this line produce warning
+ ick_bool warn112:1; /* AIS: Should this line produce warning
112 during degeneration? */
- bool warn128:1, warn534:1, warn018:1, warn016:1, warn276:1, warn239:1,
+ ick_bool warn128:1, warn534:1, warn018:1, warn016:1, warn276:1, warn239:1,
warn622:1; /* AIS: As warn112. The warnings are a bitfield to save space. */
unsigned int type; /* statement type */
struct
} u;
unsigned int nexttarget; /* AIS: The target tuple of a NEXT must
also be recorded for optimizef */
- int lineno; /* source line for error messages */
- bool sharedline; /* if NZ, two statements on a line */
+ int ick_lineno; /* source line for error messages */
+ ick_bool sharedline; /* if NZ, two statements on a line */
enum onceagain onceagainflag; /* AIS: ONCE / AGAIN */
int ppnewtype; /* AIS: 'real' type of this line when
the preprocessor is used; 0 on all
turn it off, before this command */
} tuple;
-/* this maps the `external' name of a variable to an internal array index */
+/* this maps the `external' name of a variable to an internal ick_array index */
typedef struct
{
int type;
- unsigned int extindex;
- unsigned int intindex;
+ unsigned long extindex;
+ unsigned long intindex;
int ignorable; /* AIS: Can this variable be IGNOREd? */
int memloc; /* AIS: Where does a PIC store this in memory? */
}
}
assoc;
-extern atom *oblist, *obdex;
+/*@null@*/ /*@owned@*/ /*@partial@*/ extern atom *oblist;
+/*@null@*/ /*@dependent@*/ /*@partial@*/ extern atom *obdex;
extern int obcount, nonespots, ntwospots, ntails, nhybrids;
extern int nmeshes; /* AIS */
-extern tuple *tuples;
+/*@only@*/ extern tuple *tuples;
extern int tuplecount;
-extern tuple *optuple; /* AIS: The tuple currently being optimized */
+/*@dependent@*/ extern tuple *optuple; /* AIS: The tuple currently being optimized */
extern char **enablers;
extern char *enablersm1[MAXTYPES+1];
extern assoc vartypes[];
/* the lexical analyzer keeps copies of the source logical lines */
-extern char **textlines;
+/*@only@*/ extern char **textlines;
extern int textlinecount;
extern int iyylineno;
extern int sparkearslev;
/* compilation options */
-extern bool compile_only; /* just compile into C, don't run the linker */
-extern bool nocompilerbug; /* set possibility of E774 to zero */
-extern int traditional; /* compile as INTERCAL-72 */
+extern ick_bool compile_only; /* just compile into C, don't run the linker */
+extern ick_bool nocompilerbug; /* set possibility of IE774 to zero */
+extern int ick_traditional; /* compile as INTERCAL-72 */
extern int yydebug; /* print debugging information while parsing */
extern int politesse;
extern int nextfromsused; /* is NEXT FROM used? */
extern int gerucomesused; /* is COME FROM gerund used? */
extern int opoverused; /* is operand overloading used? */
-extern node* firstslat; /* the first node with a slat */
-extern node* prevslat; /* the last node so far with a slat */
+extern int useickec; /* are external calls used? */
+/*@null@*/ extern node* firstslat; /* the ick_first node with a slat */
+/*@null@*/ extern node* prevslat; /* the last node so far with a slat */
extern int multithread; /* is the program multithreaded? */
extern int variableconstants; /* is any assignment allowed? */
-extern int coreonerr; /* dump core on E778? */
+extern int ick_coreonerr; /* dump core on IE778? */
extern int optdebug; /* debug the optimizer */
extern int flowoptimize; /* optimize program flow */
-extern int checkforbugs; /* check for bugs */
+extern int ick_checkforbugs; /* check for bugs */
extern int coopt; /* constant-output optimizer */
/* ick.h ends here */
--- /dev/null
+/*****************************************************************************
+
+NAME
+ ick_ec.c -- external call support between C and C-INTERCAL
+
+LICENSE TERMS
+ Copyright (C) 2008 Alex Smith
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+***************************************************************************/
+
+/* Implement the INTERCAL flow control operators in C, except for ABSTAIN
+ and REINSTATE. Worryingly, this is freestanding-legal and needs no C
+ headers other than setjmp.h. */
+
+#include "ick_lose.h"
+#include "abcess.h" /* must come before ick_ec.h */
+#include "ick_ec.h"
+#include <setjmp.h>
+
+static jmp_buf lastcspjb[ick_MAXNEXT];
+static int lastcspjbvalid[ick_MAXNEXT]={0};
+
+/* Checkmode values, for reference:
+ * 0: not using checkmode
+ * 1: looking for a COME FROM or NEXT FROM, or COME FROM found
+ * 2: looking for a label to NEXT to or goto
+ * 3: NEXT FROM found
+ * 4: no suitable target found
+ * 5: do a resume(1) if this reaches ick_allecfuncs
+ */
+int ick_global_checkmode = 0;
+int ick_global_stackcleanup = 0;
+/* ick_global_linelabel's marked as volatile to avoid problems with
+ optimisation of assignments to it near setjmps. */
+unsigned long ick_global_linelabel;
+int ick_forgetamount = 0;
+unsigned long ick_global_goto;
+
+/* Clean cspjb data. */
+static void cleancspjb(void)
+{
+ int i=ick_MAXNEXT;
+ while(i-->ick_nextindex) lastcspjbvalid[i]=0;
+}
+
+/* Do a NEXT. */
+/*@maynotreturn@*/ void ick_donext(unsigned long linelabel,
+ int emitlineno,
+ int willforget)
+{
+ /* OK, so auto is never necessary, but the point here is that this is being
+ stored on the stack deliberately so that it can be recalled if this
+ procedure is longjmped to. */
+ auto volatile int nextlevel = ick_nextindex;
+ if(ick_printflow&&linelabel<=65535) printf("[next:%lu]",linelabel);
+ ick_global_checkmode = 2; /* look for linelabels */
+ ick_global_linelabel = linelabel;
+ /* If there was a FORGET earlier, implement it now, by removing the relevant
+ NEXT stack entries. Unfortunately, we can't remove them from the main C
+ stack if we care about the return address of this NEXT. */
+ if(ick_forgetamount)
+ {
+ if(ick_printflow) printf("[doforget:%d]",ick_forgetamount);
+ nextlevel = ick_nextindex -= ick_forgetamount;
+ ick_forgetamount = 0;
+ if(ick_nextindex < 0) ick_nextindex = 0;
+ if(willforget) longjmp(ick_next_jmpbufs[ick_nextindex],2);
+ }
+ /* longjmp return codes: 1 = resume, 2 = clean up stack */
+ if(setjmp(ick_next_jmpbufs[ick_nextindex])==1)
+ {
+ /* Returning from the next. Clean up the next stack, just in
+ case the callee didn't. */
+ ick_nextindex = nextlevel;
+ cleancspjb();
+ ick_global_checkmode=0;
+ return;
+ }
+ ick_nextindex = nextlevel; /* in case we were longjmped to */
+ cleancspjb();
+ ick_next[ick_nextindex++] = 0;
+ ick_allecfuncs();
+ /* If the checkmode is 4, we didn't find a target. */
+ if(ick_global_checkmode == 4)
+ ick_lose(IE129, emitlineno, (char*) NULL);
+ /* Otherwise, the function called return(). */
+ ick_doresume(1,emitlineno);
+}
+
+/* Schedule a FORGET. This doesn't alter the NEXT stack immediately;
+ instead, the next RESUME or NEXT takes it into account. */
+void ick_forget(unsigned short amount)
+{
+ if(ick_printflow) printf("[forget:%hu]",amount);
+ ick_forgetamount += amount;
+ if(ick_forgetamount > ick_nextindex)
+ ick_forgetamount = ick_nextindex;
+}
+
+/* Resume to a previous NEXT stack entry. */
+/*@noreturn@*/ void ick_doresume(unsigned short amount, int emitlineno)
+{
+ if(ick_printflow) printf("[resume:%hu]",amount);
+ if(ick_printflow&&ick_forgetamount) printf("[doforget:%d]",ick_forgetamount);
+ if(!amount) ick_lose(IE621, emitlineno, (char *)NULL);
+ amount += ick_forgetamount;
+ ick_forgetamount = 0;
+ ick_nextindex -= amount;
+ if(ick_nextindex < 0)
+ ick_lose(IE632, emitlineno, (char *)NULL);
+ longjmp(ick_next_jmpbufs[ick_nextindex],1);
+}
+
+/* Check to see if anything tries to steal control from a suckpoint.
+ * This allows line labels > 65535, but bear in mind that such high
+ * line labels cannot be COME FROM or NEXTed FROM or to by the user.
+ * ('High' line labels are used by the implementation to implement
+ * this function, but only as goto targets.)
+ */
+/*@maynotreturn@*/ void ick_checksuckpoint(unsigned long linelabel)
+{
+ /* Check to see if any suckpoints aim here; if not, return. */
+ ick_global_checkmode=1;
+ ick_global_goto=0;
+ ick_global_linelabel=linelabel;
+ ick_allecfuncs();
+ if(!ick_global_goto) {ick_global_checkmode=0; return;}
+ /* Cut out bits of stack that we'll never need. */
+ if(lastcspjbvalid[ick_nextindex]) longjmp(lastcspjb[ick_nextindex],1);
+ setjmp(lastcspjb[ick_nextindex]);
+ lastcspjbvalid[ick_nextindex]=1;
+ /* If this was a COME FROM, goto it. */
+ if(ick_global_checkmode == 1)
+ {
+ if(ick_printflow) printf("[comefrom:%lu]",ick_global_linelabel);
+ ick_global_checkmode = 2;
+ ick_global_linelabel = ick_global_goto;
+ ick_allecfuncs();
+ }
+ else if(ick_global_checkmode == 3)
+ {
+ if(ick_printflow) printf("[nextfrom:%lu]",ick_global_linelabel);
+ ick_donext(ick_global_goto,-1,0);
+ return; /* we were RESUMEd to */
+ }
+ /* This line should be unreachable. */
+ ick_lose(IE778, -1, (char *)NULL);
+}
--- /dev/null
+/*****************************************************************************
+
+NAME
+ ick_ec.h -- external call support between C and C-INTERCAL
+
+LICENSE TERMS
+ Copyright (C) 2008 Alex Smith
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+***************************************************************************/
+
+/* The external calls to C work via ICK_EC_FUNCs; whenever a suckpoint is
+ encountered, all ICK_EC_FUNCs are run with ick_global_checkmode set to 1,
+ and when a NEXT is called but finds no target in the INTERCAL program, all
+ ICK_EC_FUNCs are run with ick_global_checkmode set to 2. COME FROMs and
+ NEXT FROMs don't steal control immediately (they know where to steal
+ control from using ick_global_linelabel), but instead set ick_global_goto
+ to a 'high' line label (one of the internal ones above 65536 which are
+ allocated for this sort of purpose, and inside the preprocessor) or error
+ if it's set nonzero already. After verifying that exactly one COME or NEXT
+ FROM is involved, the INTERCAL program will NEXT to the high line label
+ (whether it leaves a NEXT stack entry will depend on whether COME FROM or
+ NEXT FROM was used, which is communicated by a NEXT FROM setting the
+ checkmode to 3, which is identical to 1 in all other respects).
+
+ To prevent this process running the program out of stack space (which would
+ happen with a naive implementation if there were many COME FROMs from
+ inside the C program back to inside the C program), ick_checksuckpoint will
+ longjmp back to a previous incarnation of itself if doing so eliminates no
+ NEXT stack entries. This trick doesn't work with FORGET, though; instead
+ the stray C stack entries are eliminated at the next RESUME past them;
+ also, all but one of the entries can be eliminated at each line label if
+ there are more than one of them.
+*/
+
+#define ICK_EC_FUNC_START(id) \
+ICK_EC_PP_0(id) \
+void id(void) \
+{ \
+ void* ick_local_rv = 0; \
+ int ick_local_checkmode = ick_global_checkmode; \
+ jmp_buf ick_local_jmpbuf; \
+ setjmp(ick_local_jmpbuf); \
+ if(ick_global_checkmode==2) \
+ { \
+ goto ick_l2_ICK_EC_PP_2; \
+ } \
+ else if(ick_global_checkmode==1 || \
+ ick_global_checkmode==3) \
+ { \
+ goto ick_l1_ICK_EC_PP_1; \
+ } \
+ else
+
+#define ick_linelabel(expr) ick_labeledblock(expr,0)
+
+#define ick_labeledblock(expr,block) \
+ do { \
+ if(ick_forgetamount > 1) \
+ { \
+ ick_global_stackcleanup=1; \
+ ick_donext(expr,-1,1); \
+ } \
+ if(0) \
+ { \
+ ick_l2_ICK_EC_PP_2: ; \
+ if(ick_global_linelabel != (expr) || (expr) > 65535) \
+ goto ick_l2_ICK_EC_PP_2; \
+ ick_global_checkmode = 0; \
+ if(ick_global_stackcleanup) \
+ ick_forget(1); \
+ ick_global_stackcleanup = 0; \
+ } \
+ block ; \
+ ick_checksuckpoint(expr); \
+ } \
+ while(0)
+
+#define ick_comefrom(expr) \
+ if(0) \
+ { \
+ ick_l1_ICK_EC_PP_1: ; \
+ if(ick_global_linelabel == (expr) && (expr) <= 65535) \
+ { \
+ if(ick_global_goto) ick_multicome0(-1,ick_local_jmpbuf); \
+ ick_global_goto = ICK_EC_PP_3; \
+ } \
+ goto ick_l1_ICK_EC_PP_1; \
+ ick_l2_ICK_EC_PP_2: ; \
+ if(ick_global_linelabel != ICK_EC_PP_3) \
+ goto ick_l2_ICK_EC_PP_2; \
+ ick_global_checkmode = 0; \
+ }
+
+#define ick_nextfrom(expr) \
+ if(0) \
+ { \
+ ick_l1_ICK_EC_PP_1: ; \
+ if(ick_global_linelabel == (expr) && (expr) <= 65535) \
+ { \
+ if(ick_global_goto) ick_multicome0(-1,ick_local_jmpbuf); \
+ ick_global_goto = ICK_EC_PP_3; \
+ ick_global_checkmode = 3; \
+ } \
+ goto ick_l1_ICK_EC_PP_1; \
+ ick_l2_ICK_EC_PP_2: ; \
+ if(ick_global_linelabel != ICK_EC_PP_3) \
+ goto ick_l2_ICK_EC_PP_2; \
+ ick_global_checkmode = 0; \
+ }
+
+#define ICK_EC_FUNC_END \
+ if(ick_local_checkmode) ick_resume(1); \
+ick_l1_ICK_EC_PP_1: ; \
+ick_l2_ICK_EC_PP_2: return; \
+}
+
+#define ick_next(label) do{ \
+ if((label)<=65535) \
+ ick_donext((label),-1,0); \
+ } while(0)
+
+#define ick_resume(amount) ick_doresume((amount),-1)
+
+#define ick_return_or_resume() do{ \
+ ick_global_checkmode=5; \
+ return; \
+ } while(0)
+
+/*@maynotreturn@*/ void ick_donext(unsigned long, int, int);
+void ick_forget(unsigned short amount);
+/*@noreturn@*/ void ick_doresume(unsigned short amount, int emitlineno);
+/*@maynortreturn@*/ void ick_checksuckpoint(unsigned long linelabel);
+
+void ick_allecfuncs(void); /* in generated program */
+
+extern int ick_global_checkmode;
+extern int ick_global_stackcleanup;
+extern unsigned long ick_global_linelabel;
+extern unsigned long ick_global_goto;
+extern int ick_forgetamount;
--- /dev/null
+/*
+ *
+ * NAME
+ * ick_lose.c -- report INTERCAL compile- or run-time error
+ *
+LICENSE TERMS
+ Copyright (C) 1996 Eric S. Raymond
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*LINTLIBRARY*/
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include "ick_lose.h"
+
+int ick_coreonerr = 0; /* AIS */
+
+int ick_checkforbugs; /* AIS */
+
+/*@-formatconst@*/
+void ick_lose(char *m, int n, char *s)
+{
+ (void) fflush(stdout); /* AIS: To stop stdout getting muddled with stderr*/
+ (void) fprintf(stderr,
+ "ICL%c%c%cI\t",
+ m[0], m[1], m[2]);
+ if (s)
+ (void) fprintf(stderr, m + 4, s, n);
+ else
+ (void) fprintf(stderr, m + 4, n);
+ (void) fprintf(stderr, " CORRECT SOURCE AND RESUBNIT\n");
+ if(atoi(m)==778&&ick_coreonerr) /* AIS */
+ {
+ /* AIS: Dump core. */
+ (void) raise(SIGABRT);
+ }
+ exit(atoi(m));
+}
+
+/* AIS: This function reports potential bugs. It's paraphrased from ick_lose. */
+void ick_lwarn(char *m, int n, char *s)
+{
+ if(!ick_checkforbugs) return; /* Don't report a potential bug without -l */
+ (void) fflush(stdout);
+ (void) fprintf(stderr,
+ "ICL%c%c%cW\t",
+ m[0],m[1],m[2]);
+ if (s)
+ (void) fprintf(stderr, m + 4, s, n);
+ else if(m[0]!='2'||m[1]!='7'||m[2]!='8')
+ (void) fprintf(stderr, m + 4, n);
+ else
+ (void) fprintf(stderr, m + 4);
+ (void) fprintf(stderr, " RECONSIDER SOURCE AND RESUBNIT\n\n");
+ /* Don't exit. This is not any error except one not causing immediate
+ termination of program execution. */
+}
+/*@=formatconst@*/
+
+/* ick_lose.c ends here */
--- /dev/null
+/* ick_lose.h --- error message strings */
+
+/*
+ * Note: these error message texts, with one exception, are direct from
+ * the Princeton compiler (INTERCAL-72) sources (transmitted by Don Woods).
+ * The one exception is IE632, which in INTERCAL-72 had the error message
+ * PROGRAM ATTEMPTED TO EXIT WITHOUT ERROR MESSAGE
+ * 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", ick_first published in
+ * 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. */
+#define IE000 "000 %s\n\
+ ON THE WAY TO %d\n"
+/* An expression contains a syntax error. */
+#define IE017 "017 DO YOU EXPECT ME TO FIGURE THIS OUT?\n\
+ ON THE WAY TO %d\n"
+/* Improper use has been made of statement identifiers. */
+#define IE079 "079 PROGRAMMER IS INSUFFICIENTLY POLITE\n\
+ ON THE WAY TO %d\n"
+/* Improper use has been made of statement identifiers. */
+#define IE099 "099 PROGRAMMER IS OVERLY POLITE\n\
+ ON THE WAY TO %d\n"
+/* Program has attempted 80 levels of NEXTing */
+#define IE123 "123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON\n\
+ ON THE WAY TO %d\n"
+/* Program has attempted to transfer to a non-existent line label */
+#define IE129 "129 PROGRAM HAS GOTTEN LOST\n\
+ ON THE WAY TO WHO KNOWS WHERE\n"
+/* An ABSTAIN or REINSTATE statement references a non-existent line label */
+#define IE139 "139 I WASN'T PLANNING TO GO THERE ANYWAY\n\
+ ON THE WAY TO %d\n"
+/* A line label has been multiply defined. */
+#define IE182 "182 YOU MUST LIKE THIS LABEL A LOT!\n\
+ ON THE WAY TO %d\n"
+/* An invalid line label has been encountered. */
+#define IE197 "197 SO! 65535 LABELS AREN'T ENOUGH FOR YOU?\n\
+ ON THE WAY TO %d\n"
+/* An expression involves an unidentified variable. */
+#define IE200 "200 NOTHING VENTURED, NOTHING GAINED\n\
+ ON THE WAY TO %d\n"
+/* An attempt has been made to give an ick_array a dimension of zero. */
+#define IE240 "240 ERROR HANDLER PRINTED SNIDE REMARK\n\
+ ON THE WAY TO %d\n"
+/* Invalid dimensioning information was supplied
+ * in defining or using an ick_array. */
+#define IE241 "241 VARIABLES MAY NOT BE STORED IN WEST HYPERSPACE\n\
+ ON THE WAY TO %d\n"
+/* A 32-bit value has been assigned to a 16-bit variable. */
+#define IE275 "275 DON'T BYTE OFF MORE THAN YOU CAN CHEW\n\
+ ON THE WAY TO %d\n"
+/* A retrieval has been attempted for an unSTASHed value. */
+#define IE436 "436 THROW STICK BEFORE RETRIEVING!\n\
+ ON THE WAY TO %d\n"
+/* A WRITE IN statement or interleave ($) operation
+ * has produced value requiring over 32 bits to represent. */
+#define IE533 "533 YOU WANT MAYBE WE SHOULD IMPLEMENT 64-BIT VARIABLES?\n\
+ ON THE WAY TO %d\n"
+/* Insufficient data. (raised by reading past EOF) */
+#define IE562 "562 I DO NOT COMPUTE\n\
+ ON THE WAY TO %d\n"
+/* Input data is invalid. */
+#define IE579 "579 WHAT BASE AND/OR LANGUAGE INCLUDES %s?\n\
+ ON THE WAY TO %d\n"
+/* The expression of a RESUME statement evaluated to #0. */
+#define IE621 "621 ERROR TYPE 621 ENCOUNTERED\n\
+ ON THE WAY TO %d\n"
+/* Program execution terminated via a RESUME statement instead of GIVE UP. */
+#define IE632 "632 THE NEXT STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!\n\
+ ON THE WAY TO %d\n"
+/* Execution has passed beyond the last statement of the program. */
+#define IE633 "633 PROGRAM FELL OFF THE EDGE\n\
+ ON THE WAY TO THE NEW WORLD\n"
+/* A compiler error has occurred (see section 8.1). */
+#define IE774 "774 RANDOM COMPILER BUG\n\
+ ON THE WAY TO %d\n"
+/* An unexplainable compiler error has occurred (see J. Lyon or D. Woods). */
+#define IE778 "778 UNEXPLAINED COMPILER BUG\n\
+ ON THE WAY TO %d\n"
+
+/*
+ * These errors are unique to C-INTERCAL.
+ */
+/* You tried to use a C-INTERCAL extension with the `ick_traditional' flag on */
+#define IE111 "111 COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING\n\
+ ON THE WAY TO %d\n"
+/* Cannot find the magically included system library */
+#define IE127 "127 SAYING 'ABRACADABRA' WITHOUT A MAGIC WAND WON'T DO YOU ANY GOOD\n\
+ ON THE WAY TO THE CLOSET\n"
+/* Out of ick_stash space */
+#define IE222 "222 BUMMER, DUDE!\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Out of memory during I/O */
+#define IE252 "252 I'VE FORGOTTEN WHAT I WAS ABOUT TO SAY\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Can't reverse an expression in an assignment. This is the
+ same error number as in CLC-INTERCAL, but the message is different. */
+#define IE277 "277 YOU CAN ONLY DISTORT THE LAWS OF MATHEMATICS SO FAR\n\
+ ON THE WAY TO %d\n"
+/* (AIS) The spark/ears nesting is too deep. */
+#define IE281 "281 THAT MUCH QUOTATION AMOUNTS TO PLAGIARISM\n\
+ ON THE WAY TO %d\n"
+/* Too many variables. */
+#define IE333 "333 YOU CAN'T HAVE EVERYTHING, WHERE WOULD YOU PUT IT?\n\
+ ON THE WAY TO %d\n"
+/* Out of memory during compilation. */
+#define IE345 "345 THAT'S TOO COMPLEX FOR ME TO GRASP\n\
+ ON THE WAY TO SOMEWHERE\n"
+/* (AIS, from the suggestion by Malcom Ryan)
+ GO BACK or GO AHEAD was executed without a choicepoint. */
+#define IE404 "404 I'M ALL OUT OF CHOICES!\n\
+ ON THE WAY TO %d\n"
+/* (AIS) WHILE, MAYBE, GO BACK, or GO AHEAD used without the -m option. */
+#define IE405 "405 PROGRAM REJECTED FOR MENTAL HEALTH REASONS\n\
+ ON THE WAY TO %d\n"
+/* A COME FROM statement references a non-existent line label. */
+#define IE444 "444 IT CAME FROM BEYOND SPACE\n\
+ ON THE WAY TO %d\n"
+/* More than one COME FROM references the same label. */
+#define IE555 "555 FLOW DIAGRAM IS EXCESSIVELY CONNECTED\n\
+ ON THE WAY TO %d\n"
+/* Too many source lines, or too many input files. */
+#define IE666 "666 COMPILER HAS INDIGESTION\n\
+ ON THE WAY TO %d\n"
+/* No such source file. */
+#define IE777 "777 A SOURCE IS A SOURCE, OF COURSE, OF COURSE\n\
+ ON THE WAY TO %d\n"
+/* Can't open C output file */
+#define IE888 "888 I HAVE NO FILE AND I MUST SCREAM\n\
+ ON THE WAY TO %d\n"
+/* Can't open C skeleton file. */
+#define IE999 "999 NO SKELETON IN MY CLOSET, WOE IS ME!\n\
+ ON THE WAY TO %d\n"
+/* Source file name with invalid extension (use .i or .[3-7]i). */
+#define IE998 "998 EXCUSE ME,\n\
+ YOU MUST HAVE ME CONFUSED WITH SOME OTHER COMPILER\n"
+/* Illegal possession of a controlled unary operator. */
+#define IE997 "997 ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR.\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Command found after TRY AGAIN. */
+#define IE993 "993 I GAVE UP LONG AGO\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Memory allocation failure during multithreading */
+#define IE991 "991 YOU HAVE TOO MUCH ROPE TO HANG YOURSELF\n\
+ ON THE WAY TO %d\n"
+/* (AIS) Unimplemented feature used. This should never come up, hopefully. */
+#define IE995 "995 DO YOU REALLY EXPECT ME TO HAVE IMPLEMENTED THAT?\n\
+ ON THE WAY TO %d\n"
+/*
+ * AIS: These errors are specific to PIC-INTERCAL
+ */
+/* (AIS) Attempted to use an unsupported language feature. */
+#define IE256 "256 THAT'S TOO HARD FOR MY TINY BRAIN\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Attempted to use a PIC feature in a non-PIC program. */
+#define IE652 "652 HOW DARE YOU INSULT ME!\n\
+ ON THE WAY TO %d\n"
+
+/*
+ * AIS: These errors are generated by the yuk debugger
+ */
+/* (AIS) fgets' buffer overflowed on debugger comand input. */
+#define IE810 "810 ARE ONE-CHARACTER COMMANDS TOO SHORT FOR YOU?\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Too many breakpoints. */
+#define IE811 "811 PROGRAM IS TOO BADLY BROKEN TO RUN\n\
+ ON THE WAY TO %d\n"
+
+/*
+ * (AIS) Warnings produced by -l.
+ */
+
+/* (AIS) Non-INTERCAL-72 identifier used. */
+#define W112 "112 THAT RELIES ON THE NEW WORLD ORDER\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) That stupid idiom in syslib was used. */
+#define W128 "128 SYSLIB IS OPTIMIZED FOR OBFUSCATION\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Possibly nonportable unary operator. */
+#define W534 "534 KEEP LOOKING AT THE TOP BIT\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Expression still contains INTERCAL operators after
+ optimization. Only in binary, because this nearly always
+ happens in the higher bases. Syslib causes quite a lot of
+ these. This warning is fine on INTERCAL-like lines, but
+ flags a mistake on lines that are meant to be translations
+ of C. */
+#define W018 "018 THAT WAS MEANT TO BE A JOKE\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Possible misplaced unary operator. At the moment, ick -l cannot
+ detect this condition (so it never comes up). It's meant to detect
+ expressions like '?"?.1~#256"$#2'~#3 (from numio.i); in this expression,
+ the second what has no effect (it changes only the msb of the immediately
+ surrounding expression, which is eventually filtered out by the select
+ against #3). But detecting this would probably require code that could
+ check which bits of a result were going to be used elsewhere in an
+ expression, which is something I haven't written yet (but would make
+ a decent optimize_pass3). */
+#define W016 "016 DON'T TYPE THAT SO HASTILY\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) Possibly overflowing assignment or ick_mingle. Syslib causes some of
+ these too, in complicated situations where the bugcatcher can't figure
+ out what's happening, and also in a few blatant statements in the mould
+ of DO .3 <- :3, which are quite clearly possible overflows. Strangely
+ enough, there's a commented-out section of code in feh.c that suggests
+ that someone tried to make this an error (using a more general check
+ which would have caught more correct code involving GETS, but none
+ involving $). As a middle ground, I've made it an -l warning. */
+#define W276 "276 YOU CAN'T EXPECT ME TO CHECK BACK THAT FAR\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) A line will inevitably cause an expression-reversal failure. */
+#define W278 "278 FROM A CONTRADICTION, ANYTHING FOLLOWS\n\
+ ON THE WAY TO A HUGE DISASTER\n"
+
+/* (AIS) The two following warnings are both compile-time traps for
+ near-certain runtime errors. As such, they have similar numbers
+ and similar messages. In fact, they're a shameless ripoff of the
+ originals, but should serve as a reminder for anyone aware of the
+ original messages. */
+/* (AIS) Dimension given for an ick_array will come out as #0. */
+#define W239 "239 WARNING HANDLER PRINTED SNIDE REMARK\n\
+ ON THE WAY TO %d\n"
+
+/* (AIS) RESUME argument will come out as #0. */
+#define W622 "622 WARNING TYPE 622 ENCOUNTERED\n\
+ ON THE WAY TO %d\n"
+
+extern int ick_lineno;
+
+extern void /*@noreturn@*/ ick_lose(char *m, int n, /*@null@*/ char *s);
+
+extern void ick_lwarn(char *m, int n, /*@null@*/ char *s);
+
+/* ick_lose.h ends here */
-; \r
-; NAME \r
-; idiotism.oil -- optimizer idioms for C-INTERCAL\r
-; \r
-; LICENSE TERMS\r
-; Copyright (C) 2007 Alex Smith\r
-;\r
-; This program is free software; you can redistribute it and/or modify\r
-; it under the terms of the GNU General Public License as published by\r
-; the Free Software Foundation; either version 2 of the License, or\r
-; (at your option) any later version.\r
-;\r
-; This program is distributed in the hope that it will be useful,\r
-; but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-; GNU General Public License for more details.\r
-;\r
-; You should have received a copy of the GNU General Public License\r
-; along with this program; if not, write to the Free Software\r
-; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
-;\r
-\r
-; Optimizer Idiom Language input file for C-INTERCAL\r
-\r
-; See the appendix "Optimizer Idiom Language" in the Revamped manual\r
-; for information about the format of this file.\r
-\r
-; Some useful constants:\r
-; 0x55555555 1431655765\r
-; 0xAAAAAAAA 2863311530\r
-; 0x0000FFFF 65535\r
-; 0xFFFF0000 4294901760\r
-; 0xFFFFFFFF 4294967295\r
-\r
-; Constant folding\r
-[minglefold]\r
-(#{1}1$#{1}2)->(#{mingle(x1,x2)}0)\r
-[selectfold]\r
-(#{1}1~#{1}2)->(#{iselect(x1,x2)}0)\r
-[and32fold]\r
-(&32 #{1}1)->(#{and32(x1)}0)\r
-[or32fold]\r
-(V32 #{1}1)->(#{or32(x1)}0)\r
-[xor32fold]\r
-(?32 #{1}1)->(#{xor32(x1)}0)\r
-[and15fold]\r
-(&16 #{1}1)->(#{and16(x1)}0)\r
-[or14fold]\r
-(V16 #{1}1)->(#{or16(x1)}0)\r
-[xor14fold]\r
-(?16 #{1}1)->(#{xor16(x1)}0)\r
-; C operations can, and should, be folded too\r
-[cfold]\r
-(#{1}1 & #{1}2)->(#{x1 & x2}0)\r
-(#{1}1 | #{1}2)->(#{x1 | x2}0)\r
-(#{1}1 ^ #{1}2)->(#{x1 ^ x2}0)\r
-(#{1}1 + #{1}2)->(#{x1 + x2}0)\r
-(#{1}1 - #{1}2)->(#{x1 - x2}0)\r
-(#{1}1 * #{1}2)->(#{x1 * x2}0)\r
-(#{1}1 / #{1}2)->(#{x1 / x2}0)\r
-(#{1}1 % #{1}2)->(#{x1 % x2}0)\r
-(#{1}1 > #{1}2)->(#{x1 > x2}0)\r
-(#{1}1 < #{1}2)->(#{x1 < x2}0)\r
-(#{1}1 >> #{1}2)->(#{x1 >> x2}0)\r
-(#{1}1 << #{1}2)->(#{x1 << x2}0)\r
-(#{1}1 == #{1}2)->(#{x1 == x2}0)\r
-(#{1}1 != #{1}2)->(#{x1 != x2}0)\r
-\r
-\r
-; Binary bitwise optimizations\r
-[cbinand]\r
-((&32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->((_1 & _2) & #{iselect(x3,1431655765LU)}0)\r
-[cbinor]\r
-((V32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->((_1 | _2) & #{iselect(x3,1431655765LU)}0)\r
-[cbinxor]\r
-((?32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->((_1 ^ _2) & #{iselect(x3,1431655765LU)}0)\r
-; Sometimes, an expanded output is wanted, optimizations happen in the wrong\r
-; order, and we end up with & rather than ~ on the previous idiom. Correct\r
-; such situations now.\r
-[cbinandnoselect]\r
-((&32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(#0 $ ((_1 & _2) & #{iselect(x3,1431655765LU)}0))\r
-[cbinornoselect]\r
-((V32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(#0 $ ((_1 | _2) & #{iselect(x3,1431655765LU)}0))\r
-[cbinxornoselect]\r
-((?32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(#0 $ ((_1 ^ _2) & #{iselect(x3,1431655765LU)}0))\r
-; Sometimes, there isn't even a mingle...\r
-[cbinandnomingle]\r
-((&32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) & _1) ~ _3)\r
-((&32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) & _1) ~ _3)\r
-((&32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) & _1) & _3)\r
-((&32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) & _1) & _3)\r
-[cbinornomingle]\r
-((V32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) | _1) ~ _3)\r
-((V32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) | _1) ~ _3)\r
-((V32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) | _1) & _3)\r
-((V32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) | _1) & _3)\r
-[cbinxornomingle]\r
-((?32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) ^ _1) ~ _3)\r
-((?32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) ^ _1) ~ _3)\r
-((?32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) ^ _1) & _3)\r
-((?32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))&\r
- #{!(x&2863311530LU)&&iselect(x,1431655765LU)==xselx(iselect(x,1431655765LU))}3\r
-)->(((_2 >> #1) ^ _1) & _3)\r
-\r
-; Bitwise complements. (The INTERCAL which ultimately leads to cases 3 and 4\r
-; is not the most efficient way to do this, by the way.)\r
-[cnot1]\r
-(#65535 ^ .{!c&4294901760LU}1)->(~16 .1)\r
-[cnot2]\r
-(.{!c&4294901760LU}1 ^ #65535)->(~16 .1)\r
-[cnot3]\r
-(#4294967295 ^ :1)->(~32 :1)\r
-[cnot4]\r
-(:1 ^ #4294967295)->(~32 :1)\r
-\r
-; Special cases of select\r
-\r
-; Selecting the rightmost bits of a number\r
-[xselpow2m1]\r
-(_1 ~ #{x==xselx(x)}2)->(_1 & _2)\r
-; Selecting one bit from a number\r
-[xselpow2]\r
-(_1 ~ #{xselx(x)==1}2)->(!(!(_1 & _2)))\r
-; Selecting a number against itself and then selecting 1 from that\r
-[xselxsel1]\r
-((_1~_1)~#1)->(!(!_1))\r
-((_1~_1))->(!(!_1))\r
-(#1&(_1~_1))->(!(!_1))\r
-((_1~_1)&_{c==1}2)->(_1 && _2)\r
-(_{c==1}2&(_1~_1))->(_1 && _2)\r
-; Selecting a number from a constant that's just below a power of 2\r
-[pow2m1selx]\r
-((#{x==xselx(x)}1 ~ _2) ~ #1)->(!(!(_1 & _2)))\r
-; Boolean-negating a select\r
-[notselect]\r
-(!(_1~_2))->(!(_1&_2))\r
-\r
-; Sometimes select and mingle cancel each other out\r
-[selectmingle1]\r
-((_1~#2863311530)$_2)->((_1�)|(#0$_2))\r
-[selectmingle2]\r
-(_1$(_2~#1431655765))->((_1$#0)|(_2�))\r
-[selectmingle3]\r
-((_1~#1431655765)$_2)->(((_1�)<<#1)|(#0$_2))\r
-[selectmingle4]\r
-(_1$(_2~#2863311530))->(((_2�)>>#1)|(_1$#0))\r
-\r
-; Shifts\r
-\r
-; A helper in calculating 32-bit shifts; this is a shift on half the bits of\r
-; a 32-bit number.\r
-[lshift32half]\r
-(#0$((_1~#715827882)<<#1))->((_1�)<<#1)\r
-; Rightshift some of the bits\r
-[rshift]\r
-<#1-#31\r
-(_1~#{xselx(x)<<r==x&&x}2)->((_1&_2)>>#{r}0)\r
->\r
-; General 16-bit leftshifts\r
-;\r
-; Large left-shifts can be written in an optimized way using knowledge of the\r
-; rightmost bits to shift more than one bit at a time.\r
-; If the rightmost few bits of a number are known to be 0, it can be mingled\r
-; with 0, and then selected with a number which has many 0s to do a leftshift.\r
-; Here, if none of the bits marked l are set this is a right-shift by 3, and\r
-; for each bit set, the shift goes 1 leftwards.\r
-; (xxxxxxxxxxxxxttt $ 000000000000uuuu) ~ (h0h0h0h0h0h0h0h0h0h0h0h01lllllll)\r
-; x0x0x0x0x0x0x0x0x0x0x0x0xutututu\r
-; h0h0h0h0h0h0h0h0h0h0h0h01lllllll\r
-; There's three cases here for each possible width for the ts, including one\r
-; which has them as zeros and two which have them higher.\r
-[lshift16]\r
-<#0-#14\r
-((_{c<=65535&&!(c&((1LU<<r)-1LU))}1$\r
- #{!(x&(4294967294LU<<r))}2)~#{!(x&(1431655765LU<<(r*2+2)))}3)\r
-->((((_1>>#{r}0)~#{iselect(x3>>(r*2+1),1431655765LU)}0)\r
- <<#{setbitcount(x3&((2LU<<(r*2))-1))}0)|#{iselect(mingle(0,x2),x3)}0)\r
-(((_{c<=65535&&!(c&((1LU<<r)-1LU))}1|#{x<=65535&&!(c&~((1LU<<r)-1LU))}4)$\r
- #{!(x&(4294967294LU<<r))}2)~#{!(x&(1431655765LU<<(r*2+2)))}3)\r
-->((((_1>>#{r}0)~#{iselect(x3>>(r*2+1),1431655765LU)}0)\r
- <<#{setbitcount(x3&((2LU<<(r*2))-1))}0)|#{iselect(mingle(x4,x2),x3)}0)\r
-(((#{x<=65535&&!(c&~((1LU<<r)-1LU))}4|_{c<=65535&&!(c&((1LU<<r)-1LU))}1)$\r
- #{!(x&(4294967294LU<<r))}2)~#{!(x&(1431655765LU<<(r*2+2)))}3)\r
-->((((_1>>#{r}0)~#{iselect(x3>>(r*2+1),1431655765LU)}0)\r
- <<#{setbitcount(x3&((2LU<<(r*2))-1))}0)|#{iselect(mingle(x4,x2),x3)}0)\r
->\r
-; 32-bit leftshift by 1; there are 8 ways to write this.\r
-[lshift32by1]\r
-(((_1�)<<#1)|((_1�)<<#1))->((_1�)<<#1)\r
-(((#1431655765&_1)<<#1)|((_1�)<<#1))->((_1�)<<#1)\r
-(((_1�)<<#1)|((#715827882&_1)<<#1))->((_1�)<<#1)\r
-(((#1431655765&_1)<<#1)|((#715827882&_1)<<#1))->((_1�)<<#1)\r
-(((_1�)<<#1)|((_1�)<<#1))->((_1�)<<#1)\r
-(((_1�)<<#1)|((#1431655765&_1)<<#1))->((_1�)<<#1)\r
-(((#715827882&_1)<<#1)|((_1�)<<#1))->((_1�)<<#1)\r
-(((#715827882&_1)<<#1)|((#1431655765&_1)<<#1))->((_1�)<<#1)\r
-; Move AND inside shifts, and OR and XOR outside shifts\r
-[andintoshift]\r
-((_1 << #{1}2) & #{1}3)->((_1 & #{x3>>x2}0) << _2)\r
-((_1 >> #{1}2) & #{1}3)->((_1 & #{x3<<x2}0) >> _2)\r
-[oroutofshift]\r
-((_1 | #{1}2) << #{1}3)->((_1 << _3) | #{x2<<x3}0)\r
-((_1 | #{1}2) >> #{1}3)->((_1 >> _3) | #{x2>>x3}0)\r
-[xoroutofshift]\r
-((_1 ^ #{1}2) << #{1}3)->((_1 << _3) ^ #{x2<<x3}0)\r
-((_1 ^ #{1}2) >> #{1}3)->((_1 >> _3) ^ #{x2>>x3}0)\r
-; Larger leftshifts can be created by combining smaller ones, although there\r
-; are shortcuts that can be used and this idiom only works if they haven't\r
-; been. Also, idioms later on can create shifts that cancel each other out, so\r
-; the code for cancelling them is here.\r
-[combinellshift]\r
-((_1 << #{1}2) << #{1}3)->(_1 << #{x2+x3}0)\r
-[combinelrshift]\r
-((_1 << #{1}2) >> #{x>x2}3)->(_1 >> #{x3-x2}0)\r
-((_1 << #{1}2) >> #{x==x2}3)->(_1)\r
-((_1 << #{1}2) >> #{x<x2}3)->(_1 << #{x2-x3}0)\r
-[combinerlshift]\r
-((_1 >> #{1}2) << #{x>x2}3)->(_1 << #{x3-x2}0)\r
-((_1 >> #{1}2) << #{x==x2}3)->(_1)\r
-((_1 >> #{1}2) << #{x<x2}3)->(_1 >> #{x2-x3}0)\r
-[combinerrshift]\r
-((_1 >> #{1}2) >> #{1}3)->(_1 >> #{x2+x3}0)\r
-[nullshift]\r
-(_1 >> #0)->(_1)\r
-(_1 << #0)->(_1)\r
-\r
-; INTERCAL logical values are 1 and 2.\r
-[xorto1or2]\r
-((?32(_1$#1)))->((_1)+#1)\r
-((?32(_1$#2)))->(#2-(_1))\r
-\r
-; Removing, combining and weakening unneeded C_ANDs\r
-[unneededand]\r
-(_1&#{!(c1&~x)}0)->(_1)\r
-(#{!(c1&~x)}0&_1)->(_1)\r
-[combineand]\r
-((_1&#{1}2)&#{1}3)->(_1&#{x2&x3}0)\r
-((#{1}2&_1)&#{1}3)->(_1&#{x2&x3}0)\r
-(#{1}3&(_1&#{1}2))->(_1&#{x2&x3}0)\r
-(#{1}3&(#{1}2&_1))->(_1&#{x2&x3}0)\r
-[weakenand]\r
-(_1&#{(~c1)&x}2)->(_1&#{c1&x2}0)\r
-(#{(~c1)&x}2&_1)->(_1&#{c1&x2}0)\r
-\r
-; 32-bit complements\r
-\r
-; Complement odd bits, zero even bits\r
-[com1z0]\r
-(((?32(_1|#1431655765))�)<<#1)->((_1�)^#2863311530)\r
-(((?32(#1431655765|_1))�)<<#1)->((_1�)^#2863311530)\r
-((#1431655765&(?32(_1|#1431655765)))<<#1)->((_1�)^#2863311530)\r
-((#1431655765&(?32(#1431655765|_1)))<<#1)->((_1�)^#2863311530)\r
-; Complement even bits, zero odd bits\r
-[com0z1]\r
-((?32(((_1�)<<#1)|#1431655765))�)\r
-->((_1�)^#1431655765)\r
-((?32(((#1431655765&_1)<<#1)|#1431655765))�)\r
-->((_1�)^#1431655765)\r
-((?32(#1431655765|((_1�)<<#1)))�)\r
-->((_1�)^#1431655765)\r
-((?32(#1431655765|((#1431655765&_1)<<#1)))�)\r
-->((_1�)^#1431655765)\r
-(#1431655765&(?32(((_1�)<<#1)|#1431655765)))\r
-->((_1�)^#1431655765)\r
-(#1431655765&(?32(((#1431655765&_1)<<#1)|#1431655765)))\r
-->((_1�)^#1431655765)\r
-(#1431655765&(?32(#1431655765|((_1�)<<#1))))\r
-->((_1�)^#1431655765)\r
-(#1431655765&(?32(#1431655765|((#1431655765&_1)<<#1))))\r
-->((_1�)^#1431655765)\r
-; 32-bit complements, in full\r
-[cnot5]\r
-(((:1&#{1}2)^#{x==x2}0)|((:1&#{(x^x2)==4294967295LU}3)^#{x==x3}0))->(~32 :1)\r
-\r
-; Distributive laws\r
-\r
-; Several of these laws go towards helping finish off 32-bit C binary logical\r
-; operations, but are useful in other places as well (especially distributions\r
-; involving shifts).\r
-[distribll]\r
-((_1&_3)&(_2&_3))->((_1&_2)&_3)\r
-((_1|_3)&(_2|_3))->((_1&_2)|_3)\r
-((_1&_3)|(_2&_3))->((_1|_2)&_3)\r
-((_1|_3)|(_2|_3))->((_1|_2)|_3)\r
-((_1&_3)^(_2&_3))->((_1^_2)&_3)\r
-((_1<<_3)&(_2<<_3))->((_1&_2)<<_3)\r
-((_1<<_3)|(_2<<_3))->((_1|_2)<<_3)\r
-((_1<<_3)^(_2<<_3))->((_1^_2)<<_3)\r
-((_1>>_3)&(_2>>_3))->((_1&_2)>>_3)\r
-((_1>>_3)|(_2>>_3))->((_1|_2)>>_3)\r
-((_1>>_3)^(_2>>_3))->((_1^_2)>>_3)\r
-[distribrl]\r
-((_3&_1)&(_2&_3))->((_1&_2)&_3)\r
-((_3|_1)&(_2|_3))->((_1&_2)|_3)\r
-((_3&_1)|(_2&_3))->((_1|_2)&_3)\r
-((_3|_1)|(_2|_3))->((_1|_2)|_3)\r
-((_3&_1)^(_2&_3))->((_1^_2)&_3)\r
-[distriblr]\r
-((_1&_3)&(_3&_2))->((_1&_2)&_3)\r
-((_1|_3)&(_3|_2))->((_1&_2)|_3)\r
-((_1&_3)|(_3&_2))->((_1|_2)&_3)\r
-((_1|_3)|(_3|_2))->((_1|_2)|_3)\r
-((_1&_3)^(_3&_2))->((_1^_2)&_3)\r
-[distribrr]\r
-((_3&_1)&(_3&_2))->((_1&_2)&_3)\r
-((_3|_1)&(_3|_2))->((_1&_2)|_3)\r
-((_3&_1)|(_3&_2))->((_1|_2)&_3)\r
-((_3|_1)|(_3|_2))->((_1|_2)|_3)\r
-((_3&_1)^(_3&_2))->((_1^_2)&_3)\r
-[distribunary]\r
-((!_1)&(!_2))->(!(_1|_2))\r
-\r
-; 32-bit C binary logical operations\r
-\r
-; Strangely enough, these can be done for the most part with the combined\r
-; effect of many small optimizations (of course, that's the best way to do it).\r
-; The only potential problem is that the distributive law isn't quite general\r
-; enough for some cases involving constants, and for some cases where one side\r
-; or the other is known to have no set evenbits or no set oddbits.\r
-; Some generalised versions of the distributive law are needed here.\r
-; Unfortunately, there are lots of binary operators here that need to be\r
-; written both ways round. The 96 cases that follow, combined with weakenand,\r
-; should be enough for all but the most pathological cases.\r
-[distribhalfxoroveror1]\r
-(((_1 ^ _2) & _3) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_1 ^ _2) & _3))->((_1 ^ _2) & (_3 | _4))\r
-(((_1 ^ _2) & _3) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_1 ^ _2) & _3))->((_1 ^ _2) & (_3 | _4))\r
-((_3 & (_1 ^ _2)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_3 & (_1 ^ _2)))->((_1 ^ _2) & (_3 | _4))\r
-((_3 & (_1 ^ _2)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_3 & (_1 ^ _2)))->((_1 ^ _2) & (_3 | _4))\r
-(((_2 ^ _1) & _3) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_2 ^ _1) & _3))->((_1 ^ _2) & (_3 | _4))\r
-(((_2 ^ _1) & _3) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_2 ^ _1) & _3))->((_1 ^ _2) & (_3 | _4))\r
-((_3 & (_2 ^ _1)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_3 & (_2 ^ _1)))->((_1 ^ _2) & (_3 | _4))\r
-((_3 & (_2 ^ _1)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_3 & (_2 ^ _1)))->((_1 ^ _2) & (_3 | _4))\r
-[distribhalfxoroveror2]\r
-(((_1 & _3) ^ _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_1 & _3) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4))\r
-(((_1 & _3) ^ _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_1 & _3) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==c}2 ^ (_1 & _3)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 ^ (_1 & _3)))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==c}2 ^ (_1 & _3)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 ^ (_1 & _3)))->((_1 ^ _2) & (_3 | _4))\r
-(((_3 & _1) ^ _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_3 & _1) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4))\r
-(((_3 & _1) ^ _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_3 & _1) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==c}2 ^ (_3 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 ^ (_3 & _1)))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==c}2 ^ (_3 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 ^ (_3 & _1)))->((_1 ^ _2) & (_3 | _4))\r
-[distribhalforoveror1]\r
-(((_1 | _2) & _3) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_1 | _2) & _3))->((_1 | _2) & (_3 | _4))\r
-(((_1 | _2) & _3) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_1 | _2) & _3))->((_1 | _2) & (_3 | _4))\r
-((_3 & (_1 | _2)) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_3 & (_1 | _2)))->((_1 | _2) & (_3 | _4))\r
-((_3 & (_1 | _2)) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_3 & (_1 | _2)))->((_1 | _2) & (_3 | _4))\r
-(((_2 | _1) & _3) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_2 | _1) & _3))->((_1 | _2) & (_3 | _4))\r
-(((_2 | _1) & _3) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_2 | _1) & _3))->((_1 | _2) & (_3 | _4))\r
-((_3 & (_2 | _1)) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_3 & (_2 | _1)))->((_1 | _2) & (_3 | _4))\r
-((_3 & (_2 | _1)) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_3 & (_2 | _1)))->((_1 | _2) & (_3 | _4))\r
-[distribhalforoveror2]\r
-(((_1 & _3) | _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_1 & _3) | _{(c&c3)==c}2))->((_1 | _2) & (_3 | _4))\r
-(((_1 & _3) | _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_1 & _3) | _{(c&c3)==c}2))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==c}2 | (_1 & _3)) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 | (_1 & _3)))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==c}2 | (_1 & _3)) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 | (_1 & _3)))->((_1 | _2) & (_3 | _4))\r
-(((_3 & _1) | _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_3 & _1) | _{(c&c3)==c}2))->((_1 | _2) & (_3 | _4))\r
-(((_3 & _1) | _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_3 & _1) | _{(c&c3)==c}2))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==c}2 | (_3 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 | (_3 & _1)))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==c}2 | (_3 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 | (_3 & _1)))->((_1 | _2) & (_3 | _4))\r
-[distribhalfandoveror1]\r
-(((_1 & _2) & _3) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_1 & _2) & _3))->((_1 & _2) & (_3 | _4))\r
-(((_1 & _2) & _3) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_1 & _2) & _3))->((_1 & _2) & (_3 | _4))\r
-((_3 & (_1 & _2)) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_3 & (_1 & _2)))->((_1 & _2) & (_3 | _4))\r
-((_3 & (_1 & _2)) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_3 & (_1 & _2)))->((_1 & _2) & (_3 | _4))\r
-(((_2 & _1) & _3) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_2 & _1) & _3))->((_1 & _2) & (_3 | _4))\r
-(((_2 & _1) & _3) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_2 & _1) & _3))->((_1 & _2) & (_3 | _4))\r
-((_3 & (_2 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_3 & (_2 & _1)))->((_1 & _2) & (_3 | _4))\r
-((_3 & (_2 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_3 & (_2 & _1)))->((_1 & _2) & (_3 | _4))\r
-[distribhalfandoveror2]\r
-(((_1 & _3) & _2) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_1 & _3) & _2))->((_1 & _2) & (_3 | _4))\r
-(((_1 & _3) & _2) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_1 & _3) & _2))->((_1 & _2) & (_3 | _4))\r
-((_2 & (_1 & _3)) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_2 & (_1 & _3)))->((_1 & _2) & (_3 | _4))\r
-((_2 & (_1 & _3)) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_2 & (_1 & _3)))->((_1 & _2) & (_3 | _4))\r
-(((_3 & _1) & _2) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | ((_3 & _1) & _2))->((_1 & _2) & (_3 | _4))\r
-(((_3 & _1) & _2) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | ((_3 & _1) & _2))->((_1 & _2) & (_3 | _4))\r
-((_2 & (_3 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))\r
-((_1 & _{(c&c3)==0}4) | (_2 & (_3 & _1)))->((_1 & _2) & (_3 | _4))\r
-((_2 & (_3 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))\r
-((_{(c&c3)==0}4 & _1) | (_2 & (_3 & _1)))->((_1 & _2) & (_3 | _4))\r
-\r
-; A right-shift idiom in syslib that was written in an unneccessarily complex\r
-; way, by doing the bits separately the same way as left-shifts have to be done\r
-; (of course, select can right-shift by any difference without much trouble);\r
-; the next idiom is a helper for that. Previous code produced a warning when\r
-; this idiom was used, but the optimizer has now been enhanced to the extent\r
-; that it can deal with it without much special-casing, and therefore there's\r
-; no way now to tell that that case is being used, so the warning has been\r
-; removed.\r
-; lshift32half done in the other direction; note that the large constant here\r
-; is 0x55555554, not the all-5s number\r
-[rshift32half]\r
-((_1~#1431655764)$#0)->((_1�)>>#1)\r
-; and piecing together this with selectmingle4 gives the syslib idiom, which\r
-; optimizes through distributions over C_OR and then constant folding\r
-\r
-; When a 0 is on one side of a C binary logic operation, or the two sides are\r
-; the same, simplification is often possible. The and-0 case has been dealt\r
-; with already.\r
-[noopor]\r
-(_1|#0)->(_1)\r
-(#0|_1)->(_1)\r
-[noopxor]\r
-(_1^#0)->(_1)\r
-(#0^_1)->(_1)\r
-[anditself]\r
-(_1&_1)->(_1)\r
-[oritself]\r
-(_1|_1)->(_1)\r
-[xoritself]\r
-(_1^_1)->(#0)\r
-\r
-; Equality and inequality\r
-[xortoequal]\r
-(!(_1^_2))->(_1==_2)\r
-[negatingequal]\r
-(!(_1==_2))->(_1!=_2)\r
-(!(_1!=_2))->(_1==_2)\r
-\r
-; Greater than and less than\r
-[greaterthan32]\r
-((_1~:2)~((?32(:2~:2))^#2147483648))->(_1>(:2^_1))\r
-((_1~:2)~(#2147483648^(?32(:2~:2))))->(_1>(:2^_1))\r
-[greaterthan16]\r
-((_1~.2)~((?16(.2~.2))^#32768))->(_1>(.2^_1))\r
-((_1~.2)~(#32768^(?16(.2~.2))))->(_1>(.2^_1))\r
-\r
-; Consistency in C logical operation nesting, when it doesn't matter\r
-[xoroutsideand]\r
-((_1^_2)&_2)->((_1&_2)^_2)\r
-(_2&(_1^_2))->((_1&_2)^_2)\r
-((_2^_1)&_2)->((_1&_2)^_2)\r
-(_2&(_2^_1))->((_1&_2)^_2)\r
-\r
-; Boolean algebra, on 0s and 1s or on 1s and 2s. Unary bitwidth is irrelevant.\r
-[booleannot]\r
-(_{c==1}1^#1)->(!_1)\r
-[not21]\r
-(#2-(!(_{c==1}1)))->(_1+#1)\r
-(#1+(!(_{c==1}1)))->(#2-_1)\r
-((!(_{c==1}1))+#1)->(#2-_1)\r
-[nullmingle]\r
-(#0$_{c==1}1)->(_1)\r
+;
+; NAME
+; idiotism.oil -- optimizer idioms for C-INTERCAL
+;
+; LICENSE TERMS
+; Copyright (C) 2007 Alex Smith
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+; GNU General Public License for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with this program; if not, write to the Free Software
+; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;
+
+; Optimizer Idiom Language input file for C-INTERCAL
+
+; See the appendix "Optimizer Idiom Language" in the Revamped manual
+; for information about the format of this file.
+
+; Some useful constants:
+; 0x55555555 1431655765
+; 0xAAAAAAAA 2863311530
+; 0x0000FFFF 65535
+; 0xFFFF0000 4294901760
+; 0xFFFFFFFF 4294967295
+
+; Constant folding
+[minglefold]
+(#{1}1$#{1}2)->(#{ick_mingle(x1,x2)}0)
+[selectfold]
+(#{1}1~#{1}2)->(#{ick_iselect(x1,x2)}0)
+[and32fold]
+(&32 #{1}1)->(#{ick_and32(x1)}0)
+[or32fold]
+(V32 #{1}1)->(#{ick_or32(x1)}0)
+[xor32fold]
+(?32 #{1}1)->(#{ick_xor32(x1)}0)
+[and15fold]
+(&16 #{1}1)->(#{ick_and16(x1)}0)
+[or14fold]
+(V16 #{1}1)->(#{ick_or16(x1)}0)
+[xor14fold]
+(?16 #{1}1)->(#{ick_xor16(x1)}0)
+; C operations can, and should, be folded too
+[cfold]
+(#{1}1 & #{1}2)->(#{x1 & x2}0)
+(#{1}1 | #{1}2)->(#{x1 | x2}0)
+(#{1}1 ^ #{1}2)->(#{x1 ^ x2}0)
+(#{1}1 + #{1}2)->(#{x1 + x2}0)
+(#{1}1 - #{1}2)->(#{x1 - x2}0)
+(#{1}1 * #{1}2)->(#{x1 * x2}0)
+(#{1}1 / #{1}2)->(#{x1 / x2}0)
+(#{1}1 % #{1}2)->(#{x1 % x2}0)
+(#{1}1 > #{1}2)->(#{x1 > x2}0)
+(#{1}1 < #{1}2)->(#{x1 < x2}0)
+(#{1}1 >> #{1}2)->(#{x1 >> x2}0)
+(#{1}1 << #{1}2)->(#{x1 << x2}0)
+(#{1}1 == #{1}2)->(#{x1 == x2}0)
+(#{1}1 != #{1}2)->(#{x1 != x2}0)
+
+
+; Binary bitwise optimizations
+[cbinand]
+((&32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->((_1 & _2) & #{ick_iselect(x3,1431655765LU)}0)
+[cbinor]
+((V32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->((_1 | _2) & #{ick_iselect(x3,1431655765LU)}0)
+[cbinxor]
+((?32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->((_1 ^ _2) & #{ick_iselect(x3,1431655765LU)}0)
+; Sometimes, an expanded output is wanted, optimizations happen in the wrong
+; order, and we end up with & rather than ~ on the previous idiom. Correct
+; such situations now.
+[cbinandnoselect]
+((&32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(#0 $ ((_1 & _2) & #{ick_iselect(x3,1431655765LU)}0))
+[cbinornoselect]
+((V32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(#0 $ ((_1 | _2) & #{ick_iselect(x3,1431655765LU)}0))
+[cbinxornoselect]
+((?32(_{!(c&4294901760LU)}1$_{!(c&4294901760LU)}2))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(#0 $ ((_1 ^ _2) & #{ick_iselect(x3,1431655765LU)}0))
+; Sometimes, there isn't even a ick_mingle...
+[cbinandnomingle]
+((&32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) & _1) ~ _3)
+((&32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) & _1) ~ _3)
+((&32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) & _1) & _3)
+((&32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) & _1) & _3)
+[cbinornomingle]
+((V32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) | _1) ~ _3)
+((V32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) | _1) ~ _3)
+((V32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) | _1) & _3)
+((V32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) | _1) & _3)
+[cbinxornomingle]
+((?32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) ^ _1) ~ _3)
+((?32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))~
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) ^ _1) ~ _3)
+((?32(_{!(c&2863311530LU)}1|_{!(c&1431655765LU)}2))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) ^ _1) & _3)
+((?32(_{!(c&1431655765LU)}2|_{!(c&2863311530LU)}1))&
+ #{!(x&2863311530LU)&&ick_iselect(x,1431655765LU)==ick_xselx(ick_iselect(x,1431655765LU))}3
+)->(((_2 >> #1) ^ _1) & _3)
+
+; Bitwise complements. (The INTERCAL which ultimately leads to cases 3 and 4
+; is not the most efficient way to do this, by the way.)
+[cnot1]
+(#65535 ^ .{!c&4294901760LU}1)->(~16 .1)
+[cnot2]
+(.{!c&4294901760LU}1 ^ #65535)->(~16 .1)
+[cnot3]
+(#4294967295 ^ :1)->(~32 :1)
+[cnot4]
+(:1 ^ #4294967295)->(~32 :1)
+
+; Special cases of select
+
+; Selecting the rightmost bits of a number
+[xselpow2m1]
+(_1 ~ #{x==ick_xselx(x)}2)->(_1 & _2)
+; Selecting one bit from a number
+[xselpow2]
+(_1 ~ #{ick_xselx(x)==1}2)->(!(!(_1 & _2)))
+; Selecting a number against itself and then selecting 1 from that
+[xselxsel1]
+((_1~_1)~#1)->(!(!_1))
+((_1~_1))->(!(!_1))
+(#1&(_1~_1))->(!(!_1))
+((_1~_1)&_{c==1}2)->(_1 && _2)
+(_{c==1}2&(_1~_1))->(_1 && _2)
+; Selecting a number from a constant that's just below a power of 2
+[pow2m1selx]
+((#{x==ick_xselx(x)}1 ~ _2) ~ #1)->(!(!(_1 & _2)))
+; Boolean-negating a select
+[notselect]
+(!(_1~_2))->(!(_1&_2))
+
+; Sometimes select and ick_mingle cancel each other out
+[selectmingle1]
+((_1~#2863311530)$_2)->((_1�)|(#0$_2))
+[selectmingle2]
+(_1$(_2~#1431655765))->((_1$#0)|(_2�))
+[selectmingle3]
+((_1~#1431655765)$_2)->(((_1�)<<#1)|(#0$_2))
+[selectmingle4]
+(_1$(_2~#2863311530))->(((_2�)>>#1)|(_1$#0))
+
+; Shifts
+
+; A helper in calculating 32-bit shifts; this is a shift on half the bits of
+; a 32-bit number.
+[lshift32half]
+(#0$((_1~#715827882)<<#1))->((_1�)<<#1)
+; Rightshift some of the bits
+[rshift]
+<#1-#31
+(_1~#{ick_xselx(x)<<r==x&&x}2)->((_1&_2)>>#{r}0)
+>
+; General 16-bit leftshifts
+;
+; Large left-shifts can be written in an optimized way using knowledge of the
+; rightmost bits to shift more than one bit at a time.
+; If the rightmost few bits of a number are known to be 0, it can be mingled
+; with 0, and then selected with a number which has many 0s to do a leftshift.
+; Here, if none of the bits marked l are set this is a right-shift by 3, and
+; for each bit set, the shift goes 1 leftwards.
+; (xxxxxxxxxxxxxttt $ 000000000000uuuu) ~ (h0h0h0h0h0h0h0h0h0h0h0h01lllllll)
+; x0x0x0x0x0x0x0x0x0x0x0x0xutututu
+; h0h0h0h0h0h0h0h0h0h0h0h01lllllll
+; There's three cases here for each possible width for the ts, including one
+; which has them as zeros and two which have them higher.
+[lshift16]
+<#0-#14
+((_{c<=65535&&!(c&((1LU<<r)-1LU))}1$
+ #{!(x&(4294967294LU<<r))}2)~#{!(x&(1431655765LU<<(r*2+2)))}3)
+->((((_1>>#{r}0)~#{ick_iselect(x3>>(r*2+1),1431655765LU)}0)
+ <<#{ick_setbitcount(x3&((2LU<<(r*2))-1))}0)|#{ick_iselect(ick_mingle(0,x2),x3)}0)
+(((_{c<=65535&&!(c&((1LU<<r)-1LU))}1|#{x<=65535&&!(c&~((1LU<<r)-1LU))}4)$
+ #{!(x&(4294967294LU<<r))}2)~#{!(x&(1431655765LU<<(r*2+2)))}3)
+->((((_1>>#{r}0)~#{ick_iselect(x3>>(r*2+1),1431655765LU)}0)
+ <<#{ick_setbitcount(x3&((2LU<<(r*2))-1))}0)|#{ick_iselect(ick_mingle(x4,x2),x3)}0)
+(((#{x<=65535&&!(c&~((1LU<<r)-1LU))}4|_{c<=65535&&!(c&((1LU<<r)-1LU))}1)$
+ #{!(x&(4294967294LU<<r))}2)~#{!(x&(1431655765LU<<(r*2+2)))}3)
+->((((_1>>#{r}0)~#{ick_iselect(x3>>(r*2+1),1431655765LU)}0)
+ <<#{ick_setbitcount(x3&((2LU<<(r*2))-1))}0)|#{ick_iselect(ick_mingle(x4,x2),x3)}0)
+>
+; 32-bit leftshift by 1; there are 8 ways to write this.
+[lshift32by1]
+(((_1�)<<#1)|((_1�)<<#1))->((_1�)<<#1)
+(((#1431655765&_1)<<#1)|((_1�)<<#1))->((_1�)<<#1)
+(((_1�)<<#1)|((#715827882&_1)<<#1))->((_1�)<<#1)
+(((#1431655765&_1)<<#1)|((#715827882&_1)<<#1))->((_1�)<<#1)
+(((_1�)<<#1)|((_1�)<<#1))->((_1�)<<#1)
+(((_1�)<<#1)|((#1431655765&_1)<<#1))->((_1�)<<#1)
+(((#715827882&_1)<<#1)|((_1�)<<#1))->((_1�)<<#1)
+(((#715827882&_1)<<#1)|((#1431655765&_1)<<#1))->((_1�)<<#1)
+; Move AND inside shifts, and OR and XOR outside shifts
+[andintoshift]
+((_1 << #{1}2) & #{1}3)->((_1 & #{x3>>x2}0) << _2)
+((_1 >> #{1}2) & #{1}3)->((_1 & #{x3<<x2}0) >> _2)
+[oroutofshift]
+((_1 | #{1}2) << #{1}3)->((_1 << _3) | #{x2<<x3}0)
+((_1 | #{1}2) >> #{1}3)->((_1 >> _3) | #{x2>>x3}0)
+[xoroutofshift]
+((_1 ^ #{1}2) << #{1}3)->((_1 << _3) ^ #{x2<<x3}0)
+((_1 ^ #{1}2) >> #{1}3)->((_1 >> _3) ^ #{x2>>x3}0)
+; Larger leftshifts can be created by combining smaller ones, although there
+; are shortcuts that can be used and this idiom only works if they haven't
+; been. Also, idioms later on can create shifts that cancel each other out, so
+; the code for cancelling them is here.
+[combinellshift]
+((_1 << #{1}2) << #{1}3)->(_1 << #{x2+x3}0)
+[combinelrshift]
+((_1 << #{1}2) >> #{x>x2}3)->(_1 >> #{x3-x2}0)
+((_1 << #{1}2) >> #{x==x2}3)->(_1)
+((_1 << #{1}2) >> #{x<x2}3)->(_1 << #{x2-x3}0)
+[combinerlshift]
+((_1 >> #{1}2) << #{x>x2}3)->(_1 << #{x3-x2}0)
+((_1 >> #{1}2) << #{x==x2}3)->(_1)
+((_1 >> #{1}2) << #{x<x2}3)->(_1 >> #{x2-x3}0)
+[combinerrshift]
+((_1 >> #{1}2) >> #{1}3)->(_1 >> #{x2+x3}0)
+[nullshift]
+(_1 >> #0)->(_1)
+(_1 << #0)->(_1)
+
+; INTERCAL logical values are 1 and 2.
+[xorto1or2]
+((?32(_1$#1)))->((_1)+#1)
+((?32(_1$#2)))->(#2-(_1))
+
+; Removing, combining and weakening unneeded C_ANDs
+[unneededand]
+(_1&#{!(c1&~x)}0)->(_1)
+(#{!(c1&~x)}0&_1)->(_1)
+[combineand]
+((_1&#{1}2)&#{1}3)->(_1&#{x2&x3}0)
+((#{1}2&_1)&#{1}3)->(_1&#{x2&x3}0)
+(#{1}3&(_1&#{1}2))->(_1&#{x2&x3}0)
+(#{1}3&(#{1}2&_1))->(_1&#{x2&x3}0)
+[weakenand]
+(_1&#{(~c1)&x}2)->(_1&#{c1&x2}0)
+(#{(~c1)&x}2&_1)->(_1&#{c1&x2}0)
+
+; 32-bit complements
+
+; Complement odd bits, zero even bits
+[com1z0]
+(((?32(_1|#1431655765))�)<<#1)->((_1�)^#2863311530)
+(((?32(#1431655765|_1))�)<<#1)->((_1�)^#2863311530)
+((#1431655765&(?32(_1|#1431655765)))<<#1)->((_1�)^#2863311530)
+((#1431655765&(?32(#1431655765|_1)))<<#1)->((_1�)^#2863311530)
+; Complement even bits, zero odd bits
+[com0z1]
+((?32(((_1�)<<#1)|#1431655765))�)
+->((_1�)^#1431655765)
+((?32(((#1431655765&_1)<<#1)|#1431655765))�)
+->((_1�)^#1431655765)
+((?32(#1431655765|((_1�)<<#1)))�)
+->((_1�)^#1431655765)
+((?32(#1431655765|((#1431655765&_1)<<#1)))�)
+->((_1�)^#1431655765)
+(#1431655765&(?32(((_1�)<<#1)|#1431655765)))
+->((_1�)^#1431655765)
+(#1431655765&(?32(((#1431655765&_1)<<#1)|#1431655765)))
+->((_1�)^#1431655765)
+(#1431655765&(?32(#1431655765|((_1�)<<#1))))
+->((_1�)^#1431655765)
+(#1431655765&(?32(#1431655765|((#1431655765&_1)<<#1))))
+->((_1�)^#1431655765)
+; 32-bit complements, in full
+[cnot5]
+(((:1&#{1}2)^#{x==x2}0)|((:1&#{(x^x2)==4294967295LU}3)^#{x==x3}0))->(~32 :1)
+
+; Distributive laws
+
+; Several of these laws go towards helping finish off 32-bit C binary logical
+; operations, but are useful in other places as well (especially distributions
+; involving shifts).
+[distribll]
+((_1&_3)&(_2&_3))->((_1&_2)&_3)
+((_1|_3)&(_2|_3))->((_1&_2)|_3)
+((_1&_3)|(_2&_3))->((_1|_2)&_3)
+((_1|_3)|(_2|_3))->((_1|_2)|_3)
+((_1&_3)^(_2&_3))->((_1^_2)&_3)
+((_1<<_3)&(_2<<_3))->((_1&_2)<<_3)
+((_1<<_3)|(_2<<_3))->((_1|_2)<<_3)
+((_1<<_3)^(_2<<_3))->((_1^_2)<<_3)
+((_1>>_3)&(_2>>_3))->((_1&_2)>>_3)
+((_1>>_3)|(_2>>_3))->((_1|_2)>>_3)
+((_1>>_3)^(_2>>_3))->((_1^_2)>>_3)
+[distribrl]
+((_3&_1)&(_2&_3))->((_1&_2)&_3)
+((_3|_1)&(_2|_3))->((_1&_2)|_3)
+((_3&_1)|(_2&_3))->((_1|_2)&_3)
+((_3|_1)|(_2|_3))->((_1|_2)|_3)
+((_3&_1)^(_2&_3))->((_1^_2)&_3)
+[distriblr]
+((_1&_3)&(_3&_2))->((_1&_2)&_3)
+((_1|_3)&(_3|_2))->((_1&_2)|_3)
+((_1&_3)|(_3&_2))->((_1|_2)&_3)
+((_1|_3)|(_3|_2))->((_1|_2)|_3)
+((_1&_3)^(_3&_2))->((_1^_2)&_3)
+[distribrr]
+((_3&_1)&(_3&_2))->((_1&_2)&_3)
+((_3|_1)&(_3|_2))->((_1&_2)|_3)
+((_3&_1)|(_3&_2))->((_1|_2)&_3)
+((_3|_1)|(_3|_2))->((_1|_2)|_3)
+((_3&_1)^(_3&_2))->((_1^_2)&_3)
+[distribunary]
+((!_1)&(!_2))->(!(_1|_2))
+
+; 32-bit C binary logical operations
+
+; Strangely enough, these can be done for the most part with the combined
+; effect of many small optimizations (of course, that's the best way to do it).
+; The only potential problem is that the distributive law isn't quite general
+; enough for some cases involving constants, and for some cases where one side
+; or the other is known to have no set evenbits or no set oddbits.
+; Some generalised versions of the distributive law are needed here.
+; Unfortunately, there are lots of binary operators here that need to be
+; written both ways round. The 96 cases that follow, combined with weakenand,
+; should be enough for all but the most pathological cases.
+[distribhalfxoroveror1]
+(((_1 ^ _2) & _3) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_1 ^ _2) & _3))->((_1 ^ _2) & (_3 | _4))
+(((_1 ^ _2) & _3) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_1 ^ _2) & _3))->((_1 ^ _2) & (_3 | _4))
+((_3 & (_1 ^ _2)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_3 & (_1 ^ _2)))->((_1 ^ _2) & (_3 | _4))
+((_3 & (_1 ^ _2)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_3 & (_1 ^ _2)))->((_1 ^ _2) & (_3 | _4))
+(((_2 ^ _1) & _3) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_2 ^ _1) & _3))->((_1 ^ _2) & (_3 | _4))
+(((_2 ^ _1) & _3) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_2 ^ _1) & _3))->((_1 ^ _2) & (_3 | _4))
+((_3 & (_2 ^ _1)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_3 & (_2 ^ _1)))->((_1 ^ _2) & (_3 | _4))
+((_3 & (_2 ^ _1)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_3 & (_2 ^ _1)))->((_1 ^ _2) & (_3 | _4))
+[distribhalfxoroveror2]
+(((_1 & _3) ^ _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_1 & _3) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4))
+(((_1 & _3) ^ _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_1 & _3) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==c}2 ^ (_1 & _3)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 ^ (_1 & _3)))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==c}2 ^ (_1 & _3)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 ^ (_1 & _3)))->((_1 ^ _2) & (_3 | _4))
+(((_3 & _1) ^ _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_3 & _1) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4))
+(((_3 & _1) ^ _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_3 & _1) ^ _{(c&c3)==c}2))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==c}2 ^ (_3 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 ^ _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 ^ (_3 & _1)))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==c}2 ^ (_3 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 ^ _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 ^ (_3 & _1)))->((_1 ^ _2) & (_3 | _4))
+[distribhalforoveror1]
+(((_1 | _2) & _3) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_1 | _2) & _3))->((_1 | _2) & (_3 | _4))
+(((_1 | _2) & _3) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_1 | _2) & _3))->((_1 | _2) & (_3 | _4))
+((_3 & (_1 | _2)) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_3 & (_1 | _2)))->((_1 | _2) & (_3 | _4))
+((_3 & (_1 | _2)) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_3 & (_1 | _2)))->((_1 | _2) & (_3 | _4))
+(((_2 | _1) & _3) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_2 | _1) & _3))->((_1 | _2) & (_3 | _4))
+(((_2 | _1) & _3) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_2 | _1) & _3))->((_1 | _2) & (_3 | _4))
+((_3 & (_2 | _1)) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_3 & (_2 | _1)))->((_1 | _2) & (_3 | _4))
+((_3 & (_2 | _1)) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_3 & (_2 | _1)))->((_1 | _2) & (_3 | _4))
+[distribhalforoveror2]
+(((_1 & _3) | _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_1 & _3) | _{(c&c3)==c}2))->((_1 | _2) & (_3 | _4))
+(((_1 & _3) | _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_1 & _3) | _{(c&c3)==c}2))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==c}2 | (_1 & _3)) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 | (_1 & _3)))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==c}2 | (_1 & _3)) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 | (_1 & _3)))->((_1 | _2) & (_3 | _4))
+(((_3 & _1) | _{(c&c3)==c}2) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_3 & _1) | _{(c&c3)==c}2))->((_1 | _2) & (_3 | _4))
+(((_3 & _1) | _{(c&c3)==c}2) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_3 & _1) | _{(c&c3)==c}2))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==c}2 | (_3 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 | _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_{(c&c3)==c}2 | (_3 & _1)))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==c}2 | (_3 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 | _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_{(c&c3)==c}2 | (_3 & _1)))->((_1 | _2) & (_3 | _4))
+[distribhalfandoveror1]
+(((_1 & _2) & _3) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_1 & _2) & _3))->((_1 & _2) & (_3 | _4))
+(((_1 & _2) & _3) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_1 & _2) & _3))->((_1 & _2) & (_3 | _4))
+((_3 & (_1 & _2)) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_3 & (_1 & _2)))->((_1 & _2) & (_3 | _4))
+((_3 & (_1 & _2)) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_3 & (_1 & _2)))->((_1 & _2) & (_3 | _4))
+(((_2 & _1) & _3) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_2 & _1) & _3))->((_1 & _2) & (_3 | _4))
+(((_2 & _1) & _3) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_2 & _1) & _3))->((_1 & _2) & (_3 | _4))
+((_3 & (_2 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_3 & (_2 & _1)))->((_1 & _2) & (_3 | _4))
+((_3 & (_2 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_3 & (_2 & _1)))->((_1 & _2) & (_3 | _4))
+[distribhalfandoveror2]
+(((_1 & _3) & _2) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_1 & _3) & _2))->((_1 & _2) & (_3 | _4))
+(((_1 & _3) & _2) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_1 & _3) & _2))->((_1 & _2) & (_3 | _4))
+((_2 & (_1 & _3)) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_2 & (_1 & _3)))->((_1 & _2) & (_3 | _4))
+((_2 & (_1 & _3)) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_2 & (_1 & _3)))->((_1 & _2) & (_3 | _4))
+(((_3 & _1) & _2) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | ((_3 & _1) & _2))->((_1 & _2) & (_3 | _4))
+(((_3 & _1) & _2) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | ((_3 & _1) & _2))->((_1 & _2) & (_3 | _4))
+((_2 & (_3 & _1)) | (_1 & _{(c&c3)==0}4))->((_1 & _2) & (_3 | _4))
+((_1 & _{(c&c3)==0}4) | (_2 & (_3 & _1)))->((_1 & _2) & (_3 | _4))
+((_2 & (_3 & _1)) | (_{(c&c3)==0}4 & _1))->((_1 & _2) & (_3 | _4))
+((_{(c&c3)==0}4 & _1) | (_2 & (_3 & _1)))->((_1 & _2) & (_3 | _4))
+
+; A right-shift idiom in syslib that was written in an unneccessarily complex
+; way, by doing the bits separately the same way as left-shifts have to be done
+; (of course, select can right-shift by any difference without much trouble);
+; the ick_next idiom is a helper for that. Previous code produced a warning when
+; this idiom was used, but the optimizer has now been enhanced to the extent
+; that it can deal with it without much special-casing, and therefore there's
+; no way now to tell that that case is being used, so the warning has been
+; removed.
+; lshift32half done in the other direction; note that the large constant here
+; is 0x55555554, not the all-5s number
+[rshift32half]
+((_1~#1431655764)$#0)->((_1�)>>#1)
+; and piecing together this with selectmingle4 gives the syslib idiom, which
+; optimizes through distributions over C_OR and then constant folding
+
+; When a 0 is on one side of a C binary logic operation, or the two sides are
+; the same, simplification is often possible. The and-0 case has been dealt
+; with already.
+[noopor]
+(_1|#0)->(_1)
+(#0|_1)->(_1)
+[noopxor]
+(_1^#0)->(_1)
+(#0^_1)->(_1)
+[anditself]
+(_1&_1)->(_1)
+[oritself]
+(_1|_1)->(_1)
+[xoritself]
+(_1^_1)->(#0)
+
+; Equality and inequality
+[xortoequal]
+(!(_1^_2))->(_1==_2)
+[negatingequal]
+(!(_1==_2))->(_1!=_2)
+(!(_1!=_2))->(_1==_2)
+
+; Greater than and less than
+[greaterthan32]
+((_1~:2)~((?32(:2~:2))^#2147483648))->(_1>(:2^_1))
+((_1~:2)~(#2147483648^(?32(:2~:2))))->(_1>(:2^_1))
+[greaterthan16]
+((_1~.2)~((?16(.2~.2))^#32768))->(_1>(.2^_1))
+((_1~.2)~(#32768^(?16(.2~.2))))->(_1>(.2^_1))
+
+; Consistency in C logical operation nesting, when it doesn't matter
+[xoroutsideand]
+((_1^_2)&_2)->((_1&_2)^_2)
+(_2&(_1^_2))->((_1&_2)^_2)
+((_2^_1)&_2)->((_1&_2)^_2)
+(_2&(_2^_1))->((_1&_2)^_2)
+
+; Boolean algebra, on 0s and 1s or on 1s and 2s. Unary bitwidth is irrelevant.
+[booleannot]
+(_{c==1}1^#1)->(!_1)
+[not21]
+(#2-(!(_{c==1}1)))->(_1+#1)
+(#1+(!(_{c==1}1)))->(#2-_1)
+((!(_{c==1}1))+#1)->(#2-_1)
+[nullmingle]
+(#0$_{c==1}1)->(_1)
#include <string.h>
#include "ick.h"
#include "parser.h"
-#include "lose.h"
+#include "ick_lose.h"
/*#undef wchar_t*/
/*#define wchar_t unsigned char*/
static char *lineptr = linebuf;
-bool re_send_token = FALSE;
+ick_bool re_send_token = ick_FALSE;
int lexer(void);
static int myatoi(char *text);
/* AIS: Keep track of the spark/ears situation */
#define STACKSPARKEARS(a) \
- if (sparkearslev+1>=SENESTMAX*32) lose(E281, iyylineno, (char*) NULL); \
+ if (sparkearslev+1>=SENESTMAX*32) ick_lose(IE281, iyylineno, (char*) NULL); \
sparkearslev++; sparkearsstack[sparkearslev/32]<<=1; \
sparkearsstack[sparkearslev/32]+=a
#define CLEARSPARKEARSTACK {int i=SENESTMAX; \
{
extern FILE* yyin;
- static bool bangflag = FALSE;
- static bool backflag = FALSE;
+ static ick_bool bangflag = ick_FALSE;
+ static ick_bool backflag = ick_FALSE;
if (bangflag)
{
- bangflag = FALSE;
+ bangflag = ick_FALSE;
/* *lineptr++ = '!'; */
return('.');
}
else if (backflag) /* converting ctrl-H (backspace) to two chars "^H" */
{
- backflag = FALSE;
+ backflag = ick_FALSE;
/* *lineptr++ = '\b'; */
return('H');
}
c_char=0; /* AIS */
(void)fread(&c_char,1,1,fp);
- /* AIS: ignore the first \r in a row to deal with DOS newlines. The
+ /* AIS: ignore the ick_first \r in a row to deal with DOS newlines. The
second in a row is definitely an error, though, and will be caught
later on. */
if(c_char=='\r') (void)fread(&c_char,1,1,fp);
if (c == '!')
{
*lineptr++ = '!';
- bangflag = TRUE;
+ bangflag = ick_TRUE;
return(c = '\'');
}
else if (c == '\b') /* convert ctrl-H (backspace) to
two chars "^" and "H" so lex can take it */
{
*lineptr++ = '\b';
- backflag = TRUE;
+ backflag = ick_TRUE;
return(c = '^');
}
else if (c == '\n')
else
textlines = malloc(textlinecount * sizeof(char*));
if (!textlines)
- lose(E666, iyylineno, (char *)NULL);
+ ick_lose(IE666, iyylineno, (char *)NULL);
}
textlines[iyylineno] = malloc(1 + strlen(linebuf));
if (!textlines[iyylineno])
- lose(E666, iyylineno, (char *)NULL);
+ ick_lose(IE666, iyylineno, (char *)NULL);
strcpy(textlines[iyylineno], linebuf);
iyylineno++;
return('\n');
{D} {yylval.numval = myatoi(yytext); return(NUMBER);}
\_ {return(NOSPOT);}
-\. {return(ONESPOT);}
-\: {return(TWOSPOT);}
-\, {return(TAIL);}
-\; {return(HYBRID);}
+\. {return(ick_ONESPOT);}
+\: {return(ick_TWOSPOT);}
+\, {return(ick_TAIL);}
+\; {return(ick_HYBRID);}
\# {return(MESH);}
\xBD |
"c^H/" |
-"c^H|" {return(MINGLE); /* AIS: CLC-INTERCAL mingle symbols.
+"c^H|" {return(MINGLE); /* AIS: CLC-INTERCAL ick_mingle symbols.
The \xBD is ISO-8859-1 for cent. */}
\$ |
\xA2 |
if (yylval.numval && yylval.numval < 100)
return(OHOHSEVEN);
else
- lose(E017, iyylineno, (char *)NULL);}
+ ick_lose(IE017, iyylineno, (char *)NULL);}
SUB {return(SUB);}
MULTIPLICATUS{W}A |
BY {return(BY);}
NEXT{W}FROM{W}\({W}{D}\) {/* AIS */ yylval.numval = myatoi(yytext);
return(NEXTFROMLABEL);}
DEINDERE{W}A |
-NEXT{W}FROM {/* AIS: 'next' is not a verb, so the Latin is invented */
+NEXT{W}FROM {/* AIS: 'ick_next' is not a verb, so the Latin is invented */
return(NEXTFROMEXPR);}
DEINDENDUM |
NEXTING{W}FROM {/* AIS */ yylval.numval = NEXTFROMLABEL; return(GERUND);}
static int tok = BADCHAR;
if (re_send_token)
- re_send_token = FALSE;
+ re_send_token = ick_FALSE;
else
{
tok = yylex();
}
#ifdef MAIN
-int main(void)
+int ick_main(void)
{
int t;
+++ /dev/null
-/*
- *
- * NAME
- * lose.c -- report INTERCAL compile- or run-time error
- *
-LICENSE TERMS
- Copyright (C) 1996 Eric S. Raymond
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-/*LINTLIBRARY*/
-#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include "lose.h"
-
-int coreonerr = 0; /* AIS */
-
-int checkforbugs; /* AIS */
-
-void lose(char *m, int n, char *s)
-{
- (void) fflush(stdout); /* AIS: To stop stdout getting muddled with stderr*/
- (void) fprintf(stderr,
- "ICL%c%c%cI\t",
- m[0], m[1], m[2]);
- if (s)
- (void) fprintf(stderr, m + 4, s, n);
- else
- (void) fprintf(stderr, m + 4, n);
- (void) fprintf(stderr, " CORRECT SOURCE AND RESUBNIT\n");
- if(atoi(m)==778&&coreonerr) /* AIS */
- {
- /* AIS: Dump core. */
- raise(SIGABRT);
- }
- exit(atoi(m));
-}
-
-/* AIS: This function reports potential bugs. It's paraphrased from lose. */
-void lwarn(char *m, int n, char *s)
-{
- if(!checkforbugs) return; /* Don't report a potential bug without -l */
- (void) fflush(stdout);
- (void) fprintf(stderr,
- "ICL%c%c%cW\t",
- m[0],m[1],m[2]);
- if (s)
- (void) fprintf(stderr, m + 4, s, n);
- else if(m[0]!='2'||m[1]!='7'||m[2]!='8')
- (void) fprintf(stderr, m + 4, n);
- else
- (void) fprintf(stderr, m + 4);
- (void) fprintf(stderr, " RECONSIDER SOURCE AND RESUBNIT\n\n");
- /* Don't exit. This is not any error except one not causing immediate
- termination of program execution. */
-}
-
-/* lose.c ends here */
+++ /dev/null
-/* lose.h --- error message strings */
-
-/*
- * Note: these error message texts, with one exception, are direct from
- * the Princeton compiler (INTERCAL-72) sources (transmitted by Don Woods).
- * The one exception is E632, which in INTERCAL-72 had the error message
- * PROGRAM ATTEMPTED TO EXIT WITHOUT ERROR MESSAGE
- * 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 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. */
-#define E000 "000 %s\n\
- ON THE WAY TO %d\n"
-/* An expression contains a syntax error. */
-#define E017 "017 DO YOU EXPECT ME TO FIGURE THIS OUT?\n\
- ON THE WAY TO %d\n"
-/* Improper use has been made of statement identifiers. */
-#define E079 "079 PROGRAMMER IS INSUFFICIENTLY POLITE\n\
- ON THE WAY TO %d\n"
-/* Improper use has been made of statement identifiers. */
-#define E099 "099 PROGRAMMER IS OVERLY POLITE\n\
- ON THE WAY TO %d\n"
-/* Program has attempted 80 levels of NEXTing */
-#define E123 "123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON\n\
- ON THE WAY TO %d\n"
-/* Program has attempted to transfer to a non-existent line label */
-#define E129 "129 PROGRAM HAS GOTTEN LOST\n\
- ON THE WAY TO WHO KNOWS WHERE\n"
-/* An ABSTAIN or REINSTATE statement references a non-existent line label */
-#define E139 "139 I WASN'T PLANNING TO GO THERE ANYWAY\n\
- ON THE WAY TO %d\n"
-/* A line label has been multiply defined. */
-#define E182 "182 YOU MUST LIKE THIS LABEL A LOT!\n\
- ON THE WAY TO %d\n"
-/* An invalid line label has been encountered. */
-#define E197 "197 SO! 65535 LABELS AREN'T ENOUGH FOR YOU?\n\
- ON THE WAY TO %d\n"
-/* An expression involves an unidentified variable. */
-#define E200 "200 NOTHING VENTURED, NOTHING GAINED\n\
- ON THE WAY TO %d\n"
-/* An attempt has been made to give an array a dimension of zero. */
-#define E240 "240 ERROR HANDLER PRINTED SNIDE REMARK\n\
- ON THE WAY TO %d\n"
-/* Invalid dimensioning information was supplied
- * in defining or using an array. */
-#define E241 "241 VARIABLES MAY NOT BE STORED IN WEST HYPERSPACE\n\
- ON THE WAY TO %d\n"
-/* A 32-bit value has been assigned to a 16-bit variable. */
-#define E275 "275 DON'T BYTE OFF MORE THAN YOU CAN CHEW\n\
- ON THE WAY TO %d\n"
-/* A retrieval has been attempted for an unSTASHed value. */
-#define E436 "436 THROW STICK BEFORE RETRIEVING!\n\
- ON THE WAY TO %d\n"
-/* A WRITE IN statement or interleave ($) operation
- * has produced value requiring over 32 bits to represent. */
-#define E533 "533 YOU WANT MAYBE WE SHOULD IMPLEMENT 64-BIT VARIABLES?\n\
- ON THE WAY TO %d\n"
-/* Insufficient data. (raised by reading past EOF) */
-#define E562 "562 I DO NOT COMPUTE\n\
- ON THE WAY TO %d\n"
-/* Input data is invalid. */
-#define E579 "579 WHAT BASE AND/OR LANGUAGE INCLUDES %s?\n\
- ON THE WAY TO %d\n"
-/* The expression of a RESUME statement evaluated to #0. */
-#define E621 "621 ERROR TYPE 621 ENCOUNTERED\n\
- ON THE WAY TO %d\n"
-/* Program execution terminated via a RESUME statement instead of GIVE UP. */
-#define E632 "632 THE NEXT STACK RUPTURES. ALL DIE. OH, THE EMBARRASSMENT!\n\
- ON THE WAY TO %d\n"
-/* Execution has passed beyond the last statement of the program. */
-#define E633 "633 PROGRAM FELL OFF THE EDGE\n\
- ON THE WAY TO THE NEW WORLD\n"
-/* A compiler error has occurred (see section 8.1). */
-#define E774 "774 RANDOM COMPILER BUG\n\
- ON THE WAY TO %d\n"
-/* An unexplainable compiler error has occurred (see J. Lyon or D. Woods). */
-#define E778 "778 UNEXPLAINED COMPILER BUG\n\
- ON THE WAY TO %d\n"
-
-/*
- * These errors are unique to C-INTERCAL.
- */
-/* You tried to use a C-INTERCAL extension with the `traditional' flag on */
-#define E111 "111 COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING\n\
- ON THE WAY TO %d\n"
-/* Cannot find the magically included system library */
-#define E127 "127 SAYING 'ABRACADABRA' WITHOUT A MAGIC WAND WON'T DO YOU ANY GOOD\n\
- ON THE WAY TO THE CLOSET\n"
-/* Out of stash space */
-#define E222 "222 BUMMER, DUDE!\n\
- ON THE WAY TO %d\n"
-/* (AIS) Out of memory during I/O */
-#define E252 "252 I'VE FORGOTTEN WHAT I WAS ABOUT TO SAY\n\
- ON THE WAY TO %d\n"
-/* (AIS) Can't reverse an expression in an assignment. This is the
- same error number as in CLC-INTERCAL, but the message is different. */
-#define E277 "277 YOU CAN ONLY DISTORT THE LAWS OF MATHEMATICS SO FAR\n\
- ON THE WAY TO %d\n"
-/* (AIS) The spark/ears nesting is too deep. */
-#define E281 "281 THAT MUCH QUOTATION AMOUNTS TO PLAGIARISM\n\
- ON THE WAY TO %d\n"
-/* Too many variables. */
-#define E333 "333 YOU CAN'T HAVE EVERYTHING, WHERE WOULD YOU PUT IT?\n\
- ON THE WAY TO %d\n"
-/* (AIS, from the suggestion by Malcom Ryan)
- GO BACK or GO AHEAD was executed without a choicepoint. */
-#define E404 "404 I'M ALL OUT OF CHOICES!\n\
- ON THE WAY TO %d\n"
-/* (AIS) WHILE, MAYBE, GO BACK, or GO AHEAD used without the -m option. */
-#define E405 "405 PROGRAM REJECTED FOR MENTAL HEALTH REASONS\n\
- ON THE WAY TO %d\n"
-/* A COME FROM statement references a non-existent line label. */
-#define E444 "444 IT CAME FROM BEYOND SPACE\n\
- ON THE WAY TO %d\n"
-/* More than one COME FROM references the same label. */
-#define E555 "555 FLOW DIAGRAM IS EXCESSIVELY CONNECTED\n\
- ON THE WAY TO %d\n"
-/* Too many source lines. */
-#define E666 "666 COMPILER HAS INDIGESTION\n\
- ON THE WAY TO %d\n"
-/* No such source file. */
-#define E777 "777 A SOURCE IS A SOURCE, OF COURSE, OF COURSE\n\
- ON THE WAY TO %d\n"
-/* Can't open C output file */
-#define E888 "888 I HAVE NO FILE AND I MUST SCREAM\n\
- ON THE WAY TO %d\n"
-/* Can't open C skeleton file. */
-#define E999 "999 NO SKELETON IN MY CLOSET, WOE IS ME!\n\
- ON THE WAY TO %d\n"
-/* Source file name with invalid extension (use .i or .[3-7]i). */
-#define E998 "998 EXCUSE ME,\n\
- YOU MUST HAVE ME CONFUSED WITH SOME OTHER COMPILER\n"
-/* Illegal possession of a controlled unary operator. */
-#define E997 "997 ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR.\n\
- ON THE WAY TO %d\n"
-/* (AIS) Command found after TRY AGAIN. */
-#define E993 "993 I GAVE UP LONG AGO\n\
- ON THE WAY TO %d\n"
-/* (AIS) Memory allocation failure during multithreading */
-#define E991 "991 YOU HAVE TOO MUCH ROPE TO HANG YOURSELF\n\
- ON THE WAY TO %d\n"
-/* (AIS) Unimplemented feature used. This should never come up, hopefully. */
-#define E995 "995 DO YOU REALLY EXPECT ME TO HAVE IMPLEMENTED THAT?\n\
- ON THE WAY TO %d\n"
-/*
- * AIS: These errors are specific to PIC-INTERCAL
- */
-/* (AIS) Attempted to use an unsupported language feature. */
-#define E256 "256 THAT'S TOO HARD FOR MY TINY BRAIN\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) Attempted to use a PIC feature in a non-PIC program. */
-#define E652 "652 HOW DARE YOU INSULT ME!\n\
- ON THE WAY TO %d\n"
-
-/*
- * AIS: These errors are generated by the yuk debugger
- */
-/* (AIS) fgets' buffer overflowed on debugger comand input. */
-#define E810 "810 ARE ONE-CHARACTER COMMANDS TOO SHORT FOR YOU?\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) Too many breakpoints. */
-#define E811 "811 PROGRAM IS TOO BADLY BROKEN TO RUN\n\
- ON THE WAY TO %d\n"
-
-/*
- * (AIS) Warnings produced by -l.
- */
-
-/* (AIS) Non-INTERCAL-72 identifier used. */
-#define W112 "112 THAT RELIES ON THE NEW WORLD ORDER\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) That stupid idiom in syslib was used. */
-#define W128 "128 SYSLIB IS OPTIMIZED FOR OBFUSCATION\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) Possibly nonportable unary operator. */
-#define W534 "534 KEEP LOOKING AT THE TOP BIT\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) Expression still contains INTERCAL operators after
- optimization. Only in binary, because this nearly always
- happens in the higher bases. Syslib causes quite a lot of
- these. This warning is fine on INTERCAL-like lines, but
- flags a mistake on lines that are meant to be translations
- of C. */
-#define W018 "018 THAT WAS MEANT TO BE A JOKE\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) Possible misplaced unary operator. At the moment, ick -l cannot
- detect this condition (so it never comes up). It's meant to detect
- expressions like '?"?.1~#256"$#2'~#3 (from numio.i); in this expression,
- the second what has no effect (it changes only the msb of the immediately
- surrounding expression, which is eventually filtered out by the select
- against #3). But detecting this would probably require code that could
- check which bits of a result were going to be used elsewhere in an
- expression, which is something I haven't written yet (but would make
- a decent optimize_pass3). */
-#define W016 "016 DON'T TYPE THAT SO HASTILY\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) Possibly overflowing assignment or mingle. Syslib causes some of
- these too, in complicated situations where the bugcatcher can't figure
- out what's happening, and also in a few blatant statements in the mould
- of DO .3 <- :3, which are quite clearly possible overflows. Strangely
- enough, there's a commented-out section of code in feh.c that suggests
- that someone tried to make this an error (using a more general check
- which would have caught more correct code involving GETS, but none
- involving $). As a middle ground, I've made it an -l warning. */
-#define W276 "276 YOU CAN'T EXPECT ME TO CHECK BACK THAT FAR\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) A line will inevitably cause an expression-reversal failure. */
-#define W278 "278 FROM A CONTRADICTION, ANYTHING FOLLOWS\n\
- ON THE WAY TO A HUGE DISASTER\n"
-
-/* (AIS) The two following warnings are both compile-time traps for
- near-certain runtime errors. As such, they have similar numbers
- and similar messages. In fact, they're a shameless ripoff of the
- originals, but should serve as a reminder for anyone aware of the
- original messages. */
-/* (AIS) Dimension given for an array will come out as #0. */
-#define W239 "239 WARNING HANDLER PRINTED SNIDE REMARK\n\
- ON THE WAY TO %d\n"
-
-/* (AIS) RESUME argument will come out as #0. */
-#define W622 "622 WARNING TYPE 622 ENCOUNTERED\n\
- ON THE WAY TO %d\n"
-
-extern int lineno;
-
-extern void lose(char *m, int n, char *s);
-
-extern void lwarn(char *m, int n, char *s);
-
-/* lose.h ends here */
* Nahuatl, Tagalog, Sanskrit, Basque, Georgian, Kwakiutl, and
* Volap\"uk are now supported in addition to English.
*
- * As of release 0.18, Volap\"uk digits can be entered in either traditional
+ * As of release 0.18, Volap\"uk digits can be entered in either ick_traditional
* Tex format, Latin-1, or UTF-8. Latin is also now a supported language,
* to fulfill the requirement for Ancient Roman localization.
*
}
numeral;
-numeral numerals[] =
+numeral ick_numerals[] =
{
/* English */
{ "OH", 0 },
--- /dev/null
+/* Name mangling for compiled OIL programs.
+ Copyright (C) Alex Smith 2008
+ See oil.y for copyright conditions. */
+
+#define Base ick_Base
+#define Large_digits ick_Large_digits
+#define Max_large ick_Max_large
+#define Max_small ick_Max_small
+#define Small_digits ick_Small_digits
+#define and16 ick_and16
+#define and32 ick_and32
+#define aref ick_aref
+#define assign ick_assign
+#define binin ick_binin
+#define binout ick_binout
+#define bitencout ick_bitencout
+#define br_trans ick_br_trans
+#define cesspoolin ick_cesspoolin
+#define cesspoolout ick_cesspoolout
+#define checkforbugs ick_checkforbugs
+#define clc_cset_atari ick_clc_cset_atari
+#define clc_cset_baudot ick_clc_cset_baudot
+#define clc_cset_convert ick_clc_cset_convert
+#define clc_cset_ebcdic ick_clc_cset_ebcdic
+#define clc_cset_hardcoderead ick_clc_cset_hardcoderead
+#define clc_cset_latin1 ick_clc_cset_latin1
+#define clc_cset_load ick_clc_cset_load
+#define clc_cset_ptr ick_clc_cset_ptr
+#define clcsem ick_clcsem
+#define clcsemantics ick_clcsemantics
+#define clockface ick_clockface
+#define coreonerr ick_coreonerr
+#define cset_recent ick_cset_recent
+#define csetow ick_csetow
+#define datadir ick_datadir
+#define debfopen ick_debfopen
+#define fin ick_fin
+#define fin16 ick_fin16
+#define fin32 ick_fin32
+#define findandfopen ick_findandfopen
+#define findandfreopen ick_findandfreopen
+#define findandtestopen ick_findandtestopen
+#define first ick_first
+#define globalargv0 ick_globalargv0
+#define iselect ick_iselect
+#define lineno ick_lineno
+#define lose ick_lose
+#define lwarn ick_lwarn
+#define mingle ick_mingle
+#define multicome0 ick_multicome0
+#define mystery ick_mystery
+#define mysteryc ick_mysteryc
+#define next ick_next
+#define nextindex ick_nextindex
+#define numerals ick_numerals
+#define or16 ick_or16
+#define or32 ick_or32
+#define parseargs ick_parseargs
+#define pin ick_pin
+#define popnext ick_popnext
+#define pout ick_pout
+#define printflow ick_printflow
+#define printfopens ick_printfopens
+#define pushnext ick_pushnext
+#define resize ick_resize
+#define resume ick_resume
+#define retrieve ick_retrieve
+#define rev_and16 ick_rev_and16
+#define rev_and32 ick_rev_and32
+#define rev_fin16 ick_rev_fin16
+#define rev_fin32 ick_rev_fin32
+#define rev_or16 ick_rev_or16
+#define rev_or32 ick_rev_or32
+#define rev_whirl16 ick_rev_whirl16
+#define rev_whirl32 ick_rev_whirl32
+#define rev_xor16 ick_rev_xor16
+#define rev_xor32 ick_rev_xor32
+#define roll ick_roll
+#define rotleft16 ick_rotleft16
+#define rotleft32 ick_rotleft32
+#define setbitcount ick_setbitcount
+#define smudgeleft ick_smudgeleft
+#define smudgeright ick_smudgeright
+#define stash ick_stash
+#define stashinit ick_stashinit
+#define traditional ick_traditional
+#define whirl ick_whirl
+#define whirl16 ick_whirl16
+#define whirl32 ick_whirl32
+#define wimp_mode ick_wimp_mode
+#define xor ick_xor
+#define xor16 ick_xor16
+#define xor32 ick_xor32
+#define xselx ick_xselx
/* Autoconf lets us know if we have _Bool available, usually. On DJGPP there's
an occasional bug that I haven't managed to reproduce that leaves
- SIZEOF_BOOL as the null string, so detect that first. */
+ SIZEOF_BOOL as the null string, so detect that ick_first. */
#if 100 - SIZEOF__BOOL - 1 == 101
/* The bug happened, so play safe. */
typedef int mybool;
#{x==1}3 A constant which equals 1 (number 3, for replacements)
Note that in the last example, the expression is written strictly in C;
for instance,
- #{iselect(x,x)==1}4
- would select a constant that's a power of 2 (iselect is the C name for the
+ #{ick_iselect(x,x)==1}4
+ would select a constant that's a power of 2 (ick_iselect is the C name for the
INTERCAL operation 'select').
.{c&0xfffffffe==0}5 A 16-bit expression (number 5, for replacements) which
has been analysed to not possibly have any bits other than the least
mybool treeshapecond(YYSTYPE v, mybool firstopt)
{
if(!v) return firstopt;
- /* To prevent possibly dereferencing a null pointer, check the root first */
+ /* To prevent possibly dereferencing a null pointer, check the root ick_first */
if(v->mustbemesh) /* it's a must-be-constant constraint */
{
printf(firstopt?" if((np":" &&\n (np");
void treerepgen(YYSTYPE v, YYSTYPE* refs, int* rc)
{
if(!v) return;
- /* We absolutely have to generate the root node first here, because otherwise
+ /* We absolutely have to generate the root node ick_first here, because otherwise
the nodes in question won't exist. */
if(v->nodetypename) /* Generate an intermediate node */
{
printf("->opcode=%s;\n tp",v->nodetypename);
gennodepath(v->depth,v->path);
printf("->width=%d;\n",v->width32?32:16);
- /* optdata will be filled in by checknodeactbits before the next idiom is
+ /* optdata will be filled in by checknodeactbits before the ick_next idiom is
tested; constant is irrelevant, lval and rval are NULL at present and
will be filled in by later recursions of this function, and I seriously
hope that nextslat is never filled in by an optimizer idiom. */
else if(v->replnum&&!(v->cxneeded))
{
/* Copy a node from the template. The node ought not to be allocated at
- this point, so we can safely just assign to it with a new malloced
+ this point, so we can safely just ick_assign to it with a new malloced
node. */
if(refs[v->replnum])
{
"/* machine-generated code; modify the corresponding .oil file\n"
" and recompile, not this one, to change this file */\n\n"
"#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n"
- "#include <signal.h>\n"
+ "#include <signal.h>\n#include \"oil.h\"\n"
"#include \"sizes.h\"\n#include \"ick.h\"\n#include \"parser.h\"\n"
- "#include \"fiddle.h\"\n#include \"lose.h\"\n#include \"feh.h\"\n\n"
+ "#include \"fiddle.h\"\n#include \"ick_lose.h\"\n#include \"feh.h\"\n\n"
"#define OPTING(x) if(optdebug == 2) {\\\n"
" explexpr(optdebugnode,stderr);\\\n"
" putc('\\n',stderr); } \\\n"
#include "sizes.h"
#include "ick.h"
#include "feh.h"
-#include "lose.h"
+#include "ick_lose.h"
extern int yyerror(char*);
-/* Intervene our first-stage lexer. */
+/* Intervene our ick_first-stage lexer. */
extern int lexer(void);
#define yylex() lexer()
else {thisline = stbeginline; stbeginline = 0;}}
#define ACTION(x, nt, nn) \
- {x = newtuple(); x->type = nt; x->lineno = thisline; x->u.node = nn;}
+ {x = newtuple(); x->type = nt; x->ick_lineno = thisline; x->u.node = nn;}
#define TARGET(x, nt, nn) \
- {x = newtuple(); x->type = nt; x->lineno = thisline; x->u.target = nn;}
+ {x = newtuple(); x->type = nt; x->ick_lineno = thisline; x->u.target = nn;}
#define ACTARGET(x, nt, nn, nn2)\
- {x = newtuple(); x->type = nt; x->lineno = thisline;\
+ {x = newtuple(); x->type = nt; x->ick_lineno = thisline;\
x->u.node = nn; x->u.target = nn2;}
/* AIS : The macro above was added for ABSTAIN expr FROM. */
#define NEWFANGLED mark112 = 1; /* AIS: Added the mention of mark112 */ \
- if (traditional) lose(E111,iyylineno,(char*)NULL); else
+ if (ick_traditional) ick_lose(IE111,iyylineno,(char*)NULL); else
#define DESTACKSE1 sparkearsstack[sparkearslev--/32] >>= 1
#define DESTACKSPARKEARS DESTACKSE1; DESTACKSE1
/* AIS: ONCE and AGAIN added, for multithread support; also, NOSPOT added,
so that I can reserve _ for future use (it's nowhere in the grammar yet) */
-%token MAYBE DO PLEASE NOT ONCE AGAIN MESH NOSPOT ONESPOT TWOSPOT TAIL HYBRID
+%token MAYBE DO PLEASE NOT ONCE AGAIN MESH NOSPOT ick_ONESPOT ick_TWOSPOT ick_TAIL ick_HYBRID
%token MINGLE SELECT /* AIS: SPARK EARS */ SUB BY BADCHAR
/* AIS: For operand overloading */
%token SLAT BACKSLAT
%token REV_WHIRL REV_WHIRL2 REV_WHIRL3 REV_WHIRL4 REV_WHIRL5
%type <node> expr limexpr varlist variable constant lvalue inlist outlist
-%type <node> subscr byexpr scalar scalar2s array initem outitem sublist
+%type <node> subscr byexpr scalar scalar2s ick_array initem outitem sublist
%type <node> unambig limunambig subscr1 sublist1 oparray osubscr osubscr1
%type <node> notanlvalue nlunambig lunambig
%type <tuple> preproc perform mtperform
| LABEL please OHOHSEVEN mtperform
{checklabel($1); $4->label = $1; $4->exechance = $2 * $3;}
| error
- {lose(E017, iyylineno, (char *)NULL);}
+ {ick_lose(IE017, iyylineno, (char *)NULL);}
;
/*
* AIS: added for the ONCE/AGAIN qualifiers. It copies a pointer to the tuple,
preproc : perform {$$ = $1;} /* the simple case */
| perform WHILE perform
{
- if(!multithread) lose(E405, iyylineno, (char*)NULL);
+ if(!multithread) ick_lose(IE405, iyylineno, (char*)NULL);
NEWFANGLED{
/* (x) DO a WHILE b
is equivalent to
temptuple->preproc=1; temptuple->setweave=-1; temptuple->exechance=-100;
politesse += 3; /* Keep the politeness checker happy */
ppinit(11); tupleswap(10,9); tupleswap(11,2); lineuid+=4; /* #2, #9 */
- tuples[lineno-10].onceagainflag=onceagain_AGAIN;
- tuples[lineno-1].onceagainflag=onceagain_AGAIN;
- $$=&(tuples[lineno-2]);
+ tuples[ick_lineno-10].onceagainflag=onceagain_AGAIN;
+ tuples[ick_lineno-1].onceagainflag=onceagain_AGAIN;
+ $$=&(tuples[ick_lineno-2]);
}}
/* There are two (AIS: now four) forms of preamble returned by the lexer */
/* Here's how to parse statement bodies */
perform : lvalue GETS expr {ACTION($$, GETS, cons(GETS,$1,$3));}
- | array GETS byexpr {ACTION($$, RESIZE, cons(RESIZE,$1,$3));}
+ | ick_array GETS byexpr {ACTION($$, RESIZE, cons(RESIZE,$1,$3));}
| notanlvalue GETS expr %prec LOWPREC
{/* AIS: This is for variableconstants, and an error otherwise.*/
if(variableconstants) ACTION($$, GETS, cons(GETS,$1,$3))
| ABSTAIN FROM LABEL {stbeginline=0; TARGET($$, ABSTAIN, $3);}
| ABSTAIN FROM gerunds {ACTION($$, DISABLE, rlist);}
| ABSTAIN expr FROM LABEL {/* AIS */ NEWFANGLED {stbeginline=0; ACTARGET($$, FROM, $2, $4);}}
- | ABSTAIN expr FROM gerunds {/* AIS */ NEWFANGLED {$$ = newtuple(); $$->type = MANYFROM; $$->lineno = thisline; \
+ | ABSTAIN expr FROM gerunds {/* AIS */ NEWFANGLED {$$ = newtuple(); $$->type = MANYFROM; $$->ick_lineno = thisline; \
{node* tempnode=newnode(); $$->u.node = tempnode; tempnode->lval=$2; tempnode->rval=rlist; tempnode->opcode=MANYFROM;}}}
| REINSTATE LABEL {stbeginline=0; TARGET($$, REINSTATE, $2);}
| REINSTATE gerunds {ACTION($$, ENABLE, rlist);}
;
/* OK, here's what a variable reference looks like */
-variable: scalar | array;
+variable: scalar | ick_array;
lvalue : scalar | subscr;
-scalar2s: TWOSPOT NUMBER /* AIS: for TWOSPOTs only */
+scalar2s: ick_TWOSPOT NUMBER /* AIS: for TWOSPOTs only */
{
$$ = newnode();
- $$->opcode = TWOSPOT;
- $$->constant = intern(TWOSPOT, $2);
+ $$->opcode = ick_TWOSPOT;
+ $$->constant = intern(ick_TWOSPOT, $2);
}
-scalar : ONESPOT NUMBER
+scalar : ick_ONESPOT NUMBER
{
$$ = newnode();
- $$->opcode = ONESPOT;
- $$->constant = intern(ONESPOT, $2);
+ $$->opcode = ick_ONESPOT;
+ $$->constant = intern(ick_ONESPOT, $2);
}
- | TWOSPOT NUMBER
+ | ick_TWOSPOT NUMBER
{
$$ = newnode();
- $$->opcode = TWOSPOT;
- $$->constant = intern(TWOSPOT, $2);
+ $$->opcode = ick_TWOSPOT;
+ $$->constant = intern(ick_TWOSPOT, $2);
}
;
-array : TAIL NUMBER
+ick_array : ick_TAIL NUMBER
{
$$ = newnode();
- $$->opcode = TAIL;
- $$->constant = intern(TAIL, $2);
+ $$->opcode = ick_TAIL;
+ $$->constant = intern(ick_TAIL, $2);
}
- | HYBRID NUMBER
+ | ick_HYBRID NUMBER
{
$$ = newnode();
- $$->opcode = HYBRID;
- $$->constant = intern(HYBRID, $2);
+ $$->opcode = ick_HYBRID;
+ $$->constant = intern(ick_HYBRID, $2);
}
;
/* Array with unary operator is a special intermediate case; these
nodes will be rearranged when the subscript list is added */
-oparray : TAIL UNARY NUMBER %prec UNARYPREC
+oparray : ick_TAIL UNARY NUMBER %prec UNARYPREC
{
$$ = newnode();
$$->opcode = $2;
$$->rval = newnode();
- $$->rval->opcode = TAIL;
- $$->rval->constant = intern(TAIL, $3);
+ $$->rval->opcode = ick_TAIL;
+ $$->rval->constant = intern(ick_TAIL, $3);
}
- | HYBRID UNARY NUMBER %prec UNARYPREC
+ | ick_HYBRID UNARY NUMBER %prec UNARYPREC
{
$$ = newnode();
$$->opcode = $2;
$$->rval = newnode();
- $$->rval->opcode = HYBRID;
- $$->rval->constant = intern(HYBRID, $3);
+ $$->rval->opcode = ick_HYBRID;
+ $$->rval->constant = intern(ick_HYBRID, $3);
}
;
constant: MESH NUMBER
{
/* enforce the 16-bit constant constraint */
- if ((unsigned int)$2 > Max_small)
- lose(E017, iyylineno, (char *)NULL);
+ if ((unsigned int)$2 > ick_Max_small)
+ ick_lose(IE017, iyylineno, (char *)NULL);
$$ = newnode();
$$->opcode = MESH;
if(variableconstants) /* AIS */
/* scalars and subscript exprs are permitted in WRITE IN lists */
/* new: arrays are also permitted to allow for bitwise I/0 */
-initem : scalar | subscr | array;
+initem : scalar | subscr | ick_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 */
-outitem : scalar | subscr | constant | array;
+outitem : scalar | subscr | constant | ick_array;
outlist : outitem INTERSECTION outlist {$$=cons(INTERSECTION,$1,$3);}
| outitem {$$=cons(INTERSECTION,$1,0);}
;
/* Now the gnarly part -- expression syntax */
-/* Support array dimension assignment */
+/* Support ick_array dimension assignment */
byexpr : expr BY byexpr {$$ = cons(BY, $1, $3);}
| expr {$$ = cons(BY, $1, 0);}
;
-/* Support array subscripts (as lvalues) */
+/* Support ick_array subscripts (as lvalues) */
subscr : subscr1 {$$ = $1;}
- | array SUB sublist {$$ = cons(SUB, $1, $3);}
+ | ick_array SUB sublist {$$ = cons(SUB, $1, $3);}
;
-subscr1 : array SUB sublist1 {$$ = cons(SUB, $1, $3);}
+subscr1 : ick_array SUB sublist1 {$$ = cons(SUB, $1, $3);}
;
sublist : unambig sublist {$$ = cons(INTERSECTION, $1, $2);}
| unambig sublist1 {$$ = cons(INTERSECTION, $1, $2);}
;
-preftype: MESH {$$=MESH; } | ONESPOT {$$=ONESPOT;} | TWOSPOT {$$=TWOSPOT;};
+preftype: MESH {$$=MESH; } | ick_ONESPOT {$$=ick_ONESPOT;} | ick_TWOSPOT {$$=ick_TWOSPOT;};
/* AIS: unambig split into limunambig (unambigs that don't start with a
unary operator), nlunambig (unambigs that aren't lvalues),
$$->rval->opcode = $1;
if($1 == MESH) {
/* enforce the 16-bit constant constraint */
- if ((unsigned int)$3 > Max_small)
- lose(E017, iyylineno, (char *)NULL);
+ if ((unsigned int)$3 > ick_Max_small)
+ ick_lose(IE017, iyylineno, (char *)NULL);
if(variableconstants) /* AIS */
$$->rval->constant = intern(MESH, $2);
else
{
tuple *sp;
int tok, i;
- extern bool re_send_token;
+ extern ick_bool re_send_token;
/*
* The idea
- * here is to skip to the next DO, PLEASE or label, then unget that token.
+ * here is to skip to the ick_next DO, PLEASE or label, then unget that token.
* which we can do with a tricky flag on the lexer (re_send_token).
*/
/* fprintf(stderr,"attempting to splat at line %d....\n",iyylineno); */
- for(i = 0,re_send_token = FALSE;;i++) {
+ for(i = 0,re_send_token = ick_FALSE;;i++) {
tok = lexer();
if (!tok)
{
- re_send_token = TRUE;
+ re_send_token = ick_TRUE;
tok = ' '; /* scanner must not see a NUL */
break;
}
else if (tok == DO || tok == PLEASE || tok == LABEL
/* AIS */ || tok == MAYBE) {
- re_send_token = TRUE;
+ re_send_token = ick_TRUE;
break;
}
}
+++ /dev/null
-/*****************************************************************************
-
-NAME
- parser.y -- grammar for the INTERCAL language
-
-DESCRIPTION
- This YACC grammar parses the INTERCAL language by designed by Don R. Woods
-and James M. Lyon. There are several syntax extensions over the original
-INTERCAL-72 language.
-
-LICENSE TERMS
- Copyright (C) 1996 Eric S. Raymond
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*****************************************************************************/
-
-%{
-#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "sizes.h"
-#include "ick.h"
-#include "feh.h"
-#include "lose.h"
-
-extern int yyerror(char*);
-
-/* Intervene our first-stage lexer. */
-extern int lexer(void);
-#define yylex() lexer()
-
-static node *rlist; /* pointer to current right-hand node list */
-/*static node *llist;*/ /* pointer to current left-hand node list */
-static node *np; /* variable for building node lists */
-
-extern int stbeginline; /* line number of last seen preamble */
-static int thisline; /* line number of beginning of current statement */
-
-extern int mark112; /* AIS: Mark the tuple for W112 when it's created. */
-static int lineuid=65537; /* AIS: a line number not used anywhere else */
-
-static tuple *splat(void);
-
-#define GETLINENO \
- {if (stbeginline < 0) thisline = -stbeginline; \
- else {thisline = stbeginline; stbeginline = 0;}}
-
-#define ACTION(x, nt, nn) \
- {x = newtuple(); x->type = nt; x->lineno = thisline; x->u.node = nn;}
-#define TARGET(x, nt, nn) \
- {x = newtuple(); x->type = nt; x->lineno = thisline; x->u.target = nn;}
-#define ACTARGET(x, nt, nn, nn2)\
- {x = newtuple(); x->type = nt; x->lineno = thisline;\
- x->u.node = nn; x->u.target = nn2;}
-/* AIS : The macro above was added for ABSTAIN expr FROM. */
-#define NEWFANGLED mark112 = 1; /* AIS: Added the mention of mark112 */ \
- if (traditional) lose(E111,iyylineno,(char*)NULL); else
-
-#define DESTACKSE1 sparkearsstack[sparkearslev--/32] >>= 1
-#define DESTACKSPARKEARS DESTACKSE1; DESTACKSE1
-
-%}
-
-%start program
-
-%union
-{
- int numval; /* a numeric value */
- tuple *tuple; /* a code tuple */
- node *node; /* an expression-tree node */
-}
-
-/*
- * Don't change this statement token list gratuitously!
- * Some code in feh2.c depends on GETS being the least
- * statement type and on the order of the ones following.
- * When adding a new statement, also update MAXTYPES in ick.h
- * and the token list in feh2.c.
- * AIS: Note that although GETS is the lowest statement type (with index 0
- * in feh2.c), UNKNOWN (i.e. a line that causes error 000) is an even
- * lower statement type, with index -1. perpet.c uses indexes 1 higher.
- * AIS: Added FROM, MANYFROM, TRY_AGAIN, COMPUCOME, GERUCOME, WHILE, and
- * three NEXT FROM cases. Also added PREPROC; this is for when the parser
- * acts like a preprocessor, translating an INTERCAL statement into a
- * sequence of INTERCAL statements with the same net effect.
- * AIS: COME_FROM now merged with the label following it,
- * to distinguish it from COMPUCOME, in the lexer. This changes
- * the parser somewhat.
- */
-%token UNKNOWN /* AIS: This is so comments can be REINSTATED */
-%token GETS RESIZE NEXT GO_AHEAD GO_BACK FORGET RESUME STASH RETRIEVE IGNORE
-%token REMEMBER ABSTAIN REINSTATE
-%token DISABLE ENABLE MANYFROM GIVE_UP READ_OUT WRITE_IN /* AIS: */PIN
-%token <numval> COME_FROM NEXTFROMLABEL
-%token NEXTFROMEXPR NEXTFROMGERUND COMPUCOME GERUCOME
-%token PREPROC WHILE TRY_AGAIN FROM
-
-/* AIS: ONCE and AGAIN added, for multithread support; also, NOSPOT added,
- so that I can reserve _ for future use (it's nowhere in the grammar yet) */
-%token MAYBE DO PLEASE NOT ONCE AGAIN MESH NOSPOT ONESPOT TWOSPOT TAIL HYBRID
-%token MINGLE SELECT /* AIS: SPARK EARS */ SUB BY BADCHAR
-/* AIS: For operand overloading */
-%token SLAT BACKSLAT
-
-%token <numval> NUMBER UNARY OHOHSEVEN GERUND LABEL
-%token <node> INTERSECTION
-
-/*
- * These are not tokens returned by the lexer, but they are used as
- * tokens elsewhere. We define them here to insure that the values
- * will not conflict with the other tokens. It is important that
- * WHIRL through WHIRL5 be a continuous sequence.
- */
-/* AIS: Added new tokens for optimizer output */
-%token SPLATTERED MESH32
-%token C_AND C_OR C_XOR C_NOT C_LOGICALNOT C_LSHIFTBY C_RSHIFTBY
-%token C_NOTEQUAL C_A C_PLUS C_MINUS C_TIMES C_DIVIDEBY C_MODULUS
-%token C_GREATER C_LESS C_ISEQUAL C_LOGICALAND C_LOGICALOR
-/* The reverse unary operators have to be in the same order as the forward
- unary operators. */
-%token AND OR XOR FIN WHIRL WHIRL2 WHIRL3 WHIRL4 WHIRL5
-%token REV_AND REV_OR REV_XOR REV_FIN
-%token REV_WHIRL REV_WHIRL2 REV_WHIRL3 REV_WHIRL4 REV_WHIRL5
-
-%type <node> expr limexpr varlist variable constant lvalue inlist outlist
-%type <node> subscr byexpr scalar scalar2s array initem outitem sublist
-%type <node> unambig limunambig subscr1 sublist1 oparray osubscr osubscr1
-%type <node> notanlvalue nlunambig lunambig
-%type <tuple> preproc perform mtperform
-%type <numval> please preftype
-
-%nonassoc OPENEARS OPENSPARK CLOSEEARS CLOSESPARK
-%nonassoc HIGHPREC
-%nonassoc UNARYPREC
-%nonassoc LOWPREC
-/* AIS: I reversed this precedence, to sort out the near-ambiguity.
- UNARYPREC and LOWPREC are to give the C-INTERCAL meaning of a statement
- precedence above its CLC-INTERCAL meaning. */
-
-%% /* beginning of rules section */
-
-/* A program description consists of a sequence of statements */
-program : /* EMPTY */
- | program command
- ;
-
-/*
- * Each command consists of an optional label, followed by a preamble,
- * followed by an optional probability, followed by the statement body.
- * Negative exechance values indicate initial abstentions, and will be
- * made positive before code is emitted.
- * AIS: An exechance above 100 indicates a MAYBE situation (e.g. 4545
- * means MAYBE DO %45 ...). This means %0 should be illegal. I modified
- * all these to allow for MAYBE.
- */
-command : please mtperform
- {$2->label = 0; $2->exechance = $1 * 100;}
- | please OHOHSEVEN mtperform
- {$3->label = 0; $3->exechance = $1 * $2;}
- | LABEL please mtperform
- {checklabel($1); $3->label = $1; $3->exechance = $2 * 100;}
- | LABEL please OHOHSEVEN mtperform
- {checklabel($1); $4->label = $1; $4->exechance = $2 * $3;}
- | error
- {lose(E017, iyylineno, (char *)NULL);}
- ;
-/*
- * AIS: added for the ONCE/AGAIN qualifiers. It copies a pointer to the tuple,
- * so command will set the values in the original tuple via the copy.
- */
-
-mtperform : preproc
- {$1->onceagainflag = onceagain_NORMAL; $$ = $1;}
- | preproc ONCE
- {NEWFANGLED {$1->onceagainflag = onceagain_ONCE; $$ = $1;}}
- | preproc AGAIN
- {NEWFANGLED {$1->onceagainflag = onceagain_AGAIN; $$ = $1;}}
-
-/* AIS: Either we do a simple 'perform', or preprocessing is needed.
- I wrote all of this. The way the preprocessor works is to add a whole
- load of new tuples. The tuples are written in the correct order,
- except for where one of the commands referenced in the preproc is
- needed; then one command from near the start is written, and swapped
- into place using tupleswap. ppinit must also be called giving the
- number of tuples at the end, to sort out each of the tuples. Note
- that preprocs can't be nested (so no DO a WHILE b WHILE c), and that
- lineuid can be used to create unreplicable numbers. preproc must also
- be set by hand on all commands that you want to be immune to ABSTAIN,
- etc., from outside the preproc, and $$ is set to the command that
- gets the line number and can be NEXTED to and from. */
-
-preproc : perform {$$ = $1;} /* the simple case */
- | perform WHILE perform
-{
- if(!multithread) lose(E405, iyylineno, (char*)NULL);
- NEWFANGLED{
- /* (x) DO a WHILE b
- is equivalent to
- #11 (l0) DO REINSTATE (l3) <weave on>
- #10 (l1) DO COME FROM (l2) AGAIN
- #9 DO b
- #8 DO COME FROM (l0)
- #7 DO NOTHING
- #6 DO NOTHING
- #5 (l2) DO NOTHING
- #4 DO GIVE UP
- #3 DO COME FROM (l0)
- #2 (x) DO a
- #1 (l3) DON'T ABSTAIN FROM (l1) AGAIN <weave off> */
- tuple* temptuple;
- TARGET(temptuple, COME_FROM, lineuid+2);
- temptuple->label=lineuid+1; temptuple->preproc=1; /* #10 */
- TARGET(temptuple, COME_FROM, lineuid+0); temptuple->preproc=1; /* #8 */
- ACTION(temptuple, PREPROC, 0); temptuple->preproc=1; /* #7 */
- ACTION(temptuple, PREPROC, 0); temptuple->preproc=1; /* #6 */
- ACTION(temptuple, PREPROC, 0);
- temptuple->label=lineuid+2; temptuple->preproc=1; /* #5 */
- ACTION(temptuple, GIVE_UP, 0); temptuple->preproc=1; /* #4 */
- TARGET(temptuple, COME_FROM, lineuid+0); temptuple->preproc=1; /* #3 */
- TARGET(temptuple, REINSTATE, lineuid+3); temptuple->setweave=1;
- temptuple->label=lineuid+0; temptuple->preproc=1; /* #11 */
- TARGET(temptuple, ABSTAIN, lineuid+1); temptuple->label=lineuid+3; /* #1 */
- temptuple->preproc=1; temptuple->setweave=-1; temptuple->exechance=-100;
- politesse += 3; /* Keep the politeness checker happy */
- ppinit(11); tupleswap(10,9); tupleswap(11,2); lineuid+=4; /* #2, #9 */
- tuples[lineno-10].onceagainflag=onceagain_AGAIN;
- tuples[lineno-1].onceagainflag=onceagain_AGAIN;
- $$=&(tuples[lineno-2]);
-}}
-
-/* There are two (AIS: now four) forms of preamble returned by the lexer */
-please : DO {GETLINENO; $$ = 1;}
- | DO NOT {GETLINENO; $$ = -1;}
- | MAYBE {NEWFANGLED {GETLINENO; $$ = 101;}}
- | MAYBE NOT {NEWFANGLED {GETLINENO; $$ = -101;}}
- ;
-
-/* Here's how to parse statement bodies */
-perform : lvalue GETS expr {ACTION($$, GETS, cons(GETS,$1,$3));}
- | array GETS byexpr {ACTION($$, RESIZE, cons(RESIZE,$1,$3));}
- | notanlvalue GETS expr %prec LOWPREC
- {/* AIS: This is for variableconstants, and an error otherwise.*/
- if(variableconstants) ACTION($$, GETS, cons(GETS,$1,$3))
- else {yyclearin; $$=splat();}}
- | LABEL NEXT {TARGET($$, NEXT, $1);}
- | FORGET expr {ACTION($$, FORGET, $2);}
- | RESUME expr {ACTION($$, RESUME, $2);}
- | STASH varlist {ACTION($$, STASH, rlist);}
- | RETRIEVE varlist {ACTION($$, RETRIEVE, rlist);}
- | IGNORE varlist {ACTION($$, IGNORE, rlist);}
- | REMEMBER varlist {ACTION($$, REMEMBER, rlist);}
- | ABSTAIN FROM LABEL {stbeginline=0; TARGET($$, ABSTAIN, $3);}
- | ABSTAIN FROM gerunds {ACTION($$, DISABLE, rlist);}
- | ABSTAIN expr FROM LABEL {/* AIS */ NEWFANGLED {stbeginline=0; ACTARGET($$, FROM, $2, $4);}}
- | ABSTAIN expr FROM gerunds {/* AIS */ NEWFANGLED {$$ = newtuple(); $$->type = MANYFROM; $$->lineno = thisline; \
- {node* tempnode=newnode(); $$->u.node = tempnode; tempnode->lval=$2; tempnode->rval=rlist; tempnode->opcode=MANYFROM;}}}
- | REINSTATE LABEL {stbeginline=0; TARGET($$, REINSTATE, $2);}
- | REINSTATE gerunds {ACTION($$, ENABLE, rlist);}
- | WRITE_IN inlist {ACTION($$, WRITE_IN, $2);}
- | READ_OUT outlist {ACTION($$, READ_OUT, $2);}
- | PIN scalar2s {ACTION($$, PIN, $2);}
- | GIVE_UP {ACTION($$, GIVE_UP, 0);}
- | GO_AHEAD {/* AIS */ NEWFANGLED {ACTION($$, GO_AHEAD, 0);}}
- | GO_BACK {/* AIS */ NEWFANGLED {ACTION($$, GO_BACK, 0);}}
- | TRY_AGAIN {/* AIS */ NEWFANGLED {ACTION($$,TRY_AGAIN,0);}}
- | COME_FROM {/* AIS: Modified */ NEWFANGLED {TARGET($$,COME_FROM,$1);}}
- | COMPUCOME gerunds {/* AIS: COME FROM gerund */
- NEWFANGLED{ACTION($$,GERUCOME,rlist);
- compucomesused=1; gerucomesused=1;}}
- | COMPUCOME expr {/* AIS */NEWFANGLED {ACTION($$,COMPUCOME,$2);
- compucomesused=1;}}
-/* AIS: NEXT FROM works along the same lines as COME FROM */
- | NEXTFROMLABEL {NEWFANGLED {TARGET($$,NEXTFROMLABEL,$1);}
- nextfromsused=1;}
- | NEXTFROMEXPR gerunds{NEWFANGLED{ACTION($$,NEXTFROMGERUND,rlist);
- compucomesused=1; gerucomesused=1;}
- nextfromsused=1;}
- | NEXTFROMEXPR expr {NEWFANGLED {ACTION($$,NEXTFROMEXPR,$2);
- compucomesused=1; nextfromsused=1;}}
- | BADCHAR {yyclearin; $$ = splat();}
- | error {yyclearin; $$ = splat();}
- ;
-
-/* gerund lists are used by ABSTAIN and REINSTATE */
-gerunds : GERUND
- {rlist = np = newnode(); np->constant = $1;}
- | gerunds INTERSECTION GERUND
- {
- np->rval = newnode();
- np = np->rval;
- np->constant = $3;
- }
- ;
-
-/* OK, here's what a variable reference looks like */
-variable: scalar | array;
-
-lvalue : scalar | subscr;
-
-scalar2s: TWOSPOT NUMBER /* AIS: for TWOSPOTs only */
- {
- $$ = newnode();
- $$->opcode = TWOSPOT;
- $$->constant = intern(TWOSPOT, $2);
- }
-scalar : ONESPOT NUMBER
- {
- $$ = newnode();
- $$->opcode = ONESPOT;
- $$->constant = intern(ONESPOT, $2);
- }
- | TWOSPOT NUMBER
- {
- $$ = newnode();
- $$->opcode = TWOSPOT;
- $$->constant = intern(TWOSPOT, $2);
- }
- ;
-
-array : TAIL NUMBER
- {
- $$ = newnode();
- $$->opcode = TAIL;
- $$->constant = intern(TAIL, $2);
- }
- | HYBRID NUMBER
- {
- $$ = newnode();
- $$->opcode = HYBRID;
- $$->constant = intern(HYBRID, $2);
- }
- ;
-
-/* Array with unary operator is a special intermediate case; these
- nodes will be rearranged when the subscript list is added */
-oparray : TAIL UNARY NUMBER %prec UNARYPREC
- {
- $$ = newnode();
- $$->opcode = $2;
- $$->rval = newnode();
- $$->rval->opcode = TAIL;
- $$->rval->constant = intern(TAIL, $3);
- }
- | HYBRID UNARY NUMBER %prec UNARYPREC
- {
- $$ = newnode();
- $$->opcode = $2;
- $$->rval = newnode();
- $$->rval->opcode = HYBRID;
- $$->rval->constant = intern(HYBRID, $3);
- }
- ;
-
-/* And a constant looks like this */
-constant: MESH NUMBER
- {
- /* enforce the 16-bit constant constraint */
- if ((unsigned int)$2 > Max_small)
- lose(E017, iyylineno, (char *)NULL);
- $$ = newnode();
- $$->opcode = MESH;
- if(variableconstants) /* AIS */
- $$->constant = intern(MESH, $2);
- else
- $$->constant = $2;
- }
- ;
-
-/* variable lists are used in STASH, RETRIEVE, IGNORE, REMEMBER */
-varlist : variable {rlist = np = $1;}
- | varlist INTERSECTION variable {np = np->rval = $3;
- /* newnode(); */ }
- ;
-
-/* scalars and subscript exprs are permitted in WRITE IN lists */
-/* new: arrays are also permitted to allow for bitwise I/0 */
-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 */
-outitem : scalar | subscr | constant | array;
-outlist : outitem INTERSECTION outlist {$$=cons(INTERSECTION,$1,$3);}
- | outitem {$$=cons(INTERSECTION,$1,0);}
- ;
-
-/* Now the gnarly part -- expression syntax */
-
-/* Support array dimension assignment */
-byexpr : expr BY byexpr {$$ = cons(BY, $1, $3);}
- | expr {$$ = cons(BY, $1, 0);}
- ;
-
-/* Support array subscripts (as lvalues) */
-subscr : subscr1 {$$ = $1;}
- | array SUB sublist {$$ = cons(SUB, $1, $3);}
- ;
-subscr1 : array SUB sublist1 {$$ = cons(SUB, $1, $3);}
- ;
-sublist : unambig sublist {$$ = cons(INTERSECTION, $1, $2);}
- | unambig sublist1 {$$ = cons(INTERSECTION, $1, $2);}
- ;
-sublist1: subscr1 {$$ = cons(INTERSECTION, $1, 0);}
- | osubscr1 {$$ = cons(INTERSECTION, $1, 0);}
- | unambig %prec HIGHPREC {$$ = cons(INTERSECTION, $1, 0);}
- ;
-
-/* Unary operators with arrays act like arrays only in expressions */
-osubscr : osubscr1 {$$ = $1;}
- | oparray SUB sublist
- {$$ = $1; $$->rval = cons(SUB, $$->rval, $3);}
- ;
-osubscr1: oparray SUB sublist1
- {$$ = $1; $$->rval = cons(SUB, $$->rval, $3);}
- ;
-
-/* here goes the general expression syntax */
-expr : unambig {$$ = $1;}
-/* AIS: CLC-INTERCAL allows right-association of SELECT and MINGLE.
- (Strangely, that simplifies this section somewhat.) */
- | unambig SELECT expr {$$ = cons(SELECT, $1, $3);}
- | unambig MINGLE expr {$$ = cons(MINGLE, $1, $3);}
-/* AIS: Operand overloading */
- | scalar SLAT expr {NEWFANGLED{$$ = cons(SLAT, $1, $3);
- opoverused=1; if(!firstslat)
- firstslat=$$; else
- prevslat->nextslat=$$; prevslat=$$;
- $$->nextslat=0;}}
- | subscr {$$ = $1;}
- | osubscr {$$ = $1;}
- ;
-
-/* AIS: Any expression that isn't an lvalue */
-notanlvalue:nlunambig {$$ = $1;}
- | osubscr {$$ = $1;}
- | unambig SELECT expr {$$ = cons(SELECT, $1, $3);}
- | unambig MINGLE expr {$$ = cons(MINGLE, $1, $3);}
- | scalar SLAT expr {NEWFANGLED{$$ = cons(SLAT, $1, $3);
- opoverused=1; if(!firstslat)
- firstslat=$$; else
- prevslat->nextslat=$$; prevslat=$$;
- $$->nextslat=0;}}
- ;
-
-/* AIS: an expr that doesn't start with a unary operator */
-limexpr : limunambig {$$ = $1;}
- | limunambig SELECT expr {$$ = cons(SELECT, $1, $3);}
- | limunambig MINGLE expr {$$ = cons(MINGLE, $1, $3);}
- | scalar SLAT expr {NEWFANGLED{$$ = cons(SLAT, $1, $3);
- opoverused=1; if(!firstslat)
- firstslat=$$; else
- prevslat->nextslat=$$; prevslat=$$;
- $$->nextslat=0;}}
- | subscr {$$ = $1;}
- | osubscr {$$ = $1;}
- ;
-
-
-preftype: MESH {$$=MESH; } | ONESPOT {$$=ONESPOT;} | TWOSPOT {$$=TWOSPOT;};
-
-/* AIS: unambig split into limunambig (unambigs that don't start with a
- unary operator), nlunambig (unambigs that aren't lvalues),
- lunambig (both), and unambig (the general case) */
-lunambig: constant {$$ = $1;}
- /* deal with the bizarre unary-op syntax */
- | preftype UNARY NUMBER %prec UNARYPREC
- {
- $$ = newnode();
- $$->opcode = $2;
- $$->rval = newnode();
- $$->rval->opcode = $1;
- if($1 == MESH) {
- /* enforce the 16-bit constant constraint */
- if ((unsigned int)$3 > Max_small)
- lose(E017, iyylineno, (char *)NULL);
- $$->rval->constant = intern(MESH, $3);
- }
- else {
- $$->rval->constant = intern($1, $3);
- }
- }
-
- /* Now deal with the screwy unary-op interaction with grouping */
- /* AIS: Modified to allow for maintenance of the SPARK/EARS stack */
- | eitherspark UNARY expr CLOSESPARK %prec UNARYPREC
- {
- $$ = newnode();
- $$->opcode = $2;
- $$->rval = $3;
- DESTACKSPARKEARS;
- }
- | eitherears UNARY expr CLOSEEARS %prec UNARYPREC
- {
- $$ = newnode();
- $$->opcode = $2;
- $$->rval = $3;
- DESTACKSPARKEARS;
- }
-/* AIS: limexpr, a limited expression that isn't allowed to start with a
- unary operator, is used here to avoid a reduce/reduce conflict. */
- | eitherspark limexpr CLOSESPARK {$$ = $2; DESTACKSPARKEARS;}
- | eitherears limexpr CLOSEEARS {$$ = $2; DESTACKSPARKEARS;}
- ;
-
-limunambig: lunambig {$$ = $1;}
- | scalar {$$ = $1;}
- ;
-
-nlunambig: lunambig {$$ = $1;}
- | UNARY unambig %prec LOWPREC
- {$$=newnode(); $$->opcode = $1; $$->rval = $2;}
- ;
-
-/* AIS: A bit of CLC-INTERCAL compatibility here.
- The syntax now allows any number of unary operators before, and one inside,
- an expression. In ambiguous cases like '&VV#1~#5', the & applies to the
- whole expression (one operator inside is allowed, and inside takes
- precedence), but the Vs apply just to the #1, because only one operator
- inside is allowed. */
-unambig : limunambig {$$ = $1;}
- | UNARY unambig %prec LOWPREC
- {$$=newnode(); $$->opcode = $1; $$->rval = $2;}
- ;
-
-eitherspark : OPENSPARK ;
- | CLOSESPARK ;
- ;
-
-eitherears : OPENEARS ;
- | CLOSEEARS ;
- ;
-
-%%
-
-static tuple *splat(void)
-/* try to recover from an invalid statement. */
-{
- tuple *sp;
- int tok, i;
- extern bool re_send_token;
-
- /*
- * The idea
- * here is to skip to the next DO, PLEASE or label, then unget that token.
- * which we can do with a tricky flag on the lexer (re_send_token).
- */
-
- /* fprintf(stderr,"attempting to splat at line %d....\n",iyylineno); */
- for(i = 0,re_send_token = FALSE;;i++) {
- tok = lexer();
- if (!tok)
- {
- re_send_token = TRUE;
- tok = ' '; /* scanner must not see a NUL */
- break;
- }
- else if (tok == DO || tok == PLEASE || tok == LABEL
- /* AIS */ || tok == MAYBE) {
- re_send_token = TRUE;
- break;
- }
- }
- /*
- fprintf(stderr,"found %d on line %d after %d other tokens.\n",
- tok,iyylineno,i);
- */
-
- /* generate a placeholder tuple for the text line */
- TARGET(sp, SPLATTERED, 0);
-
- return(sp);
-}
-
-/* parser.y ends here */
#include <string.h>
#include <signal.h>
#include <time.h>
+#include <assert.h>
#include "ick.h"
#include "feh.h"
#include "parser.h"
#include "sizes.h"
-#include "lose.h"
+#include "ick_lose.h"
#include "uncommon.h"
/* AIS: split ICKDATADIR from ICKLIBDIR */
#define CC "gcc"
#endif
-#define ARGSTRING "bcdfghlmoptuvxyCFHOPUX@"
+#define ARGSTRING "bcdefghlmoptuvxyCFHOPUX@"
#ifdef USE_YYRESTART
/* function supplied by lex */
int yydebug;
/* compilation options */
-bool compile_only; /* just compile into C, don't run the linker */
-bool traditional; /* insist on strict INTERCAL-72 conformance */
-bool nocompilerbug; /* disable error E774 */
+ick_bool compile_only; /* just compile into C, don't run the linker */
+ick_bool ick_traditional; /* insist on strict INTERCAL-72 conformance */
+ick_bool nocompilerbug; /* disable error IE774 */
int yukdebug; /* AIS: Use the yuk debugger. */
int yukprofile; /* AIS: Use the yuk profiler. */
-extern int coreonerr; /* AIS: Dump core on E778. (defined in lose.c) */
+extern int ick_coreonerr; /* AIS: Dump core on IE778. (defined in ick_lose.c) */
int multithread; /* AIS: Allow multithreading and backtracking. */
int variableconstants; /* AIS: Allow anything on the left of an assignment. */
-int cdebug; /* AIS: Pass -g to our C compiler, and leave C code. */
+int useickec; /* AIS: Link together INTERCAL and C. */
+static int cdebug; /* AIS: Pass -g to our C compiler, and leave C code. */
int optdebug; /* AIS: Debug the optimizer. Value is 0, 1, 2, or 3. */
int flowoptimize; /* AIS: Do flow optimizations (in INTERCAL!). */
int coopt; /* AIS: The constant-output optimization. This should
mean that INTERCAL will beat any other language at
many benchmark programs (!) */
-extern int printfopens; /* AIS: Print messages whenever attempting to open a
+extern int ick_printfopens; /* AIS: Print messages whenever attempting to open a
file: from uncommon.c */
-extern int checkforbugs;/* AIS: Try to find possible bugs in the source code */
+extern int ick_checkforbugs;/* AIS: Try to find possible bugs in the source code */
int pickcompile; /* AIS: Compile for PIC? */
+/*@-exportlocal@*/ /* AIS: relevant to the lexer */
int clclex; /* AIS: 1 means use CLC-INTERCAL meanings for @, ? */
-int clcsemantics; /* AIS: CLC semantics for I/O, abstaining GIVE UP, &c*/
-int outtostdout; /* AIS: Output on stdout rather than the output file */
+/*@=exportlocal@*/
+int ick_clcsemantics; /* AIS: CLC semantics for I/O, abstaining GIVE UP, &c*/
+static int outtostdout; /* AIS: Output on stdout rather than the output file */
/* AIS: Autodetected compilation options */
int compucomecount=0; /* Computed COME FROM count */
int gerucomesused=0; /* Is COME FROM gerund used? */
int nextfromsused=0; /* Is NEXT FROM used? */
int opoverused=0; /* Is operand overloading used? */
-node* firstslat=0; /* The first slat expression in the program */
-node* prevslat=0; /* The last slat expression used so far */
+/*@null@*/ node* firstslat=0; /* The first slat expression in the program */
+/*@null@*/ node* prevslat=0; /* The last slat expression used so far */
-static bool dooptimize; /* do optimizations? (controlled by -O) */
-static bool clockface; /* set up output to do IIII for IV */
+static ick_bool dooptimize; /* do optimizations? (controlled by -O) */
+static ick_bool ick_clockface; /* set up output to do IIII for IV */
#define SKELETON "ick-wrap.c"
#define PSKELETON "pickwrap.c"
#define DEFAULT_MAX_SMALL 0xffffL
#define DEFAULT_MAX_LARGE 0xffffffffL
-int Base;
-int Small_digits;
-int Large_digits;
-unsigned int Max_small;
-unsigned int Max_large;
+int ick_Base;
+int ick_Small_digits;
+int ick_Large_digits;
+unsigned int ick_Max_small;
+unsigned int ick_Max_large;
-int lineno; /* after yyparse, this is the total number of statements */
+int ick_lineno; /* after yyparse, this is the total number of statements */
/* currently supported numeric bases, not exported */
static int maxbase = 7;
static unsigned int maxsmalls[8] =
{0, 0, 65535, 59048, 65535, 15624, 46655, 16806};
-static char *compiler;
+/*@observer@*/ static char *compiler;
atom *oblist = NULL, *obdex;
int obcount = 0;
if(!argv[optind]) return EOF; /* Out of command line */
while(!strcmp(argv[optind],"-"))
{
- optind++; /* Go to next argument */
+ optind++; /* Go to ick_next argument */
if(!argv[optind]) return EOF;
}
if(*(argv[optind])!='-') return EOF; /* this arg is not an option */
static int myfgetc(FILE* in)
{
char c;
- fread(&c,1,1,in);
+ (void) fread(&c,1,1,in);
if(feof(in)) return EOF;
return (int)c;
}
static RETSIGTYPE abend(int signim)
{
- lose(E778, iyylineno, (char *)NULL);
- (void) signim;
+ /*@-noeffect@*/ (void) signim; /*@=noeffect@*/
+ ick_lose(IE778, iyylineno, (char *)NULL);
}
static void print_usage(char *prog, char *options)
{
- fprintf(stderr,"Usage: %s [-%s] <file>\n",prog,options);
- fprintf(stderr,"\t-b\t:reduce the probability of E774 to zero\n");
+ fprintf(stderr,"Usage: %s [-%s] <file> [<file> ...]\n",prog,options);
+ fprintf(stderr,"\t-b\t:reduce the probability of IE774 to zero\n");
fprintf(stderr,"\t-c\t:compile INTERCAL to C, but don't compile C\n");
fprintf(stderr,"\t-d\t:print yacc debugging information (implies -c)\n");
- fprintf(stderr,"\t-t\t:traditional mode, accept only INTERCAL-72\n");
- fprintf(stderr,"\t-C\t:clockface output (e.g. use IIII instead of IV)\n");
+ fprintf(stderr,"\t-e\t:link together INTERCAL and C files as one program\n");
+ fprintf(stderr,"\t\t (without this option, all INTERCAL files produce\n");
+ fprintf(stderr,"\t\t separate output files; with it, the first file given\n");
+ fprintf(stderr,"\t\t must be the only INTERCAL file) (prevents -mypPf)\n");
+ fprintf(stderr,"\t-t\t:ick_traditional mode, accept only INTERCAL-72\n");
+ fprintf(stderr,"\t-C\t:ick_clockface output (e.g. use IIII instead of IV)\n");
fprintf(stderr,"\t-O\t:optimize expresssions in generated code\n");
/* AIS: Changed the help message for the previous line (because the
function of -O has changed). I wrote the next group of options. */
fprintf(stderr,"\t-F\t:optimize everything in generated code for\n"
"\t\tspeed, regardless of how slow the compiler becomes or how\n"
"\t\tlarge the object file becomes. Implies -fO, "
- "prevents -cdghpyH\n");
+ "prevents -cdeghpyH\n");
# else
fprintf(stderr,"\t-F\t:unsupported on computers without #! support\n");
# endif
fprintf(stderr,"\t-hH\t:print optimizer debugging information in a\n"
"\t\tdifferent form (implies -cO)\n");
#ifdef HAVE_UNISTD_H
- fprintf(stderr,"\t-y\t:run the yuk debugger on the code (prevents -fm)\n");
- fprintf(stderr,"\t-p\t:run the yuk profiler on the code (prevents -fm)\n");
+ fprintf(stderr,"\t-y\t:run the yuk debugger on the code (prevents -fme)\n");
+ fprintf(stderr,"\t-p\t:run the yuk profiler on the code (prevents -fme)\n");
#else
- fprintf(stderr,"\t-y\t:unsupported on computers without unistd.h\n");
- fprintf(stderr,"\t-p\t:unsupported on computers without unistd.h\n");
+ fprintf(stderr,"\t-y\t:unsupported on computers without <unistd.h>\n");
+ fprintf(stderr,"\t-p\t:unsupported on computers without <unistd.h>\n");
#endif
fprintf(stderr,"\t-m\t:allow multithreading and backtracking "
- "(prevents -yp)\n");
+ "(prevents -ype)\n");
fprintf(stderr,"\t-v\t:allow anything on the left of an assignment. This "
"is required\n\t\tif you want operand overloading to change "
"meshes.\n\t\t(prevents -fFOP)\n");
fprintf(stderr,"\t-P\t:compile PIC-INTERCAL rather than INTERCAL\n");
- fprintf(stderr,"\t\t(prevents -mFvx, implies -cfO)\n");
+ fprintf(stderr,"\t\t(prevents -mFvxe, implies -cfO)\n");
fprintf(stderr,"\t-o\t:output to stdout rather than .c (implies -c)\n");
fprintf(stderr,"\t-X\t:interpret ambiguous syntax as Princeton not\n"
"\t\tAtari (i.e. CLC-INTERCAL not C-INTERCAL)\n");
"\t\tfrom a GIVE UP by label (prevents -P)\n");
fprintf(stderr,"\t-u\t:print a message whenever the compiler tries to "
"open a file\n");
- fprintf(stderr,"\t-U\t:dump core on E778 after printing an error\n");
+ fprintf(stderr,"\t-U\t:dump core on IE778 after printing an error\n");
fprintf(stderr,"\t-g\t:compile to both debuggable executable and C\n");
fprintf(stderr,"\t-l\t:attempt to report likely bugs "
"and nonportabilities (implies -O)\n");
int isenv(char* e)
{
char* x=getenv(e);
- return x&&*x;
+ return x != NULL && *x != '\0';
}
+/*@-redef@*/
int main(int argc, char *argv[])
+/*@=redef@*/
{
- extern int optind; /* set by getopt */
- char buf[BUFSIZ], buf2[BUFSIZ], *chp, yukcmdstr[BUFSIZ];
+ /*@-nestedextern@*/
+ extern int optind; /* set by getopt */
+ /*@=nestedextern@*/
+ char buf[BUFSIZ], buf2[BUFSIZ], *chp, yukcmdstr[BUFSIZ], path[BUFSIZ];
tuple *tp;
atom *op;
int c, i;
- char *includedir, *datadir, *libdir;
- /* AIS: removed getenv(), added datadir on the line above */
+ /*@-shadow@*/ /* no it doesn't, cesspool isn't linked to perpet */
+ char *includedir, *libdir, *ick_datadir;
+ /*@=shadow@*/
+ /* AIS: removed getenv(), added ick_datadir */
char *cooptsh; /* AIS */
FILE *ifp, *ofp;
int maxabstain, /* nextcount, AIS */ bugline;
- bool needsyslib, firstfile;
+ ick_bool needsyslib, firstfile;
+ int oldoptind;
#ifdef HAVE_UNISTD_H
int oldstdin; /* AIS: for keeping track of where stdin was */
#endif
includedir = ICKINCLUDEDIR;
if (!(libdir = getenv("ICKLIBDIR")))
libdir = ICKLIBDIR;
- if (!(datadir = getenv("ICKDATADIR"))) /* AIS */
- datadir = ICKDATADIR;
+ if (!(ick_datadir = getenv("ICKDATADIR"))) /* AIS */
+ ick_datadir = ICKDATADIR;
/*
AIS: nothing actually uses this at the moment,
commenting it out for future use
if (!(compiler = getenv("CC")))
compiler = CC;
+ /* getopt is POSIX, and I provide my own version if the POSIX version
+ isn't found, so the unrecog warning is a false positive. */
+ /*@-unrecog@*/
while ((c = getopt(argc, argv, ARGSTRING)) != EOF)
+ /*@=unrecog@*/
{
switch (c)
{
case 'b':
- nocompilerbug = TRUE;
+ nocompilerbug = ick_TRUE;
break;
case 'c':
- compile_only = TRUE;
- /* AIS */ coopt = FALSE;
+ compile_only = ick_TRUE;
+ /* AIS */ coopt = ick_FALSE;
break;
case 'o': /* AIS */
- compile_only = TRUE;
- outtostdout = TRUE;
- coopt = FALSE;
+ compile_only = ick_TRUE;
+ outtostdout = ick_TRUE;
+ coopt = ick_FALSE;
break;
case 'd':
- yydebug = compile_only = TRUE;
- /* AIS */ coopt = FALSE;
+ yydebug = compile_only = ick_TRUE;
+ /* AIS */ coopt = ick_FALSE;
break;
+ case 'e': /* AIS */
+ useickec = ick_TRUE;
+ multithread = pickcompile = coopt = yukdebug = yukprofile = ick_FALSE;
+ break;
+
case 'C':
- clockface = TRUE;
+ ick_clockface = ick_TRUE;
break;
case 't':
- traditional = TRUE;
- if(multithread) lose(E111, 1, (char*) NULL); /* AIS */
- if(pickcompile) lose(E111, 1, (char*) NULL); /* AIS */
+ ick_traditional = ick_TRUE;
+ if(multithread) ick_lose(IE111, 1, (char*) NULL); /* AIS */
+ if(pickcompile) ick_lose(IE111, 1, (char*) NULL); /* AIS */
break;
case 'O':
- dooptimize = TRUE;
- variableconstants = FALSE; /* AIS */
+ dooptimize = ick_TRUE;
+ variableconstants = ick_FALSE; /* AIS */
break;
case 'f': /* By AIS */
- flowoptimize = TRUE;
- yukdebug = yukprofile = FALSE;
- variableconstants = FALSE;
+ flowoptimize = ick_TRUE;
+ yukdebug = yukprofile = ick_FALSE;
+ variableconstants = ick_FALSE;
break;
case 'F': /* By AIS */
- coopt = flowoptimize = dooptimize = TRUE;
- variableconstants = FALSE;
+ coopt = flowoptimize = dooptimize = ick_TRUE;
+ variableconstants = useickec = ick_FALSE;
yukdebug = yukprofile = yydebug = outtostdout =
- compile_only = cdebug = FALSE;
- if(pickcompile) lose(E256, 1, (char*) NULL);
+ compile_only = cdebug = ick_FALSE;
+ if(pickcompile) ick_lose(IE256, 1, (char*) NULL);
break;
case 'h': /* By AIS */
optdebug|=1;
- compile_only=dooptimize=TRUE;
- coopt=FALSE;
+ compile_only=dooptimize=ick_TRUE;
+ coopt=ick_FALSE;
break;
case 'H': /* By AIS */
optdebug|=2;
- compile_only=dooptimize=TRUE;
- coopt=FALSE;
+ compile_only=dooptimize=ick_TRUE;
+ coopt=ick_FALSE;
break;
case 'y': /* By AIS */
#ifdef HAVE_UNISTD_H
- yukdebug=TRUE;
- multithread=flowoptimize=coopt=FALSE;
+ yukdebug=ick_TRUE;
+ multithread=flowoptimize=coopt=useickec=ick_FALSE;
#endif
break;
case 'p': /* By AIS */
#ifdef HAVE_UNISTD_H
- yukprofile=TRUE;
- multithread=flowoptimize=coopt=FALSE;
+ yukprofile=ick_TRUE;
+ multithread=flowoptimize=coopt=useickec=ick_FALSE;
#endif
break;
case 'm': /* By AIS */
- multithread=TRUE;
- yukprofile=FALSE;
- yukdebug=FALSE;
- if(traditional) lose(E111, 1, (char*) NULL);
+ multithread=ick_TRUE;
+ yukprofile=ick_FALSE;
+ yukdebug=ick_FALSE;
+ useickec=ick_FALSE;
+ if(ick_traditional) ick_lose(IE111, 1, (char*) NULL);
break;
case 'v': /* By AIS */
- variableconstants=TRUE;
- dooptimize=FALSE;
- flowoptimize=FALSE;
- coopt=FALSE;
- pickcompile=FALSE;
+ variableconstants=ick_TRUE;
+ dooptimize=ick_FALSE;
+ flowoptimize=ick_FALSE;
+ coopt=ick_FALSE;
+ pickcompile=ick_FALSE;
break;
case 'l': /* By AIS */
- checkforbugs=TRUE;
- dooptimize=TRUE;
+ ick_checkforbugs=ick_TRUE;
+ dooptimize=ick_TRUE;
break;
case 'U': /* By AIS */
- coreonerr=TRUE;
+ ick_coreonerr=ick_TRUE;
break;
case 'u': /* By AIS */
- printfopens=TRUE;
+ ick_printfopens=ick_TRUE;
break;
case 'P': /* By AIS */
- pickcompile=TRUE;
- multithread=coopt=variableconstants=FALSE;
- clcsemantics=FALSE;
- compile_only=TRUE;
- dooptimize=flowoptimize=TRUE; /* needed for PICs */
+ pickcompile=ick_TRUE;
+ multithread=coopt=variableconstants=ick_FALSE;
+ ick_clcsemantics=useickec=ick_FALSE;
+ compile_only=ick_TRUE;
+ dooptimize=flowoptimize=ick_TRUE; /* needed for PICs */
break;
case 'X': /* By AIS */
- clclex=TRUE;
+ clclex=ick_TRUE;
break;
case 'x': /* By AIS */
- clcsemantics=TRUE;
- pickcompile=FALSE;
+ ick_clcsemantics=ick_TRUE;
+ pickcompile=ick_FALSE;
break;
case 'g': /* By AIS */
- cdebug=TRUE;
- coopt=FALSE;
+ cdebug=ick_TRUE;
+ coopt=ick_FALSE;
break;
case '?':
default:
case '@':
print_usage(argv[0], ARGSTRING);
- exit(1);
- break;
+ exit(EXIT_FAILURE);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
}
}
- /* AIS: This has only been able to compile 1 file at a time for ages,
- as far as I can tell, without problems. */
- if(optind+1<argc)
- {
- print_usage(argv[0], ARGSTRING);
- exit(1);
- }
-
(void) signal(SIGSEGV, abend);
#ifdef SIGBUS
(void) signal(SIGBUS, abend);
#ifdef USG
srand48(time(NULL) + getpid());
#else
- srand(time(NULL));
+ srand((unsigned)time(NULL));
#endif /* UNIX */
}
/* AIS: New function for enhanced file-finding */
- if ((ifp = findandfopen(pickcompile?PSKELETON:SKELETON,
- datadir, "r", argv[0])) == 0)
- lose(E999, 1, (char *)NULL);
+ ifp = ick_findandfopen(pickcompile?PSKELETON:SKELETON,
+ ick_datadir, "r", argv[0]);
+ if(!ifp) ick_lose(IE999, 1, (char *)NULL);
/* now substitute in tokens in the skeleton */
- buf[strlen(buf) - 2] = '\0';
+ /* AIS: This doesn't actually seem to do anything, and buf is
+ uninitialised at this point, so it's actually dangerous
+ because it's undefined behaviour.
+ buf[strlen(buf) - 2] = '\0'; */
/* AIS: Save the old stdin, if we can */
#ifdef HAVE_UNISTD_H
oldstdin=dup(0);
#endif
- for (firstfile = TRUE; optind < argc; optind++, firstfile = FALSE)
+ oldoptind=optind; /* AIS */
+ for (firstfile = ick_TRUE; optind < argc; optind++, firstfile = ick_FALSE)
{
/* AIS: Read as binary to pick up Latin-1 and UTF-8 better */
if (freopen(argv[optind], "rb", stdin) == (FILE *)NULL)
- lose(E777, 1, (char *)NULL);
+ ick_lose(IE777, 1, (char *)NULL);
else
{
/* strip off the file extension */
if(!(chp = strrchr(argv[optind],'.')))
{
- lose(E998, 1, (char *)NULL);
+ ick_lose(IE998, 1, (char *)NULL);
}
*chp++ = '\0';
+ if(useickec && (!strcmp(chp,"c") || !strcmp(chp,"cio"))) /* AIS */
+ {
+ break; /* don't process C or cio files further yet */
+ }
+
+ if(useickec && firstfile == ick_FALSE) /* AIS */
+ ick_lose(IE998, 1, (char *)NULL);
+
/* wwp: reset the base variables to defaults, because if the */
/* sourcefile has extension .i they will not be reset in the */
/* following chunk of code. but i don't want to modify the */
/* following chunk of code because i think it is very clever; */
- /* grabs the base on the first pass, then validates the rest */
+ /* grabs the base on the ick_first pass, then validates the rest */
/* of the extension on the second. */
- Base = DEFAULT_BASE;
- Small_digits = DEFAULT_SMALL_DIGITS;
- Large_digits = DEFAULT_LARGE_DIGITS;
- Max_small = DEFAULT_MAX_SMALL;
- Max_large = DEFAULT_MAX_LARGE;
+ ick_Base = DEFAULT_BASE;
+ ick_Small_digits = DEFAULT_SMALL_DIGITS;
+ ick_Large_digits = DEFAULT_LARGE_DIGITS;
+ ick_Max_small = (unsigned)DEFAULT_MAX_SMALL;
+ ick_Max_large = (unsigned)DEFAULT_MAX_LARGE;
/* determine the file type from the extension */
while (strcmp(chp,"i"))
{
- Base = strtol(chp,&chp,10);
- if (Base < 2 || Base > maxbase)
- lose(E998, 1, (char *)NULL);
- else if (traditional && Base != 2)
- lose(E111, 1, (char *)NULL);
- else if (pickcompile && Base != 2)
- lose(E256, 1, (char *)NULL); /* AIS */
- Small_digits = smallsizes[Base];
- Large_digits = 2 * Small_digits;
- Max_small = maxsmalls[Base];
- if (Max_small == 0xffff)
- Max_large = 0xffffffffLU;
+ ick_Base = (int)strtol(chp,&chp,10);
+ if (ick_Base < 2 || ick_Base > maxbase)
+ ick_lose(IE998, 1, (char *)NULL);
+ else if (ick_traditional && ick_Base != 2)
+ ick_lose(IE111, 1, (char *)NULL);
+ else if (pickcompile && ick_Base != 2)
+ ick_lose(IE256, 1, (char *)NULL); /* AIS */
+ ick_Small_digits = smallsizes[ick_Base];
+ ick_Large_digits = 2 * ick_Small_digits;
+ ick_Max_small = maxsmalls[ick_Base];
+ if (ick_Max_small == 0xffff)
+ ick_Max_large = (unsigned)0xffffffffLU;
else
- Max_large = (Max_small + 1) * (Max_small + 1) - 1;
+ ick_Max_large = (ick_Max_small + 1) * (ick_Max_small + 1) - 1;
}
/* zero out tuple and oblist storage */
treset();
politesse = 0;
+ /* JH: default to no op-overusage and no computed come from */
+ opoverused = 0;
+ compucomesused = compucomecount = 0;
/* reset the lex/yacc environment */
if (!firstfile)
}
/* compile tuples from current input source */
- yyparse();
+ (void) yyparse();
if(variableconstants)
{
/* AIS: Up to 4 extra meshes may be needed by feh.c. */
- intern(MESH, 0xFFFFFFFFLU);
- intern(MESH, 0xFFFFLU);
- intern(MESH, 0xAAAAAAAALU);
- intern(MESH, 0x55555555LU);
+ (void) intern(MESH, 0xFFFFFFFFLU);
+ (void) intern(MESH, 0xFFFFLU);
+ (void) intern(MESH, 0xAAAAAAAALU);
+ (void) intern(MESH, 0x55555555LU);
}
-
+
/*
* Miss Manners lives.
*/
- if (lineno > 2)
+ if (ick_lineno > 2)
{
- if (politesse == 0 || (lineno - 1) / politesse >= 5)
- lose(E079, iyylineno, (char *)NULL);
- else if (lineno / politesse < 3)
- lose(E099, iyylineno, (char *)NULL);
+ if (politesse == 0 || (ick_lineno - 1) / politesse >= 5)
+ ick_lose(IE079, iyylineno, (char *)NULL);
+ else if (ick_lineno / politesse < 3)
+ ick_lose(IE099, iyylineno, (char *)NULL);
}
/*
* check if we need to magically include the system library
*/
- needsyslib = FALSE;
+ needsyslib = ick_FALSE;
if(!pickcompile) /* AIS: We never need syslib when compiling
for PIC, because it's preoptimized. */
{
* can stop searching and won't need the syslib.
*/
if (tp->label >= 1000 && tp->label <= 1999) {
- needsyslib = FALSE;
+ needsyslib = ick_FALSE;
break;
}
/*
*/
if (tp->type == NEXT && tp->u.target >= 1000 &&
tp->u.target <= 1999)
- needsyslib = TRUE;
+ needsyslib = ick_TRUE;
}
}
- if ( needsyslib ) { /* AIS: modified to use findandfreopen */
- if (Base == 2) /* see code for opening the skeleton */
+ if ( needsyslib ) { /* AIS: modified to use ick_findandfreopen */
+ if (ick_Base == 2) /* see code for opening the skeleton */
+#ifndef HAVE_SNPRINTF
(void) sprintf(buf2, "%s.i", SYSLIB);
+#else
+ (void) snprintf(buf2, sizeof buf2, "%s.i", SYSLIB);
+#endif
else
- (void) sprintf(buf2, "%s.%di", SYSLIB, Base);
- if (findandfreopen(buf2, datadir, "r", argv[0], stdin) == 0)
- lose(E127, 1, (char*) NULL);
+#ifndef HAVE_SNPRINTF
+ (void) sprintf(buf2, "%s.%di", SYSLIB, ick_Base);
+#else
+ (void) snprintf(buf2, sizeof buf2, "%s.%di", SYSLIB, ick_Base);
+#endif
+ if (ick_findandfreopen(buf2, ick_datadir, "r", argv[0], stdin) == NULL)
+ ick_lose(IE127, 1, (char*) NULL);
#ifdef USE_YYRESTART
yyrestart(stdin);
#endif /* USE_YYRESTART */
- yyparse();
+ (void) yyparse();
+ textlinecount=iyylineno;
}
- /*
+ /*
* Now propagate type information up the expression tree.
* We need to do this because the unary-logical operations
* are sensitive to the type widths of their operands, so
codecheck(); /* check for compile-time errors */
/* AIS: And importantly, sort out line number references */
-
+
/* perform optimizations */
if (dooptimize)
for (tp = tuples; tp->type; tp++)
{
+ /* AIS: Allow breaching of the only specification on tuples
+ at this point; I've checked that tuples isn't reallocated
+ during the block, so this is fine. */
+ /*@-onlytrans@*/
optuple = tp;
+ /*@=onlytrans@*/
if (tp->type == GETS || tp->type == RESIZE
|| tp->type == FORGET || tp->type == RESUME
|| tp->type == FROM || tp->type == COMPUCOME)
/* decide if and where to place the compiler bug */
#ifdef USG
if (!nocompilerbug && lrand48() % 10 == 0)
- bugline = (int)(lrand48() % lineno);
+ bugline = (int)(lrand48() % ick_lineno);
#else
if (!nocompilerbug && rand() % 10 == 0)
- bugline = rand() % lineno;
+ bugline = rand() % ick_lineno;
#endif
else
bugline = -1;
/* set up the generated C output file name */
(void) strcpy(buf, argv[optind]);
(void) strcat(buf, ".c");
+ /* AIS: ofp holds fopened storage if !outtostdout, and local-copy
+ storage if outtostdout, and this is not a bug, although it
+ confuses Splint. */
+ /*@-branchstate@*/
if(outtostdout) ofp=stdout; /* AIS */
- else if((ofp = debfopen(buf, "w")) == (FILE *)NULL)
- lose(E888, 1, (char *)NULL);
+ else if((ofp = ick_debfopen(buf, "w")) == (FILE *)NULL)
+ ick_lose(IE888, 1, (char *)NULL);
+ /*@=branchstate@*/
- fseek(ifp,0L,0); /* rewind skeleton file */
+ (void) fseek(ifp,0L,0); /* rewind skeleton file */
/* AIS: Before changing argv[0], locate coopt.sh. */
- cooptsh = findandtestopen("coopt.sh", datadir, "rb", argv[0]);
+ cooptsh = ick_findandtestopen("coopt.sh", ick_datadir, "rb", argv[0]);
/* AIS: and calculate yukcmdstr. */
- sprintf(yukcmdstr,"%s" EXEEXT " %s %s",
- argv[optind],datadir,argv[0]);
+#ifndef HAVE_SNPRINTF
+ (void) sprintf(yukcmdstr,"%s" EXEEXT " %s %s",
+ argv[optind],ick_datadir,argv[0]);
+#else
+ (void) snprintf(yukcmdstr, sizeof yukcmdstr, "%s" EXEEXT " %s %s",
+ argv[optind], ick_datadir, argv[0]);
+#endif
/* AIS: Remove the filename from argv[0], leaving only a directory.
If this would leave it blank, change argv[0] to '.'.
This is so gcc can find the includes/libraries the same way that
- findandfreopen does. */
- if(strchr(argv[0],'/')) *(strrchr(argv[0],'/')) = 0;
- else strcpy(argv[0],".");
-
+ ick_findandfreopen does. */
+ /* JH: use a copy of argv[0] for the path, to ensure argv[0] is
+ * available for the next round
+ */
+ strcpy(path,argv[0]);
+ if(strchr(path,'/')) *(strrchr(path,'/')) = '\0';
+ else strcpy(path,".");
+
+#ifndef HAVE_SNPRINTF
(void) sprintf(buf2,
+#else
+ (void) snprintf(buf2, sizeof buf2,
+#endif
"%s %s%s-I%s -I%s -I%s/../include -L%s -L%s -L%s/../lib -O%c -o %s"
#ifdef __DJGPP__
EXEEXT " -lick%s%s","",
EXEEXT " -lick%s%s",compiler,
#endif
buf, yukdebug||yukprofile?" -lyuk ":" ",
- includedir, argv[0], argv[0], libdir, argv[0], argv[0],
+ includedir, path, path, libdir, path, path,
coopt?'3':'2', /* AIS: If coopting, optimize as much as possible */
argv[optind], multithread?"mt":"", cdebug?" -g":"");
/* AIS: Possibly link in the debugger yuk and/or libickmt.a here. */
/* AIS: Added -g support. */
- /* AIS: Added argv[0] to the -I, -L settings. */
-
+ /* AIS: Added argv[0] (now path) to the -I, -L settings. */
+
+ textlinecount=0; /* AIS: If there are no files, there's
+ no need to free any textlines */
while ((c = myfgetc(ifp)) != EOF)
- if (c != '$')
+ if (c != (int)'$')
(void) fputc(c, ofp);
else switch(myfgetc(ifp))
{
break;
case 'B': /* # of statements */
- (void) fprintf(ofp, "%d", lineno);
+ (void) fprintf(ofp, "%d", ick_lineno);
break;
case 'C': /* initial abstentions */
(void) fprintf(ofp, "1, ");
tp->exechance = -tp->exechance;
tp->initabstain=1; /* AIS: As above */
- /* AIS: If the line was abstained, we need to
+ /* AIS: If the line was ick_abstained, we need to
swap ONCEs and AGAINs on it round, to suit
the code degenerator. */
if(tp->onceagainflag == onceagain_ONCE)
if(tp->exechance > 0)
(void) fprintf(ofp, "ICK_INT1 ICKABSTAINED(%d)=0;\n",tp-tuples);
else
- (void) fprintf(ofp, "ICK_INT1 ICKABSTAINED(%d)=1;\n",tp-tuples);
+ (void) fprintf(ofp, "ICK_INT1 ICKABSTAINED(%d)=1;\n",tp-tuples);
}
}
if(!pickcompile) (void) fprintf(ofp, "}");
}
break;
- case 'D': /* linetypes array for abstention handling */
+ case 'D': /* linetypes ick_array for abstention handling */
maxabstain = 0;
for (tp = tuples; tp->type; tp++)
if (tp->type == ENABLE || tp->type == DISABLE || tp->type == MANYFROM)
case 'E': /* extern to intern map */
if(!pickcompile)
{
- (void) fprintf(ofp,"int Base = %d;\n",Base);
- (void) fprintf(ofp,"int Small_digits = %d;\n",
- Small_digits);
- (void) fprintf(ofp,"int Large_digits = %d;\n",
- Large_digits);
- (void) fprintf(ofp,"unsigned int Max_small = 0x%x;\n",
- Max_small);
- (void) fprintf(ofp,"unsigned int Max_large = 0x%x;\n",
- Max_large);
+ (void) fprintf(ofp,"int ick_Base = %d;\n",ick_Base);
+ (void) fprintf(ofp,"int ick_Small_digits = %d;\n",
+ ick_Small_digits);
+ (void) fprintf(ofp,"int ick_Large_digits = %d;\n",
+ ick_Large_digits);
+ (void) fprintf(ofp,"unsigned int ick_Max_small = 0x%x;\n",
+ ick_Max_small);
+ (void) fprintf(ofp,"unsigned int ick_Max_large = 0x%x;\n",
+ ick_Max_large);
if (yukprofile || yukdebug || multithread)
{ /* AIS: yuk.c, multithreading require all these to exist */
if(!nonespots) nonespots = 1;
if (variableconstants) /* AIS */
{
int temp=0;
- (void) fprintf(ofp, "type32 meshes[%d] = {",nmeshes);
+ (void) fprintf(ofp, "ick_type32 meshes[%d] = {",nmeshes);
while(temp<nmeshes)
{
- (void) fprintf(ofp, "%luLU, ", varextern(temp,MESH));
+ (void) fprintf(ofp, "%luLU, ", varextern((unsigned long)temp,MESH));
temp++;
}
(void) fprintf(ofp, "};\n");
}
-
+
if (nonespots)
{
(void) fprintf(ofp,
- "type16* onespots;\n");
+ "ick_type16* ick_onespots;\n");
(void) fprintf(ofp,
- "bool* oneforget;\n");
+ "ick_bool* ick_oneforget;\n");
if(yukprofile || yukdebug)
{
(void) fprintf(ofp,
- "type16 oneold[%d];\n",
+ "ick_type16 oneold[%d];\n",
nonespots);
(void) fprintf(ofp,
"signed char onewatch[%d];\n",
{
int temp=nonespots;
(void) fprintf(ofp,
- "overop* oo_onespots;\n");
+ "ick_overop* ick_oo_onespots;\n");
while(temp--)
(void) fprintf(ofp,
-"type32 og1spot%d(type32 t)\n{\n (void)t;\n return onespots[%d];\n}\n"
-"void os1spot%d(type32 val, void(*f)())\n{\n (void)f;\n assign((void*)"
-"(onespots+%d), ONESPOT, oneforget[%d], val);\n}\n",temp,temp,temp,temp,temp);
+"ick_type32 og1spot%d(ick_type32 t)\n{\n (void)t;\n return ick_onespots[%d];\n}\n"
+"void os1spot%d(ick_type32 val, void(*f)())\n{\n (void)f;\n ick_assign((void*)"
+"(ick_onespots+%d), ick_ONESPOT, ick_oneforget[%d], val);\n}\n",temp,temp,temp,temp,temp);
}
else if(multithread)
- (void) fprintf(ofp, "overop* oo_onespots=0;\n");
+ (void) fprintf(ofp, "ick_overop* ick_oo_onespots=0;\n");
}
if (ntwospots)
{
(void) fprintf(ofp,
- "type32* twospots;\n");
+ "ick_type32* ick_twospots;\n");
(void) fprintf(ofp,
- "bool* twoforget;\n");
+ "ick_bool* ick_twoforget;\n");
if(yukprofile || yukdebug)
{
(void) fprintf(ofp,
- "type32 twoold[%d];\n",
+ "ick_type32 twoold[%d];\n",
ntwospots);
(void) fprintf(ofp,
"signed char twowatch[%d];\n",
{
int temp=ntwospots;
(void) fprintf(ofp,
- "overop* oo_twospots;\n");
+ "ick_overop* ick_oo_twospots;\n");
while(temp--)
(void) fprintf(ofp,
-"type32 og2spot%d(type32 t)\n{\n (void)t;\n return twospots[%d];\n}\n"
-"void os2spot%d(type32 val, void(*f)())\n{\n (void)f;\n assign((void*)"
-"(twospots+%d), TWOSPOT, twoforget[%d], val);\n}\n",temp,temp,temp,temp,temp);
+"ick_type32 og2spot%d(ick_type32 t)\n{\n (void)t;\n return ick_twospots[%d];\n}\n"
+"void os2spot%d(ick_type32 val, void(*f)())\n{\n (void)f;\n ick_assign((void*)"
+"(ick_twospots+%d), ick_TWOSPOT, ick_twoforget[%d], val);\n}\n",temp,temp,temp,temp,temp);
}
else if(multithread)
- (void) fprintf(ofp, "overop* oo_twospots=0;\n");
+ (void) fprintf(ofp, "ick_overop* ick_oo_twospots=0;\n");
}
if (ntails)
{
(void) fprintf(ofp,
- "array* tails;\n");
+ "ick_array* ick_tails;\n");
(void) fprintf(ofp,
- "bool* tailforget;\n");
+ "ick_bool* ick_tailforget;\n");
if(multithread)
{
(void) fprintf(ofp,
if (nhybrids)
{
(void) fprintf(ofp,
- "array* hybrids;\n");
+ "ick_array* ick_hybrids;\n");
(void) fprintf(ofp,
- "bool* hyforget;\n");
+ "ick_bool* ick_hyforget;\n");
if(multithread)
{
(void) fprintf(ofp,
}
}
if (yydebug || compile_only)
- for (op = oblist; op < obdex; op++)
- if(op->type!=MESH) /* AIS: Added this check */
- (void) fprintf(ofp, " /* %s %d -> %d */\n",
- nameof(op->type, vartypes),
- op->extindex,
- op->intindex);
+ {
+ assert(oblist != NULL);
+ for (op = oblist; op < obdex; op++)
+ if(op->type!=MESH) /* AIS: Added this check */
+ (void) fprintf(ofp, " /* %s %lu -> %lu */\n",
+ nameof(op->type, vartypes),
+ op->extindex,
+ op->intindex);
+ }
if (yukdebug || yukprofile)
{ /* AIS: drop intern to extern map into the program */
(void) fprintf(ofp, "\nyukvar yukvars[]={\n");
+ assert(oblist != NULL);
for (op = oblist; op < obdex; op++)
if(op->type!=MESH) /* AIS: Added this check */
- (void) fprintf(ofp," {%s,%d,%d},\n",
+ (void) fprintf(ofp," {%s,%lu,%lu},\n",
nameof(op->type, vartypes),
op->extindex,
op->intindex);
/* Compiling for PIC */
/* Arrays not supported on PICs */
if(ntails || nhybrids)
- lose(E256, iyylineno, (char*) NULL);
+ ick_lose(IE256, iyylineno, (char*) NULL);
/* and neither are variable constants */
if(variableconstants)
- lose(E256, iyylineno, (char*) NULL);
+ ick_lose(IE256, iyylineno, (char*) NULL);
+ assert(oblist != NULL);
for (op = oblist; op < obdex; op++)
{
- (void) fprintf(ofp, " /* %s %d -> %d */\n",
+ (void) fprintf(ofp, " /* %s %lu -> %lu */\n",
nameof(op->type, vartypes),
op->extindex,
op->intindex);
- (void) fprintf(ofp, "#define %s%d %s[%d]\n",
+ (void) fprintf(ofp, "#define %s%lu %s[%lu]\n",
nameof(op->type, vartypes),
op->extindex,
nameof(op->type, varstores),
op->intindex);
if(op->ignorable)
- (void) fprintf(ofp, "ICK_INT1 ignore%s%d = 0;\n",
+ (void) fprintf(ofp, "ICK_INT1 ignore%s%lu = 0;\n",
nameof(op->type, varstores),
op->intindex);
}
if(nonespots)
{
(void) fprintf(ofp,
- "ICK_INT16 onespots[%d];\n"
+ "ICK_INT16 ick_onespots[%d];\n"
"ICK_INT16 onespotsstash[%d];\n",
nonespots,
nonespots);
if(opoverused) /* AIS */
{
int temp=nonespots;
- (void) fprintf(ofp,"overop* oo_onespots;\n");
+ (void) fprintf(ofp,"ick_overop* ick_oo_onespots;\n");
while(temp--)
(void) fprintf(ofp,
-"type32 og1spot%d(type32 t)\n{\n (void)t;\n return onespots[%d];\n}\n"
-"void os1spot%d(type32 val,void(*f)())\n{\n (void)f;\n if(!ignoreonespots%d)"
-" onespots[%d]=val;\n}\n",temp,temp,temp,temp,temp);
+"ick_type32 og1spot%d(ick_type32 t)\n{\n (void)t;\n return ick_onespots[%d];\n}\n"
+"void os1spot%d(ick_type32 val,void(*f)())\n{\n (void)f;\n if(!ignoreonespots%d)"
+" ick_onespots[%d]=val;\n}\n",temp,temp,temp,temp,temp);
}
}
if(ntwospots)
{
(void) fprintf(ofp,
- "ICK_INT32 twospots[%d];\n"
+ "ICK_INT32 ick_twospots[%d];\n"
"ICK_INT32 twospotsstash[%d];\n",
ntwospots,
ntwospots);
if(opoverused) /* AIS */
{
int temp=ntwospots;
- (void) fprintf(ofp,"overop* oo_twospots;\n");
+ (void) fprintf(ofp,"ick_overop* ick_oo_twospots;\n");
while(temp--)
(void) fprintf(ofp,
-"type32 og2spot%d(type32 t)\n{\n (void)t;\n return twospots[%d];\n}\n"
-"void os2spot%d(type32 val,void(*f)())\n{\n (void)f;\n if(!ignoretwospots%d)"
-" twospots[%d]=val;\n}\n",temp,temp,temp,temp,temp);
+"ick_type32 og2spot%d(ick_type32 t)\n{\n (void)t;\n return ick_twospots[%d];\n}\n"
+"void os2spot%d(ick_type32 val,void(*f)())\n{\n (void)f;\n if(!ignoretwospots%d)"
+" ick_twospots[%d]=val;\n}\n",temp,temp,temp,temp,temp);
}
}
(void) fprintf(ofp, "#include \"pick2.h\"\n");
break;
case 'F': /* set options from command line */
- if (clockface)
- (void) fprintf(ofp, "clockface(TRUE);\n");
- if (clcsemantics) /* AIS */
- (void) fprintf(ofp, "clcsemantics(TRUE);\n");
+ if (ick_clockface)
+ (void) fprintf(ofp, "ick_clockface(ick_TRUE);\n");
+ if (ick_clcsemantics) /* AIS */
+ (void) fprintf(ofp, "ick_setclcsemantics(ick_TRUE);\n");
break;
case 'G': /* degenerated code */
{
emit(tp, ofp);
if (i == bugline)
- (void) fprintf(ofp, " lose(E774, lineno, "
+ (void) fprintf(ofp, " ick_lose(IE774, ick_lineno, "
"(char *)NULL);\n");
}
break;
case 'H': /* COMPUCOME, and dispatching for resumes */
/* AIS: Added COMPUCOME here. This line must be fully guarded
to prevent a longjmp to an uninitialised buffer (it's
- guarded by a lose() in ick-wrap.c.) Also checks for
+ guarded by a ick_lose() in ick-wrap.c.) Also checks for
multithread; programs that mix normal and computed COME
FROM need to use the same conventions for both, so even
if no computed COME FROMs are used, the normal ones need
this line so that COME FROMs can be handled consistently.*/
if(compucomesused || multithread)
{
- (void) fprintf(ofp, "CCFL: ; CCF%d: longjmp(cjb,1);\n",
+ (void) fprintf(ofp, "CCFL: ; CCF%d: longjmp(ick_cjb,1);\n",
compucomecount);
}
#if 0
if (nextcount)
{
(void) fputs("/* generated switch for resumes */",ofp);
- (void) fputs("top:\n switch(skipto)\n {\n", ofp);
+ (void) fputs("top:\n switch(ick_skipto)\n {\n", ofp);
for (tp = tuples; tp->type; tp++)
if (tp->type == NEXT)
(void) fprintf(ofp,
(void) fprintf(ofp, "int lineofaboff[] = {\n");
for (tp = tuples; tp->type; tp++)
{
- fprintf(ofp,"%d,",tp->lineno);
+ fprintf(ofp,"%d,",tp->ick_lineno);
}
(void) fprintf(ofp, "-1};\n\n");
(void) fprintf(ofp, "int yukopts = %d;\n", yukprofile+yukdebug*2);
- (void) fprintf(ofp, "yptimer ypexectime[%d];\n", lineno);
- (void) fprintf(ofp, "ypcounter ypexecount[%d];\n",lineno);
- (void) fprintf(ofp, "ypcounter ypabscount[%d];\n",lineno);
+ (void) fprintf(ofp, "yptimer ypexectime[%d];\n", ick_lineno);
+ (void) fprintf(ofp, "ypcounter ypexecount[%d];\n",ick_lineno);
+ (void) fprintf(ofp, "ypcounter ypabscount[%d];\n",ick_lineno);
}
break;
overloads operands (I don't think this is used at
the moment, though) */
(void) fprintf(ofp, "#define OPOVERUSED %d\n",opoverused);
+ /* and whether to use the ICK_EC code */
+ if(useickec)
+ (void) fprintf(ofp, "#define ICK_EC 1\n");
break;
case 'N': /* allocate variables */
if(!pickcompile) /* AIS */
{
(void) fprintf(ofp,
- " onespots = calloc("
- "%d, sizeof *onespots);\n",
+ " ick_onespots = calloc("
+ "%d, sizeof *ick_onespots);\n",
nonespots);
(void) fprintf(ofp,
- " oneforget = calloc("
- "%d, sizeof *oneforget);\n",
+ " ick_oneforget = calloc("
+ "%d, sizeof *ick_oneforget);\n",
nonespots);
}
if(opoverused)
{
int temp=nonespots;
(void) fprintf(ofp,
-" oo_onespots=malloc(%d*sizeof*oo_onespots);\n",temp);
+" ick_oo_onespots=malloc(%d*sizeof*ick_oo_onespots);\n",temp);
while(temp--)
(void) fprintf(ofp,
-" oo_onespots[%d].get=og1spot%d;\n oo_onespots[%d].set=os1spot%d;\n",
+" ick_oo_onespots[%d].get=og1spot%d;\n ick_oo_onespots[%d].set=os1spot%d;\n",
temp,temp,temp,temp);
}
}
if(!pickcompile)
{
(void) fprintf(ofp,
- " twospots = calloc("
- "%d, sizeof *twospots);\n",
+ " ick_twospots = calloc("
+ "%d, sizeof *ick_twospots);\n",
ntwospots);
(void) fprintf(ofp,
- " twoforget = calloc("
- "%d, sizeof *twoforget);\n",
+ " ick_twoforget = calloc("
+ "%d, sizeof *ick_twoforget);\n",
ntwospots);
}
if(opoverused)
{
int temp=ntwospots;
(void) fprintf(ofp,
-" oo_twospots=malloc(%d*sizeof*oo_twospots);\n",temp);
+" ick_oo_twospots=malloc(%d*sizeof*ick_oo_twospots);\n",temp);
while(temp--)
(void) fprintf(ofp,
-" oo_twospots[%d].get=og2spot%d;\n oo_twospots[%d].set=os2spot%d;\n",
+" ick_oo_twospots[%d].get=og2spot%d;\n ick_oo_twospots[%d].set=os2spot%d;\n",
temp,temp,temp,temp);
}
}
if (ntails&&!pickcompile)
{
(void) fprintf(ofp,
- " tails = calloc("
- "%d, sizeof *tails);\n",
+ " ick_tails = calloc("
+ "%d, sizeof *ick_tails);\n",
ntails);
(void) fprintf(ofp,
- " tailforget = calloc("
- "%d, sizeof *tailforget);\n",
+ " ick_tailforget = calloc("
+ "%d, sizeof *ick_tailforget);\n",
ntails);
}
if (nhybrids&&!pickcompile)
{
(void) fprintf(ofp,
- " hybrids = calloc("
- "%d, sizeof *hybrids);\n",
+ " ick_hybrids = calloc("
+ "%d, sizeof *ick_hybrids);\n",
nhybrids);
(void) fprintf(ofp,
- " hyforget = calloc("
- "%d, sizeof *hyforget);\n",
+ " ick_hyforget = calloc("
+ "%d, sizeof *ick_hyforget);\n",
nhybrids);
}
break;
fprintf(ofp,"unsigned truelineno = 0;\n");
if(opoverused)
fprintf(ofp,"%s trueval;\n",
- pickcompile?"ICK_INT32":"type32");
+ pickcompile?"ICK_INT32":"ick_type32");
break;
case 'P': /* AIS: for operand overloading */
if(opoverused)
if(!outtostdout) (void) fclose(ofp);
-#ifndef __DJGPP__
+#ifndef __DJGPP__
/* OK, now sic the C compiler on the results */
- if (!compile_only&&!yukdebug&&!yukprofile)
+ if (!compile_only&&!yukdebug&&!yukprofile&&!useickec)
{
/* AIS: buf2 now assigned elsewhere so $L works */
(void) system(buf2);
/* AIS: no unlink if cdebug */ if(!cdebug) (void) unlink(buf);
}
- else if(!compile_only)
+ else if(!compile_only&&!useickec)
{ /* AIS: run, then delete all output but yuk.out */
/* Note that the output must be deleted for copyright
reasons (so as not to GPL a non-GPL file automatically) */
(void) system(buf2);
#ifdef HAVE_UNISTD_H
- dup2(oldstdin,0); /* restore stdin */
+ (void) dup2(oldstdin,0); /* restore stdin */
#endif
(void) system(yukcmdstr);
(void) unlink(buf);
}
#else /* we are using DJGPP */
/* OK, now sic the C compiler on the results */
- if (!compile_only)
+ if (!compile_only&&!useickec)
{
/* AIS: buf2 now assigned elsewhere so $L works */
/* AIS: This changes somewhat for DJGPP, due to the
FILE* rsp;
/* Use current dir as temp if needed */
char* tempfn="gcc @ickgcc.rsp";
- /* Three tries are used to find a temp directory.
+ /* Four tries are used to find a temp directory.
ICKTEMP is the preferred environment variable to check;
if, as expected, this isn't set, try TMPDIR (which DJGPP
sets to its own temp directory, at least when running under
if(isenv("TEMP")) tempfn="gcc @/dev/env/TEMP/ickgcc.rsp";
if(isenv("TMPDIR")) tempfn="gcc @/dev/env/TMPDIR/ickgcc.rsp";
if(isenv("ICKTEMP")) tempfn="gcc @/dev/env/ICKTEMP/ickgcc.rsp";
- rsp=debfopen(tempfn+5,"w");
+ rsp=ick_debfopen(tempfn+5,"w");
fprintf(rsp,"%s\n",buf2);
fclose(rsp);
system(tempfn);
#ifdef HAVE_UNISTD_H
dup2(oldstdin,0); /* restore stdin */
#endif
+#ifndef HAVE_SNPRINTF
sprintf(buf2,"%s" EXEEXT,argv[optind]);
+#else
+ snprintf(buf2,"%s" EXEEXT,argv[optind]);
+#endif
system(yukcmdstr);
remove(buf);
remove(buf2);
WRITE IN. Double-oh-sevens screw this up, too. */
if(cooptsh)
{
- sprintf(buf2,"sh %s %s", cooptsh, argv[optind]);
+#ifndef HAVE_SNPRINTF
+ (void) sprintf(buf2,"sh %s %s", cooptsh, argv[optind]);
+#else
+ (void) snprintf(buf2, sizeof buf2,
+ "sh %s %s", cooptsh, argv[optind]);
+#endif
(void) system(buf2); /* replaces the output executable if
neccesary */
}
}
}
(void) fclose(ifp);
+
+ if(!compile_only && useickec) /* AIS */
+ {
+ FILE* cioin;
+ FILE* cioallec;
+ char* buf2ptr;
+ long remspace;
+ char* tempfn="ickectmp.c";
+#if __DJGPP__
+ /* Look for a temp directory, as above. */
+ if(isenv("TMP")) tempfn="/dev/env/TMP/ickectmp.c";
+ if(isenv("TEMP")) tempfn="/dev/env/TEMP/ickectmp.c";
+ if(isenv("TMPDIR")) tempfn="/dev/env/TMPDIR/ickectmp.c";
+ if(isenv("ICKTEMP")) tempfn="/dev/env/ICKTEMP/ickectmp.c";
+#else
+ tempfn="/tmp/ickectmp.c"; /* always a valid temporary folder on POSIX */
+#endif
+ cioallec=ick_debfopen(tempfn,"w");
+ if(cioallec == NULL)
+ ick_lose(IE888, -1, (char*) NULL);
+ (void) fprintf(cioallec,"void ick_doresume(unsigned short,int);\n");
+ (void) fprintf(cioallec,"extern int ick_global_checkmode;\n");
+ (void) fprintf(cioallec,"void ick_allecfuncs(void)\n{\n");
+
+ /* Here, we run the C preprocessor on the files in question, then our
+ own preprocessor, and finally link all the files together into one
+ executable. */
+ for(optind=oldoptind; optind < argc; optind++)
+ {
+#ifndef HAVE_SNPRINTF
+ (void) sprintf(buf2,
+#else
+ (void) snprintf(buf2, sizeof buf2,
+#endif
+ "%s -E -I%s -I%s -I%s/../include %s.c > %s.cio",
+ compiler, includedir, path, path, argv[optind], argv[optind]);
+#if 0
+ ); /* for Emacs' autoindenter */
+#endif
+ if(argv[optind][strlen(argv[optind])+2]=='\0' /* it was a .c or .i file */
+ ||argv[optind][strlen(argv[optind])+3]!='o') /* it was a .2-7i file */
+ (void) system(buf2); /* run the C preprocessor */
+ buf2ptr = strrchr(buf2,'>'); /* get the .cio's filename */
+ cioin=NULL;
+ /* Do our preprocessing, by editing the file in place using rb+. */
+ if(buf2ptr != NULL && buf2ptr[1] != '\0' && buf2ptr[2] != '\0')
+ cioin=ick_debfopen(buf2ptr+2,"rb+");
+ if(cioin)
+ {
+ int inchar=fgetc(cioin);
+ int toparencount=0;
+ /* The ppnums are replacements for strings in the .cio file.
+ The choice of 65538 means that we don't clash with any
+ line numbers in the program, but do clash with the other
+ C-INTERCAL preprocessor (that handles WHILE); that isn't a
+ problem because external calls are inconsistent with
+ multithreading anyway. */
+ long ppnum1=65538L*2L;
+ long ppnum2=65538L*2L;
+ long ppnum3=65538L*2L;
+ long ciopos=0L;
+ /*@+charintliteral@*/ /* literal chars are ints */
+ while(inchar != EOF)
+ {
+ if(inchar=='I')
+ {
+ /* Look for the ICK_EC_PP_ string that indicates preprocessing
+ is needed. This method of doing it works as long as the
+ ICK_EC_PP_ string is never preceded by something which looks
+ like part of the same string, but luckily, it never is. */
+ if((inchar=fgetc(cioin))!='C') continue;
+ if((inchar=fgetc(cioin))!='K') continue;
+ if((inchar=fgetc(cioin))!='_') continue;
+ if((inchar=fgetc(cioin))!='E') continue;
+ if((inchar=fgetc(cioin))!='C') continue;
+ if((inchar=fgetc(cioin))!='_') continue;
+ if((inchar=fgetc(cioin))!='P') continue;
+ if((inchar=fgetc(cioin))!='P') continue;
+ if((inchar=fgetc(cioin))!='_') continue;
+ inchar=fgetc(cioin);
+ toparencount=0;
+ if(inchar=='0')
+ {
+ fprintf(cioallec,"#define X ");
+ while(fputc(fgetc(cioin),cioallec) != ')') toparencount++;
+ }
+ (void) fseek(cioin,ciopos,SEEK_SET);
+ switch(inchar)
+ {
+ case '0': /* a function exists */
+ fprintf(cioin," ");
+ fprintf(cioallec,"\nvoid X(void); X();\n"
+ "if(ick_global_checkmode==5) ick_doresume(1,-1);\n");
+ while(toparencount--) (void) fputc(' ',cioin);
+ break;
+ case '1':
+ fprintf(cioin,"%-11ld",ppnum1++/2);
+ break;
+ case '2':
+ fprintf(cioin,"%-11ld",ppnum2++/2);
+ break;
+ case '3':
+ fprintf(cioin,"%-11ld",ppnum3++/2);
+ break;
+ case '4':
+ fprintf(cioin,"%-11d",optind);
+ break;
+ default:
+ ick_lose(IE778, -1, (char*) NULL);
+ }
+ (void) fseek(cioin,0L,SEEK_CUR); /* synch the file */
+ }
+ ciopos=ftell(cioin);
+ inchar=fgetc(cioin);
+ }
+ /*@=charintliteral@*/
+ (void) fclose(cioin);
+ }
+ }
+ fprintf(cioallec,"if(ick_global_checkmode==2)\n");
+ fprintf(cioallec," ick_global_checkmode=4;\n");
+ fprintf(cioallec,"};\n");
+ (void) fclose(cioallec);
+
+ /* This command line needs some explanation, and is specific to gcc and
+ GNU ld. The -x causes gcc to interpret the .cio files as C; the
+ -Wl,-z,muldefs is an instruction to GNU ld, telling it to link in the
+ first main found and ignore the others. (That way, there can be a
+ main function in each .cio, but the .cios can be linked in any order,
+ with the right main function foremost each time.)
+ */
+#ifdef HAVE_SNPRINTF
+ (void) snprintf(buf2, sizeof buf2,
+#else
+ (void) sprintf(buf2,
+#endif
+ "%s -L%s -L%s -L%s/../lib -O2 -o %s" EXEEXT
+ "%s -Wl,-z,muldefs -x c %s", compiler, libdir,
+ path, path, argv[oldoptind], cdebug?" -g":"", tempfn);
+#if 0
+ ); /* for Emacs' autoindenter */
+#endif
+ remspace = (long)(sizeof buf2 - strlen(buf2) - 1);
+ for(optind=oldoptind; optind < argc; optind++)
+ {
+ remspace -= strlen(argv[optind]) - 5; /* 5 for <space>.cio */
+ if(remspace <= 0)
+ ick_lose(IE666, -1, (char*)NULL);
+ strcat(buf2," ");
+ strcat(buf2,argv[optind]);
+ strcat(buf2,".cio");
+ }
+ remspace -= strlen(" -lickec");
+ if(remspace <= 0)
+ ick_lose(IE666, -1, (char*)NULL);
+ strcat(buf2," -lickec");
+ (void) system(buf2);
+ }
+
+ /* AIS: Free malloc'd memory. */
+ if(textlines)
+ {
+ /* Marking what textlines points to as only would be the 'right'
+ way to do this (because it is only), but I can't figure out the
+ syntax to do it, so instead I'm supressing the warning that comes
+ up because it isn't marked as only. */
+ /*@-unqualifiedtrans@*/
+ while(textlinecount--) free(textlines[textlinecount]);
+ free(textlines);
+ /*@=unqualifiedtrans@*/
+ }
+
#ifdef HAVE_UNISTD_H
(void) close(oldstdin); /* AIS */
#endif
+ /* This point is the very end of the program. So it's correct for
+ normal DO NOT FREE UNDER ANY CIRCUMSTANCES globals to be free
+ at this point, so supressing the warning given as a result. */
+ /*@-globstate@*/
return 0;
+ /*@=globstate@*/
}
/* perpet.c ends here */
This should block the program; the SLEEP command is one possibility,
somehow getting the PIC to disconnect its own power supply and signal
an error is another. */
-#define lose(a,b,c) for(;;)
+#define ick_lose(a,b,c) for(;;)
/* PORTA, PORTB, TRISA, and TRISB must be variables which, when read or
modified, read or modify the corresponding location in the PIC's RAM;
/* If your implementation doesn't use function pointers, delete this and
don't write any code that uses operator-overloading. */
-typedef struct overop_t
+typedef struct ick_overop_t
{
ICK_INT32 (*get)(ICK_INT32);
void (*set)(ICK_INT32);
-} overop;
+} ick_overop;
-#define type16 ICK_INT16
-#define type32 ICK_INT32
+#define ick_type16 ICK_INT16
+#define ick_type32 ICK_INT32
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define resume popnext
+#define ick_resume ick_popnext
-ICK_INT32 mingle(ICK_INT16 r, ICK_INT16 s)
+ICK_INT32 ick_mingle(ICK_INT16 r, ICK_INT16 s)
{
r = ((r & 0x0000ff00) << 8) | (r & 0x000000ff);
r = ((r & 0x00f000f0) << 4) | (r & 0x000f000f);
return (r << 1) | s;
}
-ICK_INT32 iselect(ICK_INT32 r, ICK_INT32 s)
+ICK_INT32 ick_iselect(ICK_INT32 r, ICK_INT32 s)
{
ICK_INT32 i = 1, t = 0;
while (s) {
return t;
}
-ICK_INT16 and16(ICK_INT16 n)
+ICK_INT16 ick_and16(ICK_INT16 n)
{
ICK_INT16 m;
m = (n >> 1);
return(m & n);
}
-ICK_INT16 or16(ICK_INT16 n)
+ICK_INT16 ick_or16(ICK_INT16 n)
{
ICK_INT16 m;
m = (n >> 1);
return(m | n);
}
-ICK_INT32 and32(ICK_INT32 n)
+ICK_INT32 ick_and32(ICK_INT32 n)
{
ICK_INT32 m;
m = (n >> 1);
return(m & n);
}
-ICK_INT32 or32(ICK_INT32 n)
+ICK_INT32 ick_or32(ICK_INT32 n)
{
ICK_INT32 m;
m = (n >> 1);
return(m | n);
}
-ICK_INT16 xor16(ICK_INT16 n)
+ICK_INT16 ick_xor16(ICK_INT16 n)
{
ICK_INT16 m;
m = (n >> 1);
return(m ^ n);
}
-ICK_INT32 xor32(ICK_INT32 n)
+ICK_INT32 ick_xor32(ICK_INT32 n)
{
ICK_INT32 m;
m = (n >> 1);
return(m ^ n);
}
-ICK_INT8 nextindex = 0;
-ICK_INT16 next[16];
+ICK_INT8 ick_nextindex = 0;
+ICK_INT16 ick_next[16];
-void pushnext(ICK_INT16 n)
+void ick_pushnext(ICK_INT16 n)
{
- next[nextindex++] = n;
+ ick_next[ick_nextindex++] = n;
}
-ICK_INT16 popnext(ICK_INT8 n)
+ICK_INT16 ick_popnext(ICK_INT8 n)
{
- if (nextindex < n) {
- nextindex = 0;
+ if (ick_nextindex < n) {
+ ick_nextindex = 0;
return (ICK_INT16)-1;
}
else
- nextindex -= n;
- return(next[nextindex]);
+ ick_nextindex -= n;
+ return(ick_next[ick_nextindex]);
}
/* It's hard to do randomization on a PIC. */
-ICK_INT1 roll(ICK_INT8 n)
+ICK_INT1 ick_roll(ICK_INT8 n)
{
return n>50;
}
$K
#define ICKABSTAINED(d) abstain##d
-#define ICKSTASH(a,b,c,d) c##stash[b]=c[b]
-#define ICKRETRIEVE(a,b,c,d,e) a[b]=a##stash[b]
+#define ICKSTASH(a,b,c,d) c##ick_stash[b]=c[b]
+#define ICKRETRIEVE(a,b,c,d,e) a[b]=a##ick_stash[b]
#define ICKIGNORE(a,b,c) ignore##c##b
-ICK_INT16 skipto=0;
+ICK_INT16 ick_skipto=0;
$O
$C
$D
$P
-int main(void)
+int ick_main(void)
{
pickinit();
/* degenerated code */
ick_restart:
top:
- switch(skipto)
+ switch(ick_skipto)
{
case 0:
$G
#ifdef YUK
if(yukloop) goto ick_restart;
#endif
- lose(E633, $J, (char *)0);
+ ick_lose(IE633, $J, (char *)0);
$H
/* sizes.h -- constants defining the numeric base for INTERCAL variations */
-extern int Base;
-extern int Small_digits;
-extern int Large_digits;
-extern unsigned int Max_small;
-extern unsigned int Max_large;
+extern int ick_Base;
+extern int ick_Small_digits;
+extern int ick_Large_digits;
+extern unsigned int ick_Max_small;
+extern unsigned int ick_Max_large;
/* sizes.h ends here */
--- /dev/null
+-*- compilation -*-
+yuk.h:21:14: Variable textlines redeclared with inconsistent type (arrays and
+ pointers are not identical in variable declarations): char * []
+ A function, variable or constant is redefined with a different type. (Use
+ -incondefs to inhibit warning)
+ ick.h:141:26: Previous declaration of textlines: char **
+dekludge.c:101:5: Function exported but not used outside dekludge: abstainmatch
+ A declaration is exported, but not used outside this module. Declaration can
+ use static qualifier. (Use -exportlocal to inhibit warning)
+ dekludge.c:113:1: Definition of abstainmatch
+
#include "uncommon.h"
/* Options that might affect this */
-int printfopens=0;
+int ick_printfopens=0;
-FILE* debfopen(char* fname, char* mode)
+/*@dependent@*/ /*@null@*/ FILE* ick_debfopen(/*@observer@*/ char* fname,
+ /*@observer@*/ char* mode)
{
FILE* t;
- if(printfopens) fprintf(stderr,"Trying to open '%s'...\n",fname);
+ if(ick_printfopens) fprintf(stderr,"Trying to open '%s'...\n",fname);
t=fopen(fname,mode);
- if(printfopens&&t) fprintf(stderr,"Success!\n");
- if(printfopens&&!t) fprintf(stderr,"Failed!\n");
+ if(ick_printfopens && t != NULL) fprintf(stderr,"Success!\n");
+ if(ick_printfopens && t == NULL) fprintf(stderr,"Failed!\n");
return t;
}
-/* This function looks for the skeleton and syslib, searching first the
+/* This function looks for the skeleton and syslib, searching ick_first the
path they should be in, then the current directory, then argv[0]'s
directory (if one was given). This function avoids possible buffer
overflows, instead truncating filenames (and if that manages to find them,
I'll be incredibly surprised). It also tries argv[0]/../lib and
argv[0]/../include (where they are when running without installing). */
-FILE* findandfopen(char* file, char* guessdir, char* mode, char* argv0)
+/*@dependent@*/ /*@null@*/ FILE* ick_findandfopen(/*@observer@*/ char* file,
+ /*@observer@*/ char* guessdir,
+ /*@observer@*/ char* mode,
+ /*@observer@*/ char* argv0)
{
- char buf2[BUFSIZ], *fileiter;
- int i = 0, j;
+ static char buf2[BUFSIZ];
+ /*@observer@*/ static char *fileiter;
+ size_t i = 0, j;
FILE* ret;
- while(*guessdir&&i<BUFSIZ-2) buf2[i++] = *guessdir++;
+ while(*guessdir != '\0' && i<BUFSIZ-2) buf2[i++] = *guessdir++;
buf2[i++] = '/';
fileiter = file;
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
- buf2[i] = 0;
- ret = debfopen(buf2,mode); /* where it ought to be */
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ buf2[i] = '\0';
+ ret = ick_debfopen(buf2,mode); /* where it ought to be */
if(ret) return ret;
- ret = debfopen(file,mode); /* current dir */
+ ret = ick_debfopen(file,mode); /* current dir */
if(ret) return ret;
if(!strchr(argv0,'/')&&
- !strchr(argv0,'\\')) return 0; /* argv[0] has no dir specified */
+ !strchr(argv0,'\\')) return NULL; /* argv[0] has no dir specified */
i = j = 0;
- while(*argv0&&i<BUFSIZ-2)
+ while(*argv0 != '\0' && i<BUFSIZ-2)
{
buf2[i++] = *argv0++;
if(*argv0=='/') j = i;
}
i = j + 1;
fileiter=file;
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
- buf2[i] = 0;
- ret = debfopen(buf2,mode); /* argv[0]'s dir */
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ buf2[i] = '\0';
+ ret = ick_debfopen(buf2,mode); /* argv[0]'s dir */
if(ret) return ret;
i = j + 1;
fileiter="../lib/"; /* correct for POSIX and DJGPP */
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
fileiter=file;
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
- buf2[i]=0;
- ret = debfopen(buf2,mode); /* argv[0]/../lib/ */
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ buf2[i]='\0';
+ ret = ick_debfopen(buf2,mode); /* argv[0]/../lib/ */
if(ret) return ret;
i = j + 1;
fileiter="../include/"; /* correct for POSIX and DJGPP */
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
fileiter=file;
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
- buf2[i]=0;
- ret = debfopen(buf2,mode); /* argv[0]/../include/ */
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ buf2[i]='\0';
+ ret = ick_debfopen(buf2,mode); /* argv[0]/../include/ */
if(ret) return ret;
- return 0; /* just return 0 if even this failed */
+ return NULL; /* just return 0 if even this failed */
}
/* AIS: The same, looking for an executable */
-char* findandtestopen(char* file, char* guessdir, char* mode,
- char* argv0)
+/*@observer@*/ /*@null@*/ char* ick_findandtestopen(/*@observer@*/ char* file,
+ /*@observer@*/ char* guessdir,
+ /*@observer@*/ char* mode,
+ /*@observer@*/ char* argv0)
{
- static char buf2[BUFSIZ], *fileiter;
- int i = 0, j;
+ static char buf2[BUFSIZ];
+ /*@observer@*/ static char *fileiter;
+ size_t i = 0, j;
FILE* ret;
- while(*guessdir&&i<BUFSIZ-2) buf2[i++] = *guessdir++;
+ while(*guessdir != '\0' && i<BUFSIZ-2) buf2[i++] = *guessdir++;
buf2[i++] = '/';
fileiter = file;
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
- buf2[i] = 0;
- ret = debfopen(buf2,mode); /* where it ought to be */
- if(ret) {fclose(ret); return buf2;}
- ret = debfopen(file,mode); /* current dir */
- if(ret) {fclose(ret); return file;}
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ buf2[i] = '\0';
+ ret = ick_debfopen(buf2,mode); /* where it ought to be */
+ if(ret) {(void) fclose(ret); return buf2;}
+ ret = ick_debfopen(file,mode); /* current dir */
+ if(ret) {(void) fclose(ret); return file;}
if(!strchr(argv0,'/')&&
!strchr(argv0,'\\')) return 0; /* argv[0] has no dir specified */
i = j = 0;
- while(*argv0&&i<BUFSIZ-2)
+ while(*argv0 != '\0' && i<BUFSIZ-2)
{
buf2[i++] = *argv0++;
if(*argv0=='/') j = i;
}
i = j + 1;
fileiter=file;
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
- buf2[i] = 0;
- ret = debfopen(buf2,mode); /* argv[0]'s dir */
- if(ret) {fclose(ret); return buf2;}
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ buf2[i] = '\0';
+ ret = ick_debfopen(buf2,mode); /* argv[0]'s dir */
+ if(ret) {(void) fclose(ret); return buf2;}
i = j + 1;
fileiter="../lib/"; /* correct for POSIX and DJGPP */
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
fileiter=file;
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
- buf2[i]=0;
- ret = debfopen(buf2,mode); /* argv[0]/../lib/ */
- if(ret) {fclose(ret); return buf2;}
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ buf2[i]='\0';
+ ret = ick_debfopen(buf2,mode); /* argv[0]/../lib/ */
+ if(ret) {(void) fclose(ret); return buf2;}
i = j + 1;
fileiter="../include/"; /* correct for POSIX and DJGPP */
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
fileiter=file;
- while(*fileiter&&i<BUFSIZ-1) buf2[i++] = *fileiter++;
- buf2[i]=0;
- ret = debfopen(buf2,mode); /* argv[0]/../include/ */
- if(ret) {fclose(ret); return buf2;}
+ while(*fileiter != '\0' && i<BUFSIZ-1) buf2[i++] = *fileiter++;
+ buf2[i]='\0';
+ ret = ick_debfopen(buf2,mode); /* argv[0]/../include/ */
+ if(ret) {(void) fclose(ret); return buf2;}
return 0; /* just return 0 if even this failed */
}
/* AIS: The same thing, but with freopen */
-FILE* findandfreopen(char* file, char* guessdir, char* mode,
- char* argv0, FILE* over)
+/*@dependent@*/ /*@null@*/ FILE* ick_findandfreopen(/*@observer@*/ char* file,
+ /*@observer@*/ char* guessdir,
+ /*@observer@*/ char* mode,
+ /*@observer@*/ char* argv0,
+ FILE* over)
{
- char* s=findandtestopen(file,guessdir,mode,argv0);
- return freopen(s,mode,over);
+ char* s=ick_findandtestopen(file,guessdir,mode,argv0);
+ if(s != NULL)
+ return freopen(s,mode,over);
+ else
+ return NULL;
}
/* uncommon.h -- declarations for uncommon.c and C files linked to it */
-extern FILE* debfopen(char*, char*);
-extern FILE* findandfopen(char*, char*, char*, char*);
-extern char* findandtestopen(char*, char*, char*, char*);
-extern FILE* findandfreopen(char*, char*, char*, char*, FILE*);
+#include "config.h"
+
+/*@null@*/ /*@dependent@*/ extern FILE* ick_debfopen(/*@observer@*/ char*, /*@observer@*/ char*);
+/*@null@*/ /*@dependent@*/ extern FILE* ick_findandfopen(/*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*);
+/*@observer@*/ /*@null@*/ extern char* ick_findandtestopen(/*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*);
+/*@null@*/ /*@dependent@*/ extern FILE* ick_findandfreopen(/*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*, FILE*);
It is strictly to be used only when neccesary, or when writing INTERCAL
compilers. They also lead to weird portability problems when you don't obey
all the restrictions put on them by the C standard. For instance,
- if(setjmp(cjb)!=0) puts("Jumped"); is portable, but
- if(setjmp(cjb)) puts("Jumped"); is not, despite seeming to mean exactly the
+ if(setjmp(ick_cjb)!=0) puts("Jumped"); is portable, but
+ if(setjmp(ick_cjb)) puts("Jumped"); is not, despite seeming to mean exactly the
same thing. Also, the address of setjmp can't be taken. Semantically,
setjmp/longjmp lets you do the same crazy things like goto, like jump into
the middle of a loop, except in this case the loop can be in a different
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
+#include <assert.h>
#define MULTITHREAD 1
#include "sizes.h"
#include "abcess.h"
-#include "lose.h"
+#include "ick_lose.h"
int gonebackto; /* Is the choicepoint reached by GOING BACK? */
static int choicing = 0; /* Is a multithread function being used to do
backtracking processing? */
jmp_buf btjb; /* The backtracking jmp_buf */
-static ickthread* topchoice; /* Top of the choicepoint stack */
-extern int lineno; /* Keep track of error-message lines */
+/* About the annotation 'dependent': topchoice is really 'owned', but the owner keeps
+ on changing. So Splint gets less confused if we simply never tell it who the owner
+ is. */
+/*@null@*/ /*@dependent@*/ static ickthread* topchoice; /* Top of the choicepoint stack */
+extern int ick_lineno; /* Keep track of error-message lines */
-extern int printflow; /* from arrgghh.c; a debug option */
+extern int ick_printflow; /* from arrgghh.c; a debug option */
int weaving=0; /* Weave newly created threads? */
static void fluputs(char* s)
{
printf("%s",s);
- fflush(stdout);
+ (void) fflush(stdout);
}
/**********************************************************************
int oldweave;
if(gonebackto)
{ /* Create a stale choicepoint */
- if(printflow) fluputs("(back)");
+ if(ick_printflow) fluputs("(back)");
oldtc = topchoice;
+ /* Suppress the onlytrans warning because we're allocating a member
+ of a linked list, which confuses Splint no matter what the list
+ is flagged as (because malloc returns 'only' data, but yet that
+ data has to be pointed to by other 'only' data in the same list). */
+ /*@-onlytrans@*/
topchoice = (ickthread*) malloc(sizeof(ickthread));
- if(!topchoice) lose(E991, lineno, (char*) NULL);
+ /*@=onlytrans@*/
+ if(!topchoice) ick_lose(IE991, ick_lineno, (char*) NULL);
topchoice->choicepoint = oldtc;
topchoice->stale = 1;
topchoice->refcount = 1; /* At the moment, this is the only
thread looking at this choicepoint */
topchoice->dsi=topchoice;
topchoice->usesthis=0;
+ /* topchoice needn't be completely defined if it's stale */
+ /*@-compdef@*/
return;
+ /*@=compdef@*/
}
else
{ /* Create a new choicepoint */
- if(printflow) fluputs("(maybe)");
+ if(ick_printflow) fluputs("(maybe)");
oldprev = ickmt_prev;
choicing = 1;
oldweave = weaving;
weaving = 0;
- multicome1(lineno,btjb); /* Duplicate data */
+ (void) multicome1(ick_lineno,btjb); /* Duplicate data */
weaving = oldweave;
choicing = 0;
- oldprev->next = ickmt_cur;
+ oldprev->ick_next = ickmt_cur;
ickmt_prev->choicepoint = topchoice;
topchoice = ickmt_prev;
ickmt_prev = oldprev;
ickthread* tempthread;
jmp_buf fakepc;
- if(!topchoice) lose(E404, lineno, (char*) NULL); /* That's what E404's for */
+ if(!topchoice) ick_lose(IE404, ick_lineno, (char*) NULL); /* That's what IE404's for */
/* GO AHEAD with multithreading requires care. The choicepoint should only
- be removed from this thread. topchoice = topchoice->next almost works, but
+ be removed from this thread. topchoice = topchoice->ick_next almost works, but
is a memory leak. So most of this is garbage-collection. */
/* If other threads are using the choicepoint, don't free it. */
if(topchoice->refcount > 1)
{
- if(printflow) fluputs("(refahead)");
+ if(ick_printflow) fluputs("(refahead)");
topchoice->refcount--;
topchoice = topchoice->choicepoint;
return;
/* Freeing a stale choicepoint (which contains no data) is easy. */
if(topchoice->stale)
{
- if(printflow) fluputs("(destale)");
+ if(ick_printflow) fluputs("(destale)");
tempthread = topchoice;
topchoice = topchoice->choicepoint;
+ /*@-dependenttrans@*/ /* because it's really owned, not dependent */
free(tempthread);
+ /*@=dependenttrans@*/
return;
}
- if(printflow) fluputs("(ahead)");
+ if(ick_printflow) fluputs("(ahead)");
/* This code works by converting topchoice back to a thread and placing it
just before the current thread, and then killing it. First, the data from
choicing = 1;
if(setjmp(fakepc) == 0)
{
- memcpy(ickmt_cur->pc,fakepc,sizeof(jmp_buf));
+ memcpy((void*)ickmt_cur->pc,(void*)fakepc,sizeof(jmp_buf));
nextthread(fakepc, -1, 5);
}
choicing = 0;
/* That's saved the current thread's data. Now to convert topchoice to a
thread. */
tempthread = topchoice->choicepoint;
- ickmt_prev->next = topchoice;
- topchoice->next = ickmt_cur;
+ ickmt_prev->ick_next = topchoice;
+ topchoice->ick_next = ickmt_cur;
ickmt_cur = topchoice;
topchoice = tempthread;
/* Let's load the backtracking data... */
choicing = 1;
if(setjmp(fakepc) == 0)
{
- memcpy(ickmt_cur->pc,fakepc,sizeof(jmp_buf));
+ memcpy((void *)ickmt_cur->pc,(void *)fakepc,sizeof(jmp_buf));
nextthread(fakepc, -1, 6);
}
/* only to destroy it! Mwahahahahah! */
if(setjmp(fakepc) == 0)
{
- memcpy(ickmt_cur->next->pc,fakepc,sizeof(jmp_buf));
+ memcpy((void *)ickmt_cur->ick_next->pc,(void *)fakepc,sizeof(jmp_buf));
killthread();
}
choicing = 0;
void choiceback(void)
{
- if(!topchoice) lose(E404, lineno, (char *) NULL);
+ if(!topchoice) ick_lose(IE404, ick_lineno, (char *) NULL);
if(topchoice->stale)
{
- if(printflow) fluputs("(back=)");
+ if(ick_printflow) fluputs("(back=)");
choiceahead();
return;
}
/* The Threaded INTERCAL standard states that if other threads are using
the choicepoint, a GO BACK should cause the thread it's in to be
killed. (Of course, if it's stale, it should just have been removed.)*/
- if(printflow) fluputs("(desplit)");
+ if(ick_printflow) fluputs("(desplit)");
killthread();
return;
}
- topchoice->next = ickmt_cur->next;
- ickmt_cur->next = topchoice;
+ topchoice->ick_next = ickmt_cur->ick_next;
+ ickmt_cur->ick_next = topchoice;
topchoice = topchoice->choicepoint;
- if(ickmt_cur==ickmt_prev) ickmt_prev = ickmt_cur->next;
+ if(ickmt_cur==ickmt_prev) ickmt_prev = ickmt_cur->ick_next;
choicing = 2; /* Tells killthread to set it back to 0 */
killthread();
}
*
* This function is called when two COME FROMs reference the same
* line at runtime. multicome1 is used in a multithread
- * program; it forks the program. For multicome0, see cesspool.c.
+ * program; it forks the program. For ick_multicome0, see cesspool.c.
*
*********************************************************************/
call nextthread. The upshot of all this is that all this thread's
data is stored in the new thread's state. Then, we have to copy
all this thread's current data to new locations. */
- static ickthread* newthread;
+ ickthread* newthread;
jmp_buf fakepc;
- stashbox *isb, *isb2, *isbprev;
+ ick_stashbox *isb, *isb2, *isbprev;
void* tvp;
- array* a;
+ ick_array* a;
int prod, i, j;
newthread = malloc(sizeof(ickthread));
- if(!newthread) lose(E991, errlineno, (char *) NULL);
- ickmt_prev->next = newthread;
- newthread->next = ickmt_cur;
+ if(!newthread) ick_lose(IE991, errlineno, (char *) NULL);
+ ickmt_prev->ick_next = newthread;
+ newthread->ick_next = ickmt_cur;
ickmt_cur = newthread;
newthread->dsi=newthread;
newthread->usesthis=0;
- if(printflow && !choicing) fluputs("(fork)");
+ if(ick_printflow && !choicing) fluputs("(fork)");
if(setjmp(fakepc) == 0)
{
- memcpy(newthread->next->pc,fakepc,sizeof(jmp_buf));
+ memcpy((void *)newthread->ick_next->pc,(void *)fakepc,sizeof(jmp_buf));
nextthread(pc, -1, 1);
}
/* So on the previous line: Save the value of pc as the program
{
/* duplicate variables, forget indicators */
i = onespotcount;
- tvp = onespots;
- onespots = malloc(i * sizeof *onespots);
- if(!onespots) lose(E991, errlineno, (char *) NULL);
- memcpy(onespots, tvp, i * sizeof *onespots);
- if(oo_onespots)
+ tvp = ick_onespots;
+ ick_onespots = malloc(i * sizeof *ick_onespots);
+ if(!ick_onespots) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_onespots, tvp, i * sizeof *ick_onespots);
+ if(ick_oo_onespots)
{
- tvp = oo_onespots;
- oo_onespots = malloc(i * sizeof *oo_onespots);
- if(!oo_onespots) lose(E991, errlineno, (char *) NULL);
- memcpy(oo_onespots, tvp, i * sizeof *oo_onespots);
+ tvp = ick_oo_onespots;
+ ick_oo_onespots = malloc(i * sizeof *ick_oo_onespots);
+ if(!ick_oo_onespots) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_oo_onespots, tvp, i * sizeof *ick_oo_onespots);
}
i = twospotcount;
- tvp = twospots;
- twospots = malloc(i * sizeof *twospots);
- if(!twospots) lose(E991, errlineno, (char *) NULL);
- memcpy(twospots, tvp, i * sizeof *twospots);
- if(oo_twospots)
+ tvp = ick_twospots;
+ ick_twospots = malloc(i * sizeof *ick_twospots);
+ if(!ick_twospots) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_twospots, tvp, i * sizeof *ick_twospots);
+ if(ick_oo_twospots)
{
- tvp = oo_twospots;
- oo_twospots = malloc(i * sizeof *oo_twospots);
- if(!oo_twospots) lose(E991, errlineno, (char *) NULL);
- memcpy(oo_twospots, tvp, i * sizeof *oo_twospots);
+ tvp = ick_oo_twospots;
+ ick_oo_twospots = malloc(i * sizeof *ick_oo_twospots);
+ if(!ick_oo_twospots) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_oo_twospots, tvp, i * sizeof *ick_oo_twospots);
}
i = tailcount;
- tvp = tails;
- tails = malloc(i * sizeof *tails);
- if(!tails) lose(E991, errlineno, (char *) NULL);
- memcpy(tails, tvp, i * sizeof *tails);
+ tvp = ick_tails;
+ ick_tails = malloc(i * sizeof *ick_tails);
+ if(!ick_tails) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_tails, tvp, i * sizeof *ick_tails);
i = hybridcount;
- tvp = hybrids;
- hybrids = malloc(i * sizeof *hybrids);
- if(!hybrids) lose(E991, errlineno, (char *) NULL);
- memcpy(hybrids, tvp, i * sizeof *hybrids);
+ tvp = ick_hybrids;
+ ick_hybrids = malloc(i * sizeof *ick_hybrids);
+ if(!ick_hybrids) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_hybrids, tvp, i * sizeof *ick_hybrids);
i = onespotcount;
- tvp = oneforget;
- oneforget = malloc(i * sizeof *oneforget);
- if(!oneforget) lose(E991, errlineno, (char *) NULL);
- memcpy(oneforget, tvp, i * sizeof *oneforget);
+ tvp = ick_oneforget;
+ ick_oneforget = malloc(i * sizeof *ick_oneforget);
+ if(!ick_oneforget) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_oneforget, tvp, i * sizeof *ick_oneforget);
i = twospotcount;
- tvp = twoforget;
- twoforget = malloc(i * sizeof *twoforget);
- if(!twoforget) lose(E991, errlineno, (char *) NULL);
- memcpy(twoforget, tvp, i * sizeof *twoforget);
+ tvp = ick_twoforget;
+ ick_twoforget = malloc(i * sizeof *ick_twoforget);
+ if(!ick_twoforget) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_twoforget, tvp, i * sizeof *ick_twoforget);
i = tailcount;
- tvp = tailforget;
- tailforget = malloc(i * sizeof *tailforget);
- if(!tailforget) lose(E991, errlineno, (char *) NULL);
- memcpy(tailforget, tvp, i * sizeof *tailforget);
+ tvp = ick_tailforget;
+ ick_tailforget = malloc(i * sizeof *ick_tailforget);
+ if(!ick_tailforget) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_tailforget, tvp, i * sizeof *ick_tailforget);
i = hybridcount;
- tvp = hyforget;
- hyforget = malloc(i * sizeof *hyforget);
- if(!hyforget) lose(E991, errlineno, (char *) NULL);
- memcpy(hyforget, tvp, i * sizeof *hyforget);
+ tvp = ick_hyforget;
+ ick_hyforget = malloc(i * sizeof *ick_hyforget);
+ if(!ick_hyforget) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_hyforget, tvp, i * sizeof *ick_hyforget);
/* duplicate data stored in arrays */
j = tailcount;
+ tvp = NULL;
while(j--)
{
- a = tails+j; /* &(tails[j]) */
- if(!a->rank||!a->dims) continue; /* don't duplicate a deallocated array */
+ a = ick_tails+j; /* &(ick_tails[j]) */
+ if(!a->rank||!a->dims) continue; /* don't duplicate a deallocated ick_array */
tvp = a->dims;
- /* Much of this code is paraphrased from the stashbox-copying code below,
+ /* Much of this code is paraphrased from the ick_stashbox-copying code below,
which was in turn paraphrased from a section in cesspool.c I didn't
write. So any errors in this code are probably mine, but the algorithm
isn't. */
- a->dims = malloc(a->rank * sizeof(unsigned int));
- memcpy(a->dims, tvp, a->rank * sizeof(unsigned int));
- prod = !!a->rank;
- i = a->rank;
+ a->dims = malloc(a->rank * sizeof *(a->dims));
+ if(a->dims == NULL) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(a->dims, tvp, a->rank * sizeof *(a->dims));
+ prod = (int)!!a->rank;
+ i = (int)a->rank;
while(i--) prod *= a->dims[i];
+ /*@-mustfreeonly@*/ /* how on earth did a->dims become only? */
tvp = a->data.tail;
- a->data.tail = malloc(prod * sizeof(type16));
- if(!a->data.tail) lose(E991, errlineno, (char *) NULL);
- memcpy(a->data.tail, tvp, prod * sizeof(type16));
+ /*@=mustfreeonly@*/
+ a->data.tail = malloc(prod * sizeof(ick_type16));
+ if(!a->data.tail) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(a->data.tail, tvp, prod * sizeof(ick_type16));
+ /*@-mustfreeonly@*/ /* likewise. This isn't only, honest! */
+ tvp = NULL;
+ /*@=mustfreeonly@*/
}
j = hybridcount;
while(j--)
{
- a = hybrids+j; /* &(hybrids[j]) */
- if(!a->rank||!a->dims) continue; /* don't duplicate a deallocated array */
+ a = ick_hybrids+j; /* &(ick_hybrids[j]) */
+ if(!a->rank||!a->dims) continue; /* don't duplicate a deallocated ick_array */
tvp = a->dims;
- /* Much of this code is paraphrased from the stashbox-copying code below,
+ /* Much of this code is paraphrased from the ick_stashbox-copying code below,
which was in turn paraphrased from a section in cesspool.c I didn't
write. So any errors in this code are probably mine, but the algorithm
isn't. */
- a->dims = malloc(a->rank * sizeof(unsigned int));
- memcpy(a->dims, tvp, a->rank * sizeof(unsigned int));
- prod = !!a->rank;
- i = a->rank;
+ a->dims = malloc(a->rank * sizeof(*(a->dims)));
+ if(!a->dims) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(a->dims, tvp, a->rank * sizeof(*(a->dims)));
+ prod = (int)!!a->rank;
+ i = (int)a->rank;
while(i--) prod *= a->dims[i];
+ /*@-mustfreeonly@*/
tvp = a->data.hybrid;
- a->data.hybrid = malloc(prod * sizeof(type32));
- if(!a->data.hybrid) lose(E991, errlineno, (char *) NULL);
- memcpy(a->data.hybrid, tvp, prod * sizeof(type32));
+ /*@=mustfreeonly@*/
+ a->data.hybrid = malloc(prod * sizeof(ick_type32));
+ if(!a->data.hybrid) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(a->data.hybrid, tvp, prod * sizeof(ick_type32));
+ /*@-mustfreeonly@*/
+ tvp=NULL;
+ /*@=mustfreeonly@*/
}
- /* duplicate stashbox */
- isb2 = first;
- isbprev = (stashbox*)NULL;
+ /* duplicate ick_stashbox */
+ isb2 = ick_first;
+ isbprev = (ick_stashbox*)NULL;
while(isb2)
{
- isb = (stashbox*)malloc(sizeof(stashbox));
- if(!isb) lose(E991, errlineno, (char *) NULL);
- memcpy(isb,isb2,sizeof(stashbox));
- if(isbprev) isbprev->next = isb;
+ isb = (ick_stashbox*)malloc(sizeof(ick_stashbox));
+ if(!isb) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(isb,isb2,sizeof(ick_stashbox));
+ if(isbprev) isbprev->ick_next = isb;
isbprev = isb;
- if(isb2==first) first = isb; /* change first only the first time round */
- if(isb->type == ONESPOT || isb->type == TWOSPOT)
+ if(isb2==ick_first) ick_first = isb; /* change ick_first only the ick_first time round */
+ if(isb->type == ick_ONESPOT || isb->type == ick_TWOSPOT)
{ /* all copying already done */
- isb2 = isb->next;
+ isb2 = isb->ick_next;
continue;
}
- /* Copy the stashed array. Much of this code is paraphrased from some
+ /* Copy the stashed ick_array. Much of this code is paraphrased from some
code in cesspool.c. In fact, it's the same, with a few idioms added
and variable names changed. So, although it's in this file, I can't
take the credit for it. */
- isb->save.a = (array*)malloc(sizeof(array));
- if(!isb->save.a) lose(E991, errlineno, (char *) NULL);
+ isb->save.a = (ick_array*)malloc(sizeof(ick_array));
+ if(!isb->save.a) ick_lose(IE991, errlineno, (char *) NULL);
+ assert(isb2 != NULL); /* we already said that in the while condition,
+ so it's surprising that Splint needs this hint */
isb->save.a->rank = isb2->save.a->rank;
- isb->save.a->dims = (unsigned int*)malloc(isb2->save.a->rank *
- sizeof(unsigned int));
- if(!isb->save.a->dims) lose(E991, errlineno, (char *) NULL);
+ isb->save.a->dims = malloc(isb2->save.a->rank *
+ sizeof(*(isb2->save.a->dims)));
+ if(!isb->save.a->dims) ick_lose(IE991, errlineno, (char *) NULL);
memcpy(isb->save.a->dims, isb2->save.a->dims,
- isb2->save.a->rank * sizeof(unsigned int));
- prod = !!isb2->save.a->rank; /* I use this idiom often enough in the
- code produced by my optimizer that I
- may as well use it here. */
- i = isb2->save.a->rank;
+ isb2->save.a->rank * sizeof(*(isb2->save.a->dims)));
+ prod = (int)!!isb2->save.a->rank;
+ /* I use this idiom often enough in the code produced by my optimizer that I
+ may as well use it here. */
+ i = (int)isb2->save.a->rank;
while(i--) prod *= isb2->save.a->dims[i];
- if(isb2->type == TAIL)
+ if(isb2->type == ick_TAIL)
{
- isb->save.a->data.tail = (type16*)malloc(prod * sizeof(type16));
- if(!isb->save.a->data.tail) lose(E991, errlineno, (char *) NULL);
+ isb->save.a->data.tail = (ick_type16*)malloc(prod * sizeof(ick_type16));
+ if(!isb->save.a->data.tail) ick_lose(IE991, errlineno, (char *) NULL);
memcpy(isb->save.a->data.tail, isb2->save.a->data.tail,
- prod * sizeof(type16));
+ prod * sizeof(ick_type16));
}
else
{
- isb->save.a->data.hybrid = (type32*)malloc(prod * sizeof(type32));
- if(!isb->save.a->data.hybrid) lose(E991, errlineno, (char *) NULL);
+ isb->save.a->data.hybrid = (ick_type32*)malloc(prod * sizeof(ick_type32));
+ if(!isb->save.a->data.hybrid) ick_lose(IE991, errlineno, (char *) NULL);
memcpy(isb->save.a->data.hybrid, isb2->save.a->data.hybrid,
- prod * sizeof(type32));
+ prod * sizeof(ick_type32));
}
- isb2 = isb->next;
+ isb2 = isb->ick_next;
}
}
else /* we are weaving, reference the old current thread */
{
ickthread* tempthread;
- if(printflow) fluputs("(weave)");
+ if(ick_printflow) fluputs("(weave)");
/* Sanity check to make sure that the threads are arranged correctly */
- if(newthread->next!=ickmt_cur) lose(E778, errlineno, (char *) NULL);
- tempthread=newthread->next; /* the old current thread */
+ if(newthread->ick_next!=ickmt_cur) ick_lose(IE778, errlineno, (char *) NULL);
+ tempthread=newthread->ick_next; /* the old current thread */
while(tempthread->usesthis) tempthread=tempthread->usesthis;
newthread->dsi=tempthread->dsi;
tempthread->usesthis=newthread;
}
/* duplicate NEXT stack */
- tvp = next;
- next = malloc(MAXNEXT * sizeof *next);
- if(!next) lose(E991, errlineno, (char *) NULL);
- memcpy(next, tvp, MAXNEXT * sizeof *next);
+ tvp = ick_next;
+ ick_next = malloc(ick_MAXNEXT * sizeof *ick_next);
+ if(!ick_next) ick_lose(IE991, errlineno, (char *) NULL);
+ memcpy(ick_next, tvp, ick_MAXNEXT * sizeof *ick_next);
/* allow for multithreading with choicepoints on the stack */
- if(!choicing && topchoice)
+ if(!choicing && topchoice != NULL)
{
ickthread* icktp = topchoice;
while(icktp)
{
icktp->refcount++;
- icktp = icktp->choicepoint; /* next choicepoint on the stack */
+ icktp = icktp->choicepoint; /* ick_next choicepoint on the stack */
}
/* The old thread's and new thread's choicepoint stack share
memory. This is pretty much necessary to handle backtracking
past a fork correctly. */
}
-
+
+ /* The nullstate annotation is because Splint doesn't notice that all
+ the mallocs are guarded by lines that error out permanently if they
+ fail. The mustfreefresh annotation is because Splint doesn't realise
+ that I've stored newthread in a pointer buried in the linked list of
+ threads, and so Splint assumes that it's memory-leaking. */
+ /*@-nullstate@*/ /*@-mustfreefresh@*/
return 1; /* Tell the degenerated program to look for yet
another COME FROM */
+ /*@=nullstate@*/ /*@=mustfreefresh@*/
}
/**********************************************************************
*
* These functions do the multithreading, using setjmp and longjmp
- * to save the program counter. ickmtinit sets up the first
- * thread, and nextthread changes to the next thread in the
+ * to save the program counter. ickmtinit sets up the ick_first
+ * thread, and nextthread changes to the ick_next thread in the
* sequence. (Note that nextthread rarely actually returns). The
* code makes each command atomic, so that ONCE and AGAIN appear
* to the user to be atomic operations.
*
*********************************************************************/
-ickthread* ickmt_cur; /* define ickmt_cur */
-ickthread* ickmt_prev; /* define ickmt_prev */
+/*@partial@*/ /*@dependent@*/ ickthread* ickmt_cur; /* define ickmt_cur */
+/*@partial@*/ /*@dependent@*/ ickthread* ickmt_prev; /* define ickmt_prev */
void ickmtinit(void)
{
+ /* Splint linked list problems again; the list is marked as 'dependent',
+ which is correct for everything except adding and removing items in the
+ list. (All annotations are incorrect in some respects.) */
+ /*@-onlytrans@*/
ickmt_cur = malloc(sizeof(ickthread));
- if(!ickmt_cur) lose(E991, 1, (char *) NULL);
+ /*@=onlytrans@*/
+ if(!ickmt_cur) ick_lose(IE991, 1, (char *) NULL);
ickmt_prev = ickmt_cur;
- ickmt_cur->next = ickmt_cur;
+ ickmt_cur->ick_next = ickmt_cur;
topchoice = (ickthread*) NULL; /* No choicepoints */
ickmt_cur->dsi=ickmt_cur;
ickmt_cur->usesthis=0;
}
-/* Destroys the current thread, and switches to the next thread.
+/* Destroys the current thread, and switches to the ick_next thread.
If there are no threads left, terminates the program using exit(0). */
void killthread(void)
{
static jmp_buf dummy;
- stashbox* isb, *isbi;
+ ick_stashbox* isb, *isbi;
int i;
- if(printflow&&!choicing) fluputs("(kill)");
+ if(ick_printflow&&!choicing) fluputs("(kill)");
if(!choicing) while(topchoice) choiceahead();
/* The above line will mark each of the choicepoints as no longer being
used by this thread, and free them if neccesary. This has to be done
- first while this thread's pointers are still valid due to the way that
+ ick_first while this thread's pointers are still valid due to the way that
choiceahead works. */
/* If this thread uses another, let the other know about the change */
if(ickmt_cur->dsi!=ickmt_cur)
{
ickthread* temp=ickmt_cur->dsi;
- if(printflow) fluputs("(deweave)");
+ if(ick_printflow) fluputs("(deweave)");
while(!temp||temp->usesthis!=ickmt_cur)
{
- if(!temp) lose(E778, -1, (char *) NULL);
+ if(!temp) ick_lose(IE778, -1, (char *) NULL);
temp=temp->usesthis;
}
temp->usesthis=ickmt_cur->usesthis;
}
/* If this thread is holding data for others, move it somewhere safe */
- if(ickmt_cur->usesthis&&ickmt_cur->usesthis->dsi==ickmt_cur)
+ if(ickmt_cur->usesthis != NULL && ickmt_cur->usesthis->dsi==ickmt_cur)
{
ickthread* newuses=ickmt_cur->usesthis;
ickthread* temp=ickmt_cur->usesthis;
- if(printflow) fluputs("(shift)");
+ if(ick_printflow) fluputs("(shift)");
while(temp)
{
temp->dsi=newuses;
/* We aren't storing data for another thread, and we have data of our own,
or dsi would point somewhere else (either naturally or because it was
changed higher up). */
- if(printflow) fluputs("(free)");
+ if(ick_printflow) fluputs("(free)");
/* Deallocate the current thread's data */
i=tailcount;
while(i--)
{ /* free tail data */
- if(!tails[i].rank||!tails[i].dims) continue; /* already free */
- free(tails[i].dims);
- free(tails[i].data.tail);
+ if(!ick_tails[i].rank||!ick_tails[i].dims) continue; /* already free */
+ free(ick_tails[i].dims);
+ free(ick_tails[i].data.tail);
}
i=hybridcount;
while(i--)
{ /* free hybrid data */
- if(!hybrids[i].rank||!hybrids[i].dims) continue; /* already free */
- free(hybrids[i].dims);
- free(hybrids[i].data.hybrid);
- }
- free(onespots); free(twospots); free(tails); free(hybrids);
- free(oneforget); free(twoforget); free(tailforget); free(hyforget);
- if(oo_onespots) free(oo_onespots); if(oo_twospots) free(oo_twospots);
-
- isbi = first;
- while(isbi) /* Free stash */
+ if(!ick_hybrids[i].rank||!ick_hybrids[i].dims) continue; /* already free */
+ free(ick_hybrids[i].dims);
+ free(ick_hybrids[i].data.hybrid);
+ }
+ /* unqualifiedtrans because although they aren't always only, they're only at the moment;
+ compdestroy because we have just deallocated tail and hybrid data */
+ /*@-unqualifiedtrans@*/ /*@-compdestroy@*/
+ free(ick_onespots); free(ick_twospots); free(ick_tails); free(ick_hybrids);
+ free(ick_oneforget); free(ick_twoforget); free(ick_tailforget); free(ick_hyforget);
+ if(ick_oo_onespots) free(ick_oo_onespots); if(ick_oo_twospots) free(ick_oo_twospots);
+ /*@=unqualifiedtrans@*/ /*@=compdestroy@*/
+
+ isbi = ick_first;
+ while(isbi) /* Free ick_stash */
{
- isb=isbi->next;
- if(isbi->type == TAIL || isbi->type == HYBRID)
+ isb=isbi->ick_next;
+ if(isbi->type == ick_TAIL || isbi->type == ick_HYBRID)
{
free(isbi->save.a->dims);
- if(isbi->type == TAIL)
+ if(isbi->type == ick_TAIL)
free(isbi->save.a->data.tail);
else
free(isbi->save.a->data.hybrid);
{
/* We still need to save our variables for the benefit of woven threads. */
/* save variables */
- ickmt_cur->dsi->varforget[0] = onespots;
- ickmt_cur->dsi->varforget[1] = twospots;
- ickmt_cur->dsi->varforget[2] = tails;
- ickmt_cur->dsi->varforget[3] = hybrids;
- ickmt_cur->dsi->varforget[4] = oneforget;
- ickmt_cur->dsi->varforget[5] = twoforget;
- ickmt_cur->dsi->varforget[6] = tailforget;
- ickmt_cur->dsi->varforget[7] = hyforget;
- ickmt_cur->dsi->varforget[8] = oo_onespots;
- ickmt_cur->dsi->varforget[9] = oo_twospots;
-
- /* save stashbox */
- ickmt_cur->dsi->sb = first;
+ ickmt_cur->dsi->varforget[0] = ick_onespots;
+ ickmt_cur->dsi->varforget[1] = ick_twospots;
+ ickmt_cur->dsi->varforget[2] = ick_tails;
+ ickmt_cur->dsi->varforget[3] = ick_hybrids;
+ ickmt_cur->dsi->varforget[4] = ick_oneforget;
+ ickmt_cur->dsi->varforget[5] = ick_twoforget;
+ ickmt_cur->dsi->varforget[6] = ick_tailforget;
+ ickmt_cur->dsi->varforget[7] = ick_hyforget;
+ ickmt_cur->dsi->varforget[8] = ick_oo_onespots;
+ ickmt_cur->dsi->varforget[9] = ick_oo_twospots;
+
+ /* save ick_stashbox */
+ /*@-unqualifiedtrans@*/ /* the linked list problem again */
+ ickmt_cur->dsi->sb = ick_first;
+ /*@=unqualifiedtrans@*/
+ /*@-branchstate@*/ /* it's reference-counted */
}
- free(next); /* Free NEXT stack */
+ /*@=branchstate@*/
+ /*@-unqualifiedtrans@*/ /* it is only at this point */
+ free(ick_next); /* Free NEXT stack */
+ /*@=unqualifiedtrans@*/
- ickmt_prev->next = ickmt_cur->next;
- if(ickmt_cur->next == ickmt_cur)
+ ickmt_prev->ick_next = ickmt_cur->ick_next;
+ if(ickmt_cur->ick_next == ickmt_cur)
{
+ /*@-dependenttrans@*/ /* because it isn't really dependent */
free(ickmt_cur);
+ /*@=dependenttrans@*/
exit(0);
}
else
{
/* We need to run about half of nextthread. So we pass in a 2 for
- flags and tell it to skip the first half. */
+ flags and tell it to skip the ick_first half. */
+ /*@-dependenttrans@*/ /* because it isn't really dependent */
free(ickmt_cur);
+ /*@=dependenttrans@*/
ickmt_cur = ickmt_prev;
nextthread(dummy, -1, 2); /* dummy is not used by nextthread */
- lose(E778, -1, (char *) NULL); /* nextthread does not return */
+ ick_lose(IE778, -1, (char *) NULL); /* nextthread does not return */
}
}
program shorter. */
void nextthread(jmp_buf pc, int errlineno, int flags)
{ /* flags | 1 means save this thread.
- flags | 2 means load the next thread.
+ flags | 2 means load the ick_next thread.
flags | 4 means don't change thread. */
- if(errlineno > -1 && ickmt_cur->next == ickmt_cur && !choicing) longjmp(pc,1);
+ if(errlineno > -1 && ickmt_cur->ick_next == ickmt_cur && !choicing) longjmp(pc,1);
/* If we only have 1 thread, just continue with it. Otherwise: */
if(!(flags&1)) goto advancethread;
a goto seemed crystal-clear by comparison. */
/* save variables */
- ickmt_cur->dsi->varforget[0] = onespots;
- ickmt_cur->dsi->varforget[1] = twospots;
- ickmt_cur->dsi->varforget[2] = tails;
- ickmt_cur->dsi->varforget[3] = hybrids;
- ickmt_cur->dsi->varforget[4] = oneforget;
- ickmt_cur->dsi->varforget[5] = twoforget;
- ickmt_cur->dsi->varforget[6] = tailforget;
- ickmt_cur->dsi->varforget[7] = hyforget;
- ickmt_cur->dsi->varforget[8] = oo_onespots;
- ickmt_cur->dsi->varforget[9] = oo_twospots;
+ ickmt_cur->dsi->varforget[0] = ick_onespots;
+ ickmt_cur->dsi->varforget[1] = ick_twospots;
+ ickmt_cur->dsi->varforget[2] = ick_tails;
+ ickmt_cur->dsi->varforget[3] = ick_hybrids;
+ ickmt_cur->dsi->varforget[4] = ick_oneforget;
+ ickmt_cur->dsi->varforget[5] = ick_twoforget;
+ ickmt_cur->dsi->varforget[6] = ick_tailforget;
+ ickmt_cur->dsi->varforget[7] = ick_hyforget;
+ ickmt_cur->dsi->varforget[8] = ick_oo_onespots;
+ ickmt_cur->dsi->varforget[9] = ick_oo_twospots;
/* save NEXT stack */
- ickmt_cur->nextstack = next;
- ickmt_cur->nextpointer = nextindex;
+ /*@-unqualifiedtrans@*/ /* because nextstack isn't only really */
+ ickmt_cur->nextstack = ick_next;
+ /*@=unqualifiedtrans@*/
+ ickmt_cur->nextpointer = ick_nextindex;
- /* save stashbox */
- ickmt_cur->dsi->sb = first;
+ /* save ick_stashbox */
+ /*@-unqualifiedtrans@*/ /* ditto */
+ ickmt_cur->dsi->sb = ick_first;
+ /*@=unqualifiedtrans@*/
/* save choicepoints */
if(!choicing) ickmt_cur->choicepoint = topchoice;
/* save comefrom information */
- memcpy(ickmt_cur->cjb, cjb, sizeof(jmp_buf));
- ickmt_cur->ccfc = ccfc;
- ickmt_cur->skipto = skipto;
-
+ memcpy((void*)(ickmt_cur->ick_cjb), (void*)ick_cjb, sizeof(jmp_buf));
+ ickmt_cur->ick_ccfc = ick_ccfc;
+ ickmt_cur->ick_skipto = ick_skipto;
+
/* save program counter */
- memcpy(ickmt_cur->pc, pc, sizeof(jmp_buf));
+ memcpy((void*)(ickmt_cur->pc), (void*)pc, sizeof(jmp_buf));
/* And another thing about setjmp/longjmp. A jmp_buf
acts like a structure that passes itself around by
reference. However, it cannot be assigned, although
just about everything else in C can be, although it
can be copied with memcpy (what I'm doing in the line
above - remember it passes itself around by reference).
- Generally speaking, it's some sort of array,
- even though some implementors use a 1-element array.
+ Generally speaking, it's some sort of ick_array,
+ even though some implementors use a 1-element ick_array.
The exact representation of jmp_buf is one of the most
implementation-dependent things in C (I've seen both
- a 1-element array of structure and an int[12].) */
+ a 1-element ick_array of structure and an int[12].) */
advancethread:
/* change thread */
if(!(flags&4))
{
ickmt_prev = ickmt_cur;
- ickmt_cur = ickmt_cur->next;
+ ickmt_cur = ickmt_cur->ick_next;
}
if(!(flags&2)) goto returnjmp;
/* load variables */
- onespots = ickmt_cur->dsi->varforget[0];
- twospots = ickmt_cur->dsi->varforget[1];
- tails = ickmt_cur->dsi->varforget[2];
- hybrids = ickmt_cur->dsi->varforget[3];
- oneforget = ickmt_cur->dsi->varforget[4];
- twoforget = ickmt_cur->dsi->varforget[5];
- tailforget = ickmt_cur->dsi->varforget[6];
- hyforget = ickmt_cur->dsi->varforget[7];
- oo_onespots = ickmt_cur->dsi->varforget[8];
- oo_twospots = ickmt_cur->dsi->varforget[9];
+ ick_onespots = ickmt_cur->dsi->varforget[0];
+ ick_twospots = ickmt_cur->dsi->varforget[1];
+ ick_tails = ickmt_cur->dsi->varforget[2];
+ ick_hybrids = ickmt_cur->dsi->varforget[3];
+ ick_oneforget = ickmt_cur->dsi->varforget[4];
+ ick_twoforget = ickmt_cur->dsi->varforget[5];
+ ick_tailforget = ickmt_cur->dsi->varforget[6];
+ ick_hyforget = ickmt_cur->dsi->varforget[7];
+ ick_oo_onespots = ickmt_cur->dsi->varforget[8];
+ ick_oo_twospots = ickmt_cur->dsi->varforget[9];
/* load NEXT stack */
- next = ickmt_cur->nextstack;
- nextindex = ickmt_cur->nextpointer;
+ /*@-onlytrans@*/ /* the nextstack shouldn't be only */
+ ick_next = ickmt_cur->nextstack;
+ /*@=onlytrans@*/
+ ick_nextindex = ickmt_cur->nextpointer;
/* load choicepoints */
if(!choicing) topchoice = ickmt_cur->choicepoint;
- /* load stashbox */
- first = ickmt_cur->dsi->sb;
+ /* load ick_stashbox */
+ /*@-onlytrans@*/ /* ditto */
+ ick_first = ickmt_cur->dsi->sb;
+ /*@=onlytrans@*/
/* load comefrom information */
- memcpy(cjb, ickmt_cur->cjb, sizeof(jmp_buf));
- ccfc = ickmt_cur->ccfc;
- skipto = ickmt_cur->skipto;
+ memcpy((void*)ick_cjb, (void*)(ickmt_cur->ick_cjb), sizeof(jmp_buf));
+ ick_ccfc = ickmt_cur->ick_ccfc;
+ ick_skipto = ickmt_cur->ick_skipto;
returnjmp:
/* return to the new current thread's program counter */
#define YUKDEBUG 1
#include "yuk.h"
-#include "lose.h"
+#include "ick_lose.h"
#include "sizes.h"
#include "abcess.h"
#include "uncommon.h"
extern signed char onewatch[];
extern signed char twowatch[];
-extern type16 oneold[];
-extern type32 twoold[];
+extern ick_type16 oneold[];
+extern ick_type32 twoold[];
char** globalargv;
int globalargc;
static int monitors[80]; /* monitors give a message when program flow passes them */
static int nmonitors = 0;
static int untilnext = -1; /* NEXTING level to break the program at */
-static int firstrun = 1; /* first time an interactive command point is reached */
+static int firstrun = 1; /* ick_first time an interactive command point is reached */
static int yukerrcmdg = -1; /* the aboff that indicates an error in the 'g' command */
static yptimer tickcount; /* yptimer of last run */
static int lastaboff = 0; /* last value of aboff */
-void handlesigint(int i)
+static void handlesigint(int i)
{ /* this is a signal handler, so can't do much */
singlestep = 1;
writelines = 1;
- (void) i; /* we're ignoring our argument */
+ /*@-noeffect@*/ (void) i; /*@=noeffect@*/
}
#if YPTIMERTYPE==1 || YPTIMERTYPE==2
-yptimer yukgettimeofday()
+static yptimer yukgettimeofday()
{
static struct timeval tp;
yptimer temp;
+ /* gettimeofday is POSIX; config.sh has checked that it's
+ available, so turn off the unrecog warning */
+ /*@-unrecog@*/
gettimeofday(&tp,0);
+ /*@=unrecog@*/
temp=(yptimer)tp.tv_usec +
(yptimer)tp.tv_sec * (yptimer)1000000LU;
/* here we make use of unsigned wraparound. In the case
{
int i,lastline,thisline,inrow=0;
yptimer avgtime,avgtime2;
- if(yukopts==2) puts("Program ended without error.");
+ if(yukopts==2) (void) puts("Program ended without error.");
if(!(yukopts&1)) return;
/* Print profiling information */
- puts("Profiling information saved to \"yuk.out\".");
- freopen("yuk.out","w",stdout);
+ (void) puts("Profiling information saved to \"yuk.out\".");
+ (void) freopen("yuk.out","w",stdout);
i=-1;
lastline=-1;
while(++i<yukcommands)
if(avgtime) avgtime=ypexectime[i]/avgtime;
avgtime2=0;
if(ypexecount[i]) avgtime2=ypexectime[i]/ypexecount[i];
+ /*@-formatcode@*/ /* Splint doesn't understand string interpolation */
printf("C%d: Time%4" YPTIMERTFORMAT ".%0" YPTIMERTFORMATD
", Avg%2" YPTIMERTFORMAT ".%0" YPTIMERTFORMATD ", "
"Avg Exec%2" YPTIMERTFORMAT ".%0" YPTIMERTFORMATD
avgtime/YPTIMERSCALE, avgtime%YPTIMERSCALE,
avgtime2/YPTIMERSCALE, avgtime2%YPTIMERSCALE,
ypexecount[i],ypabscount[i]);
+ /*@=formatcode@*/
}
}
char* tempcharp;
if(!yukopts) return;
if(globalargc!=3)
- lose(E778,emitlineno,(char*)NULL);
+ ick_lose(IE778,emitlineno,(char*)NULL);
if(yukopts & 1)
{ /* profile */
temptick=YPGETTIME;
if(lastaboff) ypexectime[lastaboff]+=temptick-tickcount;
tickcount=temptick;
- if(abstained[aboff]) ypabscount[aboff]++;
+ if(ick_abstained[aboff]) ypabscount[aboff]++;
else ypexecount[aboff]++;
lastaboff=aboff;
}
if(firstrun)
{
/* GNU GPL requires a copyright notice at this point */
- puts("yuk debugger Copyright (C) 2006 Alex Smith.");
- puts("The yuk debugger is covered by the GNU GPL and can");
- puts("be redistributed freely, but comes with ABSOLUTELY");
- puts("NO WARRANTY. For more information, type *<RET>.\n");
- puts("For help on yuk, type ?<RET>.\n");
+ (void) puts("yuk debugger Copyright (C) 2006 Alex Smith.");
+ (void) puts("The yuk debugger is covered by the GNU GPL and can");
+ (void) puts("be redistributed freely, but comes with ABSOLUTELY");
+ (void) puts("NO WARRANTY. For more information, type *<RET>.\n");
+ (void) puts("For help on yuk, type ?<RET>.\n");
}
i=nbreakpoints;
broken=0;
if(yukloop) broken=0;
if(broken) printf("Command flowed past line %d:\n",lineofaboff[aboff]);
}
- if(nextindex <= untilnext)
+ if(ick_nextindex <= untilnext)
{
broken = 1;
singlestep = 1;
if(!broken&&yukerrcmdg==aboff)
{
singlestep = 1;
- puts("There are no commands on that line.");
+ (void) puts("There are no commands on that line.");
/* To the user, nothing will have happened but the error message! */
}
i=-1;
while(++i,1)
{
if(yukvars[i].vartype==YUKEND) break;
- if(yukvars[i].vartype==ONESPOT)
+ if(yukvars[i].vartype==ick_ONESPOT)
{
- if(onewatch[yukvars[i].intername])
+ if(onewatch[yukvars[i].intername] != (char)0)
{
- if(onespots[yukvars[i].intername]!=oneold[yukvars[i].intername]&&
- onewatch[yukvars[i].intername]>1)
+ if(ick_onespots[yukvars[i].intername]!=oneold[yukvars[i].intername]&&
+ onewatch[yukvars[i].intername]>(char)1)
{
- oneold[yukvars[i].intername]=onespots[yukvars[i].intername];
- if(onewatch[yukvars[i].intername]==2||!onespots[yukvars[i].intername])
+ oneold[yukvars[i].intername]=ick_onespots[yukvars[i].intername];
+ if(onewatch[yukvars[i].intername]==(char)2||!ick_onespots[yukvars[i].intername])
{
- printf(onewatch[yukvars[i].intername]==2?
+ /*@-formatconst@*/ /* it's safe, I checked it */
+ printf(onewatch[yukvars[i].intername]==(char)2?
"Variable .%d changed.\n":"Variable .%d became 0.\n",
yukvars[i].extername);
+ /*@=formatconst@*/
broken=1; singlestep=1;
}
}
if(writelines||broken)
{
printf(".%d is:\n",yukvars[i].extername);
- pout(onespots[yukvars[i].intername]);
+ ick_pout(ick_onespots[yukvars[i].intername]);
}
}
}
- if(yukvars[i].vartype==TWOSPOT)
+ if(yukvars[i].vartype==ick_TWOSPOT)
{
- if(twowatch[yukvars[i].intername])
+ if(twowatch[yukvars[i].intername] != (char)0)
{
- if(twospots[yukvars[i].intername]!=twoold[yukvars[i].intername]&&
- twowatch[yukvars[i].intername]>1)
+ if(ick_twospots[yukvars[i].intername]!=twoold[yukvars[i].intername]&&
+ twowatch[yukvars[i].intername] > (char)1)
{
- twoold[yukvars[i].intername]=twospots[yukvars[i].intername];
- if(twowatch[yukvars[i].intername]==2||!twospots[yukvars[i].intername])
+ twoold[yukvars[i].intername]=ick_twospots[yukvars[i].intername];
+ if(twowatch[yukvars[i].intername]==(char)2||!ick_twospots[yukvars[i].intername])
{
- printf(twowatch[yukvars[i].intername]==2?
+ /*@-formatconst@*/ /* there's just the one %d each way round */
+ printf(twowatch[yukvars[i].intername]==(char)2?
"Variable :%d changed.\n":"Variable :%d became 0.\n",
yukvars[i].extername);
+ /*@=formatconst@*/
broken=1; singlestep=1;
}
}
if(writelines||broken)
{
printf(":%d is:\n",yukvars[i].extername);
- pout(twospots[yukvars[i].intername]);
+ ick_pout(ick_twospots[yukvars[i].intername]);
}
}
}
tempcmd=aboff;
while(tempcmd&&lineofaboff[--tempcmd]==lineofaboff[aboff]);
printf("On C%d: Abstained %d time%s\n",aboff?aboff-tempcmd:1,
- abstained[aboff]-yukloop,abstained[aboff]-yukloop==1?".":"s.");
+ ick_abstained[aboff]-yukloop,ick_abstained[aboff]-yukloop==1?".":"s.");
}
if(singlestep)
{
- signal(SIGINT,handlesigint); /* placing this line here means that a rapid
- ^C^C will terminate the program, if it's
- stuck in a loop somewhere */
+ (void)signal(SIGINT,handlesigint); /* placing this line here means that a rapid
+ ^C^C will terminate the program, if it's
+ stuck in a loop somewhere */
keeplooping = 1;
breakpoints[0] = 0; /* breakpoints[0] goes whenever a breakpoint is hit */
untilnext = -1;
if(yukloop)
{ /* reverse the abstentions that g caused */
i = -1;
- while(++i<yukcommands) abstained[i]--;
+ while(++i<yukcommands) ick_abstained[i]--;
}
yukloop = 0;
yukerrcmdg = -1;
{
printf("yuk007 "); /* this is our prompt, a sort of reverse
INTERCAL version of % */
- fgets(buf,20,stdin);
+ (void) fgets(buf,20,stdin);
if(!strchr(buf,'\n'))
{
- lose(E810,emitlineno,(char*)NULL);
+ ick_lose(IE810,emitlineno,(char*)NULL);
}
templine=0;
switch(*buf)
{
case '?':
case '@':
- puts("a<line>\tabstain once from all non-abstained commands on <line>");
- puts("b<line>\tset breakpoint at <line>");
- puts("c\tcontinue execution until a breakpoint is reached");
- puts("d<line>\tdelete breakpoint at <line>");
- puts("e<line>\texplain the main expression on <line>");
- puts("f<line>\tstop producing messages when commands on <line> are run");
- puts("g<line>\tchange currently executing command to the first command");
- puts("\ton <line> or the next command if already on <line>");
- puts("h\tlist 10 lines either side of the current line");
- puts("i<var>\tignore a variable");
- puts("j<var>\tremember a variable");
- puts("k\tcontinue until we RESUME back to the current nexting level");
- puts("\t(that is, step unless we are on a NEXT, in which case execute");
- puts("\tuntil a RESUME or FORGET back to the same or smaller NEXT stack)");
- puts("l<line>\tlist 10 lines either side of <line>");
- puts("m<line>\tproduce a message every time a command on <line> is run");
- puts("n\tshow the NEXT stack");
- puts("o\tcontinue until we RESUME/FORGET below the current nexting level");
- puts("\tie until the NEXT stack becomes smaller than it is at present");
- puts("p\tdisplay the values of all onespot and twospot variables");
- puts("q\tabort execution");
- puts("r<line>\treinstate once all abstained commands on <line>");
- puts("s\texecute one command");
- puts("t\tcontinue until a breakpoint, displaying all lines executed");
- puts("u<line>\texecute until just before <line> is reached");
- puts("v<var>\tshow value of variable every time a command is printed");
- puts("w\tshow the current line and current command");
- puts("x<var>\tremove a variable view, breakchange, or breakzero");
- puts("y<var>\tview variable every displayed line, and break on change");
- puts("z<var>\tview variable every displayed line, and break on zero");
- puts("<var>\tview the value of a onespot or twospot variable");
- puts("<<var>\tset the value of a onespot or twospot variable");
- puts("*\tview the GNU General Public License");
- puts("?\tview this help screen");
- puts("@\tview this help screen");
- puts("Line numbers refer to lines of source code, not line labels.");
- puts("Listings have (Axxxxxx) at the start of each line: this shows");
- puts("the abstention status of each command on that line.");
- puts("The values of variables must be input in proper INTERCAL");
- puts("notation (i.e. ONE TWO THREE), and are output as butchered");
- puts("Roman numerals.");
+ (void) puts("a<line>\tabstain once from all non-ick_abstained commands on <line>");
+ (void) puts("b<line>\tset breakpoint at <line>");
+ (void) puts("c\tcontinue execution until a breakpoint is reached");
+ (void) puts("d<line>\tdelete breakpoint at <line>");
+ (void) puts("e<line>\texplain the ick_main expression on <line>");
+ (void) puts("f<line>\tstop producing messages when commands on <line> are run");
+ (void) puts("g<line>\tchange currently executing command to the ick_first command");
+ (void) puts("\ton <line> or the ick_next command if already on <line>");
+ (void) puts("h\tlist 10 lines either side of the current line");
+ (void) puts("i<var>\tignore a variable");
+ (void) puts("j<var>\tremember a variable");
+ (void) puts("k\tcontinue until we RESUME back to the current nexting level");
+ (void) puts("\t(that is, step unless we are on a NEXT, in which case execute");
+ (void) puts("\tuntil a RESUME or FORGET back to the same or smaller NEXT stack)");
+ (void) puts("l<line>\tlist 10 lines either side of <line>");
+ (void) puts("m<line>\tproduce a message every time a command on <line> is run");
+ (void) puts("n\tshow the NEXT stack");
+ (void) puts("o\tcontinue until we RESUME/FORGET below the current nexting level");
+ (void) puts("\tie until the NEXT stack becomes smaller than it is at present");
+ (void) puts("p\tdisplay the values of all onespot and twospot variables");
+ (void) puts("q\tabort execution");
+ (void) puts("r<line>\treinstate once all ick_abstained commands on <line>");
+ (void) puts("s\texecute one command");
+ (void) puts("t\tcontinue until a breakpoint, displaying all lines executed");
+ (void) puts("u<line>\texecute until just before <line> is reached");
+ (void) puts("v<var>\tshow value of variable every time a command is printed");
+ (void) puts("w\tshow the current line and current command");
+ (void) puts("x<var>\tremove a variable view, breakchange, or breakzero");
+ (void) puts("y<var>\tview variable every displayed line, and break on change");
+ (void) puts("z<var>\tview variable every displayed line, and break on zero");
+ (void) puts("<var>\tview the value of a onespot or twospot variable");
+ (void) puts("<<var>\tset the value of a onespot or twospot variable");
+ (void) puts("*\tview the GNU General Public License");
+ (void) puts("?\tview this help screen");
+ (void) puts("@\tview this help screen");
+ (void) puts("Line numbers refer to lines of source code, not line labels.");
+ (void) puts("Listings have (Axxxxxx) at the start of each line: this shows");
+ (void) puts("the abstention status of each command on that line.");
+ (void) puts("The values of variables must be input in proper INTERCAL");
+ (void) puts("notation (i.e. ONE TWO THREE), and are output as butchered");
+ (void) puts("Roman ick_numerals.");
#ifdef __DJGPP__
- puts("You can press <CTRL>-<BREAK> to interrupt an executing program.");
+ (void) puts("You can press <CTRL>-<BREAK> to interrupt an executing program.");
#else
- puts("You can press <CTRL>-C to interrupt an executing program.");
+ (void) puts("You can press <CTRL>-C to interrupt an executing program.");
#endif
break;
case 'q':
exit(0);
- break;
+ /*@-unreachable@*/ break; /*@=unreachable@*/
case 'n':
- i=nextindex;
+ i=ick_nextindex;
if(!i)
{
- puts("The NEXT stack is empty.");
+ (void) puts("The NEXT stack is empty.");
}
else
{
- puts("Commands NEXTED from:");
+ (void) puts("Commands NEXTED from:");
while(i--)
{
/* write NEXT line */
- printf("%5d:\t%s\n",lineofaboff[next[i]-1],
- textlines[lineofaboff[next[i]-1]]);
+ printf("%5d:\t%s\n",lineofaboff[ick_next[i]-1],
+ textlines[lineofaboff[ick_next[i]-1]]);
/* write NEXT command within line */
- tempcmd=next[i];
- while(tempcmd&&lineofaboff[--tempcmd]==lineofaboff[next[i]-1]);
- printf("NEXTED from command C%d: Abstained %d time%s\n",next[i]-1?
- next[i]-1-tempcmd:1,abstained[next[i]-1],
- abstained[next[i]-1]==1?".":"s.");
+ tempcmd=(int)ick_next[i];
+ while(tempcmd&&lineofaboff[--tempcmd]==lineofaboff[ick_next[i]-1]);
+ printf("NEXTED from command C%u: Abstained %d time%s\n",ick_next[i]-1?
+ ick_next[i]-1-tempcmd:1,ick_abstained[ick_next[i]-1],
+ ick_abstained[ick_next[i]-1]==1?".":"s.");
}
}
break;
/* write command within line that we're on */
tempcmd=aboff;
while(tempcmd&&lineofaboff[--tempcmd]==lineofaboff[aboff]);
- printf("On C%d: Abstained %d time%s\n",aboff?aboff-tempcmd:1,abstained[aboff],
- abstained[aboff]==1?".":"s.");
+ printf("On C%d: Abstained %d time%s\n",aboff?aboff-tempcmd:1,ick_abstained[aboff],
+ ick_abstained[aboff]==1?".":"s.");
break;
case 'p':
i=-1;
while(++i,1)
{
if(yukvars[i].vartype==YUKEND) break;
- if(yukvars[i].vartype==ONESPOT)
+ if(yukvars[i].vartype==ick_ONESPOT)
{
printf("Variable .%d is:\n",yukvars[i].extername);
- pout(onespots[yukvars[i].intername]);
+ ick_pout(ick_onespots[yukvars[i].intername]);
}
- if(yukvars[i].vartype==TWOSPOT)
+ if(yukvars[i].vartype==ick_TWOSPOT)
{
printf("Variable :%d is:\n",yukvars[i].extername);
- pout(twospots[yukvars[i].intername]);
+ ick_pout(ick_twospots[yukvars[i].intername]);
}
}
break;
case '.':
case ':':
- sscanf(buf+1,"%d",&templine);
- if(templine<1)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(templine<1 || temp != 1)
{
- puts("Don't know which variable you mean.");
+ (void) puts("Don't know which variable you mean.");
break;
}
i=-1;
while(++i,!temp)
{
if(yukvars[i].vartype==YUKEND) break;
- if((*buf=='.'&&yukvars[i].vartype==ONESPOT)||
- (*buf==':'&&yukvars[i].vartype==TWOSPOT))
+ if((*buf=='.'&&yukvars[i].vartype==ick_ONESPOT)||
+ (*buf==':'&&yukvars[i].vartype==ick_TWOSPOT))
{
if(yukvars[i].extername==templine)
{
temp=1;
- if(yukvars[i].vartype==ONESPOT)
+ if(yukvars[i].vartype==ick_ONESPOT)
{
- pout(onespots[yukvars[i].intername]);
- puts(oneforget[yukvars[i].intername]?
+ ick_pout(ick_onespots[yukvars[i].intername]);
+ (void) puts(ick_oneforget[yukvars[i].intername]?
"This variable is currently ignored.":
"This variable is currently remembered.");
}
- if(yukvars[i].vartype==TWOSPOT)
+ if(yukvars[i].vartype==ick_TWOSPOT)
{
- pout(twospots[yukvars[i].intername]);
- puts(twoforget[yukvars[i].intername]?
+ ick_pout(ick_twospots[yukvars[i].intername]);
+ (void) puts(ick_twoforget[yukvars[i].intername]?
"This variable is currently ignored.":
"This variable is currently remembered.");
}
}
}
if(temp) break;
- puts("That variable is not in the program.");
+ (void) puts("That variable is not in the program.");
break;
case 'v':
case 'x':
case 'z':
if(buf[1]!='.'&&buf[1]!=':')
{
- puts("This command only works on onespot and twospot variables.");
+ (void) puts("This command only works on onespot and twospot variables.");
break;
}
- sscanf(buf+2,"%d",&templine);
- if(templine<1)
+ temp = sscanf(buf+2,"%d",&templine);
+ if(templine<1 || temp != 1)
{
- puts("Don't know which variable you mean.");
+ (void) puts("Don't know which variable you mean.");
break;
}
i=-1;
if(yukvars[i].vartype==YUKEND) break;
if(yukvars[i].extername==templine)
{
- if(buf[1]=='.'&&yukvars[i].vartype==ONESPOT)
+ if(buf[1]=='.'&&yukvars[i].vartype==ick_ONESPOT)
{
- if(*buf=='v') onewatch[yukvars[i].intername]=1;
- if(*buf=='x') onewatch[yukvars[i].intername]=0;
- if(*buf=='y') onewatch[yukvars[i].intername]=2;
- if(*buf=='z') onewatch[yukvars[i].intername]=3;
- oneold[yukvars[i].intername]=onespots[yukvars[i].intername];
+ if(*buf=='v') onewatch[yukvars[i].intername]=(char)1;
+ if(*buf=='x') onewatch[yukvars[i].intername]=(char)0;
+ if(*buf=='y') onewatch[yukvars[i].intername]=(char)2;
+ if(*buf=='z') onewatch[yukvars[i].intername]=(char)3;
+ oneold[yukvars[i].intername]=ick_onespots[yukvars[i].intername];
temp=1;
}
- if(buf[1]==':'&&yukvars[i].vartype==TWOSPOT)
+ if(buf[1]==':'&&yukvars[i].vartype==ick_TWOSPOT)
{
- if(*buf=='v') twowatch[yukvars[i].intername]=1;
- if(*buf=='x') twowatch[yukvars[i].intername]=0;
- if(*buf=='y') twowatch[yukvars[i].intername]=2;
- if(*buf=='z') twowatch[yukvars[i].intername]=3;
- twoold[yukvars[i].intername]=twospots[yukvars[i].intername];
+ if(*buf=='v') twowatch[yukvars[i].intername]=(char)1;
+ if(*buf=='x') twowatch[yukvars[i].intername]=(char)0;
+ if(*buf=='y') twowatch[yukvars[i].intername]=(char)2;
+ if(*buf=='z') twowatch[yukvars[i].intername]=(char)3;
+ twoold[yukvars[i].intername]=ick_twospots[yukvars[i].intername];
temp=1;
}
}
}
if(!temp)
{
- puts("That variable is not in the program.");
+ (void) puts("That variable is not in the program.");
break;
}
- if(*buf=='v') puts("Set a normal variable view.");
- if(*buf=='x') puts("Removed all views from that variable.");
- if(*buf=='y') puts("Set a breakchange variable view.");
- if(*buf=='z') puts("Set a breakzero variable view.");
+ if(*buf=='v') (void) puts("Set a normal variable view.");
+ if(*buf=='x') (void) puts("Removed all views from that variable.");
+ if(*buf=='y') (void) puts("Set a breakchange variable view.");
+ if(*buf=='z') (void) puts("Set a breakzero variable view.");
break;
case 'i':
case 'j':
if(buf[1]!='.'&&buf[1]!=':'&&buf[1]!=','&&buf[1]!=';')
{
- puts("That isn't a real sort of variable.");
+ (void) puts("That isn't a real sort of variable.");
break;
}
- sscanf(buf+2,"%d",&templine);
- if(templine<1)
+ temp = sscanf(buf+2,"%d",&templine);
+ if(templine<1 || temp != 1)
{
- puts("Don't know which variable you mean.");
+ (void) puts("Don't know which variable you mean.");
break;
}
i=-1;
while(++i,!temp)
{
if(yukvars[i].vartype==YUKEND) break;
- if((buf[1]=='.'&&yukvars[i].vartype==ONESPOT)||
- (buf[1]==':'&&yukvars[i].vartype==TWOSPOT)||
- (buf[1]==','&&yukvars[i].vartype==TAIL)||
- (buf[1]==';'&&yukvars[i].vartype==HYBRID))
+ if((buf[1]=='.'&&yukvars[i].vartype==ick_ONESPOT)||
+ (buf[1]==':'&&yukvars[i].vartype==ick_TWOSPOT)||
+ (buf[1]==','&&yukvars[i].vartype==ick_TAIL)||
+ (buf[1]==';'&&yukvars[i].vartype==ick_HYBRID))
{
if(yukvars[i].extername==templine)
{
temp=1;
- if(yukvars[i].vartype==ONESPOT)
- oneforget[yukvars[i].intername]=*buf=='i';
- if(yukvars[i].vartype==TWOSPOT)
- twoforget[yukvars[i].intername]=*buf=='i';
- if(yukvars[i].vartype==TAIL)
- tailforget[yukvars[i].intername]=*buf=='i';
- if(yukvars[i].vartype==HYBRID)
- hyforget[yukvars[i].intername]=*buf=='i';
+ if(yukvars[i].vartype==ick_ONESPOT)
+ ick_oneforget[yukvars[i].intername]=*buf=='i';
+ if(yukvars[i].vartype==ick_TWOSPOT)
+ ick_twoforget[yukvars[i].intername]=*buf=='i';
+ if(yukvars[i].vartype==ick_TAIL)
+ ick_tailforget[yukvars[i].intername]=*buf=='i';
+ if(yukvars[i].vartype==ick_HYBRID)
+ ick_hyforget[yukvars[i].intername]=*buf=='i';
}
}
}
if(temp)
{
if(*buf=='i')
- puts("Variable ignored.");
+ (void) puts("Variable ignored.");
else
- puts("Variable remembered.");
+ (void) puts("Variable remembered.");
break;
}
- puts("That variable is not in the program.");
+ (void) puts("That variable is not in the program.");
break;
case '<':
if(buf[1]!='.'&&buf[1]!=':')
{
- puts("You cannot set that sort of variable (if it exists at all).");
+ (void) puts("You cannot set that sort of variable (if it exists at all).");
break;
}
- sscanf(buf+2,"%d",&templine);
- if(templine<1)
+ temp = sscanf(buf+2,"%d",&templine);
+ if(templine<1 || temp != 1)
{
- puts("Don't know which variable you mean.");
+ (void) puts("Don't know which variable you mean.");
break;
}
i=-1;
while(++i,!temp)
{
if(yukvars[i].vartype==YUKEND) break;
- if((buf[1]=='.'&&yukvars[i].vartype==ONESPOT)||
- (buf[1]==':'&&yukvars[i].vartype==TWOSPOT))
+ if((buf[1]=='.'&&yukvars[i].vartype==ick_ONESPOT)||
+ (buf[1]==':'&&yukvars[i].vartype==ick_TWOSPOT))
{
if(yukvars[i].extername==templine)
{
temp=1;
- if(yukvars[i].vartype==ONESPOT)
- onespots[yukvars[i].intername]=pin();
- if(yukvars[i].vartype==TWOSPOT)
- twospots[yukvars[i].intername]=pin();
+ if(yukvars[i].vartype==ick_ONESPOT)
+ ick_onespots[yukvars[i].intername]=(ick_type16)ick_pin();
+ if(yukvars[i].vartype==ick_TWOSPOT)
+ ick_twospots[yukvars[i].intername]=(ick_type32)ick_pin();
/* note that when debugging, you can set an
ignored variable */
}
}
}
if(temp) break;
- puts("That variable is not in the program.");
+ (void) puts("That variable is not in the program.");
break;
case 'g':
- sscanf(buf+1,"%d",&templine);
- if(!templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(!templine || temp != 1)
{
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
}
breakpoints[0] = templine;
line with no commands (although this debugger command is called
'g', would I dare to describe this as a GOTO?) */
i = -1;
- while(++i<yukcommands) abstained[i]++;
+ while(++i<yukcommands) ick_abstained[i]++;
yukerrcmdg = aboff;
singlestep = 0;
writelines = 0;
break;
case 'a':
case 'r':
- sscanf(buf+1,"%d",&templine);
- if(!templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(!templine || temp != 1)
{
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
}
i=-1;
{
if(lineofaboff[i]==templine)
{
- temp=abstained[i];
- if(*buf=='a') if(!temp) abstained[i]=1;
- if(*buf=='r') if(temp) abstained[i]--;
- printf("Command %d on line %d was abstained %d time%s, "
- "now abstained %d time%s.\n",tempcmd,templine,
- temp,temp==1?"":"s",abstained[i],
- abstained[i]==1?"":"s");
+ temp=ick_abstained[i];
+ if(*buf=='a') if(!temp) ick_abstained[i]=1;
+ if(*buf=='r') if(temp) ick_abstained[i]--;
+ printf("Command %d on line %d was ick_abstained %d time%s, "
+ "now ick_abstained %d time%s.\n",tempcmd,templine,
+ temp,temp==1?"":"s",ick_abstained[i],
+ ick_abstained[i]==1?"":"s");
tempcmd++;
}
}
- if(tempcmd==1) puts("No commands start on this line.");
+ if(tempcmd==1) (void) puts("No commands start on this line.");
break;
case 'k':
case 'o':
- untilnext=nextindex-(*buf=='o');
- /* no break;! */
+ untilnext=ick_nextindex-(*buf=='o');
+ /*@fallthrough@*/
case 'c':
singlestep=0;
writelines=0;
keeplooping=0;
break;
case 'b':
- sscanf(buf+1,"%d",&templine);
- if(templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(templine && temp == 1)
{
printf("Breakpoint set at line %d.\n",templine);
breakpoints[nbreakpoints++]=templine;
- if(nbreakpoints>=80) lose(E811,emitlineno,(char*)NULL);
+ if(nbreakpoints>=80) ick_lose(IE811,emitlineno,(char*)NULL);
}
else
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
case 'd':
- sscanf(buf+1,"%d",&templine);
- if(templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(templine && temp == 1)
{
printf("All breakpoints removed from line %d.\n",templine);
i=nbreakpoints;
}
}
else
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
case 'm':
- sscanf(buf+1,"%d",&templine);
- if(templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(templine && temp == 1)
{
printf("Monitor set at line %d.\n",templine);
monitors[nmonitors++]=templine;
- if(nmonitors>=80) lose(E811,emitlineno,(char*)NULL);
+ if(nmonitors>=80) ick_lose(IE811,emitlineno,(char*)NULL);
}
else
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
case 'f':
- sscanf(buf+1,"%d",&templine);
- if(templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(templine && temp == 1)
{
printf("All monitors removed from line %d.\n",templine);
i=nmonitors;
}
}
else
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
case 's':
singlestep=1;
keeplooping=0;
break;
case 'u':
- sscanf(buf+1,"%d",&templine);
- if(templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(templine && temp == 1)
{
breakpoints[0]=templine;
singlestep=0;
keeplooping=0;
}
else
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
case 'e':
- sscanf(buf+1,"%d",&templine);
- if(!templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(!templine || temp != 1)
{
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
}
tempcmd=-1;
}
}
}
- if(!temp) puts("No expressions on that line.");
+ if(!temp) (void) puts("No expressions on that line.");
break;
case 'l':
- sscanf(buf+1,"%d",&templine);
- if(!templine)
+ temp = sscanf(buf+1,"%d",&templine);
+ if(!templine || temp != 1)
{
- puts("Don't know which line you mean.");
+ (void) puts("Don't know which line you mean.");
break;
}
- /* no break;! */
+ /*@fallthrough@*/
case 'h':
if(!templine) templine=lineofaboff[aboff];
templine-=10;
i=templine;
while(i<templine+21&&i<yuklines)
{
- buf[6]=0;
+ buf[6]='\0';
buf[0]=buf[1]=buf[2]=buf[3]=buf[4]=buf[5]=' ';
tempcmd=-1;
temp=0;
{
if(lineofaboff[tempcmd]==i)
{
- buf[temp++]='0'+abstained[tempcmd];
- if(abstained[tempcmd]>9) buf[temp-1]='!';
+ if(ick_abstained[tempcmd]>9) buf[temp++]='!';
+ else buf[temp++]='0'+(char)ick_abstained[tempcmd];
if(temp==6) break;
}
}
}
break;
case '*':
- tempcharp=findandtestopen("COPYING.txt",globalargv[1],
+ tempcharp=ick_findandtestopen("COPYING.txt",globalargv[1],
"r",globalargv[2]);
- sprintf(copyloc,"more < %s",tempcharp);
- system(copyloc); /* display the GNU GPL copyright */
+ if(tempcharp != NULL)
+ {
+#ifndef HAVE_SNPRINTF
+ (void) sprintf(copyloc,"more < %s",tempcharp);
+#else
+ (void) snprintf(copyloc,sizeof copyloc,"more < %s",tempcharp);
+#endif
+ (void) system(copyloc); /* display the GNU GPL copyright */
+ }
+ else
+ (void) puts("Couldn't find license file. See the file COPYING.txt that\n"
+ "came with your C-INTERCAL distribution.");
break;
default:
- puts("Not sure what you mean. Try typing ?<RET>.");
+ (void) puts("Not sure what you mean. Try typing ?<RET>.");
break;
}
} while(keeplooping);
#define YUKEND 5
+/*@-exportlocal@*/ /* because these are used by generated programs */
extern void yukline(int,int);
extern void yukterm(void);
-extern int abstained[];
+extern int ick_abstained[];
extern int yukopts;
-extern int lineno;
+extern int ick_lineno;
extern int yuklines;
extern int yukcommands;
+/*@-incondefs@*/ /* because it's a different textlines to the one in ick.h */
extern char *textlines[];
+/*@=incondefs@*/
extern int lineofaboff[];
extern char *yukexplain[];
extern int yukloop;
+/*@=exportlocal@*/
/* Defines that change the functions used for profiling. */
extern yukvar yukvars[];
+/*@-exportlocal@*/ /* this needs to be global */
extern char** globalargv;
extern int globalargc;
+/*@=exportlocal@*/