+++ /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:
--->
#define CC "gcc"
#endif
-#define ARGSTRING "bcdefghlmoptuvxyCFHOPUX@"
+#define ARGSTRING "abcdefghlmoptuvwxyCEFHOPUX@"
#ifdef USE_YYRESTART
/* function supplied by lex */
ick_bool nocompilerbug; /* disable error IE774 */
int yukdebug; /* AIS: Use the yuk debugger. */
int yukprofile; /* AIS: Use the yuk profiler. */
+int useprintflow=0; /* AIS: Add +printflow support. */
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 createsused=0; /* AIS: Allow the use of CREATE. */
int useickec; /* AIS: Link together INTERCAL and C. */
+static int nosyslib=0; /* AIS: Don't link syslib under any circumstances. */
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!). */
mean that INTERCAL will beat any other language at
many benchmark programs (!) */
extern int ick_printfopens; /* AIS: Print messages whenever attempting to open a
- file: from uncommon.c */
+ file: from uncommon.c */
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 */
static int maxbase = 7;
static int smallsizes[8] = {0, 0, 16, 10, 8, 6, 6, 5};
static unsigned int maxsmalls[8] =
- {0, 0, 65535, 59048, 65535, 15624, 46655, 16806};
+{0, 0, 65535, 59048, 65535, 15624, 46655, 16806};
/*@observer@*/ static char *compiler;
static RETSIGTYPE abend(int signim)
{
- /*@-noeffect@*/ (void) signim; /*@=noeffect@*/
- ick_lose(IE778, iyylineno, (char *)NULL);
+ /*@-noeffect@*/ (void) signim; /*@=noeffect@*/
+ ick_lose(IE778, iyylineno, (char *)NULL);
}
static void print_usage(char *prog, char *options)
{
- 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-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 control flow in generated code "
- "(prevents -yp)\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-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-E\t:never include the system library (prevents -P)\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 control flow in generated code "
+ "(prevents -yp)\n");
#ifdef HAVE_PROG_SH
# ifdef HAVE_SYS_INTERPRETER
- 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 -cdeghpyH\n");
+ fprintf(stderr,"\t-F\t:optimize everything in generated code for\n"
+ "\t\t speed, regardless of how slow the compiler becomes or how\n"
+ "\t\t large the object file becomes. Implies -fO, "
+ "prevents -cdeghpyH\n");
# else
- fprintf(stderr,"\t-F\t:unsupported on computers without #! support\n");
+ fprintf(stderr,"\t-F\t:unsupported on computers without #! support\n");
# endif
#else
- fprintf(stderr,"\t-F\t:unsupported on computers without sh or bash\n");
+ fprintf(stderr,"\t-F\t:unsupported on computers without sh or bash\n");
#endif
- fprintf(stderr,"\t-h\t:print optimizer debugging information "
- "(implies -cO)\n");
- fprintf(stderr,"\t-H\t:print verbose optimizer debugging information "
- "(implies -cO)\n");
- fprintf(stderr,"\t-hH\t:print optimizer debugging information in a\n"
- "\t\tdifferent form (implies -cO)\n");
+ fprintf(stderr,"\t-h\t:print optimizer debugging information "
+ "(implies -cO)\n");
+ fprintf(stderr,"\t-H\t:print verbose optimizer debugging information "
+ "(implies -cO)\n");
+ fprintf(stderr,"\t-hH\t:print optimizer debugging information in a\n"
+ "\t\t different form (implies -cO)\n");
#ifdef HAVE_UNISTD_H
- 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");
+ 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 -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 -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");
- fprintf(stderr,"\t-x\t:use CLC-INTERCAL rules for I/O and abstaining\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 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");
- /* AIS: End of options I added. */
- fprintf(stderr,"\t<file>\tINTERCAL source file (use extension .i\n");
- fprintf(stderr,"\t\tfor base 2 or .3i, etc., for base 3, etc.).\n");
+ fprintf(stderr,"\t-w\t:add support for the +printflow option\n");
+ fprintf(stderr,"\t-m\t:allow multithreading and backtracking\n"
+ "\t\t (prevents -ype, implies -w)\n");
+ fprintf(stderr,"\t-a\t:allow the use of CREATE (prevents -P)\n");
+ fprintf(stderr,"\t-v\t:allow anything on the left of an assignment. This "
+ "is required\n\t\t if 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 -amFvxeE, 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\t Atari (i.e. CLC-INTERCAL not C-INTERCAL)\n");
+ fprintf(stderr,"\t-x\t:use CLC-INTERCAL rules for I/O and abstaining\n"
+ "\t\t from 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 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");
+ /* AIS: End of options I added. */
+ fprintf(stderr,"\t<file>\tINTERCAL source file (use extension .i\n");
+ fprintf(stderr,"\t\tfor base 2 or .3i, etc., for base 3, etc.).\n");
}
/* AIS: Determine whether an environment variable exists (this is used to
/*@-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;
- /*@-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;
- ick_bool needsyslib, firstfile;
- int oldoptind;
+ char buf[BUFSIZ], buf2[BUFSIZ], *chp, yukcmdstr[BUFSIZ], path[BUFSIZ];
+ tuple *tp;
+ atom *op;
+ int c, i;
+ /*@-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;
+ ick_bool needsyslib, firstfile;
+ int oldoptind;
#ifdef HAVE_UNISTD_H
- int oldstdin; /* AIS: for keeping track of where stdin was */
+ int oldstdin; /* AIS: for keeping track of where stdin was */
#endif
- if (!(includedir = getenv("ICKINCLUDEDIR")))
- includedir = ICKINCLUDEDIR;
- if (!(libdir = getenv("ICKLIBDIR")))
- libdir = ICKLIBDIR;
- if (!(ick_datadir = getenv("ICKDATADIR"))) /* AIS */
- ick_datadir = ICKDATADIR;
+ if (!(includedir = getenv("ICKINCLUDEDIR")))
+ includedir = ICKINCLUDEDIR;
+ if (!(libdir = getenv("ICKLIBDIR")))
+ libdir = ICKLIBDIR;
+ if (!(ick_datadir = getenv("ICKDATADIR"))) /* AIS */
+ ick_datadir = ICKDATADIR;
/*
AIS: nothing actually uses this at the moment,
- commenting it out for future use
+ commenting it out for future use
- if (!(bindir = getenv("ICKBINDIR")))
- bindir = ICKBINDIR;
+ if (!(bindir = getenv("ICKBINDIR")))
+ bindir = ICKBINDIR;
*/
- 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@*/
+ 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)
{
- switch (c)
- {
- case 'b':
- nocompilerbug = ick_TRUE;
- break;
-
- case 'c':
- compile_only = ick_TRUE;
- /* AIS */ coopt = ick_FALSE;
- break;
-
- case 'o': /* AIS */
- compile_only = ick_TRUE;
- outtostdout = ick_TRUE;
- coopt = ick_FALSE;
- break;
-
- case 'd':
- 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':
- ick_clockface = ick_TRUE;
- break;
-
- case 't':
- 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 = ick_TRUE;
- variableconstants = ick_FALSE; /* AIS */
- break;
-
- case 'f': /* By AIS */
- flowoptimize = ick_TRUE;
- yukdebug = yukprofile = ick_FALSE;
- variableconstants = ick_FALSE;
- break;
-
- case 'F': /* By AIS */
- coopt = flowoptimize = dooptimize = ick_TRUE;
- variableconstants = useickec = ick_FALSE;
- yukdebug = yukprofile = yydebug = outtostdout =
- compile_only = cdebug = ick_FALSE;
- if(pickcompile) ick_lose(IE256, 1, (char*) NULL);
- break;
-
- case 'h': /* By AIS */
- optdebug|=1;
- compile_only=dooptimize=ick_TRUE;
- coopt=ick_FALSE;
- break;
-
- case 'H': /* By AIS */
- optdebug|=2;
- compile_only=dooptimize=ick_TRUE;
- coopt=ick_FALSE;
- break;
-
- case 'y': /* By AIS */
+ case 'b':
+ nocompilerbug = ick_TRUE;
+ break;
+
+ case 'c':
+ compile_only = ick_TRUE;
+ /* AIS */ coopt = ick_FALSE;
+ break;
+
+ case 'o': /* AIS */
+ compile_only = ick_TRUE;
+ outtostdout = ick_TRUE;
+ coopt = ick_FALSE;
+ break;
+
+ case 'd':
+ 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 'E': /* AIS */
+ nosyslib = ick_TRUE;
+ pickcompile = ick_FALSE;
+ break;
+
+ case 'C':
+ ick_clockface = ick_TRUE;
+ break;
+
+ case 't':
+ 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 = ick_TRUE;
+ variableconstants = ick_FALSE; /* AIS */
+ break;
+
+ case 'f': /* By AIS */
+ flowoptimize = ick_TRUE;
+ yukdebug = yukprofile = ick_FALSE;
+ variableconstants = ick_FALSE;
+ break;
+
+ case 'F': /* By AIS */
+ coopt = flowoptimize = dooptimize = ick_TRUE;
+ variableconstants = useickec = ick_FALSE;
+ yukdebug = yukprofile = yydebug = outtostdout =
+ compile_only = cdebug = ick_FALSE;
+ if(pickcompile) ick_lose(IE256, 1, (char*) NULL);
+ break;
+
+ case 'h': /* By AIS */
+ optdebug|=1;
+ compile_only=dooptimize=ick_TRUE;
+ coopt=ick_FALSE;
+ break;
+
+ case 'H': /* By AIS */
+ optdebug|=2;
+ compile_only=dooptimize=ick_TRUE;
+ coopt=ick_FALSE;
+ break;
+
+ case 'y': /* By AIS */
#ifdef HAVE_UNISTD_H
- yukdebug=ick_TRUE;
- multithread=flowoptimize=coopt=useickec=ick_FALSE;
+ yukdebug=ick_TRUE;
+ multithread=flowoptimize=coopt=useickec=ick_FALSE;
#endif
- break;
+ break;
- case 'p': /* By AIS */
+ case 'p': /* By AIS */
#ifdef HAVE_UNISTD_H
- yukprofile=ick_TRUE;
- multithread=flowoptimize=coopt=useickec=ick_FALSE;
+ yukprofile=ick_TRUE;
+ multithread=flowoptimize=coopt=useickec=ick_FALSE;
#endif
- break;
-
- case 'm': /* By AIS */
- 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=ick_TRUE;
- dooptimize=ick_FALSE;
- flowoptimize=ick_FALSE;
- coopt=ick_FALSE;
- pickcompile=ick_FALSE;
- break;
-
- case 'l': /* By AIS */
- ick_checkforbugs=ick_TRUE;
- dooptimize=ick_TRUE;
- break;
-
- case 'U': /* By AIS */
- ick_coreonerr=ick_TRUE;
- break;
-
- case 'u': /* By AIS */
- ick_printfopens=ick_TRUE;
- break;
-
- case 'P': /* By AIS */
- 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=ick_TRUE;
- break;
-
- case 'x': /* By AIS */
- ick_clcsemantics=ick_TRUE;
- pickcompile=ick_FALSE;
- break;
-
- case 'g': /* By AIS */
- cdebug=ick_TRUE;
- coopt=ick_FALSE;
- break;
-
- case '?':
- default:
- case '@':
- print_usage(argv[0], ARGSTRING);
- exit(EXIT_FAILURE);
- /*@-unreachable@*/ break; /*@=unreachable@*/
- }
+ break;
+
+ case 'w': /* By AIS */
+ useprintflow = ick_TRUE;
+ break;
+
+ case 'm': /* By AIS */
+ multithread=ick_TRUE;
+ yukprofile=ick_FALSE;
+ yukdebug=ick_FALSE;
+ useickec=ick_FALSE;
+ if(ick_traditional) ick_lose(IE111, 1, (char*) NULL);
+ break;
+
+ case 'a': /* By AIS */
+ createsused=ick_TRUE;
+ pickcompile=ick_FALSE;
+ break;
+
+ case 'v': /* By AIS */
+ variableconstants=ick_TRUE;
+ dooptimize=ick_FALSE;
+ flowoptimize=ick_FALSE;
+ coopt=ick_FALSE;
+ pickcompile=ick_FALSE;
+ break;
+
+ case 'l': /* By AIS */
+ ick_checkforbugs=ick_TRUE;
+ dooptimize=ick_TRUE;
+ break;
+
+ case 'U': /* By AIS */
+ ick_coreonerr=ick_TRUE;
+ break;
+
+ case 'u': /* By AIS */
+ ick_printfopens=ick_TRUE;
+ break;
+
+ case 'P': /* By AIS */
+ pickcompile=ick_TRUE;
+ multithread=coopt=variableconstants=createsused=ick_FALSE;
+ ick_clcsemantics=useickec=nosyslib=ick_FALSE;
+ compile_only=ick_TRUE;
+ dooptimize=flowoptimize=ick_TRUE; /* needed for PICs */
+ break;
+
+ case 'X': /* By AIS */
+ clclex=ick_TRUE;
+ break;
+
+ case 'x': /* By AIS */
+ ick_clcsemantics=ick_TRUE;
+ pickcompile=ick_FALSE;
+ break;
+
+ case 'g': /* By AIS */
+ cdebug=ick_TRUE;
+ coopt=ick_FALSE;
+ break;
+
+ case '?':
+ default:
+ case '@':
+ print_usage(argv[0], ARGSTRING);
+ exit(EXIT_FAILURE);
+ /*@-unreachable@*/ break; /*@=unreachable@*/
}
+ }
- (void) signal(SIGSEGV, abend);
+ (void) signal(SIGSEGV, abend);
#ifdef SIGBUS
- (void) signal(SIGBUS, abend);
+ (void) signal(SIGBUS, abend);
#endif /* SIGBUS */
- if (!nocompilerbug) {
+ if (!nocompilerbug) {
#ifdef USG
- srand48(time(NULL) + getpid());
+ srand48(time(NULL) + getpid());
#else
- srand((unsigned)time(NULL));
+ srand((unsigned)time(NULL));
#endif /* UNIX */
- }
+ }
- /* AIS: New function for enhanced file-finding */
- ifp = ick_findandfopen(pickcompile?PSKELETON:SKELETON,
- ick_datadir, "r", argv[0]);
- if(!ifp) ick_lose(IE999, 1, (char *)NULL);
+ /* AIS: New function for enhanced file-finding */
+ 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 */
+ /* now substitute in tokens in the skeleton */
- /* 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: 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 */
+ /* AIS: Save the old stdin, if we can */
#ifdef HAVE_UNISTD_H
- oldstdin=dup(0);
+ oldstdin=dup(0);
#endif
- oldoptind=optind; /* AIS */
- for (firstfile = ick_TRUE; optind < argc; optind++, firstfile = ick_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 (/* AIS */ strrchr(argv[optind],'.') != NULL &&
+ freopen(argv[optind], "rb", stdin) == (FILE *)NULL)
+ ick_lose(IE777, 1, (char *)NULL);
+ else
{
- /* AIS: Read as binary to pick up Latin-1 and UTF-8 better */
- if (freopen(argv[optind], "rb", stdin) == (FILE *)NULL)
- ick_lose(IE777, 1, (char *)NULL);
- else
+ /* strip off the file extension */
+ if(!(chp = strrchr(argv[optind],'.')))
+ {
+ if(useickec && firstfile == ick_FALSE) /* By AIS */
{
- /* strip off the file extension */
- if(!(chp = strrchr(argv[optind],'.')))
- {
- ick_lose(IE998, 1, (char *)NULL);
- }
- *chp++ = '\0';
+ /* the filename indicates a request for an expansion library,
+ along the same lines as CLC-INTERCAL's preloads. Search for
+ it in the usual places, then make a copy in a temp directory
+ and substitute that on the command line. */
+ char* tempfn="%s.c";
+ FILE* fromcopy;
+ FILE* tocopy;
+ int c2;
+#ifndef HAVE_SNPRINTF
+ (void) sprintf(buf2, "%s.c", argv[optind]);
+#else
+ (void) snprintf(buf2, sizeof buf2, "%s.c", argv[optind]);
+#endif
+ fromcopy = ick_findandfopen(buf2,ick_datadir,"rb",argv[0]);
+ if(!fromcopy) /* same error as for syslib */
+ ick_lose(IE127, 1, (char*) NULL);
+#if __DJGPP__
+ /* Look for a temp directory to store a copy of the C file,
+ the resulting .cio, .o files, etc. */
+ if(isenv("TMP")) tempfn="/dev/env/TMP/%s.c";
+ if(isenv("TEMP")) tempfn="/dev/env/TEMP/%s.c";
+ if(isenv("TMPDIR")) tempfn="/dev/env/TMPDIR/%s.c";
+ if(isenv("ICKTEMP")) tempfn="/dev/env/ICKTEMP/%s.c";
+#else
+ tempfn="/tmp/%s.c"; /* always valid on POSIX */
+#endif
+ /*@-formatconst@*/ /* all possibilities are fine */
+#ifndef HAVE_SNPRINTF
+ (void) sprintf(buf2, tempfn, argv[optind]);
+#else
+ (void) snprintf(buf2, sizeof buf2, tempfn, argv[optind]);
+#endif
+ /*@=formatconst@*/
+ if((tocopy = fopen(buf2,"wb")) == NULL)
+ ick_lose(IE888, 1, (char*) NULL);
- if(useickec && (!strcmp(chp,"c") || !strcmp(chp,"cio"))) /* AIS */
- {
- break; /* don't process C or cio files further yet */
- }
+ for(;;)
+ {
+ c2=fgetc(fromcopy);
+ if(c2==EOF) break;
+ (void) fputc(c2,tocopy);
+ }
+ (void) fclose(fromcopy); (void) fclose(tocopy);
+ /*@+onlytrans@*/
+ /* this is a memory leak that will need sorting out later,
+ thus the explicit turn-warning-on */
+ argv[optind]=malloc(sizeof(buf2)+1);
+ /*@=onlytrans@*/
+ if(!(argv[optind]))
+ ick_lose(IE888, 1, (char*) NULL);
+ strcpy(argv[optind],buf2);
+ *(strrchr(argv[optind],'.')) = '\0';
+ continue;
+ }
- 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 ick_first pass, then validates the rest */
- /* of the extension on the second. */
- 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"))
- {
- 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
- ick_Max_large = (ick_Max_small + 1) * (ick_Max_small + 1) - 1;
- }
+ ick_lose(IE998, 1, (char *)NULL);
+ }
+ *chp++ = '\0';
- /* 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;
+ if(useickec && (!strcmp(chp,"c") || !strcmp(chp,"cio"))) /* AIS */
+ {
+ if(firstfile != ick_FALSE) /* need exactly 1 INTERCAL file */
+ ick_lose(IE998, 1, (char *)NULL);
+ break; /* don't process C or cio files further yet */
+ }
- /* reset the lex/yacc environment */
- if (!firstfile)
- {
+ 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 ick_first pass, then validates the rest */
+ /* of the extension on the second. */
+ 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"))
+ {
+ 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
+ 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;
+ gerucomesused = 0; /* AIS: you forgot this one */
+ /* AIS: ensure that at least one variable exists, to prevent
+ NULL pointers later on */
+ (void) intern(ick_ONESPOT, 1); /* mention .1 */
+
+ /* reset the lex/yacc environment */
+ if (!firstfile)
+ {
#ifdef NEED_YYRESTART
- yyrestart(stdin);
+ yyrestart(stdin);
#endif /* NEED_YYRESTART */
- iyylineno = 1;
- }
+ iyylineno = 1;
+ }
- /* compile tuples from current input source */
- (void) yyparse();
+ /* compile tuples from current input source */
+ (void) yyparse();
- if(variableconstants)
- {
- /* AIS: Up to 4 extra meshes may be needed by feh.c. */
- (void) intern(MESH, 0xFFFFFFFFLU);
- (void) intern(MESH, 0xFFFFLU);
- (void) intern(MESH, 0xAAAAAAAALU);
- (void) intern(MESH, 0x55555555LU);
- }
+ if(variableconstants)
+ {
+ /* AIS: Up to 4 extra meshes may be needed by feh.c. */
+ (void) intern(MESH, 0xFFFFFFFFLU);
+ (void) intern(MESH, 0xFFFFLU);
+ (void) intern(MESH, 0xAAAAAAAALU);
+ (void) intern(MESH, 0x55555555LU);
+ }
- /*
- * Miss Manners lives.
- */
- if (ick_lineno > 2)
- {
- 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);
- }
+ /*
+ * Miss Manners lives.
+ */
+ if (ick_lineno > 2)
+ {
+ 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
- */
+ /*
+ * check if we need to magically include the system library
+ */
+ needsyslib = ick_FALSE;
+ if(!pickcompile) /* AIS: We never need syslib when compiling
+ for PIC, because it's preoptimized. */
+ {
+ for (tp = tuples; tp->type; tp++)
+ {
+ /*
+ * If some label in the (1000)-(2000) range is defined,
+ * then clearly the syslib is already there, so we
+ * can stop searching and won't need the syslib.
+ */
+ if (tp->label >= 1000 && tp->label <= 1999) {
needsyslib = ick_FALSE;
- if(!pickcompile) /* AIS: We never need syslib when compiling
- for PIC, because it's preoptimized. */
- {
- for (tp = tuples; tp->type; tp++)
- {
- /*
- * If some label in the (1000)-(2000) range is defined,
- * then clearly the syslib is already there, so we
- * can stop searching and won't need the syslib.
- */
- if (tp->label >= 1000 && tp->label <= 1999) {
- needsyslib = ick_FALSE;
- break;
- }
- /*
- * If some label in the (1000)-(2000) range is being
- * called, we might need the system library.
- */
- if (tp->type == NEXT && tp->u.target >= 1000 &&
- tp->u.target <= 1999)
- needsyslib = ick_TRUE;
- }
- }
- if ( needsyslib ) { /* AIS: modified to use ick_findandfreopen */
- if (ick_Base == 2) /* see code for opening the skeleton */
+ break;
+ }
+ /*
+ * If some label in the (1000)-(2000) range is being
+ * called, we might need the system library.
+ */
+ if (tp->type == NEXT && tp->u.target >= 1000 &&
+ tp->u.target <= 1999)
+ needsyslib = ick_TRUE;
+ }
+ }
+ if(nosyslib) needsyslib = ick_FALSE; /* AIS */
+ 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);
+ (void) sprintf(buf2, "%s.i", SYSLIB);
#else
- (void) snprintf(buf2, sizeof buf2, "%s.i", SYSLIB);
+ (void) snprintf(buf2, sizeof buf2, "%s.i", SYSLIB);
#endif
- else
+ else
#ifndef HAVE_SNPRINTF
- (void) sprintf(buf2, "%s.%di", SYSLIB, ick_Base);
+ (void) sprintf(buf2, "%s.%di", SYSLIB, ick_Base);
#else
- (void) snprintf(buf2, sizeof buf2, "%s.%di", SYSLIB, ick_Base);
+ (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);
+ if (ick_findandfreopen(buf2, ick_datadir, "r", argv[0], stdin) == NULL)
+ ick_lose(IE127, 1, (char*) NULL);
#ifdef USE_YYRESTART
- yyrestart(stdin);
+ yyrestart(stdin);
#endif /* USE_YYRESTART */
- (void) yyparse();
- textlinecount=iyylineno;
- }
+ (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
- * we have to generate different code depending on the
- * deducible type of the operand.
- */
- for (tp = tuples; tp->type; tp++)
- {
- if (tp->type == GETS || tp->type == RESIZE
- || tp->type == WRITE_IN || tp->type == READ_OUT
- || tp->type == FROM || tp->type == MANYFROM
- || tp->type == FORGET || tp->type == RESUME
- || tp->type == COMPUCOME)
- typecast(tp->type == MANYFROM ? tp->u.node->lval : tp->u.node);
- if (tp->type == WRITE_IN) coopt = 0; /* AIS: may as well do
- this here */
- }
+ /*
+ * 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
+ * we have to generate different code depending on the
+ * deducible type of the operand.
+ */
+ for (tp = tuples; tp->type; tp++)
+ {
+ if (tp->type == GETS || tp->type == RESIZE
+ || tp->type == WRITE_IN || tp->type == READ_OUT
+ || tp->type == FROM || tp->type == MANYFROM
+ || tp->type == FORGET || tp->type == RESUME
+ || tp->type == COMPUCOME || tp->type == UNKNOWN)
+ typecast(tp->type == MANYFROM ? tp->u.node->lval : tp->u.node);
+ if (tp->type == WRITE_IN) coopt = 0; /* AIS: may as well do
+ this here */
+ }
+
+ codecheck(); /* check for compile-time errors */
+ /* AIS: And importantly, sort out line number references */
- 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)
- optimize(tp->u.node);
- if (tp->type == MANYFROM) optimize(tp->u.node->lval);
- } /* AIS: Added FROM and MANYFROM support. */
-
- /* AIS: perform flow optimizations */
- if (flowoptimize) optimizef();
-
- /* decide if and where to place the compiler bug */
+ /* 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)
+ optimize(tp->u.node);
+ if (tp->type == MANYFROM) optimize(tp->u.node->lval);
+ } /* AIS: Added FROM and MANYFROM support. */
+
+ /* AIS: perform flow optimizations */
+ if (flowoptimize) optimizef();
+
+ /* decide if and where to place the compiler bug */
#ifdef USG
- if (!nocompilerbug && lrand48() % 10 == 0)
- bugline = (int)(lrand48() % ick_lineno);
+ if (!nocompilerbug && lrand48() % 10 == 0)
+ bugline = (int)(lrand48() % ick_lineno);
#else
- if (!nocompilerbug && rand() % 10 == 0)
- bugline = rand() % ick_lineno;
+ if (!nocompilerbug && rand() % 10 == 0)
+ 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 = ick_debfopen(buf, "w")) == (FILE *)NULL)
- ick_lose(IE888, 1, (char *)NULL);
- /*@=branchstate@*/
-
- (void) fseek(ifp,0L,0); /* rewind skeleton file */
-
- /* AIS: Before changing argv[0], locate coopt.sh. */
- cooptsh = ick_findandtestopen("coopt.sh", ick_datadir, "rb", argv[0]);
- /* AIS: and calculate yukcmdstr. */
+ 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 = ick_debfopen(buf, "w")) == (FILE *)NULL)
+ ick_lose(IE888, 1, (char *)NULL);
+ /*@=branchstate@*/
+
+ (void) fseek(ifp,0L,0); /* rewind skeleton file */
+
+ /* AIS: Before changing argv[0], locate coopt.sh. */
+ cooptsh = ick_findandtestopen("coopt.sh", ick_datadir, "rb", argv[0]);
+ /* AIS: and calculate yukcmdstr. */
#ifndef HAVE_SNPRINTF
- (void) sprintf(yukcmdstr,"%s" EXEEXT " %s %s",
- argv[optind],ick_datadir,argv[0]);
+ (void) sprintf(yukcmdstr,"%s%s" EXEEXT " %s %s",
+ strchr(argv[optind],'/')||strchr(argv[optind],'\\')?
+ "":"./",argv[optind],ick_datadir,argv[0]);
#else
- (void) snprintf(yukcmdstr, sizeof yukcmdstr, "%s" EXEEXT " %s %s",
- argv[optind], ick_datadir, argv[0]);
+ (void) snprintf(yukcmdstr, sizeof yukcmdstr, "%s%s" EXEEXT " %s %s",
+ strchr(argv[optind],'/')||strchr(argv[optind],'\\')?
+ "":"./",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
- 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,".");
+ /* 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
+ 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,
+ (void) sprintf(buf2,
+#if 0
+ 0); /* unconfuse Emacs' autoindenter */
+#endif
#else
- (void) snprintf(buf2, sizeof buf2,
+ (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"
+ "%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","",
#else
- EXEEXT " -lick%s%s",compiler,
-#endif
- buf, yukdebug||yukprofile?" -lyuk ":" ",
- 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] (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 != (int)'$')
- (void) fputc(c, ofp);
- else switch(myfgetc(ifp))
- {
- case 'A': /* source name stem */
- (void) fputs(argv[optind], ofp);
- break;
-
- case 'B': /* # of statements */
- (void) fprintf(ofp, "%d", ick_lineno);
- break;
-
- case 'C': /* initial abstentions */
- /* AIS: Modified to check for coopt, pickcompile */
- maxabstain = 0;
- for (tp = tuples; tp->type; tp++)
- if (((tp->exechance <= 0 || tp->exechance >= 101)
- && tp - tuples + 1 > maxabstain)
- || coopt || pickcompile)
- maxabstain = tp - tuples + 1;
- if (maxabstain)
- {
- if(!pickcompile) (void) fprintf(ofp, " = {");
- for (tp = tuples; tp < tuples + maxabstain; tp++)
- {
- if(tp->exechance != 100 && tp->exechance != -100)
- { /* AIS: The double-oh-seven operator prevents
- coopt working. However, syslib contains a
- double-oh-seven. feh.c has checked that that
- isn't referenced; if it isn't, we can allow
- one double-oh-seven if syslib was
- automagically inclulded. */
- if(needsyslib) needsyslib = 0; else coopt = 0;
- }
- if(!pickcompile)
- {
- if (tp->exechance > 0)
- {
- (void) fprintf(ofp, "0, ");
- tp->initabstain=0; /* AIS: -f might not be
- given, so we can't rely
- on dekludge.c doing
- this */
- }
- else {
- (void) fprintf(ofp, "1, ");
- tp->exechance = -tp->exechance;
- tp->initabstain=1; /* AIS: As above */
- /* 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)
- tp->onceagainflag = onceagain_AGAIN;
- else if(tp->onceagainflag == onceagain_AGAIN)
- tp->onceagainflag = onceagain_ONCE;
- }
- if(tp->exechance >= 101)
- {
- /* AIS: This line has a MAYBE */
- tp->maybe = 1;
- tp->exechance /= 100;
- }
- else tp->maybe = 0;
- }
- else /* AIS: hardcoded abstain bits for PICs */
- {
- if(!tp->abstainable) continue;
- 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);
- }
- }
- if(!pickcompile) (void) fprintf(ofp, "}");
- }
- break;
-
- 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)
- maxabstain++;
- if (maxabstain || /* AIS */ gerucomesused)
- {
- /* AIS: Changed to use enablersm1 */
- /*(void) fprintf(ofp, "#define UNKNOWN\t\t0\n");*/
- i = 0;
- for (;i < (int)(sizeof(enablersm1)/sizeof(char *));i++)
- (void) fprintf(ofp,
- "#define %s\t%d\n",
- enablersm1[i], i);
-
- (void) fprintf(ofp, "int linetype[] = {\n");
- for (tp = tuples; tp->type; tp++)
- if(tp->ppnewtype) /* AIS */
- (void) fprintf(ofp," %s,\n",
- enablers[tp->ppnewtype - GETS]);
- else if(tp->preproc) /* AIS */
- (void) fprintf(ofp," PREPROC,\n");
- else if (tp->type >= GETS && tp->type <= FROM)
- /* AIS: FROM added */
- (void) fprintf(ofp,
- " %s,\n",
- enablers[tp->type - GETS]);
- else
- (void) fprintf(ofp, " UNKNOWN,\n");
- (void) fprintf(ofp, "};\n");
- }
- break;
-
- case 'E': /* extern to intern map */
- if(!pickcompile)
- {
- (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(!ntwospots) ntwospots = 1;
- if(!ntails) ntails = 1;
- if(!nhybrids) nhybrids = 1;
- }
- else if(opoverused)
- {
- /* AIS: The operand-overloading code requires onespot and
- twospot variables to exist. */
- if(!nonespots) nonespots = 1;
- if(!ntwospots) ntwospots = 1;
- }
- /* AIS:I de-staticed all these so they could be accessed by
- yuk and cesspool, and added all the mentions of yuk and
- multithread. Then I changed it so the variables would be
- allocated dynamically, to speed up multithreading. (It's
- an O(1) change to the speed of ordinary programs, so I
- thought I could get away with it. The order is wrt the
- number of lines in the program. The change is O(n) wrt
- the number of variables, but again I hope that doesn't
- matter, and I won't get the entire INTERCAL community
- angry with me for daring to implement an extension that
- slows down existing programs.) */
- if (variableconstants) /* AIS */
- {
- int temp=0;
- (void) fprintf(ofp, "ick_type32 meshes[%d] = {",nmeshes);
- while(temp<nmeshes)
- {
- (void) fprintf(ofp, "%luLU, ", varextern((unsigned long)temp,MESH));
- temp++;
- }
- (void) fprintf(ofp, "};\n");
- }
-
- if (nonespots)
- {
- (void) fprintf(ofp,
- "ick_type16* ick_onespots;\n");
- (void) fprintf(ofp,
- "ick_bool* ick_oneforget;\n");
- if(yukprofile || yukdebug)
- {
- (void) fprintf(ofp,
- "ick_type16 oneold[%d];\n",
- nonespots);
- (void) fprintf(ofp,
- "signed char onewatch[%d];\n",
- nonespots);
- }
- if(multithread)
- {
- (void) fprintf(ofp,
- "int onespotcount = %d;\n",
- nonespots);
- }
- if(opoverused) /* AIS */
- {
- int temp=nonespots;
- (void) fprintf(ofp,
- "ick_overop* ick_oo_onespots;\n");
- while(temp--)
- (void) fprintf(ofp,
-"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, "ick_overop* ick_oo_onespots=0;\n");
- }
- if (ntwospots)
- {
- (void) fprintf(ofp,
- "ick_type32* ick_twospots;\n");
- (void) fprintf(ofp,
- "ick_bool* ick_twoforget;\n");
- if(yukprofile || yukdebug)
- {
- (void) fprintf(ofp,
- "ick_type32 twoold[%d];\n",
- ntwospots);
- (void) fprintf(ofp,
- "signed char twowatch[%d];\n",
- ntwospots);
- }
- if(multithread)
- {
- (void) fprintf(ofp,
- "int twospotcount = %d;\n",
- ntwospots);
- }
- if(opoverused) /* AIS */
- {
- int temp=ntwospots;
- (void) fprintf(ofp,
- "ick_overop* ick_oo_twospots;\n");
- while(temp--)
- (void) fprintf(ofp,
-"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, "ick_overop* ick_oo_twospots=0;\n");
- }
- if (ntails)
- {
- (void) fprintf(ofp,
- "ick_array* ick_tails;\n");
- (void) fprintf(ofp,
- "ick_bool* ick_tailforget;\n");
- if(multithread)
- {
- (void) fprintf(ofp,
- "int tailcount = %d;\n",
- ntails);
- }
- }
- if (nhybrids)
- {
- (void) fprintf(ofp,
- "ick_array* ick_hybrids;\n");
- (void) fprintf(ofp,
- "ick_bool* ick_hyforget;\n");
- if(multithread)
- {
- (void) fprintf(ofp,
- "int hybridcount = %d;\n",
- nhybrids);
- }
- }
- if (yydebug || compile_only)
- {
- 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,%lu,%lu},\n",
- nameof(op->type, vartypes),
- op->extindex,
- op->intindex);
- (void) fprintf(ofp," {YUKEND,0,0}};\n");
- }
- }
- else
- {
- /* Compiling for PIC */
- /* Arrays not supported on PICs */
- if(ntails || nhybrids)
- ick_lose(IE256, iyylineno, (char*) NULL);
- /* and neither are variable constants */
- if(variableconstants)
- ick_lose(IE256, iyylineno, (char*) NULL);
- assert(oblist != NULL);
- for (op = oblist; op < obdex; op++)
- {
- (void) fprintf(ofp, " /* %s %lu -> %lu */\n",
- nameof(op->type, vartypes),
- op->extindex,
- op->intindex);
- (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%lu = 0;\n",
- nameof(op->type, varstores),
- op->intindex);
- }
- (void) fprintf(ofp, "#include \"pick1.h\"\n");
- if(nonespots)
- {
- (void) fprintf(ofp,
- "ICK_INT16 ick_onespots[%d];\n"
- "ICK_INT16 onespotsstash[%d];\n",
- nonespots,
- nonespots);
- if(opoverused) /* AIS */
- {
- int temp=nonespots;
- (void) fprintf(ofp,"ick_overop* ick_oo_onespots;\n");
- while(temp--)
- (void) fprintf(ofp,
-"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 ick_twospots[%d];\n"
- "ICK_INT32 twospotsstash[%d];\n",
- ntwospots,
- ntwospots);
- if(opoverused) /* AIS */
- {
- int temp=ntwospots;
- (void) fprintf(ofp,"ick_overop* ick_oo_twospots;\n");
- while(temp--)
- (void) fprintf(ofp,
-"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 (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 */
- for (tp = tuples, i = 0; tp->type; tp++, i++)
- {
- emit(tp, ofp);
- if (i == bugline)
- (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 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(ick_cjb,1);\n",
- compucomecount);
- }
-#if 0
- /* AIS: This section is no longer used, because a switch
- is used inline instead of using gotos into the code. */
- nextcount = 0;
- for (tp = tuples; tp->type; tp++)
- if (tp->type == NEXT)
- nextcount++;
- if (nextcount)
- {
- (void) fputs("/* generated switch for resumes */",ofp);
- (void) fputs("top:\n switch(ick_skipto)\n {\n", ofp);
- for (tp = tuples; tp->type; tp++)
- if (tp->type == NEXT)
- (void) fprintf(ofp,
- "\tcase %d: goto N%d; break;\n",
- (int)(tp-tuples+1), (int)(tp-tuples+1));
- (void) fprintf(ofp, " }");
- }
+ EXEEXT " -lick%s%s",compiler,
#endif
- break;
-
- case 'J': /* # of source file lines */
- (void) fprintf(ofp, "%d", iyylineno);
- break;
-
- case 'K': /* AIS: yuk information (or not) */
- if(yukdebug||yukprofile)
- {
- (void) fprintf(ofp, "#include \"yuk.h\"\n\n");
- (void) fprintf(ofp, "char* textlines[] = {\n");
- emittextlines(ofp); /* from feh.c */
- (void) fprintf(ofp, "\"\"};\n\n");
- (void) fprintf(ofp, "char* yukexplain[] = {\n");
- for (tp = tuples; tp->type; tp++)
- {
- if (tp->type == GETS || tp->type == FORGET || tp->type == RESUME
- || tp->type == FROM || tp->type == COMPUCOME
- || tp->type == MANYFROM)
- {
- (void) fprintf(ofp, "\"");
- explexpr(tp->type == MANYFROM ? tp->u.node->lval :
- tp->type == GETS ? tp->u.node->rval : tp->u.node, ofp);
- (void) fprintf(ofp, "\",\n");
- }
- else (void) fprintf(ofp, "0,");
- }
- (void) fprintf(ofp, "0};\n\n");
- (void) fprintf(ofp, "int lineofaboff[] = {\n");
- for (tp = tuples; tp->type; tp++)
- {
- 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", ick_lineno);
- (void) fprintf(ofp, "ypcounter ypexecount[%d];\n",ick_lineno);
- (void) fprintf(ofp, "ypcounter ypabscount[%d];\n",ick_lineno);
- }
- break;
-
- case 'L': /* AIS: increase Emacs compatibility */
- (void) fprintf(ofp,
- "/* -*- mode:c; compile-command:\"%s%s%s\" -*- */",
+ buf, yukdebug||yukprofile?" -lyuk ":" ",
+ 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] (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 != (int)'$')
+ (void) fputc(c, ofp);
+ else switch(myfgetc(ifp))
+ {
+ case 'A': /* source name stem */
+ (void) fputs(argv[optind], ofp);
+ break;
+
+ case 'B': /* # of statements */
+ (void) fprintf(ofp, "%d", ick_lineno);
+ break;
+
+ case 'C': /* initial abstentions */
+ /* AIS: Modified to check for coopt, pickcompile */
+ maxabstain = 0;
+ for (tp = tuples; tp->type; tp++)
+ if (((tp->exechance <= 0 || tp->exechance >= 101)
+ && tp - tuples + 1 > maxabstain)
+ || coopt || pickcompile)
+ maxabstain = tp - tuples + 1;
+ if (maxabstain)
+ {
+ if(!pickcompile) (void) fprintf(ofp, " = {");
+ for (tp = tuples; tp < tuples + maxabstain; tp++)
+ {
+ if(tp->exechance != 100 && tp->exechance != -100)
+ { /* AIS: The double-oh-seven operator prevents
+ coopt working. However, syslib contains a
+ double-oh-seven. feh.c has checked that that
+ isn't referenced; if it isn't, we can allow
+ one double-oh-seven if syslib was
+ automagically inclulded. */
+ if(needsyslib) needsyslib = 0; else coopt = 0;
+ }
+ if(!pickcompile)
+ {
+ if (tp->exechance > 0)
+ {
+ (void) fprintf(ofp, "0, ");
+ tp->initabstain=0; /* AIS: -f might not be
+ given, so we can't rely
+ on dekludge.c doing
+ this */
+ }
+ else {
+ (void) fprintf(ofp, "1, ");
+ tp->exechance = -tp->exechance;
+ tp->initabstain=1; /* AIS: As above */
+ /* 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)
+ tp->onceagainflag = onceagain_AGAIN;
+ else if(tp->onceagainflag == onceagain_AGAIN)
+ tp->onceagainflag = onceagain_ONCE;
+ }
+ if(tp->exechance >= 101)
+ {
+ /* AIS: This line has a MAYBE */
+ tp->maybe = 1;
+ tp->exechance /= 100;
+ }
+ else tp->maybe = 0;
+ }
+ else /* AIS: hardcoded abstain bits for PICs */
+ {
+ if(!tp->abstainable) continue;
+ 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);
+ }
+ }
+ if(!pickcompile) (void) fprintf(ofp, "}");
+ }
+ break;
+
+ 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)
+ maxabstain++;
+ if (maxabstain || /* AIS */ gerucomesused)
+ {
+ /* AIS: Changed to use enablersm1 */
+ /*(void) fprintf(ofp, "#define UNKNOWN\t\t0\n");*/
+ i = 0;
+ for (;i < (int)(sizeof(enablersm1)/sizeof(char *));i++)
+ (void) fprintf(ofp,
+ "#define %s\t%d\n",
+ enablersm1[i], i);
+
+ (void) fprintf(ofp, "int linetype[] = {\n");
+ for (tp = tuples; tp->type; tp++)
+ if(tp->ppnewtype) /* AIS */
+ (void) fprintf(ofp," %s,\n",
+ enablers[tp->ppnewtype - GETS]);
+ else if(tp->preproc) /* AIS */
+ (void) fprintf(ofp," PREPROC,\n");
+ else if (tp->type >= GETS && tp->type <= FROM)
+ /* AIS: FROM added */
+ (void) fprintf(ofp,
+ " %s,\n",
+ enablers[tp->type - GETS]);
+ else
+ /* AIS: I didn't change this code, but relied on
+ it when implementing just-in-case compilation;
+ SPLATTERED and UNKNOWN (the two types of
+ syntax error, unsalvageable and salvageable
+ respectively) both become UNKNOWN in the
+ linetypes array. */
+ (void) fprintf(ofp, " UNKNOWN,\n");
+ (void) fprintf(ofp, "};\n"); } break;
+
+ case 'E': /* extern to intern map */
+ if(!pickcompile)
+ {
+ (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 || useickec)
+ { /* AIS: yuk.c, multithreading require all these to exist */
+ if(!nonespots) nonespots = 1;
+ if(!ntwospots) ntwospots = 1;
+ if(!ntails) ntails = 1;
+ if(!nhybrids) nhybrids = 1;
+ }
+ else if(opoverused)
+ {
+ /* AIS: The operand-overloading code requires onespot and
+ twospot variables to exist. */
+ if(!nonespots) nonespots = 1;
+ if(!ntwospots) ntwospots = 1;
+ }
+ /* AIS:I de-staticed all these so they could be accessed by
+ yuk and cesspool, and added all the mentions of yuk and
+ multithread. Then I changed it so the variables would be
+ allocated dynamically, to speed up multithreading. (It's
+ an O(1) change to the speed of ordinary programs, so I
+ thought I could get away with it. The order is wrt the
+ number of lines in the program. The change is O(n) wrt
+ the number of variables, but again I hope that doesn't
+ matter, and I won't get the entire INTERCAL community
+ angry with me for daring to implement an extension that
+ slows down existing programs.) */
+ if (variableconstants) /* AIS */
+ {
+ int temp=0;
+ (void) fprintf(ofp, "ick_type32 meshes[%d] = {",nmeshes);
+ while(temp<nmeshes)
+ {
+ (void) fprintf(ofp, "%luLU, ", varextern((unsigned long)temp,MESH));
+ temp++;
+ }
+ (void) fprintf(ofp, "};\n");
+ }
+
+ if (nonespots)
+ {
+ (void) fprintf(ofp,
+ "ick_type16* ick_onespots;\n");
+ (void) fprintf(ofp,
+ "ick_bool* ick_oneforget;\n");
+ if(yukprofile || yukdebug)
+ {
+ (void) fprintf(ofp,
+ "ick_type16 oneold[%d];\n",
+ nonespots);
+ (void) fprintf(ofp,
+ "signed char onewatch[%d];\n",
+ nonespots);
+ }
+ if(multithread)
+ {
+ (void) fprintf(ofp,
+ "int onespotcount = %d;\n",
+ nonespots);
+ }
+ if(multithread || opoverused) /* AIS */
+ {
+ int temp=nonespots;
+ (void) fprintf(ofp,
+ "ick_overop* ick_oo_onespots = 0;\n");
+ if(opoverused)
+ while(temp--)
+ (void) fprintf(ofp,
+ "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);
+ }
+ }
+ if (ntwospots)
+ {
+ (void) fprintf(ofp,
+ "ick_type32* ick_twospots;\n");
+ (void) fprintf(ofp,
+ "ick_bool* ick_twoforget;\n");
+ if(yukprofile || yukdebug)
+ {
+ (void) fprintf(ofp,
+ "ick_type32 twoold[%d];\n",
+ ntwospots);
+ (void) fprintf(ofp,
+ "signed char twowatch[%d];\n",
+ ntwospots);
+ }
+ if(multithread)
+ {
+ (void) fprintf(ofp,
+ "int twospotcount = %d;\n",
+ ntwospots);
+ }
+ if(multithread || opoverused) /* AIS */
+ {
+ int temp=ntwospots;
+ (void) fprintf(ofp,
+ "ick_overop* ick_oo_twospots = 0;\n");
+ if(opoverused)
+ while(temp--)
+ (void) fprintf(ofp,
+ "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);
+ }
+ }
+ if (ntails)
+ {
+ (void) fprintf(ofp,
+ "ick_array* ick_tails;\n");
+ (void) fprintf(ofp,
+ "ick_bool* ick_tailforget;\n");
+ if(multithread)
+ {
+ (void) fprintf(ofp,
+ "int tailcount = %d;\n",
+ ntails);
+ }
+ }
+ if (nhybrids)
+ {
+ (void) fprintf(ofp,
+ "ick_array* ick_hybrids;\n");
+ (void) fprintf(ofp,
+ "ick_bool* ick_hyforget;\n");
+ if(multithread)
+ {
+ (void) fprintf(ofp,
+ "int hybridcount = %d;\n",
+ nhybrids);
+ }
+ }
+ if (yydebug || compile_only)
+ {
+ 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,%lu,%lu},\n",
+ nameof(op->type, vartypes),
+ op->extindex,
+ op->intindex);
+ (void) fprintf(ofp," {YUKEND,0,0}};\n");
+ }
+ else if(useickec)
+ { /* AIS: likewise, but with different identifiers */
+ (void) fprintf(ofp, "\nick_ec_var ick_ec_vars[]={\n");
+ assert(oblist != NULL);
+ for (op = oblist; op < obdex; op++)
+ if(op->type!=MESH)
+ (void) fprintf(ofp," {%s,%lu,%lu},\n",
+ nameof(op->type, vartypes),
+ op->extindex,
+ op->intindex);
+ (void) fprintf(ofp," {ICK_EC_VARS_END,0,0}};\n");
+ }
+ }
+ else
+ {
+ /* Compiling for PIC */
+ /* Arrays not supported on PICs */
+ if(ntails || nhybrids)
+ ick_lose(IE256, iyylineno, (char*) NULL);
+ /* and neither are variable constants */
+ if(variableconstants)
+ ick_lose(IE256, iyylineno, (char*) NULL);
+ assert(oblist != NULL);
+ for (op = oblist; op < obdex; op++)
+ {
+ (void) fprintf(ofp, " /* %s %lu -> %lu */\n",
+ nameof(op->type, vartypes),
+ op->extindex,
+ op->intindex);
+ (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%lu = 0;\n",
+ nameof(op->type, varstores),
+ op->intindex);
+ }
+ (void) fprintf(ofp, "#include \"pick1.h\"\n");
+ if(nonespots)
+ {
+ (void) fprintf(ofp,
+ "ICK_INT16 ick_onespots[%d];\n"
+ "ICK_INT16 onespotsstash[%d];\n",
+ nonespots,
+ nonespots);
+ if(opoverused) /* AIS */
+ {
+ int temp=nonespots;
+ (void) fprintf(ofp,"ick_overop* ick_oo_onespots;\n");
+ while(temp--)
+ (void) fprintf(ofp,
+ "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 ick_twospots[%d];\n"
+ "ICK_INT32 twospotsstash[%d];\n",
+ ntwospots,
+ ntwospots);
+ if(opoverused) /* AIS */
+ {
+ int temp=ntwospots;
+ (void) fprintf(ofp,"ick_overop* ick_oo_twospots;\n");
+ while(temp--)
+ (void) fprintf(ofp,
+ "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 (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 */
+ for (tp = tuples, i = 0; tp->type; tp++, i++)
+ {
+ emit(tp, ofp);
+ if (i == bugline)
+ (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 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(ick_cjb,1);\n",
+ compucomecount);
+ }
+ break;
+
+ case 'J': /* # of source file lines */
+ (void) fprintf(ofp, "%d", iyylineno);
+ break;
+
+ case 'K': /* AIS: yuk information (or not) */
+ if(yukdebug||yukprofile)
+ {
+ (void) fprintf(ofp, "#include \"yuk.h\"\n\n");
+ (void) fprintf(ofp, "char* textlines[] = {\n");
+ emittextlines(ofp); /* from feh.c */
+ (void) fprintf(ofp, "\"\"};\n\n");
+ (void) fprintf(ofp, "char* yukexplain[] = {\n");
+ for (tp = tuples; tp->type; tp++)
+ {
+ if (tp->type == GETS || tp->type == FORGET || tp->type == RESUME
+ || tp->type == FROM || tp->type == COMPUCOME
+ || tp->type == MANYFROM)
+ {
+ (void) fprintf(ofp, "\"");
+ explexpr(tp->type == MANYFROM ? tp->u.node->lval :
+ tp->type == GETS ? tp->u.node->rval : tp->u.node, ofp);
+ (void) fprintf(ofp, "\",\n");
+ }
+ else (void) fprintf(ofp, "0,");
+ }
+ (void) fprintf(ofp, "0};\n\n");
+ (void) fprintf(ofp, "int lineofaboff[] = {\n");
+ for (tp = tuples; tp->type; tp++)
+ {
+ 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", ick_lineno);
+ (void) fprintf(ofp, "ypcounter ypexecount[%d];\n",ick_lineno);
+ (void) fprintf(ofp, "ypcounter ypabscount[%d];\n",ick_lineno);
+ }
+ break;
+
+ case 'L': /* AIS: increase Emacs compatibility */
+ (void) fprintf(ofp,
+ "/* -*- mode:c; compile-command:\"%s%s%s\" -*- */",
#ifdef __DJGPP__
- compiler," ",
+ compiler," ",
#else
- "","",
+ "","",
#endif
- buf2);
- break;
-
- case 'M': /* AIS: place new features defines in program */
- /* This is needed even in a non-multithread program, to let
- the header files know it's non-multithread */
- (void) fprintf(ofp, "#define MULTITHREAD %d\n", multithread);
- /* Likewise, to let the header files know whether it
- 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 */
- /* AIS:I de-staticed all these so they could be accessed by
- yuk and cesspool, and added all the mentions of yuk and
- multithread. Then I changed it so the variables would be
- allocated dynamically, to speed up multithreading (it's
- an O(1) change to the speed of ordinary programs, so I
- thought I could get away with it). At this point, the
- 'E' case must already have been done. calloc sets all
- the integer values to 0, as before. In the case of
- arrays, it will not zero pointers, but the number-of-
- dimensions value will become 0, which can serve as a
- 'deallocated' flag. */
- if (nonespots)
- {
- if(!pickcompile) /* AIS */
- {
- (void) fprintf(ofp,
- " ick_onespots = calloc("
- "%d, sizeof *ick_onespots);\n",
- nonespots);
- (void) fprintf(ofp,
- " ick_oneforget = calloc("
- "%d, sizeof *ick_oneforget);\n",
- nonespots);
- }
- if(opoverused)
- {
- int temp=nonespots;
- (void) fprintf(ofp,
-" ick_oo_onespots=malloc(%d*sizeof*ick_oo_onespots);\n",temp);
- while(temp--)
- (void) fprintf(ofp,
-" ick_oo_onespots[%d].get=og1spot%d;\n ick_oo_onespots[%d].set=os1spot%d;\n",
- temp,temp,temp,temp);
- }
- }
- if (ntwospots)
- {
- if(!pickcompile)
- {
- (void) fprintf(ofp,
- " ick_twospots = calloc("
- "%d, sizeof *ick_twospots);\n",
- ntwospots);
- (void) fprintf(ofp,
- " ick_twoforget = calloc("
- "%d, sizeof *ick_twoforget);\n",
- ntwospots);
- }
- if(opoverused)
- {
- int temp=ntwospots;
- (void) fprintf(ofp,
-" ick_oo_twospots=malloc(%d*sizeof*ick_oo_twospots);\n",temp);
- while(temp--)
- (void) fprintf(ofp,
-" 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,
- " ick_tails = calloc("
- "%d, sizeof *ick_tails);\n",
- ntails);
- (void) fprintf(ofp,
- " ick_tailforget = calloc("
- "%d, sizeof *ick_tailforget);\n",
- ntails);
- }
- if (nhybrids&&!pickcompile)
- {
- (void) fprintf(ofp,
- " ick_hybrids = calloc("
- "%d, sizeof *ick_hybrids);\n",
- nhybrids);
- (void) fprintf(ofp,
- " ick_hyforget = calloc("
- "%d, sizeof *ick_hyforget);\n",
- nhybrids);
- }
- break;
- case 'O': /* AIS; for GERUCOME and operand overloading */
- if(gerucomesused || nextfromsused)
- fprintf(ofp,"unsigned truelineno = 0;\n");
- if(opoverused)
- fprintf(ofp,"%s trueval;\n",
- pickcompile?"ICK_INT32":"ick_type32");
- break;
- case 'P': /* AIS: for operand overloading */
- if(opoverused)
- emitslatproto(ofp);
- break;
- case 'Q': /* AIS: for operand overloading */
- if(opoverused)
- emitslat(ofp);
- break;
- }
-
- if(!outtostdout) (void) fclose(ofp);
+ buf2);
+ break;
+
+ case 'M': /* AIS: place new features defines in program */
+ /* This is needed even in a non-multithread program, to let
+ the header files know it's non-multithread */
+ (void) fprintf(ofp, "#define MULTITHREAD %d\n", multithread);
+ /* Likewise, to let the header files know whether it
+ 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 */
+ /* AIS:I de-staticed all these so they could be accessed by
+ yuk and cesspool, and added all the mentions of yuk and
+ multithread. Then I changed it so the variables would be
+ allocated dynamically, to speed up multithreading (it's
+ an O(1) change to the speed of ordinary programs, so I
+ thought I could get away with it). At this point, the
+ 'E' case must already have been done. calloc sets all
+ the integer values to 0, as before. In the case of
+ arrays, it will not zero pointers, but the number-of-
+ dimensions value will become 0, which can serve as a
+ 'deallocated' flag. */
+ if (nonespots)
+ {
+ if(!pickcompile) /* AIS */
+ {
+ (void) fprintf(ofp,
+ " ick_onespots = calloc("
+ "%d, sizeof *ick_onespots);\n",
+ nonespots);
+ (void) fprintf(ofp,
+ " ick_oneforget = calloc("
+ "%d, sizeof *ick_oneforget);\n",
+ nonespots);
+ }
+ if(opoverused)
+ {
+ int temp=nonespots;
+ (void) fprintf(ofp,
+ " ick_oo_onespots=malloc(%d*sizeof*ick_oo_onespots);\n",temp);
+ while(temp--)
+ (void) fprintf(ofp,
+ " ick_oo_onespots[%d].get=og1spot%d;\n ick_oo_onespots[%d].set=os1spot%d;\n",
+ temp,temp,temp,temp);
+ }
+ }
+ if (ntwospots)
+ {
+ if(!pickcompile)
+ {
+ (void) fprintf(ofp,
+ " ick_twospots = calloc("
+ "%d, sizeof *ick_twospots);\n",
+ ntwospots);
+ (void) fprintf(ofp,
+ " ick_twoforget = calloc("
+ "%d, sizeof *ick_twoforget);\n",
+ ntwospots);
+ }
+ if(opoverused)
+ {
+ int temp=ntwospots;
+ (void) fprintf(ofp,
+ " ick_oo_twospots=malloc(%d*sizeof*ick_oo_twospots);\n",temp);
+ while(temp--)
+ (void) fprintf(ofp,
+ " 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,
+ " ick_tails = calloc("
+ "%d, sizeof *ick_tails);\n",
+ ntails);
+ (void) fprintf(ofp,
+ " ick_tailforget = calloc("
+ "%d, sizeof *ick_tailforget);\n",
+ ntails);
+ }
+ if (nhybrids&&!pickcompile)
+ {
+ (void) fprintf(ofp,
+ " ick_hybrids = calloc("
+ "%d, sizeof *ick_hybrids);\n",
+ nhybrids);
+ (void) fprintf(ofp,
+ " ick_hyforget = calloc("
+ "%d, sizeof *ick_hyforget);\n",
+ nhybrids);
+ }
+ break;
+ case 'O': /* AIS; for GERUCOME and operand overloading */
+ if(gerucomesused || nextfromsused)
+ fprintf(ofp,"unsigned truelineno = 0;\n");
+ if(opoverused)
+ fprintf(ofp,"%s trueval;\n",
+ pickcompile?"ICK_INT32":"ick_type32");
+ break;
+ case 'P': /* AIS: for operand overloading */
+ if(opoverused)
+ emitslatproto(ofp);
+ break;
+ case 'Q': /* AIS: for operand overloading */
+ if(opoverused)
+ emitslat(ofp);
+ break;
+ }
+
+ if(!outtostdout) (void) fclose(ofp);
#ifndef __DJGPP__
- /* OK, now sic the C compiler on the results */
- 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&&!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);
+ /* OK, now sic the C compiler on the results */
+ 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&&!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
- (void) dup2(oldstdin,0); /* restore stdin */
+ (void) dup2(oldstdin,0); /* restore stdin */
#endif
- (void) system(yukcmdstr);
- (void) unlink(buf);
- (void) unlink(argv[optind]);
- }
+ (void) system(yukcmdstr);
+ (void) unlink(buf);
+ (void) unlink(argv[optind]);
+ }
#else /* we are using DJGPP */
- /* OK, now sic the C compiler on the results */
- if (!compile_only&&!useickec)
- {
- /* AIS: buf2 now assigned elsewhere so $L works */
- /* AIS: This changes somewhat for DJGPP, due to the
- command-line cap. It creates a temporary file
- with the arguments needed to give gcc. */
- FILE* rsp;
- /* Use current dir as temp if needed */
- char* tempfn="gcc @ickgcc.rsp";
- /* 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
- bash), TEMP and TMP (in that order). DJGPP offers /dev/env
- as a method of accessing environment variables in filenames.*/
- if(isenv("TMP")) tempfn="gcc @/dev/env/TMP/ickgcc.rsp";
- 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=ick_debfopen(tempfn+5,"w");
- fprintf(rsp,"%s\n",buf2);
- fclose(rsp);
- system(tempfn);
- remove(tempfn+5);
- if(yukdebug || yukprofile)
- {
+ /* OK, now sic the C compiler on the results */
+ if (!compile_only&&!useickec)
+ {
+ /* AIS: buf2 now assigned elsewhere so $L works */
+ /* AIS: This changes somewhat for DJGPP, due to the
+ command-line cap. It creates a temporary file
+ with the arguments needed to give gcc. */
+ FILE* rsp;
+ /* Use current dir as temp if needed */
+ char* tempfn="gcc @ickgcc.rsp";
+ /* 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
+ bash), TEMP and TMP (in that order). DJGPP offers /dev/env
+ as a method of accessing environment variables in filenames.*/
+ if(isenv("TMP")) tempfn="gcc @/dev/env/TMP/ickgcc.rsp";
+ 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=ick_debfopen(tempfn+5,"w");
+ fprintf(rsp,"%s\n",buf2);
+ fclose(rsp);
+ system(tempfn);
+ remove(tempfn+5);
+ if(yukdebug || yukprofile)
+ {
#ifdef HAVE_UNISTD_H
- dup2(oldstdin,0); /* restore stdin */
+ dup2(oldstdin,0); /* restore stdin */
#endif
#ifndef HAVE_SNPRINTF
- sprintf(buf2,"%s" EXEEXT,argv[optind]);
+ sprintf(buf2,"%s" EXEEXT,argv[optind]);
#else
- snprintf(buf2,"%s" EXEEXT,argv[optind]);
+ snprintf(buf2,"%s" EXEEXT,argv[optind]);
#endif
- system(yukcmdstr);
- remove(buf);
- remove(buf2);
- }
- else if(!cdebug)
- {
- remove(buf);
- }
- }
+ system(yukcmdstr);
+ remove(buf);
+ remove(buf2);
+ }
+ else if(!cdebug)
+ {
+ remove(buf);
+ }
+ }
#endif
#ifdef HAVE_PROG_SH
# ifdef HAVE_SYS_INTERPRETER
- if(coopt) /* AIS */
- {
- /* The constant-output optimizer is a form of post-processor.
- IMPORTANT NOTE: This MUST NOT be run if the input program
- takes any input or is affected in any way by the state of
- the system, as the degenerated program may be wrong. At the
- moment, the only INTERCAL command that takes input is
- WRITE IN. Double-oh-sevens screw this up, too. */
- if(cooptsh)
- {
+ if(coopt) /* AIS */
+ {
+ /* The constant-output optimizer is a form of post-processor.
+ IMPORTANT NOTE: This MUST NOT be run if the input program
+ takes any input or is affected in any way by the state of
+ the system, as the degenerated program may be wrong. At the
+ moment, the only INTERCAL command that takes input is
+ WRITE IN. Double-oh-sevens screw this up, too. */
+ if(cooptsh)
+ {
#ifndef HAVE_SNPRINTF
- (void) sprintf(buf2,"sh %s %s", cooptsh, argv[optind]);
+ (void) sprintf(buf2,"sh %s %s", cooptsh, argv[optind]);
#else
- (void) snprintf(buf2, sizeof buf2,
- "sh %s %s", cooptsh, argv[optind]);
+ (void) snprintf(buf2, sizeof buf2,
+ "sh %s %s", cooptsh, argv[optind]);
#endif
- (void) system(buf2); /* replaces the output executable if
- neccesary */
- }
- }
+ (void) system(buf2); /* replaces the output executable if
+ neccesary */
+ }
+ }
# endif
#endif
- }
}
- (void) fclose(ifp);
+ }
+ (void) fclose(ifp);
- if(!compile_only && useickec) /* AIS */
- {
- FILE* cioin;
- FILE* cioallec;
- char* buf2ptr;
- long remspace;
- char* tempfn="ickectmp.c";
+ 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";
+ /* 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 */
+ 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++)
- {
+ 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]);
+ (void) sprintf(buf2,
#if 0
- ); /* for Emacs' autoindenter */
+ ); /* 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)
+#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(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 ppnum6=65538L*2L;
+ long ciopos=0L;
+ /*@+charintliteral@*/ /* literal chars are ints */
+ while(inchar != EOF)
{
- 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')
{
- 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')
{
- /* 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 */
+ fprintf(cioallec,"#undef X\n");
+ fprintf(cioallec,"#define X ");
+ while(fputc(fgetc(cioin),cioallec) != ')') toparencount++;
}
- ciopos=ftell(cioin);
- inchar=fgetc(cioin);
+ (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;
+ case '6':
+ fprintf(cioin,"%-11ld",ppnum6++/2);
+ break;
+ default:
+ ick_lose(IE778, -1, (char*) NULL);
+ }
+ (void) fseek(cioin,0L,SEEK_CUR); /* synch the file */
}
- /*@=charintliteral@*/
- (void) fclose(cioin);
+ 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.)
- */
+ }
+ 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,
+ (void) snprintf(buf2, sizeof buf2,
#else
- (void) sprintf(buf2,
+ (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);
+ "%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 */
+ ); /* 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");
+ 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," -lickec");
- (void) system(buf2);
+ 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);
+ (void) remove(tempfn);
+ }
- /* 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@*/
- }
+ /* 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 */
+ (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@*/
+ /* 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 */